:root {
  --bg-primary: #050506;
  --bg-secondary: #0a0a0c;
  --bg-tertiary: #111114;
  --bg-elevated: #16161a;
  
  --text-primary: #ffffff;
  --text-secondary: #888890;
  --text-muted: #555560;
  
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.5);
  --accent-glow-soft: rgba(99, 102, 241, 0.15);
  
  --reflex-primary: #f59e0b;
  --reflex-glow: rgba(245, 158, 11, 0.5);
  
  --precision-primary: #06b6d4;
  --precision-glow: rgba(6, 182, 212, 0.5);
  
  --endless-primary: #ec4899;
  --endless-glow: rgba(236, 72, 153, 0.5);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.4);
  
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(255, 255, 255, 0.15);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 40px var(--accent-glow);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Background Effects */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 80%);
  pointer-events: none;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  background: rgba(5, 5, 6, 0.9);
  position: relative;
  z-index: 100;
  flex-wrap: nowrap;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.logo-pulse {
  position: absolute;
  width: 40px;
  height: 40px;
  background: var(--accent-glow-soft);
  border-radius: 50%;
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
  position: relative;
  z-index: 1;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-family: 'JetBrains Mono', monospace;
}

.logo-accent {
  color: var(--accent-primary);
}

.header-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.header-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.header-stat-value {
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-primary);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.view {
  display: none;
  animation: fadeIn 0.4s ease;
  min-width: 0;
  min-height: 0;
}

.view.active {
  display: flex;
  flex: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Menu View */
#menu-view {
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-container {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 20px;
}

.menu-hero {
  text-align: center;
}

.menu-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.title-line {
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  white-space: nowrap;
}

.title-accent {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--precision-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-select {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.mode-card {
  position: relative;
  padding: 28px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  overflow: hidden;
  min-width: 0;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-glow-soft);
  opacity: 0;
  transition: var(--transition-base);
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.mode-card:hover::before {
  opacity: 1;
}

.mode-card.selected {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.mode-card.selected::before {
  opacity: 1;
}

.mode-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  position: relative;
  z-index: 1;
}

.mode-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

.mode-icon-reflex svg {
  color: var(--reflex-primary);
}

.mode-icon-precision svg {
  color: var(--precision-primary);
}

.mode-icon-endless svg {
  color: var(--endless-primary);
}

.mode-card h3 {
  font-size: 16px;
  font-weight: 600;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.mode-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  position: relative;
  z-index: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.mode-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  z-index: 1;
}

.btn-start {
  position: relative;
  padding: 20px 64px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
}

.btn-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.btn-start:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
}

.btn-start:active {
  transform: translateY(0) scale(0.98);
}

.btn-text {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: white;
}

.btn-subtext {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}

/* Game View */
#game-view {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.game-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px clamp(20px, 4vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 50;
  pointer-events: none;
}

.game-ui-left,
.game-ui-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  max-width: 150px;
}

.combo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  min-width: 120px;
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition-base);
}

.combo-display.active {
  opacity: 1;
  transform: scale(1);
}

.combo-count {
  font-size: 36px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, var(--reflex-primary) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.combo-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-top: 4px;
}

.multiplier-display {
  padding: 10px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition-base);
}

.multiplier-display.active {
  opacity: 1;
  transform: scale(1);
}

.mult-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--reflex-primary);
}

.game-ui-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 300px;
  padding: 0 20px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-value {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px var(--accent-glow);
  white-space: nowrap;
}

.score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-top: 4px;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
}

.timer-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.timer-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.timer-value.warning {
  color: var(--reflex-primary);
  animation: timerPulse 0.5s ease infinite;
}

.timer-value.critical {
  color: var(--error);
  animation: timerPulse 0.3s ease infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.lives-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition-base);
}

.lives-display.active {
  opacity: 1;
  transform: scale(1);
}

.lives-count {
  font-size: 32px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--endless-primary);
}

.lives-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-top: 4px;
}

