:root {
  /* Paleta de cores profissional aprimorada */
  --bg-primary: #0a0d15;
  --bg-secondary: #131720;
  --bg-tertiary: #1c2028;
  --bg-quaternary: #242b36;
  --bg-gradient: linear-gradient(135deg, #0a0d15 0%, #131720 25%, #1c2028 50%, #242b36 75%, #0a0d15 100%);
  --bg-overlay: linear-gradient(135deg, rgba(10, 13, 21, 0.97), rgba(19, 23, 32, 0.95));
  
  /* Cores de destaque refinadas */
  --accent-primary: #ff6b35;
  --accent-secondary: #ff8f65;
  --accent-tertiary: #ffaa85;
  --accent-gold: #ffd700;
  --accent-blue: #4a9eff;
  --accent-cyan: #00e5ff;
  --accent-purple: #9c27b0;
  
  /* Cores de texto aprimoradas */
  --text-primary: #ffffff;
  --text-secondary: #e0e6ed;
  --text-tertiary: #c4c9d1;
  --text-muted: #8b95a1;
  --text-disabled: #5a6170;
  
  /* Cores de status expandidas */
  --success: #00d4aa;
  --success-light: #26e6c7;
  --warning: #ffab00;
  --warning-light: #ffc947;
  --danger: #ff4757;
  --danger-light: #ff6b7a;
  --info: #3742fa;
  --info-light: #5865f2;
  
  /* Sistema de bordas e sombras aprimorado */
  --border-primary: #404855;
  --border-secondary: #323844;
  --border-tertiary: #2a2f3a;
  --border-accent: rgba(255, 107, 53, 0.4);
  --border-gold: rgba(255, 215, 0, 0.4);
  
  /* Sistema de sombras profissional */
  --shadow-xs: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-2xl: 0 32px 64px rgba(0, 0, 0, 0.55);
  
  /* Sistema de glows */
  --glow-primary: rgba(255, 107, 53, 0.4);
  --glow-secondary: rgba(255, 215, 0, 0.3);
  --glow-tertiary: rgba(74, 158, 255, 0.3);
  --glow-success: rgba(0, 212, 170, 0.3);
  --glow-warning: rgba(255, 171, 0, 0.3);
  --glow-danger: rgba(255, 71, 87, 0.3);
  
  /* Gradientes profissionais */
  --gradient-primary: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
  --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #fff176 100%);
  --gradient-panel: linear-gradient(145deg, rgba(19, 23, 32, 0.95) 0%, rgba(28, 32, 40, 0.93) 100%);
  --gradient-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  --gradient-button: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  --gradient-button-hover: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-tertiary) 100%);
  
  /* Raios de borda */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Espaçamentos */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 24px;
  --spacing-3xl: 32px;
  --spacing-4xl: 40px;
  
  /* Transições */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.25s ease-out;
  --transition-slow: 0.35s ease-out;
  --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Scrollbar global styling - Remove fundo branco */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 94, 123, 0.5) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 94, 123, 0.4);
  border-radius: 4px;
  border: none;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 94, 123, 0.6);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-gradient);
  color: var(--text-primary);
  font-family: "Orbitron", "Inter", "Segoe UI", monospace;
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 14px;
  position: relative;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(74, 158, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><g fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.02"><circle cx="30" cy="30" r="1"/></g></g></svg>');
  pointer-events: none;
  z-index: -1;
}

.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  min-width: 320px;
  min-height: 100vh;
  padding: var(--spacing-xl);
  box-sizing: border-box;
}

.canvas-container {
  position: relative;
  width: 100%;
  max-width: 1500px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-md);
}

canvas {
  position: relative;
  background: linear-gradient(180deg, #2a3441 0%, #1e2530 50%, #151922 100%);
  border: 3px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  box-shadow: 
    var(--shadow-2xl),
    0 0 60px var(--glow-primary),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transition: all var(--transition-normal);
  width: 100%;
  height: auto;
  aspect-ratio: 3/1;
  max-height: 70vh;
  min-height: 200px;
  overflow: hidden;
  backdrop-filter: blur(1px);
}

canvas:hover {
  box-shadow: 
    var(--shadow-2xl),
    0 0 80px var(--glow-primary),
    0 0 120px rgba(255, 107, 53, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transform: scale(1.01);
  border-color: var(--border-accent);
}

canvas::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.02) 50%, transparent 70%);
  pointer-events: none;
  border-radius: var(--radius-xl);
}

