/* ==========================================================================
   NEON VIPER: CYBERPUNK SNAKE - MODERN STYLING
   ========================================================================== */

:root {
  --bg-deep: #060913;
  --bg-surface: #0c1222;
  --bg-card: rgba(16, 24, 48, 0.82);
  --bg-card-border: rgba(0, 243, 255, 0.25);
  
  --neon-cyan: #00f3ff;
  --neon-cyan-glow: rgba(0, 243, 255, 0.45);
  --neon-magenta: #ff007f;
  --neon-magenta-glow: rgba(255, 0, 127, 0.45);
  --neon-lime: #39ff14;
  --neon-gold: #ffbe0b;
  --neon-gold-glow: rgba(255, 190, 11, 0.45);
  --neon-purple: #9d4edd;
  
  --text-primary: #f0f6fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* Light / Custom Themes */
body.theme-synthwave {
  --neon-cyan: #ff007f;
  --neon-cyan-glow: rgba(255, 0, 127, 0.5);
  --neon-magenta: #00f3ff;
  --neon-magenta-glow: rgba(0, 243, 255, 0.5);
  --neon-gold: #ff9e00;
  --bg-deep: #10061a;
  --bg-surface: #1d0c2e;
}

body.theme-emerald {
  --neon-cyan: #39ff14;
  --neon-cyan-glow: rgba(57, 255, 20, 0.5);
  --neon-magenta: #00f3ff;
  --neon-gold: #ffff00;
  --bg-deep: #031408;
  --bg-surface: #082410;
}

body.theme-golden {
  --neon-cyan: #ffbe0b;
  --neon-cyan-glow: rgba(255, 190, 11, 0.5);
  --neon-magenta: #fb5607;
  --neon-gold: #ff006e;
  --bg-deep: #160f03;
  --bg-surface: #2b1d06;
}

body.theme-matrix {
  --neon-cyan: #00ff66;
  --neon-cyan-glow: rgba(0, 255, 102, 0.4);
  --neon-magenta: #a3ff00;
  --neon-gold: #ffffff;
  --bg-deep: #040d06;
  --bg-surface: #0a1f0f;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
}

/* Background Cyber Grid */
.cyber-background {
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(0, 243, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 127, 0.06) 0%, transparent 50%),
    linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  background-position: center center;
  z-index: 0;
  pointer-events: none;
}

/* Scanline Overlay for Retro Polish */
.scanlines {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* Main App Container */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  padding: 12px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ==========================================================================
   HEADER / HUD
   ========================================================================== */
.hud-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 243, 255, 0.1);
  transition: border-color var(--transition-normal);
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan-glow);
}

.brand-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px var(--neon-cyan));
}

.score-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
}

.stat-value.score-highlight {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--neon-cyan-glow);
}

.stat-value.best-highlight {
  color: var(--neon-gold);
  text-shadow: 0 0 10px var(--neon-gold-glow);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* Combo Meter */
.combo-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.combo-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--neon-magenta);
  text-shadow: 0 0 8px var(--neon-magenta-glow);
  min-width: 52px;
  text-align: right;
  letter-spacing: 0.5px;
}

.combo-bar-track {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.combo-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta), var(--neon-gold));
  border-radius: 99px;
  box-shadow: 0 0 10px var(--neon-magenta);
  transition: width 0.06s linear;
}

.combo-active .combo-bar-fill {
  animation: pulse-glow 0.8s infinite alternate;
}

@keyframes pulse-glow {
  0% { filter: brightness(1) drop-shadow(0 0 4px var(--neon-magenta)); }
  100% { filter: brightness(1.3) drop-shadow(0 0 12px var(--neon-gold)); }
}

/* Secondary status pills (Length, Speed, Powerups) */
.hud-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.pill-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill-item span {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
}

/* Powerup Active Badge */
#powerup-badge {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(255, 0, 127, 0.2);
  border: 1px solid var(--neon-magenta);
  color: #fff;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 0 0 6px var(--neon-magenta);
  animation: badge-pulse 0.6s infinite alternate;
}

@keyframes badge-pulse {
  from { box-shadow: 0 0 6px var(--neon-magenta-glow); }
  to { box-shadow: 0 0 14px var(--neon-magenta); }
}

/* ==========================================================================
   GAME CANVAS STAGE
   ========================================================================== */
.canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 8px 0;
}

#game-canvas {
  display: block;
  background-color: #080d1a;
  border: 2px solid rgba(0, 243, 255, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(0, 243, 255, 0.15),
    inset 0 0 20px rgba(0, 0, 0, 0.8);
  image-rendering: auto;
  touch-action: none;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* Active Fever Border */
#game-canvas.fever-mode {
  border-color: var(--neon-magenta);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 30px var(--neon-magenta-glow),
    inset 0 0 25px rgba(255, 0, 127, 0.2);
}

/* ==========================================================================
   MOBILE VIRTUAL CONTROLS (D-PAD)
   ========================================================================== */
