/**
 * ═══════════════════════════════════════════════════════════════
 *  LLOF · INFINITE PROTOCOL — Stylesheet
 *  Theme: Clean, Modern, Sci-Fi Futuristic
 *  Author: L.Malakar (refactored & upgraded)
 * ═══════════════════════════════════════════════════════════════
 */

/* ─── CUSTOM FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&family=Rajdhani:wght@300;400;600;700&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  --clr-bg:        #06090f;
  --clr-surface:   #0d1117;
  --clr-surface2:  #151c28;
  --clr-border:    rgba(0, 229, 255, 0.12);
  --clr-border-hi: rgba(0, 229, 255, 0.5);
  --clr-accent:    #00e5ff;
  --clr-accent-dim:rgba(0, 229, 255, 0.15);
  --clr-accent2:   #7c4dff;
  --clr-danger:    #ff1744;
  --clr-gold:      #ffab00;
  --clr-text:      #e2e8f0;
  --clr-text-dim:  #94a3b8;
  --clr-muted:     #475569;
  --font-display:  'Orbitron', monospace;
  --font-mono:     'Share Tech Mono', monospace;
  --font-body:     'Rajdhani', sans-serif;
  --glow-accent:   0 0 12px rgba(0,229,255,0.3), 0 0 40px rgba(0,229,255,0.08);
  --glow-danger:   0 0 12px rgba(255,23,68,0.35), 0 0 40px rgba(255,23,68,0.1);
  --glow-gold:     0 0 12px rgba(255,171,0,0.3), 0 0 36px rgba(255,171,0,0.08);
  --glow-cyan:     0 0 12px rgba(124,77,255,0.3), 0 0 36px rgba(124,77,255,0.08);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,229,255,0.06);
  --shadow-float:  0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,229,255,0.08);
  --radius:        6px;
  --radius-lg:     12px;
  --radius-pill:   100px;
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ─── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  touch-action: none;
  background: linear-gradient(180deg, #06090f 0%, #0a1020 50%, #06090f 100%);
  font-family: var(--font-body);
  color: var(--clr-text);
  cursor: default;
}

/* ─── SCANLINE OVERLAY ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.03) 3px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ─── CINEMATIC VIGNETTE ────────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 50%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 9997;
}

/* ─── ROTATE OVERLAY ────────────────────────────────────────── */
#rotate-overlay {
  position: fixed; inset: 0;
  background: var(--clr-bg);
  z-index: 9999;
  display: none;
  color: var(--clr-accent);
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 3vw, 1.1rem);
  letter-spacing: 3px;
  text-align: center;
}

@media (max-width: 900px) and (orientation: portrait) {
  #rotate-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
  }
}

#rotate-overlay img {
  width: 72px;
  opacity: 0.8;
  filter: invert(1) sepia(1) saturate(4) hue-rotate(130deg) brightness(1.1);
  animation: rotatePhone 2.5s ease-in-out infinite;
}

@keyframes rotatePhone {
  0%, 100% { transform: rotate(-90deg); }
  50%       { transform: rotate(0deg);  }
}

/* ─── CORNER DECORATION MIXIN ──────────────────────────────── */
.corner-deco {
  position: relative;
}
.corner-deco::before, .corner-deco::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: rgba(0,229,255,0.3);
  border-style: solid;
}
.corner-deco::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner-deco::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* ─── HIDE KEYBOARD SHORTCUT BADGES ON MOBILE ───────────────── */
body.is-mobile .key-badge {
  display: none;
}

/* ─── TYPOGRAPHY ────────────────────────────────────────────── */
.game-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 6rem);
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: clamp(6px, 2.5vw, 18px);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 0 60px rgba(0,229,255,0.15);
  line-height: 1.05;
  animation: titleFloat 6s ease-in-out infinite;
  position: relative;
}

.game-title::after {
  content: 'LLOF';
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0,229,255,0.08);
  transform: translate(3px, 3px);
  pointer-events: none;
}

.game-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 2.2vw, 0.9rem);
  color: var(--clr-accent);
  letter-spacing: clamp(4px, 2vw, 12px);
  margin-top: 12px;
  opacity: 0.7;
  text-transform: uppercase;
  position: relative;
}

.game-subtitle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -30px;
  right: -30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-accent), transparent);
  opacity: 0.2;
}

.crash-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 6rem);
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: clamp(6px, 2.5vw, 18px);
  text-shadow: 0 0 40px rgba(255,23,68,0.3), 0 2px 4px rgba(0,0,0,0.5);
  animation: glitchText 4s step-end infinite;
  position: relative;
}

.crash-title::after {
  content: 'CRASHED';
  position: absolute;
  inset: 0;
  color: rgba(255,23,68,0.15);
  -webkit-text-stroke: 1px rgba(255,23,68,0.2);
  transform: translate(4px, 4px);
  pointer-events: none;
  animation: none;
}

