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

:root {
  --bg-deep: #0a0a12;
  --bg-panel: rgba(16, 16, 28, 0.85);
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff006e;
  --accent-purple: #8338ec;
  --accent-gold: #ffbe0b;
  --text-primary: #f0f4ff;
  --text-muted: #8892b0;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.5);
  --glow-magenta: 0 0 20px rgba(255, 0, 110, 0.5);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(131, 56, 236, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 0, 110, 0.15), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(0, 240, 255, 0.12), transparent);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  gap: 8px;
  animation: app-enter 0.7s ease;
}

@keyframes app-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-stack {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(320px, 90vw);
}

.toast {
  padding: 12px 18px;
  background: rgba(12, 12, 24, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast strong {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.toast span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.game-container.combo-glow-3 {
  box-shadow: 0 0 24px rgba(131, 56, 236, 0.25), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.game-container.combo-glow-5 {
  box-shadow: 0 0 32px rgba(255, 0, 110, 0.35), 0 0 60px rgba(255, 190, 11, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.game-container.combo-glow-8 {
  box-shadow: 0 0 40px rgba(255, 190, 11, 0.45), 0 0 80px rgba(255, 0, 110, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: border-glow 1.5s ease-in-out infinite;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 20px);
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo:hover {
  opacity: 0.85;
}

.logo:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
}

.logo:active {
  transform: scale(0.98);
}

.logo.return-menu.logo-at-menu {
  cursor: default;
}

.logo.return-menu.logo-at-menu:hover {
  opacity: 1;
}

.logo.return-menu.logo-at-menu:active {
  transform: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  width: fit-content;
  transition: color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.rank-badge.rank-up {
  animation: rank-up 0.8s ease;
}

@keyframes rank-up {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); filter: brightness(1.4); }
  100% { transform: scale(1); }
}

.logo-icon {
  font-size: 1.4rem;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  animation: pulse-glow 2s ease-in-out infinite;
}

.logo h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-bar {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
}

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

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  opacity: 0.85;
  max-width: 80px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-panel);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.btn-icon.muted {
  opacity: 0.55;
}

.game-container.auto-mode {
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.2), 0 0 24px rgba(0, 240, 255, 0.08);
}

.combo-meter-wrap {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}

.combo-meter-wrap.visible {
  display: flex;
  animation: slide-up 0.3s ease;
}

.combo-meter-label {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 600;
}

.combo-meter {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.combo-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8338ec, #ff006e);
  box-shadow: 0 0 8px rgba(255, 0, 110, 0.6);
  transition: width 0.1s linear;
}

.combo-meter-wrap.charged .combo-meter-fill {
  background: linear-gradient(90deg, #ffbe0b, #ff006e);
  box-shadow: 0 0 12px rgba(255, 190, 11, 0.8);
  animation: combo-fire 0.5s ease-in-out infinite alternate;
}

.overlay.overlay-victory .overlay-glow {
  background: radial-gradient(circle, rgba(255, 190, 11, 0.35), transparent 70%);
}

.overlay.overlay-victory .overlay-content h2 {
  background: linear-gradient(135deg, #ffbe0b, #ff006e, #00f0ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-value.lives {
  color: var(--accent-magenta);
  letter-spacing: 0.15em;
}

.stat-value.combo {
  color: var(--accent-gold);
  transition: transform 0.15s ease, color 0.15s ease;
}

.stat-value.combo.active {
  transform: scale(1.2);
  text-shadow: 0 0 12px rgba(255, 190, 11, 0.8);
}

.stat-value.combo.combo-fire {
  color: #ff006e;
  text-shadow: 0 0 16px rgba(255, 0, 110, 0.9), 0 0 30px rgba(255, 190, 11, 0.5);
  animation: combo-fire 0.6s ease-in-out infinite alternate;
}

.stat-value.combo.combo-burst {
  animation: combo-burst 0.45s ease;
}

.stat-value.score-pop {
  animation: score-pop 0.35s ease;
}

@keyframes combo-fire {
  from { transform: scale(1.15); }
  to { transform: scale(1.35); }
}

@keyframes combo-burst {
  0% { transform: scale(1); }
  40% { transform: scale(1.6); color: #fff; }
  100% { transform: scale(1.2); }
}

@keyframes score-pop {
  0% { transform: scale(1); color: var(--text-primary); }
  50% { transform: scale(1.25); color: var(--accent-cyan); text-shadow: var(--glow-cyan); }
  100% { transform: scale(1); color: var(--text-primary); }
}

.game-container {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: rgba(8, 8, 18, 0.9);
  animation: border-glow 4s ease-in-out infinite;
}

@keyframes border-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.05), 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
  50% { box-shadow: 0 0 20px rgba(131, 56, 236, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: crosshair;
}

#gameCanvas:focus {
  outline: 2px solid rgba(0, 240, 255, 0.35);
  outline-offset: -2px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  position: relative;
  text-align: center;
  padding: 40px 48px;
  max-width: 420px;
}

.overlay-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(131, 56, 236, 0.3), transparent 70%);
  pointer-events: none;
  animation: pulse-glow 3s ease-in-out infinite;
}

.overlay-content h2 {
  position: relative;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-magenta));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-shimmer 3s linear infinite;
}

@keyframes title-shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.overlay-content p {
  position: relative;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

.overlay-stats {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.overlay-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  flex-basis: 100%;
  max-width: 340px;
  margin-top: 8px;
}

.overlay-mini-stat {
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  text-align: center;
}

.overlay-mini-stat span {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.overlay-mini-stat strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  color: var(--text-primary);
}

#overlaySubtitle {
  transition: opacity 0.3s ease;
}

#overlaySubtitle.tagline-visible {
  opacity: 1;
}