.ui-panel {
  position: absolute;
  background: var(--gradient-panel);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  backdrop-filter: blur(25px);
  box-shadow: 
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  z-index: 10;
}

.ui-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glass);
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.ui-panel:hover {
  transform: translateY(-3px);
  box-shadow: 
    var(--shadow-xl),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: var(--border-accent);
}

.ui-panel:hover::before {
  opacity: 1;
}

.score-panel {
  top: var(--spacing-sm);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  padding: var(--spacing-sm) var(--spacing-md);
}

.controls-panel {
  bottom: var(--spacing-lg);
  left: var(--spacing-lg);
  font-size: 0.85rem;
  opacity: 0.95;
  z-index: 10;
  padding: var(--spacing-sm) var(--spacing-md);
}

.stats-display {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-sm);
  font-weight: 700;
  margin: var(--spacing-sm) 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  position: relative;
  z-index: 1;
  flex: 1;
  background: var(--gradient-panel);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  backdrop-filter: blur(20px);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  animation: slideInUp 0.6s ease-out;
  animation-delay: calc(var(--index) * 0.1s);
  animation-fill-mode: both;
  min-height: 60px;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 25px var(--glow-primary);
  border-color: var(--border-accent);
}

.stat-item.primary-stat {
  background: var(--gradient-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md), 0 0 20px var(--glow-primary);
}

.stat-item.primary-stat:hover {
  box-shadow: var(--shadow-lg), 0 0 35px var(--glow-primary);
  transform: translateY(-4px) scale(1.02);
}

.stat-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  flex: 1;
}

.stat-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-value {
  font-size: 1.1rem;
  color: white;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(255, 255, 255, 0.3);
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
}

.stat-sublabel {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

.controls-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  align-items: stretch;
  margin: var(--spacing-sm) 0;
}

.control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--accent-primary);
  transition: all var(--transition-normal);
  backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
  min-height: 32px;
}

.control-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.05), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.control-item:hover {
  background: rgba(255, 107, 53, 0.15);
  transform: translateX(6px);
  box-shadow: var(--shadow-md), 0 0 20px var(--glow-primary);
  border-left-color: var(--accent-secondary);
}

.control-item:hover::before {
  opacity: 1;
}

.key {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-xs);
  font-weight: 800;
  font-size: 0.75rem;
  text-align: center;
  min-width: 45px;
  box-shadow: 
    var(--shadow-sm),
    0 0 15px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
}

.key:hover {
  transform: scale(1.05);
  box-shadow: 
    var(--shadow-md),
    0 0 25px rgba(255, 215, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.action {
  color: var(--text-secondary);
  font-weight: 600;
  margin-left: var(--spacing-sm);
  flex-grow: 1;
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.loading-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 2rem;
  color: var(--accent-primary);
  text-shadow: 
    0 4px 8px rgba(255, 107, 53, 0.5),
    0 0 30px rgba(255, 107, 53, 0.3);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.loading-bar {
  width: 400px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 2px solid var(--border-primary);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-progress {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-gold),
    var(--accent-secondary)
  );
  border-radius: 6px;
  transition: width 0.3s ease;
  box-shadow: 
    0 0 20px var(--glow-primary),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
}

.loading-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
  animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 600;
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.6s ease-out;
}

/* Menu Principal - Layout Centralizado */
#menuOverlay {
  justify-content: center;
  padding: 20px;
}

/* Nickname Overlay - Layout Centralizado */
#nicknameOverlay {
  justify-content: center;
  padding: 20px;
}

/* Pause Overlay - Layout Centralizado */
#pauseOverlay {
  justify-content: center;
  padding: 20px;
}

/* Game Over Overlay - Layout Específico Responsivo */
#gameOverOverlay {
  justify-content: flex-start;
  gap: 20px;
  padding: 20px 20px 40px;
  overflow-y: auto;
  box-sizing: border-box;
}