.crash-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 2vw, 0.78rem);
  color: var(--clr-muted);
  letter-spacing: 5px;
  margin-top: 10px;
  opacity: 0.7;
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes glitchText {
  0%, 94%, 100% { transform: none; clip-path: none; }
  95% { transform: translateX(-3px) skew(-1deg); clip-path: inset(15% 0 80% 0); }
  96% { transform: translateX(3px) skew(1deg);  clip-path: inset(80% 0 10% 0); }
  97% { transform: none; }
}

/* ─── DISABLED BUTTON STATE ─────────────────────────────────── */
.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ─── LAYOUT CONTAINERS ─────────────────────────────────────── */
#ui-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.6s;
}

#header-container, .game-over-header {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  pointer-events: none;
}

/* ─── HUD ───────────────────────────────────────────────────── */
#hud {
  position: absolute;
  top: clamp(12px, 2.5vh, 24px);
  left: clamp(12px, 2.5vw, 24px);
  display: none;
  pointer-events: none;
  z-index: 15;
}

#hud-panel {
  background: linear-gradient(135deg, rgba(13,17,23,0.85), rgba(6,9,15,0.92));
  border: 1px solid rgba(0,229,255,0.08);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: blur(16px) saturate(1.2);
  position: relative;
  box-shadow: var(--shadow-card);
}

#hud-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.4), transparent);
}

.hud-label {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 2vw, 0.78rem);
  color: var(--clr-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hud-value {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.7rem);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 2px;
}

.hud-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hud-best {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 2vw, 0.72rem);
  color: var(--clr-muted);
  letter-spacing: 1px;
}

.hud-coins {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 2.5vw, 0.88rem);
  color: var(--clr-gold);
  letter-spacing: 1px;
  margin-top: 6px;
}

/* Speed bar */
#speed-bar-wrap {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 1px;
  margin-top: 8px;
  overflow: hidden;
}
#speed-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent2));
  border-radius: 1px;
  transition: width 0.4s ease;
}

/* ─── MENU STATS (top-left on menu) ─────────────────────────── */
#menu-stats {
  position: absolute;
  top: clamp(12px, 2.5vh, 24px);
  left: clamp(12px, 2.5vw, 24px);
  z-index: 11;
  pointer-events: none;
  font-family: var(--font-mono);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.72rem, 2.8vw, 0.95rem);
  letter-spacing: 2px;
}

.stat-coins {
  color: var(--clr-gold);
}

.stat-best {
  color: var(--clr-text-dim);
  font-size: clamp(0.62rem, 2.2vw, 0.8rem);
  margin-top: 6px;
}

/* ─── BUTTONS ───────────────────────────────────────────────── */
button {
  position: relative;
  padding: clamp(10px, 2.2vh, 15px) clamp(20px, 5vw, 56px);
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 3vw, 1rem);
  font-weight: 700;
  background: rgba(0,229,255,0.04);
  color: var(--clr-accent);
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: var(--radius);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: clamp(2px, 1vw, 4px);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  pointer-events: auto;
  overflow: hidden;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,229,255,0.12), rgba(0,229,255,0.04));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

button:hover::before  { opacity: 1; }
button:hover {
  color: #ffffff;
  border-color: rgba(0,229,255,0.5);
  box-shadow: 0 0 20px rgba(0,229,255,0.1), inset 0 0 20px rgba(0,229,255,0.03);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); }
button > * { position: relative; z-index: 1; }
button span { position: relative; z-index: 1; }

/* Keybind badge on buttons */
.key-badge {
  display: inline-block;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.6em;
  color: var(--clr-muted);
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 1px;
  transition: var(--transition);
}
button:hover .key-badge {
  border-color: rgba(0,229,255,0.2);
  color: var(--clr-text-dim);
}

.btn-danger {
  color: var(--clr-danger);
  border-color: rgba(255,23,68,0.3);
  background: rgba(255,23,68,0.04);
}
.btn-danger::before { background: linear-gradient(135deg, rgba(255,23,68,0.15), rgba(255,23,68,0.04)); }
.btn-danger:hover {
  color: #fff;
  border-color: rgba(255,23,68,0.5);
  box-shadow: 0 0 20px rgba(255,23,68,0.1), inset 0 0 20px rgba(255,23,68,0.03);
}

.btn-gold {
  color: var(--clr-gold);
  border-color: rgba(255,171,0,0.3);
  background: rgba(255,171,0,0.04);
}
.btn-gold::before { background: linear-gradient(135deg, rgba(255,171,0,0.15), rgba(255,171,0,0.04)); }
.btn-gold:hover {
  color: #fff;
  border-color: rgba(255,171,0,0.5);
  box-shadow: 0 0 20px rgba(255,171,0,0.1), inset 0 0 20px rgba(255,171,0,0.03);
}