.game-area {
  flex: 1;
  position: relative;
  background: var(--bg-secondary);
  margin: 16px clamp(20px, 4vw, 40px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: none;
  min-height: 400px;
}

.crosshair {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: transform 0.03s ease-out;
  contain: layout;
}

.crosshair-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
}

.crosshair-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.crosshair.hit {
  animation: crosshairHit 0.15s ease-out;
}

@keyframes crosshairHit {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.target {
  position: absolute;
  border-radius: 50%;
  cursor: none;
  transform: scale(0);
  animation: targetSpawn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes targetSpawn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.target::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3) 0%, transparent 50%);
}

.target::after {
  content: '';
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.target-center {
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-secondary) 0%, var(--accent-primary) 100%);
  box-shadow: 0 0 20px var(--accent-glow);
}

.target.reflex::after {
  border-color: rgba(245, 158, 11, 0.8);
}

.target.reflex .target-center {
  background: radial-gradient(circle at 30% 30%, #fbbf24 0%, var(--reflex-primary) 100%);
  box-shadow: 0 0 20px var(--reflex-glow);
}

.target.precision::after {
  border-color: rgba(6, 182, 212, 0.8);
}

.target.precision .target-center {
  background: radial-gradient(circle at 30% 30%, #22d3ee 0%, var(--precision-primary) 100%);
  box-shadow: 0 0 20px var(--precision-glow);
}

.target.endless::after {
  border-color: rgba(236, 72, 153, 0.8);
}

.target.endless .target-center {
  background: radial-gradient(circle at 30% 30%, #f472b6 0%, var(--endless-primary) 100%);
  box-shadow: 0 0 20px var(--endless-glow);
}

.target.hit {
  animation: targetHit 0.2s ease forwards;
}

@keyframes targetHit {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.target.missed {
  animation: targetMiss 0.3s ease forwards;
}

@keyframes targetMiss {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.5); opacity: 0; }
}

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFly 0.6s ease-out forwards;
}

@keyframes particleFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

.game-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px clamp(20px, 4vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}

.hud-left,
.hud-right {
  flex: 1;
  min-width: 0;
}

.mode-indicator {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.hud-center {
  flex: 2;
  display: flex;
  justify-content: center;
}

.progress-track {
  width: 100%;
  max-width: 400px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.3s ease;
  width: 0%;
}

.target-count {
  font-size: 14px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  text-align: right;
}

.feedback-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.feedback {
  position: absolute;
  font-size: 24px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
  animation: feedbackFloat 0.8s ease-out forwards;
  text-shadow: 0 0 20px currentColor;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  max-width: 200px;
}

@keyframes feedbackFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-60px) scale(1.2);
    opacity: 0;
  }
}

.feedback.combo {
  font-size: 32px;
  color: var(--reflex-primary);
}

.feedback.perfect {
  font-size: 28px;
  color: var(--success);
}

.feedback.miss {
  color: var(--error);
}

/* Screen shake */
.shake {
  animation: screenShake 0.3s ease;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, -4px); }
  40% { transform: translate(4px, 4px); }
  60% { transform: translate(-4px, 4px); }
  80% { transform: translate(4px, -4px); }
}

/* Results View */
#results-view {
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

.results-container {
  position: relative;
  max-width: 560px;
  width: 100%;
  padding: clamp(24px, 5vw, 48px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: resultsSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.results-bg-effect {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow-soft) 0%, transparent 50%);
  pointer-events: none;
}

@keyframes resultsSlide {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.results-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}

.results-rank {
  display: inline-flex;
  margin-bottom: 20px;
}

.rank-letter {
  font-size: 80px;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px var(--success-glow);
  line-height: 1;
}

.rank-letter.a {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px var(--accent-glow);
}