#gameOverOverlay .menu-title {
  margin: 20px 0 15px 0;
  font-size: 2.8rem;
}

/* Responsive Game Over Layout */
.game-over-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  gap: 24px;
  align-items: center;
}

@media (min-width: 768px) and (min-height: 700px) {
  .game-over-content {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
  }
  
  .game-over-left {
    flex: 1;
    max-width: 500px;
  }
  
  .game-over-right {
    flex: 1;
    max-width: 450px;
  }
  
  #gameOverOverlay .menu-title {
    grid-column: 1 / -1;
    margin: 10px 0 20px 0;
  }
}

  /* Nickname Overlay Styles */
  #nicknameOverlay {
    background: linear-gradient(135deg, rgba(12, 14, 22, 0.95), rgba(21, 25, 34, 0.95));
    backdrop-filter: blur(15px);
    z-index: 100;
  }
  
  .nickname-form {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin: 32px 0 12px 0;
    align-items: center;
  }
  
  .nickname-input {
    padding: 14px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 250px;
  }
  
  .nickname-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    background: rgba(255, 255, 255, 0.15);
  }
  
  .nickname-button {
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  }
  
  .nickname-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
  }
  .nickname-input {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    padding: 10px 18px;
    border-radius: 8px;
    border: 2px solid #e53935;
    background: #23272f;
    color: #fff;
    outline: none;
    transition: border 0.2s;
  }
  .nickname-input:focus {
    border-color: #fff;
  }
  .nickname-hint {
    color: #fff;
    font-size: 1rem;
    margin-top: 8px;
    text-shadow: 0 0 8px #000;
  }

.menu-title {
  font-size: 3.8rem;
  font-weight: 900;
  margin-bottom: var(--spacing-2xl);
  color: var(--accent-primary);
  text-shadow: 
    0 4px 8px rgba(255, 107, 53, 0.5),
    0 0 40px rgba(255, 107, 53, 0.3),
    0 0 80px rgba(255, 107, 53, 0.1);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: glow 2s ease-in-out infinite alternate;
  position: relative;
}

.menu-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  opacity: 0.7;
}

@keyframes glow {
  from {
    text-shadow: 
      0 4px 8px rgba(255, 107, 53, 0.5),
      0 0 40px rgba(255, 107, 53, 0.3);
  }
  to {
    text-shadow: 
      0 4px 8px rgba(255, 107, 53, 0.8),
      0 0 60px rgba(255, 107, 53, 0.5);
  }
}

.menu-subtitle {
  font-size: 1.4rem;
  margin-bottom: var(--spacing-4xl);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  text-align: center;
  font-weight: 500;
}

/* Final Score Professional Design */
.final-score-container {
  background: linear-gradient(145deg, rgba(15, 20, 35, 0.95), rgba(20, 25, 40, 0.95));
  border-radius: 20px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(255, 215, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  padding: 32px 40px;
  margin: 0;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: scoreReveal 0.8s ease-out;
}

.final-score-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.score-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.5));
  animation: bounce 2s infinite;
}

.score-label {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent-gold);
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
  letter-spacing: 2px;
}

.final-score-value {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 900;
  font-size: 3.5rem;
  color: #fff;
  text-shadow: 
    0 0 20px rgba(255, 215, 0, 0.8),
    0 0 40px rgba(255, 215, 0, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.5);
  margin: 16px 0 24px;
  background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 3s ease-in-out infinite;
}

.final-score-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-detail:last-child {
  border-bottom: none;
}

.detail-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.detail-value {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(255, 215, 0, 0.3);
}

.score-achievement {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.15));
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: achievementGlow 2s ease-in-out infinite;
}

.achievement-icon {
  font-size: 1.5rem;
  animation: rotate 3s linear infinite;
}

.achievement-text {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-gold);
  text-shadow: 0 1px 3px rgba(255, 215, 0, 0.5);
  letter-spacing: 1px;
}

/* Developer Mode Indicator */
.developer-mode-indicator {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.15), rgba(255, 107, 107, 0.15));
  border: 2px solid #ffb300;
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: developerGlow 1.5s ease-in-out infinite;
}