.arrow-btn {
  padding: 10px 14px;
  font-size: clamp(1rem, 4vw, 1.6rem);
  min-width: clamp(38px, 9vw, 52px);
  border-radius: var(--radius);
  background: rgba(0,229,255,0.03);
  border-color: rgba(0,229,255,0.12);
}
.arrow-btn::before { display: none; }
.arrow-btn:hover {
  color: #ffffff;
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.3);
  box-shadow: 0 0 16px rgba(0,229,255,0.08);
  transform: translateY(-1px);
}

/* ─── ICON BUTTONS ──────────────────────────────────────────── */
.icon-btn {
  width: clamp(28px, 7vw, 40px);
  cursor: pointer;
  transition: all 0.25s ease;
  pointer-events: auto;
  filter: invert(0.85) brightness(1.2);
  opacity: 0.6;
}
.icon-btn:hover {
  transform: scale(1.1);
  filter: invert(0.85) brightness(1.5);
  opacity: 1;
}

#main-settings-btn {
  position: absolute;
  top: clamp(12px, 2.5vh, 24px);
  right: clamp(12px, 2.5vw, 24px);
  z-index: 12;
}

#pause-btn {
  position: absolute;
  top: clamp(12px, 2.5vh, 24px);
  right: clamp(12px, 2.5vw, 24px);
  z-index: 25;
  display: none;
}

/* ─── MENU CARD ─────────────────────────────────────────────── */
.menu-card {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  text-align: center;
  width: 100%;
}

#menu {
  width: auto;
  left: auto;
  right: 5%;
  transform: none;
  bottom: 8%;
}

.plane-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.plane-name-box {
  background: linear-gradient(135deg, rgba(13,17,23,0.8), rgba(6,9,15,0.9));
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: var(--radius-lg);
  padding: 10px 24px;
  min-width: clamp(120px, 30vw, 240px);
  position: relative;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.plane-name-box::before,
.plane-name-box::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border-color: rgba(0,229,255,0.4);
  border-style: solid;
}
.plane-name-box::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
.plane-name-box::after  { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }

#planeName {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 3.2vw, 1.3rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 4px;
}

.menu-actions {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

#controls-hint {
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.8vw, 0.72rem);
  color: var(--clr-muted);
  margin-top: 18px;
  letter-spacing: 3px;
  opacity: 0.7;
}

/* ─── GAME OVER SCREEN ──────────────────────────────────────── */
#game-over-screen {
  position: absolute; inset: 0;
  display: none;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,23,68,0.03) 0%, transparent 60%);
}

.game-over-card {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  text-align: center;
  width: 100%;
}

.go-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.go-stat-block {
  background: linear-gradient(135deg, rgba(13,17,23,0.85), rgba(6,9,15,0.92));
  border: 1px solid rgba(0,229,255,0.08);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  min-width: 96px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.go-stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--clr-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.go-stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  font-weight: 700;
  color: #ffffff;
  margin-top: 6px;
  letter-spacing: 1px;
}

.go-btn-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ─── PAUSE SCREEN ──────────────────────────────────────────── */
#pause-screen {
  position: absolute; inset: 0;
  display: none;
  background: rgba(6,9,15,0.92);
  backdrop-filter: blur(20px) saturate(1.1);
  z-index: 24;
  pointer-events: auto;
}
#pause-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.pause-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 12px;
  text-shadow: 0 0 40px rgba(0,229,255,0.15), 0 2px 4px rgba(0,0,0,0.5);
  text-transform: uppercase;
}

.pause-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 2vw, 0.85rem);
  color: var(--clr-muted);
  letter-spacing: 3px;
  margin-top: -20px;
}

.pause-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

#settings-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  pointer-events: auto;
}

/* ─── SETTINGS MODAL ────────────────────────────────────────── */
#settings-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(160deg, rgba(13,17,23,0.97), rgba(6,9,15,0.99));
  border: 1px solid rgba(0,229,255,0.12);
  border-radius: var(--radius-lg);
  padding: clamp(28px,4vh,48px) clamp(32px,6vw,64px);
  z-index: 1000;
  text-align: center;
  box-shadow: var(--shadow-float), 0 0 80px rgba(0,229,255,0.04);
  pointer-events: auto;
  width: clamp(300px, 65vw, 440px);
  height: clamp(360px, 60vh, 520px);
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.15) transparent;
  backdrop-filter: blur(24px);
}

#settings-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.5), transparent);
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3.5vw, 1.3rem);
  font-weight: 700;
  color: var(--clr-text-dim);
  letter-spacing: 5px;
  margin-bottom: 28px;
  text-transform: uppercase;
}

/* Tabs */
.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  overflow: hidden;
}

.tab-btn {
  flex: 1;
  padding: 10px 6px;
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 2vw, 0.7rem);
  color: var(--clr-muted);
  background: transparent;
  border: none;
  border-radius: 0;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.tab-btn::before { display: none; }