.overlay-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overlay-stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.overlay-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.btn-primary {
  position: relative;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 16px 48px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: var(--glow-cyan);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overlay:not(.hidden) .btn-primary {
  animation: btn-pulse 2.4s ease-in-out infinite;
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: var(--glow-cyan); }
  50% { box-shadow: 0 0 28px rgba(0, 240, 255, 0.75), 0 0 50px rgba(131, 56, 236, 0.35); }
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.7), 0 0 60px rgba(131, 56, 236, 0.4);
}

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

.btn-secondary {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 12px 40px;
  min-width: 200px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  background: rgba(12, 12, 24, 0.6);
  border: 1px solid var(--glass-border);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.06);
  transform: translateY(-1px);
}

.btn-secondary.active {
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.65);
  box-shadow: var(--glow-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
}

.speed-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100%, 360px);
}

.speed-switch-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.speed-switch-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.speed-option {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  background: rgba(12, 12, 24, 0.6);
  border: 1px solid var(--glass-border);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  flex: 1 1 auto;
  min-width: 64px;
}

.speed-option:hover {
  color: var(--text-primary);
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.06);
}

.speed-option.active {
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.65);
  box-shadow: var(--glow-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.speed-option[data-speed="4"].active {
  color: var(--accent-gold);
  border-color: rgba(255, 190, 11, 0.7);
  box-shadow: 0 0 16px rgba(255, 190, 11, 0.45);
}

.btn-speed-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-panel);
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.btn-speed-header:hover {
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-speed-header.speed-fast {
  color: var(--accent-magenta);
  border-color: rgba(255, 0, 110, 0.45);
}

.btn-speed-header.speed-lightning {
  color: var(--accent-gold);
  border-color: rgba(255, 190, 11, 0.55);
  box-shadow: 0 0 12px rgba(255, 190, 11, 0.25);
}

.btn-pause-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 0, 110, 0.35);
  background: var(--bg-panel);
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-magenta);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.btn-pause-header:hover {
  border-color: rgba(255, 0, 110, 0.65);
  box-shadow: var(--glow-magenta);
  color: #ff4d9d;
  transform: translateY(-1px);
}

.btn-pause-header[hidden] {
  display: none;
}

#resumeBtn[hidden],
#menuBtnOverlay[hidden] {
  display: none;
}

.btn-menu-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(131, 56, 236, 0.4);
  background: var(--bg-panel);
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-purple);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.btn-menu-header:hover {
  border-color: rgba(131, 56, 236, 0.7);
  box-shadow: 0 0 16px rgba(131, 56, 236, 0.35);
  color: #a96bff;
  transform: translateY(-1px);
}

.btn-menu-header[hidden] {
  display: none;
}

.btn-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.btn-help:hover {
  border-color: rgba(0, 240, 255, 0.7);
  box-shadow: var(--glow-cyan);
  background: rgba(0, 240, 255, 0.08);
  transform: translateY(-1px);
}

.btn-help:active {
  transform: translateY(0);
}

.overlay-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-help-overlay {
  min-width: 200px;
}

.controls-hint {
  position: relative;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--text-primary);
}

.help-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.help-link:hover {
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
}

.footer .help-link {
  font-size: inherit;
}

.powerup-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.powerup-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px 8px;
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  animation: slide-up 0.3s ease;
  min-width: 88px;
}

.powerup-badge .icon {
  font-size: 1rem;
}

.powerup-badge .label {
  white-space: nowrap;
}

.powerup-timer {
  display: block;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.powerup-timer-fill {
  display: block;
  height: 100%;
  background: var(--pu-color, var(--accent-cyan));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--pu-color, var(--accent-cyan));
  transition: width 0.1s linear;
}

.stat-value.lives.lives-danger {
  color: var(--accent-magenta);
  animation: lives-pulse 0.9s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 0, 110, 0.6);
}

@keyframes lives-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.08); }
}

.game-container.last-life {
  animation: last-life-border 1.2s ease-in-out infinite;
}

@keyframes last-life-border {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 0, 110, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6); }
  50% { box-shadow: 0 0 24px rgba(255, 0, 110, 0.35), 0 20px 60px rgba(0, 0, 0, 0.6); }
}

.overlay-menu-best {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 28px;
  margin-bottom: 8px;
  background: rgba(255, 190, 11, 0.06);
  border: 1px solid rgba(255, 190, 11, 0.25);
  border-radius: 10px;
}

.overlay-menu-best span {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.overlay-menu-best strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(255, 190, 11, 0.4);
}

.touch-zones {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.touch-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border: none;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.touch-zone:active {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.06), transparent);
}

.touch-right:active {
  background: linear-gradient(270deg, rgba(0, 240, 255, 0.06), transparent);
}

.touch-left { left: 0; }
.touch-right { right: 0; }

@media (hover: none) and (pointer: coarse) {
  .touch-zones { display: block; }
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 4px;
  flex-shrink: 0;
}

.high-score strong {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent-gold);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .app { padding: 6px; gap: 6px; }
  .header { justify-content: center; }
  .header-right {
    width: 100%;
    justify-content: center;
  }
  .stats-bar { width: 100%; justify-content: space-around; }
  .btn-help-header {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  .header { position: relative; padding-top: 36px; }
  .overlay-content { padding: 28px 24px; }
  .controls-hint { font-size: 0.7rem; }
}