.developer-icon {
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.developer-text {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #ffb300;
  text-shadow: 0 1px 3px rgba(255, 179, 0, 0.5);
  letter-spacing: 0.5px;
}

@keyframes developerGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 179, 0, 0.5);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Animations */
@keyframes scoreReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes goldShimmer {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes achievementGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.menu-button {
  background: var(--gradient-button);
  color: white;
  border: none;
  padding: var(--spacing-lg) var(--spacing-3xl);
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 
    var(--shadow-lg),
    0 0 30px var(--glow-primary),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  overflow: hidden;
  min-width: 200px;
}

.menu-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  transform: translateX(-100%);
}

.menu-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-button-hover);
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: var(--radius-md);
}

.menu-button:hover {
  transform: translateY(-4px);
  box-shadow: 
    var(--shadow-xl),
    0 0 50px var(--glow-primary),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.menu-button:hover::before {
  opacity: 1;
  animation: shimmer 0.6s ease-out;
}

.menu-button:hover::after {
  opacity: 1;
}

.menu-button:active {
  transform: translateY(-2px);
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.version-info {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Enhanced Animations and Effects */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes glow {
  from {
    text-shadow: 
      0 4px 8px rgba(255, 107, 53, 0.5),
      0 0 40px rgba(255, 107, 53, 0.3);
  }
  to {
    text-shadow: 
      0 4px 8px rgba(255, 107, 53, 0.8),
      0 0 60px rgba(255, 107, 53, 0.5);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Utility classes for animations */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in-right {
  animation: slideInFromRight 0.5s ease-out;
}

/* Enhanced hover effects */
.ui-panel {
  animation: fadeInUp 0.8s ease-out;
}

.menu-button {
  animation: fadeInUp 1s ease-out;
}

.stats-display .stat-item {
  animation: slideInFromRight 0.6s ease-out;
  animation-delay: calc(var(--index, 0) * 0.1s);
}

/* Responsive Design Enhanced */
@media (max-width: 900px) {
  .game-container {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }
  
  canvas {
    max-width: 98vw;
    aspect-ratio: 2.5/1;
    max-height: 60vh;
    border-width: 2px;
    border-radius: var(--radius-lg);
  }
  
  .sound-toggle {
    width: 44px;
    height: 44px;
    top: var(--spacing-lg);
    right: var(--spacing-md);
  }
  
  .score-panel {
    top: var(--spacing-xs);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85em;
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .controls-panel {
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    font-size: 0.8em;
    padding: var(--spacing-xs) var(--spacing-sm);
    min-width: 200px;
  }
  
  .menu-title {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }
  
  .menu-subtitle {
    font-size: 1.1rem;
  }
  
  .menu-button {
    font-size: 1.1em;
    padding: var(--spacing-lg) var(--spacing-2xl);
    min-width: 180px;
  }

  .stats-display {
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .stat-value {
    font-size: 1.3rem;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .loading-title {
    font-size: 4rem;
  }
  
  .ui-panel {
    padding: 5px 10px;
  }
  
  .stats-display {
    padding: 24px 32px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .loading-title {
    font-size: 3rem;
  }
  
  .loading-bar {
    width: 350px;
  }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .game-container {
    padding: 15px;
  }
  
  canvas {
    aspect-ratio: 2.8/1;
    max-height: 65vh;
  }
  
  .sound-toggle {
    width: 44px;
    height: 44px;
    top: var(--spacing-lg);
    right: var(--spacing-md);
  }
  
  .ui-panel {
    padding: 5px 10px;
    margin: 16px;
  }
  
  .stats-display {
    padding: 16px 20px;
  }
  
  .loading-title {
    font-size: 2.5rem;
  }
  
  .loading-bar {
    width: 300px;
  }
  
  .stats-display {
    gap: 1.5rem;
    padding: 18px 22px;
  }
  
  .stat-value {
    font-size: 1.6rem;
  }
  
  .nickname-form {
    flex-direction: column;
    gap: 16px;
  }
  
  .nickname-input {
    min-width: 200px;
  }
}

/* Mobile Large (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .game-container {
    padding: 8px;
  }
  
  canvas {
    aspect-ratio: 2.2/1;
    max-height: 55vh;
  }
  
  .sound-toggle {
    width: 36px;
    height: 36px;
    top: var(--spacing-md);
    right: var(--spacing-md);
  }
  
  .ui-panel {
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 12px;
    font-size: 0.9rem;
  }
  
  
  .stats-display {
    gap: var(--spacing-sm);
    flex-direction: column;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .stat-icon {
    font-size: 1.2rem;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .stat-content {
    align-items: flex-end;
    text-align: center;
  }
  
  .game-stats-grid {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
  }
  
  .stat-group {
    gap: var(--spacing-xs);
  }
  
  .stat-mini {
    padding: var(--spacing-xs);
  }
  
  .stat-mini-label {
    font-size: 0.6rem;
  }
  
  .stat-mini-value {
    font-size: 0.8rem;
  }
  
  .controls-panel {
    width: 250px;
    bottom: 16px;
    left: 16px;
    font-size: 0.85rem;
  }
  
  .loading-title {
    font-size: 2rem;
    letter-spacing: 2px;
  }
  
  .loading-bar {
    width: 250px;
    height: 10px;
  }
  
  .control-item {
    padding: 10px 14px;
  }
  
  .key {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 40px;
  }
  
  .action {
    font-size: 0.85rem;
  }
  
  .nickname-form {
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
  }
  
  .nickname-input {
    min-width: 200px;
    padding: 12px 16px;
  }
  
  .nickname-button {
    padding: 12px 24px;
  }
}

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
  .game-container {
    padding: 5px;
  }
  
  canvas {
    aspect-ratio: 2/1;
    max-height: 50vh;
    border-width: 1px;
  }
  
  .sound-toggle {
    width: 32px;
    height: 32px;
    top: 6px;
    right: 6px;
  }
  
  .ui-panel {
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: 10px;
    font-size: 0.85rem;
  }

  
  .stats-display {
    gap: var(--spacing-xs);
    flex-direction: column;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .stat-icon {
    font-size: 1rem;
  }
  
  .stat-value {
    font-size: 1rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .stat-content {
    align-items: flex-end;
    text-align: center;
  }
  
  .game-stats-grid {
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs);
  }
  
  .stat-group {
    gap: 2px;
  }
  
  .stat-mini {
    padding: 4px 6px;
  }
  
  .stat-mini-label {
    font-size: 0.55rem;
  }
  
  .stat-mini-value {
    font-size: 0.7rem;
  }
  
  .player-name-center {
    font-size: 1rem;
    margin: 4px 0 8px;
  }
  
  .controls-panel {
    width: 220px;
    bottom: 12px;
    left: 12px;
    font-size: 0.8rem;
  }
  
  .loading-title {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }
  
  .loading-bar {
    width: 200px;
    height: 8px;
  }
  
  .stats-display {
    gap: 0.8rem;
    padding: 14px 16px;
    flex-direction: column;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  .stat-value {
    font-size: 1.2rem;
  }
  
  .control-item {
    padding: 8px 12px;
  }
  
  .key {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-width: 35px;
  }
  
  .action {
    font-size: 0.8rem;
    margin-left: 10px;
  }
  
  .nickname-form {
    flex-direction: column;
    gap: 14px;
    margin: 20px 0;
  }
  
  .nickname-input {
    min-width: 180px;
    padding: 10px 14px;
    font-size: 1rem;
  }
  
  .nickname-button {
    padding: 10px 20px;
    font-size: 1rem;
  }
  
  canvas {
    max-width: 95vw !important;
    max-height: 50vh !important;
  }

  /* Ranking Mobile Responsiveness */
  .ranking-container {
    margin: 16px auto 0;
    max-width: 320px;
    width: 95%;
  }

  .ranking-header {
    padding: 16px 20px 12px;
  }

  .ranking-title {
    font-size: 1.2rem;
    gap: 8px;
  }

  .ranking-icon {
    font-size: 1.4rem;
  }

  .ranking-subtitle {
    font-size: 0.8rem;
  }

  .ranking-content {
    padding: 16px 20px;
    max-height: 300px;
  }

  .ranking-item {
    padding: 10px 12px;
    margin-bottom: 6px;
  }

  .ranking-position {
    gap: 8px;
    min-width: 50px;
  }

  .ranking-medal {
    font-size: 1.1rem;
  }

  .ranking-number {
    font-size: 1rem;
    min-width: 20px;
  }

  .ranking-player {
    margin: 0 12px;
  }

  .ranking-name {
    font-size: 0.9rem;
  }

  .ranking-score-value {
    font-size: 1rem;
  }

  .ranking-score-label {
    font-size: 0.7rem;
  }

  .ranking-footer {
    padding: 10px 20px;
    font-size: 0.7rem;
  }

  /* Final Score Mobile Responsiveness */
  .final-score-container {
    padding: 24px 28px;
    margin: 0;
    max-width: 340px;
  }

  /* Game Over Overlay Mobile */
  #gameOverOverlay {
    padding: 16px 16px 30px;
    gap: 16px;
  }

  #gameOverOverlay .menu-title {
    font-size: 2.2rem;
    margin: 10px 0 12px 0;
  }

  .game-over-content {
    gap: 20px;
    flex-direction: column !important;
  }

  /* Ranking Mobile Responsiveness */
  .ranking-container {
    margin: 0;
    max-width: 320px;
    width: 100%;
  }

  .final-score-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .score-icon {
    font-size: 2rem;
  }

  .score-label {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .final-score-value {
    font-size: 2.8rem;
    margin: 12px 0 20px;
  }

  .final-score-details {
    gap: 8px;
    padding: 16px;
    margin-bottom: 16px;
  }

  .score-detail {
    padding: 6px 0;
  }

  .detail-label {
    font-size: 0.9rem;
  }

  .detail-value {
    font-size: 1rem;
  }

  .score-achievement {
    padding: 12px;
    gap: 8px;
  }

  .achievement-icon {
    font-size: 1.3rem;
  }

  .achievement-text {
    font-size: 1rem;
    letter-spacing: 0.5px;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ui-panel {
    backdrop-filter: blur(15px);
  }
  
  .loading-screen {
    backdrop-filter: blur(15px);
  }
  
  .menu-overlay {
    backdrop-filter: blur(20px);
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 767px) and (orientation: landscape) {
  .game-container {
    padding: 5px;
    gap: 0.5rem;
  }
  
  canvas {
    max-height: 80vh;
    aspect-ratio: 2.8/1;
  }
  
  .score-panel {
    top: 5px;
    font-size: 0.8rem;
    padding: 8px 12px;
  }
  
  .controls-panel {
    bottom: 5px;
    left: 5px;
    font-size: 0.75rem;
    padding: 8px 12px;
    width: 180px;
  }
  
  .sound-toggle {
    width: 32px;
    height: 32px;
    top: 4px;
    right: 4px;
  }
}

/* Portrait Mobile Optimization */
@media (max-width: 767px) and (orientation: portrait) {
  canvas {
    aspect-ratio: 2/1;
    max-height: 45vh;
  }
  
  .stats-display {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

/* Dark Mode Preference */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0c12;
    --bg-secondary: #12161f;
    --text-primary: #ffffff;
    --shadow-heavy: rgba(0, 0, 0, 0.8);
  }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .loading-progress::before {
    animation: none;
  }
  
  canvas:hover {
    transform: none;
  }
  
  .menu-button:hover {
    transform: translateY(-1px);
  }
  
  .sound-toggle:hover {
    transform: scale(1.02);
  }
}

#globalRankingContainer {
  margin-top: 10px;
  overflow-y: auto;
  padding: 15px;
  border: 1px solid #e53935;
  border-radius: 8px;
  background: rgba(20, 24, 32, 0.95);
}

.player-name-center {
  text-align: center;
  font-size: 1.3em;
  font-family: 'Orbitron', Arial, sans-serif;
  color: #ff5e7b;
  margin-top: 0px;
  letter-spacing: 1px;
}

.opensource-banner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 500;
  width: 0;
  height: 0;
  border-top: 160px solid rgba(19, 23, 32, 0.95);
  border-left: 160px solid transparent;
  text-align: center;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.opensource-banner:hover {
  border-top-color: rgba(255, 107, 53, 0.95);
}

.opensource-text {
  position: absolute;
  top: -220px;
  right: -32px;
  width: 85px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1em;
  letter-spacing: 2px;
  text-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.8),
    0 0 15px rgba(255, 255, 255, 0.2);
  user-select: none;
  transform: rotate(45deg);
  transition: all var(--transition-normal);
}

.sound-toggle {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  background: var(--gradient-button);
  color: white;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 
    var(--shadow-md),
    0 0 20px var(--glow-primary),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  border: 1px solid var(--border-primary);
}

.sound-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glass);
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sound-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    var(--shadow-lg),
    0 0 35px var(--glow-primary),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  border-color: var(--border-accent);
}

.sound-toggle:hover::before {
  opacity: 1;
}

.sound-toggle:active {
  transform: translateY(-1px) scale(0.98);
}

.sound-toggle svg {
  position: relative;
  z-index: 1;
  transition: all var(--transition-fast);
}

.sound-toggle:hover svg {
  transform: scale(1.1);
}

/* Version Info Professional Styling */
.version-info {
  position: fixed;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--gradient-glass);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-full);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.version-info:hover {
  color: var(--text-secondary);
  background: var(--gradient-panel);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md), 0 0 20px var(--glow-primary);
}

.github-link {
  position: absolute;
  top: 15px;
  right: 15px;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.github-link:hover .github-icon {
  transform: scale(1.2);
}

.github-icon {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Global Ranking Container - Professional Design */
#globalRankingContainer {
  display: none;
  margin: 0;
  max-width: 420px;
  width: 100%;
}

.ranking-container {
  background: linear-gradient(145deg, rgba(15, 20, 35, 0.95), rgba(20, 25, 40, 0.95));
  border-radius: 16px;
  border: 1px solid rgba(255, 94, 123, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(255, 94, 123, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  overflow: hidden;
  animation: slideInUp 0.6s ease-out;
  height: fit-content;
}

.ranking-header {
  background: linear-gradient(135deg, rgba(255, 94, 123, 0.15), rgba(255, 179, 51, 0.15));
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 94, 123, 0.2);
  text-align: center;
}

.ranking-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(255, 94, 123, 0.5);
  margin-bottom: 8px;
}

.ranking-icon {
  font-size: 1.6rem;
  animation: bounce 2s infinite;
}

.ranking-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.ranking-content {
  padding: 20px 24px;
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 94, 123, 0.5) transparent;
}

/* Game Over Button Styling */
#gameOverOverlay .menu-button {
  margin-top: 16px;
  align-self: center;
}

/* Desktop responsiveness for better side-by-side layout */
@media (min-width: 768px) and (min-height: 700px) {
  .ranking-content {
    max-height: 400px;
  }
  
  #globalRankingContainer {
    max-width: 400px;
  }
  
  .final-score-container {
    max-width: 450px;
  }
}

/* Large desktop optimization */
@media (min-width: 1200px) {
  .game-over-content {
    max-width: 1000px;
    gap: 40px;
  }
}

.ranking-content::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

.ranking-content::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.ranking-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 94, 123, 0.6), rgba(255, 179, 51, 0.6));
  border-radius: 3px;
  border: none;
}