.tab-btn:hover { color: var(--clr-text); background: rgba(255,255,255,0.03); box-shadow: none; }
.tab-btn.active {
  color: #ffffff;
  background: rgba(0,229,255,0.12);
  box-shadow: none;
  position: relative;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--clr-accent);
  border-radius: 1px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Settings rows */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-bottom: 16px;
}

.setting-label {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 2.2vw, 0.78rem);
  color: var(--clr-text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  flex-shrink: 0;
  text-align: left;
}

.close-btn {
  position: absolute;
  top: 14px; right: 18px;
  color: var(--clr-muted);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 300;
  line-height: 1;
  pointer-events: auto;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.close-btn:hover {
  color: var(--clr-danger);
  background: rgba(255,23,68,0.08);
}

/* ─── SLIDERS ───────────────────────────────────────────────── */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  flex: 1;
}
input[type=range]:focus { outline: none; }

input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  height: 16px; width: 16px;
  border-radius: 50%;
  background: var(--clr-accent);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}
input[type=range]::-moz-range-track {
  height: 4px;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  border: none;
}
input[type=range]::-moz-range-thumb {
  height: 16px; width: 16px;
  border-radius: 50%;
  background: var(--clr-accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}

/* ─── TOGGLE SWITCH ─────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--clr-muted);
  border-radius: 999px;
  transition: all 0.25s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--clr-muted);
  transition: all 0.25s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--clr-accent-dim);
  border-color: var(--clr-accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--clr-accent);
  box-shadow: 0 0 10px rgba(0,229,255,0.6);
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

/* ─── KEYBINDS TABLE ────────────────────────────────────────── */
.keybinds-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  width: 100%;
  text-align: left;
}

.kb-action {
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 2vw, 0.78rem);
  color: var(--clr-text);
  letter-spacing: 1px;
  align-self: center;
  text-transform: uppercase;
}

.kb-key {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 2vw, 0.76rem);
  background: rgba(0,229,255,0.04);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: var(--radius);
  padding: 5px 12px;
  color: var(--clr-text);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
  min-width: 56px;
}

.kb-key:hover {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.25);
}

.kb-key.listening {
  background: rgba(124,77,255,0.1);
  border-color: rgba(124,77,255,0.4);
  color: var(--clr-accent2);
  animation: keyBlink 0.8s step-end infinite;
}

@keyframes keyBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.kb-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: rgba(255,255,255,0.04);
  margin: 6px 0;
}

.kb-section-label {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--clr-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ─── MOBILE CONTROL SELECTOR ───────────────────────────────── */
.mobile-ctrl-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ctrl-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(255,255,255,0.01);
  text-align: left;
}
.ctrl-opt::before { display: none; }
.ctrl-opt:hover {
  border-color: rgba(0,229,255,0.15);
  background: rgba(0,229,255,0.03);
  box-shadow: none;
  color: inherit;
}
.ctrl-opt.selected {
  border-color: rgba(0,229,255,0.25);
  background: rgba(0,229,255,0.06);
  box-shadow: 0 0 20px rgba(0,229,255,0.05);
}

.ctrl-opt-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--clr-muted);
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.ctrl-opt.selected .ctrl-opt-dot {
  border-color: var(--clr-accent);
  background: var(--clr-accent);
  box-shadow: 0 0 8px rgba(0,229,255,0.4);
}

.ctrl-opt-info { flex: 1; }
.ctrl-opt-name {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2.5vw, 0.88rem);
  color: var(--clr-text);
  letter-spacing: 2px;
  font-weight: 700;
}
.ctrl-opt-desc {
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.8vw, 0.7rem);
  color: var(--clr-muted);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* D-Pad on-screen buttons */
#dpad-container {
  position: absolute;
  bottom: 40px; left: 24px;
  z-index: 100;
  display: none;
  user-select: none;
  pointer-events: all;
}

.dpad-row {
  display: flex;
  justify-content: center;
}

.dpad-btn {
  width: 54px; height: 54px;
  background: rgba(0,229,255,0.04);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--clr-text-dim);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.dpad-btn:active, .dpad-btn.pressed {
  background: rgba(0,229,255,0.12);
  border-color: rgba(0,229,255,0.3);
  color: #ffffff;
}

/* ─── COUNTDOWN ─────────────────────────────────────────────── */
#countdown-overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5%;
  z-index: 15;
  pointer-events: none;
}
#countdown-overlay.active { display: flex; }

#countdown-text {
  font-family: var(--font-display);
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 8px;
  text-shadow: 0 0 60px rgba(0,229,255,0.2), 0 2px 8px rgba(0,0,0,0.6);
  animation: countdownPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

#countdown-text.go {
  color: var(--clr-accent);
  text-shadow: 0 0 40px rgba(0,229,255,0.4), 0 0 100px rgba(0,229,255,0.15);
}

@keyframes countdownPop {
  0%   { transform: scale(2); opacity: 0; filter: blur(8px); }
  50%  { opacity: 1; filter: blur(0px); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1);   opacity: 1; }
}