.touch-controls-container {
  width: 100%;
  max-width: 480px;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
  touch-action: none;
}

/* Show on touch devices or small screens */
@media (pointer: coarse), (max-width: 768px) {
  .touch-controls-container {
    display: flex;
  }
}

body.dpad-show .touch-controls-container {
  display: flex !important;
}

body.dpad-hide .touch-controls-container {
  display: none !important;
}

.dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(3, 56px);
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.dpad-btn {
  background: rgba(16, 26, 50, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(0, 243, 255, 0.3);
  border-radius: var(--radius-sm);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.08s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dpad-btn:active, .dpad-btn.active {
  background: rgba(0, 243, 255, 0.3);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px var(--neon-cyan);
  transform: scale(0.92);
}

.dpad-up    { grid-column: 2; grid-row: 1; }
.dpad-left  { grid-column: 1; grid-row: 2; }
.dpad-center{ 
  grid-column: 2; 
  grid-row: 2; 
  border-color: rgba(255, 255, 255, 0.1); 
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down  { grid-column: 2; grid-row: 3; }

/* ==========================================================================
   OVERLAY SCREENS (START, PAUSE, GAMEOVER, MODALS)
   ========================================================================== */
.overlay-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 17, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 20;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.overlay-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1.5px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(0, 243, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Title Styling */
.title-glitch {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 
    0 0 10px var(--neon-cyan),
    0 0 20px var(--neon-cyan-glow),
    0 0 40px var(--neon-cyan-glow);
  position: relative;
  line-height: 1.1;
}

.title-sub {
  font-size: 0.85rem;
  color: var(--neon-magenta);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -12px;
  text-shadow: 0 0 8px var(--neon-magenta-glow);
}

/* Tabs & Options */
.option-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.option-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  width: 100%;
}

.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 6px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.seg-btn:hover {
  color: #fff;
}

.seg-btn.active {
  background: var(--neon-cyan);
  color: #060913;
  font-weight: 700;
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

/* Action Buttons */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--neon-cyan), #0099ff);
  color: #050b14;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 0 20px var(--neon-cyan-glow), 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 30px var(--neon-cyan), 0 6px 20px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

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

.btn-secondary {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-row .btn-secondary {
  flex: 1;
}

/* Quick Keys / Hint */
.start-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: -8px;
}

.kbd-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--neon-cyan);
}

/* ==========================================================================
   GAME OVER MODAL STYLES
   ========================================================================== */
.gameover-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--neon-magenta);
  text-shadow: 0 0 16px var(--neon-magenta);
  letter-spacing: 2px;
}

.new-high-score-banner {
  display: none;
  background: linear-gradient(90deg, rgba(255, 190, 11, 0.2), rgba(255, 0, 127, 0.2));
  border: 1px solid var(--neon-gold);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  color: var(--neon-gold);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-shadow: 0 0 10px var(--neon-gold-glow);
  animation: glow-pulse 1s infinite alternate;
}

@keyframes glow-pulse {
  from { box-shadow: 0 0 8px rgba(255, 190, 11, 0.3); }
  to { box-shadow: 0 0 20px rgba(255, 190, 11, 0.7); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-box-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-box-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

/* High Score Name Input Box */
.score-entry-box {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 190, 11, 0.08);
  border: 1px solid rgba(255, 190, 11, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
}

.score-entry-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-entry-input-row {
  display: flex;
  gap: 8px;
}

.score-entry-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid var(--neon-gold);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  outline: none;
  text-align: center;
}

.score-entry-input:focus {
  box-shadow: 0 0 12px var(--neon-gold-glow);
}

.score-entry-submit {
  background: var(--neon-gold);
  color: #060913;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.85rem;
}

/* ==========================================================================
   LEADERBOARD MODAL
   ========================================================================== */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.leaderboard-table th {
  padding: 8px 6px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.leaderboard-table td {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
}

.leaderboard-table tr:hover td {
  background: rgba(0, 243, 255, 0.05);
}

.rank-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
}

.rank-1 { background: #ffd700; color: #000; box-shadow: 0 0 8px rgba(255, 215, 0, 0.6); }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #000; }

.player-name-cell {
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.score-cell {
  color: var(--neon-cyan);
  font-weight: 700;
  text-align: right;
}

/* ==========================================================================
   HOW TO PLAY & SETTINGS MODALS
   ========================================================================== */
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.guide-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.guide-card p, .guide-card ul {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  list-style-position: inside;
}

.setting-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-sublabel {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #060913;
}

/* Range input */
.range-slider {
  -webkit-appearance: none;
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neon-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--neon-cyan-glow);
}

/* Modal Close Button */
.close-modal-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: #fff;
}

/* Toast / Floating Notification */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(16, 24, 48, 0.95);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #app {
    padding: 6px 8px;
  }
  
  .title-glitch {
    font-size: 1.8rem;
  }

  .modal-card {
    padding: 20px 16px;
    gap: 14px;
  }

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

  .dpad-grid {
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(3, 50px);
    gap: 4px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}