/* ==== OVERLAY SPECIFIC STYLES ==== */
/* Separação de estilos específicos para cada overlay */

/* Menu Principal - Layout Centralizado Tradicional */
#menuOverlay {
  justify-content: center !important;
  padding: 20px !important;
  overflow-y: visible !important;
}

/* Nickname Overlay - Layout Centralizado */
#nicknameOverlay {
  justify-content: center !important;
  padding: 20px !important;
  overflow-y: visible !important;
}

/* Pause Overlay - Layout Centralizado */
#pauseOverlay {
  justify-content: center !important;
  padding: 20px !important;
  overflow-y: visible !important;
}

/* Game Over Overlay - Layout Específico Responsivo mantido */
#gameOverOverlay {
  justify-content: flex-start !important;
  gap: 20px !important;
  padding: 20px 20px 40px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* Mobile responsiveness specific to overlays */
@media (min-width: 480px) and (max-width: 767px) {
  #menuOverlay,
  #nicknameOverlay,
  #pauseOverlay {
    padding: 20px !important;
    justify-content: center !important;
  }
  
  #gameOverOverlay {
    padding: 16px 16px 30px !important;
    gap: 16px !important;
  }
}

@media (max-width: 479px) {
  #menuOverlay,
  #nicknameOverlay,
  #pauseOverlay {
    padding: 15px !important;
    justify-content: center !important;
  }
  
  #gameOverOverlay {
    padding: 12px 12px 25px !important;
    gap: 12px !important;
  }
}