@keyframes countdownFade {
  0%    { opacity: 1; transform: scale(1); }
  100%  { opacity: 0; transform: scale(0.7); }
}

#countdown-text.fade-out { animation: countdownFade 0.5s ease forwards; }

/* ─── GHOST MODE INDICATOR ───────────────────────────────────── */
#ghost-indicator {
  position: absolute;
  top: clamp(14px, 3vh, 28px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.8vw, 0.75rem);
  color: var(--clr-accent2);
  letter-spacing: 4px;
  display: none;
  z-index: 15;
  text-transform: uppercase;
  animation: ghostPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  background: rgba(124,77,255,0.08);
  border: 1px solid rgba(124,77,255,0.2);
  padding: 4px 16px;
  border-radius: var(--radius-pill);
}

@keyframes ghostPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ─── DIFFICULTY INDICATOR ───────────────────────────────────── */
#diff-label {
  position: absolute;
  top: clamp(14px, 3vh, 28px);
  right: clamp(52px, 10vw, 80px);
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.6vw, 0.7rem);
  color: var(--clr-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: none;
  z-index: 15;
  pointer-events: none;
  transition: all 0.5s ease;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* ─── JOYSTICK ──────────────────────────────────────────────── */
#joystick-container {
  position: absolute; inset: 0;
  z-index: 100;
  pointer-events: none;
  display: none;
}

#joystick-pad {
  width: 110px; height: 110px;
  background: rgba(0,229,255,0.03);
  border: 1px solid rgba(0,229,255,0.08);
  border-radius: 50%;
  position: absolute;
  bottom: 50px; left: 50px;
  opacity: 0.4;
  transition: opacity 0.2s;
  pointer-events: none;
}

#joystick-knob {
  width: 36%; height: 36%;
  background: rgba(0,229,255,0.6);
  border-radius: 50%;
  position: absolute;
  top: 32%; left: 32%;
  box-shadow: 0 0 16px rgba(0,229,255,0.3);
}

/* ─── SCROLLBAR STYLE ───────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.15); border-radius: 2px; }

/* ─── THREE.JS CANVAS (must sit below all UI) ─────────────── */
canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ─── UTILITY ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .game-title, .crash-title { font-size: 2.2rem; letter-spacing: 4px; }
  .game-title::after, .crash-title::after { display: none; }
  .game-subtitle             { font-size: 0.65rem; letter-spacing: 4px; }
  #menu { left: 50%; right: auto; transform: translateX(-50%); bottom: 10%; width: 92%; }
  .game-over-card { bottom: 10%; }
  button { padding: 9px 18px; font-size: 0.9rem; letter-spacing: 2px; }
  #countdown-text { font-size: 4.5rem; }
  .go-stats { gap: 12px; }
  .go-stat-block { padding: 10px 14px; min-width: 72px; }
  .go-stat-value { font-size: 1.2rem; }
  #hud-panel { padding: 10px 14px; }
  .pause-title { letter-spacing: 8px; }
  .pause-actions { gap: 12px; flex-wrap: wrap; justify-content: center; }
  #settings-modal { padding: 24px 20px; width: 280px; height: clamp(320px, 70vh, 460px); }
  .game-subtitle::before { left: -16px; right: -16px; }
}

@media (max-width: 480px) {
  .key-badge { display: none; }
  .settings-tabs .tab-btn { font-size: 0.5rem; padding: 8px 2px; letter-spacing: 1px; }
  .go-stats { gap: 8px; }
  .go-stat-block { padding: 8px 10px; min-width: 64px; }
  .go-stat-value { font-size: 1rem; }
  .go-stat-label { font-size: 0.52rem; letter-spacing: 2px; }
  .ctrl-opt { padding: 10px 14px; }
  #planeName { font-size: 0.8rem; letter-spacing: 3px; }
  .plane-name-box { min-width: 100px; padding: 8px 16px; }
  .arrow-btn { min-width: 34px; padding: 8px 10px; }
}
/* ═══════════════════════════════════════════════════════════════
   POWER-UP HUD
═══════════════════════════════════════════════════════════════ */

/* Container — stacks pills vertically, top-right below pause btn */
#powerup-hud {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: 200px;
}

/* Individual power-up pill */
.pu-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13,17,23,0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  padding: 5px 12px 5px 10px;
  backdrop-filter: blur(12px);
  animation: pu-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

@keyframes pu-slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0);    }
}

.pu-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--clr-text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pu-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  min-width: 36px;
}

.pu-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.pu-time {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--clr-muted);
  white-space: nowrap;
  min-width: 26px;
  text-align: right;
}

