/* NEON RUSH - UI styling. Dark neon theme, system font stack only
 * (no web fonts: Playables bundles must make zero external requests). */

:root {
  --neon-cyan: #35f0ff;
  --neon-pink: #ff2d78;
  --neon-green: #37ff8b;
  --neon-purple: #c95bff;
  --ink: #eaf6ff;
  --panel: rgba(12, 6, 36, 0.88);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #05010f;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#game-wrap {
  position: fixed; inset: 0;
  touch-action: none; /* critical: no scroll/zoom gestures on canvas */
}

#game-canvas {
  position: absolute; inset: 0;
  display: block;
  touch-action: none;
}

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  z-index: 10;
}
.screen.visible { display: flex; }

#screen-menu { background: radial-gradient(ellipse at 50% 30%, rgba(22,4,69,0.55), rgba(5,1,15,0.86)); }
#screen-pause, #screen-over { background: rgba(4, 1, 14, 0.78); backdrop-filter: blur(3px); }
#screen-settings { background: rgba(4, 1, 14, 0.9); }

.game-title {
  font-size: clamp(44px, 13vw, 84px);
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  text-shadow:
    0 0 8px var(--neon-pink),
    0 0 24px var(--neon-pink),
    0 0 64px var(--neon-pink);
}
.game-title .rush {
  color: var(--neon-cyan);
  text-shadow:
    0 0 8px var(--neon-cyan),
    0 0 24px var(--neon-cyan),
    0 0 64px var(--neon-cyan);
}
.tagline {
  font-size: 14px; letter-spacing: 3px; opacity: 0.75;
  text-transform: uppercase;
}

.stats-row {
  display: flex; gap: 28px; margin: 6px 0 10px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 11px; letter-spacing: 2px; opacity: 0.6; }
.stat .value { font-size: 30px; font-weight: 800; color: var(--neon-green); text-shadow: 0 0 12px var(--neon-green); }

.btn {
  font-family: inherit;
  font-size: 19px; font-weight: 800; letter-spacing: 2px;
  color: #04121a;
  background: linear-gradient(180deg, #7df7ff, var(--neon-cyan));
  border: none; border-radius: 12px;
  padding: 15px 44px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(53,240,255,0.55);
  transition: transform 0.08s ease;
}
.btn:active { transform: scale(0.95); }
.btn.pink {
  background: linear-gradient(180deg, #ff7ab0, var(--neon-pink));
  box-shadow: 0 0 18px rgba(255,45,120,0.55);
  color: #1a0410;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid rgba(234,246,255,0.35);
  box-shadow: none;
  font-size: 15px; padding: 11px 28px;
}
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.icon-btn {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px;
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(20, 10, 50, 0.7);
  border: 1px solid rgba(53,240,255,0.4);
  color: var(--neon-cyan); font-size: 22px;
  cursor: pointer; z-index: 30;
}
.icon-btn:active { transform: scale(0.92); }

.hint {
  font-size: 13px; opacity: 0.65; line-height: 1.7; max-width: 300px;
}
.hint b { color: var(--neon-cyan); }

/* ---------- HUD ---------- */
#screen-hud {
  display: none;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
  pointer-events: none;
  z-index: 20;
  background: none;
}
#screen-hud.visible { display: flex; }
#screen-hud .hud-left, #screen-hud .hud-right { display: flex; flex-direction: column; gap: 2px; }
#screen-hud .hud-right { align-items: flex-end; }
#hud-score { font-size: 32px; font-weight: 900; color: #fff; text-shadow: 0 0 12px var(--neon-cyan); }
#hud-coins { font-size: 17px; font-weight: 700; color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); }
#hud-coins::before { content: "● "; }
.hud-label { font-size: 10px; letter-spacing: 2px; opacity: 0.55; }

#hud-combo {
  margin-top: 8px;
  font-size: 15px; font-weight: 800; color: var(--neon-purple);
  text-shadow: 0 0 10px var(--neon-purple);
}
#combo-bar { width: 110px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); margin-top: 4px; }
#combo-fill { height: 100%; width: 0%; border-radius: 3px; background: var(--neon-purple); box-shadow: 0 0 8px var(--neon-purple); }

#btn-pause { pointer-events: auto; position: static; margin-top: 2px; }

/* ---------- game over ---------- */
#over-newbest {
  display: none;
  font-size: 16px; font-weight: 900; letter-spacing: 3px;
  color: #ffe14d; text-shadow: 0 0 14px #ffe14d;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }
.over-title { font-size: clamp(34px, 9vw, 54px); font-weight: 900; letter-spacing: 4px; color: var(--neon-pink); text-shadow: 0 0 20px var(--neon-pink); }

/* ---------- settings ---------- */
.settings-panel {
  background: var(--panel);
  border: 1px solid rgba(53,240,255,0.35);
  border-radius: 16px;
  padding: 26px 30px;
  display: flex; flex-direction: column; gap: 18px;
  min-width: min(320px, 84vw);
}
.settings-panel h2 { letter-spacing: 3px; font-size: 20px; color: var(--neon-cyan); }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; font-weight: 600; gap: 20px;
}
.toggle-row input { width: 26px; height: 26px; accent-color: var(--neon-cyan); cursor: pointer; }

/* ---------- countdown / toast ---------- */
#countdown {
  display: none;
  position: absolute; inset: 0;
  align-items: center; justify-content: center;
  font-size: 110px; font-weight: 900; color: #fff;
  text-shadow: 0 0 30px var(--neon-cyan);
  z-index: 25; pointer-events: none;
}
#countdown.pop { animation: cpop 0.6s ease-out; }
@keyframes cpop { 0% { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1); } }

#toast {
  position: absolute; left: 50%; bottom: 24%;
  transform: translateX(-50%);
  background: rgba(10, 4, 30, 0.85);
  border: 1px solid rgba(53,240,255,0.5);
  color: var(--neon-cyan);
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  padding: 10px 18px; border-radius: 999px;
  opacity: 0; transition: opacity 0.25s;
  z-index: 26; pointer-events: none;
  white-space: nowrap;
}
#toast.visible { opacity: 1; }

#boot-error {
  display: none;
  position: absolute; inset: 0; z-index: 50;
  align-items: center; justify-content: center;
  background: #05010f; padding: 30px; text-align: center;
}
#boot-error p { color: #ff8080; line-height: 1.6; }