.ranking-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 94, 123, 0.8), rgba(255, 179, 51, 0.8));
}

.ranking-content::-webkit-scrollbar-corner {
  background: transparent;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  animation: fadeInScale 0.5s ease-out;
  animation-fill-mode: both;
}

.ranking-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 94, 123, 0.1);
  border-color: rgba(255, 94, 123, 0.3);
  box-shadow: 0 4px 16px rgba(255, 94, 123, 0.2);
}

.ranking-item.top-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.15));
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.ranking-item.top-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(169, 169, 169, 0.15));
  border-color: rgba(192, 192, 192, 0.4);
}

.ranking-item.top-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(184, 115, 51, 0.15));
  border-color: rgba(205, 127, 50, 0.4);
}

.ranking-position {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 60px;
}

.ranking-medal {
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ranking-number {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-gold);
  min-width: 24px;
  text-align: center;
}

.ranking-player {
  flex: 1;
  margin: 0 16px;
}

.ranking-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.ranking-score {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-score-value {
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-gold);
  text-shadow: 0 1px 3px rgba(255, 179, 51, 0.5);
}

.ranking-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ranking-footer {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ranking-error {
  text-align: center;
  padding: 40px 24px;
  color: #ff6b6b;
  font-family: 'Montserrat', sans-serif;
}

.ranking-error-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.ranking-error-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.ranking-error-detail {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* Game Statistics Grid */
.game-stats-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.game-stats-grid:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm), 0 0 15px rgba(255, 107, 53, 0.2);
  transform: translateY(-2px);
}