/* ── Power-up pickup toast ─────────────────────────────────── */
.pu-toast {
  position: fixed;
  top: 36%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 4px;
  pointer-events: none;
  z-index: 300;
  animation: pu-toast-rise 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

@keyframes pu-toast-rise {
  0%   { opacity: 0;   transform: translateX(-50%) translateY(16px) scale(0.9); }
  12%  { opacity: 1;   transform: translateX(-50%) translateY(0) scale(1);      }
  75%  { opacity: 1;   transform: translateX(-50%) translateY(-6px) scale(1);    }
  100% { opacity: 0;   transform: translateX(-50%) translateY(-20px) scale(0.95);}
}

.pu-toast-out {
  animation: none;
  opacity: 0;
  transition: opacity 0.4s;
}

/* ── Mobile adjustments ───────────────────────────────────── */
@media (max-width: 768px) {
  #powerup-hud {
    top: 48px;
    right: 8px;
    max-width: 160px;
  }
  .pu-label  { font-size: 0.52rem; }
  .pu-toast  { font-size: 1rem; letter-spacing: 2px; }
}
/* ═══════════════════════════════════════════════════════════════
   MAP SELECTOR
═══════════════════════════════════════════════════════════════ */

#eventBtn {
  --evt-bg: linear-gradient(90deg, #ff6b00, #ff0080);
  --evt-glow: rgba(255,107,0,0.45);
  background: var(--evt-bg);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 12px var(--evt-glow);
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  white-space: nowrap;
  perspective: 400px;
}

#eventBtn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 22px var(--evt-glow);
}

#eventBtn.evt-flipping {
  animation: evtFlip 0.5s ease-in-out;
}
@keyframes evtFlip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ── Card slide-in when paging between multiple event banners ─── */
.evt-slide-in-right { animation: evtSlideInRight 0.4s cubic-bezier(0.22,1,0.36,1); }
.evt-slide-in-left  { animation: evtSlideInLeft  0.4s cubic-bezier(0.22,1,0.36,1); }
@keyframes evtSlideInRight { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes evtSlideInLeft  { from { transform: translateX(-60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Paging arrows shown while any event banner is open ────────── */
#evt-nav-arrows {
  position: fixed; inset: 0; z-index: 9995;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(8px, 3vw, 40px); pointer-events: none;
}
#evt-nav-arrows button {
  pointer-events: auto;
  box-sizing: border-box;
  width: 44px; height: 44px; padding: 0; margin: 0;
  border-radius: 50%; flex-shrink: 0;
  background: rgba(0,0,0,0.5); border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
#evt-nav-arrows button:hover { transform: scale(1.12); background: rgba(0,0,0,0.75); }

#map-btn-wrap {
  position: fixed;
  bottom: clamp(16px, 3vh, 32px);
  left: clamp(16px, 3vw, 32px);
  z-index: 50;
  pointer-events: auto;
}

#mapBtn {
  padding: 8px 22px;
  font-size: clamp(0.62rem, 2vw, 0.78rem);
  letter-spacing: 3px;
}

#map-selector {
  position: fixed;
  bottom: calc(clamp(16px, 3vh, 32px) + 56px);
  left: clamp(16px, 3vw, 32px);
  z-index: 51;
  background: linear-gradient(135deg, rgba(13,17,23,0.95), rgba(6,9,15,0.98));
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  pointer-events: auto;
  min-width: 260px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(20px);
  animation: mapSelIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mapSelIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

#map-selector::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.4), transparent);
}

.map-sel-title {
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1.8vw, 0.72rem);
  color: var(--clr-text-dim);
  letter-spacing: 3px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.map-options {
  display: flex;
  gap: 10px;
}

.map-card {
  flex: 1;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  min-width: 100px;
  position: relative;
  overflow: visible;
}

.dev-phase-select {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.68rem;
  letter-spacing: 1px;
}

.map-card:hover {
  border-color: rgba(0,229,255,0.2);
  background: rgba(0,229,255,0.04);
}

.kb-focused {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 14px rgba(255,255,255,0.5);
}
.map-card.active {
  border-color: rgba(0,229,255,0.35);
  background: rgba(0,229,255,0.08);
  box-shadow: 0 0 16px rgba(0,229,255,0.06);
}

.map-card.locked {
  opacity: 0.7;
}

.map-card.locked:hover {
  opacity: 0.9;
  border-color: rgba(255,171,0,0.25);
  background: rgba(255,171,0,0.04);
}

.map-card-name {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2.5vw, 0.88rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.map-card-desc {
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 1.5vw, 0.62rem);
  color: var(--clr-muted);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.map-status {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  color: var(--clr-muted);
  letter-spacing: 1px;
}

.map-status-active {
  color: var(--clr-accent);
}

.map-status-price {
  color: var(--clr-gold);
  font-size: clamp(0.82rem, 2.2vw, 1rem);
  font-weight: 700;
}

.map-card-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.3);
  position: relative;
}

.map-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0,229,255,0.08);
  border-radius: 4px;
  pointer-events: none;
}

.map-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.map-card:hover .map-card-img,
.map-card.active .map-card-img {
  opacity: 1;
}

.map-card.locked .map-card-img {
  filter: brightness(0.4) saturate(0.3);
  opacity: 0.5;
}