.rank-letter.b {
  background: linear-gradient(135deg, var(--reflex-primary) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px var(--reflex-glow);
}

.rank-letter.c {
  background: linear-gradient(135deg, var(--text-secondary) 0%, var(--text-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.results-mode {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.results-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
}

.results-score-value {
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px var(--accent-glow);
  white-space: nowrap;
}

.results-score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-top: 8px;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.results-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.results-stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  flex-shrink: 0;
}

.results-stat-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
}

.results-stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.results-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
}

.results-stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.results-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-secondary,
.btn-primary {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.btn-secondary svg,
.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
  border: none;
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
}

/* Footer */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 24px);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  position: relative;
  z-index: 100;
  flex-wrap: wrap;
}

.footer-text {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.footer-separator {
  color: var(--border-medium);
}

/* Responsive */
@media (max-width: 1200px) {
  .mode-select {
    grid-template-columns: repeat(2, 1fr);
  }

  .menu-container {
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    gap: 12px;
  }

  .logo-text {
    font-size: 14px;
  }

  .header-stat {
    gap: 1px;
  }

  .title-line {
    font-size: clamp(32px, 10vw, 42px);
  }

  .menu-subtitle {
    font-size: 12px;
  }

  .mode-select {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mode-card {
    padding: 20px 16px;
  }

  .mode-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu-container {
    gap: 24px;
    padding: 16px;
  }

  #menu-view {
    padding: 24px 16px;
  }

  .game-ui {
    padding: 12px 16px;
  }

  .game-ui-left,
  .game-ui-right {
    max-width: 100px;
  }

  .combo-display,
  .lives-display {
    padding: 12px 20px;
    min-width: 90px;
  }

  .combo-count,
  .lives-count {
    font-size: 24px;
  }

  .score-value {
    font-size: clamp(28px, 8vw, 36px);
  }

  .timer-display {
    padding: 12px 16px;
  }

  .timer-value {
    font-size: 20px;
  }

  .game-area {
    margin: 12px 16px;
    min-height: 300px;
  }

  .game-hud {
    padding: 16px;
  }

  .progress-track {
    max-width: 200px;
  }

  .results-container {
    padding: 24px 16px;
    max-height: calc(100vh - 60px);
  }

  .results-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .results-stat {
    padding: 12px;
  }

  .results-score-value {
    font-size: clamp(40px, 12vw, 56px);
  }

  .results-actions {
    flex-direction: column;
  }

  .btn-secondary,
  .btn-primary {
    min-width: 100%;
  }

  #results-view {
    padding: 24px 16px;
  }

  .footer {
    padding: 12px 16px;
    gap: 8px;
  }

  .footer-text {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 10px 12px;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
  }

  .logo-text {
    font-size: 12px;
  }

  .header-stat-value {
    font-size: 14px;
  }

  .title-line {
    font-size: 28px;
  }

  .menu-subtitle {
    font-size: 11px;
  }

  .mode-card h3 {
    font-size: 14px;
  }

  .mode-card p {
    font-size: 11px;
  }

  .btn-start {
    padding: 16px 32px;
    width: 100%;
    max-width: 320px;
  }

  .btn-text {
    font-size: 14px;
  }

  .game-ui {
    padding: 8px 12px;
  }

  .combo-display,
  .lives-display {
    padding: 10px 16px;
    min-width: 80px;
  }

  .combo-count,
  .lives-count {
    font-size: 20px;
  }

  .combo-label,
  .lives-label {
    font-size: 9px;
  }

  .score-value {
    font-size: 24px;
  }

  .game-area {
    margin: 8px 12px;
    min-height: 250px;
  }

  .game-hud {
    padding: 12px;
  }

  .mode-indicator {
    font-size: 10px;
  }

  .target-count {
    font-size: 12px;
  }

  .progress-track {
    max-width: 150px;
  }

  .results-rank .rank-letter {
    font-size: 60px;
  }

  .results-mode {
    font-size: 18px;
  }

  .results-score-value {
    font-size: 36px;
  }

  .results-stat-value {
    font-size: 18px;
  }

  .results-stat-icon {
    width: 32px;
    height: 32px;
  }

  .results-stat-icon svg {
    width: 16px;
    height: 16px;
  }
}

/* Prevent horizontal scroll on all elements */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.app-container {
  max-width: 100vw;
  overflow-x: hidden;
}