.stat-group {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.stat-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: var(--spacing-xs);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  min-height: 40px;
}

.stat-mini::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.stat-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 107, 53, 0.3);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.stat-mini:hover::before {
  left: 100%;
}

.stat-mini-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  text-align: center;
}

.stat-mini-value {
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 1px 3px rgba(255, 215, 0, 0.3);
  letter-spacing: 0.5px;
}

.stat-mini-value.multiplier {
  color: var(--accent-blue);
  text-shadow: 0 1px 3px rgba(74, 158, 255, 0.3);
}

.stat-mini-value.danger {
  color: var(--danger);
  text-shadow: 0 1px 3px rgba(255, 71, 87, 0.3);
}

.player-name-center {
  text-align: center;
  font-size: 1em;
  font-family: 'Orbitron', Arial, sans-serif;
  color: var(--accent-primary);
  margin: var(--spacing-xs) 0 var(--spacing-sm);
  letter-spacing: 1px;
  font-weight: 700;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 0 15px rgba(255, 107, 53, 0.4);
  transition: all var(--transition-normal);
}

.player-name-center:hover {
  color: var(--accent-gold);
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 5px rgba(255, 107, 53, 0.5));
  }
  to {
    filter: drop-shadow(0 0 15px rgba(255, 107, 53, 0.8));
  }
}
.github-link {
  position: absolute;
  top: 75px;
  right: 25px;
  text-decoration: none;
  color: #fff;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.github-link:hover .github-icon {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 10px var(--accent-gold));
  transform: rotate(45deg) scale(1.2);
}

.github-icon {
  position: absolute;
  top: -185px;
  right: 25px;
  color: #fff;
  transition: all var(--transition-normal);
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transform: rotate(45deg);
}

/* Additional Animations for Enhanced UI */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}