.map-card.locked:hover .map-card-img {
  filter: brightness(0.6) saturate(0.5);
  opacity: 0.7;
}

/* ── Mobile adjustments ───────────────────────────────────── */
@media (max-width: 768px) {
  #map-selector {
    bottom: calc(clamp(16px, 3vh, 32px) + 52px);
    left: clamp(12px, 3vw, 24px);
    min-width: 220px;
    padding: 14px 14px;
  }
  .map-card { padding: 10px 8px; min-width: 80px; }
  .map-card-name { font-size: 0.7rem; }
  .map-card-desc { font-size: 0.5rem; }
}

@media (max-width: 480px) {
  .map-options { gap: 6px; }
  .map-card { padding: 8px 6px; min-width: 70px; }
}

/* ═══════════════════════════════════════════════════════════════
   SUMMER SALE UI
═══════════════════════════════════════════════════════════════ */

/* Top scrolling banner */
#summer-sale-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9996;
  background: linear-gradient(90deg, #e76f51, #f4a261, #e9c46a, #f4a261, #e76f51);
  background-size: 300% 100%;
  animation: saleBannerScroll 4s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 5px 0;
  pointer-events: none;
}

@keyframes saleBannerScroll {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.sale-banner-icon {
  font-size: 0.9rem;
}

.sale-banner-text {
  font-family: var(--font-display);
  font-size: clamp(0.5rem, 1.8vw, 0.68rem);
  font-weight: 700;
  color: #1a0a00;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Mini sale badge next to coin count */
.sale-badge-mini {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #e76f51, #f4a261);
  color: #1a0a00;
  font-family: var(--font-display);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
  animation: salePulse 2s ease-in-out infinite;
  cursor: default;
}

@keyframes salePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,162,97,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(244,162,97,0); }
}

/* ── Starburst sale badge on map card ───────────────────────── */
.sale-ribbon {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 9000;
  width: 58px;
  height: 58px;
  background: #e8192c;
  clip-path: polygon(
    50% 0%,   61% 15%,  79% 9%,   79% 27%,
    97% 29%,  88% 44%,  100% 57%, 85% 65%,
    91% 83%,  74% 85%,  72% 100%, 57% 93%,
    50% 100%, 43% 93%,  28% 100%, 26% 85%,
    9% 83%,   15% 65%,  0% 57%,   12% 44%,
    3% 29%,   21% 27%,  21% 9%,   39% 15%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.45));
  animation: saleBadgePop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}

.sale-ribbon::before {
  content: '50%';
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.5px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.sale-ribbon::after {
  content: 'OFF';
  font-family: var(--font-display);
  font-size: 0.52rem;
  font-weight: 900;
  color: #ffdd00;
  line-height: 1;
  letter-spacing: 1px;
  margin-top: 1px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

@keyframes saleBadgePop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* Map price: old struck-through + new red price */
.map-price-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.map-price-old {
  text-decoration: line-through;
  opacity: 0.45;
  color: var(--clr-muted) !important;
}

.map-price-new {
  color: #f4a261 !important;
  font-weight: 700;
}

/* ── Starburst sale badge on plane buy button ───────────────── */
.menu-actions {
  position: relative;
}

.btn-sale-tag {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 9000;
  width: 52px;
  height: 52px;
  background: #e8192c;
  clip-path: polygon(
    50% 0%,   61% 15%,  79% 9%,   79% 27%,
    97% 29%,  88% 44%,  100% 57%, 85% 65%,
    91% 83%,  74% 85%,  72% 100%, 57% 93%,
    50% 100%, 43% 93%,  28% 100%, 26% 85%,
    9% 83%,   15% 65%,  0% 57%,   12% 44%,
    3% 29%,   21% 27%,  21% 9%,   39% 15%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
  animation: saleBadgePop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
  pointer-events: none;
}

.btn-sale-tag::before {
  content: '25%';
  color: #fff;
  font-size: 1em;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}

.btn-sale-tag::after {
  content: 'OFF';
  color: #ffdd00;
  font-size: 0.75em;
  letter-spacing: 1px;
  line-height: 1;
  margin-top: 1px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}

@media (max-width: 480px) {
  #summer-sale-banner { padding: 4px 0; }
  .sale-banner-text   { font-size: 0.48rem; letter-spacing: 2px; }
  .sale-ribbon        { font-size: 0.44rem; padding: 2px 10px; }
}

/* ─── BEACH SUNSET MAP SKIN ─────────────────────────────────── */
body.skin-beach {
  background: linear-gradient(180deg,
    #0d0a1a 0%,
    #3d1a2e 30%,
    #7a2d1a 65%,
    #4a1a0a 100%
  );
}

body.skin-beach::before {
  /* Soften scanlines on bright backgrounds */
  opacity: 0.4;
}

body.skin-beach::after {
  /* Warmer vignette */
  background: radial-gradient(ellipse 70% 60% at 50% 50%,
    transparent 50%,
    rgba(26,10,46,0.55) 100%
  );
}

/* ── Sun Ray overlay (Beach Sunset only) ────────────────────── */
#sun-rays {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  display: none;
  overflow: hidden;
}

body.skin-beach #sun-rays {
  display: block;
}

/* Central sun glow */
#sun-rays::before {
  content: '';
  position: absolute;
  top: 18%;
  left: 72%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle,
    rgba(255, 255, 200, 0.95) 0%,
    rgba(255, 200, 60, 0.7)   18%,
    rgba(255, 120, 20, 0.35)  40%,
    transparent 70%
  );
  border-radius: 50%;
  animation: sunPulse 3s ease-in-out infinite;
  filter: blur(2px);
}

/* Crepuscular rays burst */
#sun-rays::after {
  content: '';
  position: absolute;
  top: 18%;
  left: 72%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 0;
  height: 0;
  background: transparent;
  box-shadow: none;
  /* Rays are painted via repeating-conic-gradient */
  width: 200vmax;
  height: 200vmax;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 160, 30, 0.13) 0deg,
    rgba(255, 160, 30, 0.0)  6deg,
    rgba(255, 200, 80, 0.09) 9deg,
    rgba(255, 200, 80, 0.0)  14deg
  );
  border-radius: 50%;
  animation: raysRotate 18s linear infinite;
  filter: blur(1px);
}

/* Lens flare streak */
.sun-flare {
  position: absolute;
  top: 18%;
  left: 72%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 210, 80, 0.0)  20%,
    rgba(255, 210, 80, 0.55) 50%,
    rgba(255, 180, 40, 0.0)  80%,
    transparent 100%
  );
  border-radius: 50%;
  filter: blur(1.5px);
  animation: flareFlicker 4s ease-in-out infinite;
  transform-origin: center;
}

.sun-flare:nth-child(2) {
  transform: translate(-50%, -50%) rotate(25deg);
  width: 420px;
  opacity: 0.7;
  animation-delay: 0.8s;
}

.sun-flare:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-18deg);
  width: 300px;
  opacity: 0.5;
  animation-delay: 1.6s;
}

/* Lens flare orb dots along the streak axis */
.sun-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 200, 60, 0.7) 0%,
    rgba(255, 120, 20, 0.2) 60%,
    transparent 100%
  );
  filter: blur(2px);
  animation: orbPulse 4s ease-in-out infinite;
}

.sun-orb:nth-child(4) { width: 60px;  height: 60px;  top: 55%; left: 32%; animation-delay: 0s;   opacity: 0.5; }
.sun-orb:nth-child(5) { width: 35px;  height: 35px;  top: 65%; left: 22%; animation-delay: 0.6s; opacity: 0.35; }
.sun-orb:nth-child(6) { width: 20px;  height: 20px;  top: 72%; left: 14%; animation-delay: 1.2s; opacity: 0.3; }

@keyframes sunPulse {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1);    }
  50%       { opacity: 1.0;  transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes raysRotate {
  from { transform: translate(-50%, -50%) rotate(0deg);   }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes flareFlicker {
  0%, 100% { opacity: 0.9; }
  45%       { opacity: 0.6; }
  70%       { opacity: 1.0; }
}

@keyframes orbPulse {
  0%, 100% { opacity: inherit; transform: scale(1);    }
  50%       { opacity: 0.2;    transform: scale(1.15); }
}

/* ── COMING SOON map card (pre-event) ───────────────────────── */
.coming-soon-card {
  opacity: 0.85;
  cursor: not-allowed !important;
  pointer-events: auto; /* keep it visible but click handler blocks it */
}

/* Kill the "clickable" hover glow — both the generic and beach-specific
   hover rules have to be overridden since they're more specific. */
.map-card.coming-soon-card:hover {
  border-color: rgba(255,255,255,0.05) !important;
  background: rgba(255,255,255,0.02) !important;
  box-shadow: none !important;
}

.coming-soon-card .map-card-img {
  filter: grayscale(35%) brightness(0.55) saturate(0.8);
}

/* Lock glyph centred over the dimmed thumbnail */
.coming-soon-card .map-card-img-wrap::before {
  content: '🔒';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  z-index: 2;
  opacity: 0.9;
}

.map-status-coming-soon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  background: linear-gradient(90deg, #c1440e, #f4a261);
  color: #fff;
  font-size: clamp(0.56rem, 1.8vw, 0.66rem);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 4px;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(244,162,97,0.45);
  animation: comingSoonPulse 2s ease-in-out infinite;
}

@keyframes comingSoonPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(244,162,97,0.45); }
  50%      { box-shadow: 0 0 20px rgba(193,68,14,0.6);  }
}

@media (max-width: 480px) {
  .map-status-coming-soon { font-size: 0.5rem; letter-spacing: 0.5px; padding: 3px 8px; }
}