/* Ridge Runner — mobile-first neon ridge */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #0b0e1a;
  color: #e8ecff;
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#gameCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none;
}

/* ── HUD ─────────────────────────────────────────────────────────── */
#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top {
  position: absolute; top: calc(10px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: flex; justify-content: space-between; gap: 8px;
}
.hud-panel {
  background: rgba(13, 18, 38, .82); border: 1px solid #2a3560;
  border-radius: 12px; padding: 6px 14px; min-width: 96px;
}
.tr-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7f8ec9; }
.tr-value { font-size: 22px; font-weight: 800; color: #5effd6; line-height: 1.1; }
.tr-sub { font-size: 11px; color: #93a2dd; }

/* charge bar (hold to jump) */
#chargeWrap {
  position: absolute; left: 50%; bottom: calc(52px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(320px, 60vw); height: 14px;
  border-radius: 8px; border: 1px solid #2a3560;
  background: rgba(13, 18, 38, .82); overflow: hidden;
  opacity: .35; transition: opacity .15s;
}
#chargeWrap.charging { opacity: 1; }
#chargeBar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #5ec8ff, #5effd6);
}
/* audio strip lives at the bottom, below the charge bar — in flow it would
   land on top of the HUD panels (both are children of the fixed #hud). */
#hudAudio {
  position: absolute; left: 0; right: 0;
  bottom: calc(4px + env(safe-area-inset-bottom));
}

/* ghost strip — every runner's progress along the course */
#ghostStrip {
  position: absolute; left: 12px; right: 12px;
  top: calc(86px + env(safe-area-inset-top));
  height: 18px;
}
#ghostTrack {
  position: absolute; inset: 6px 0;
  height: 4px; border-radius: 2px; background: #232d58;
}
.ghost-dot {
  position: absolute; top: 1px; width: 12px; height: 12px;
  margin-left: -6px; border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, .5);
  transform: translateX(-50%);
}

/* ── overlays / lobby card ───────────────────────────────────────── */
#lobbyOverlay {
  position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; z-index: 10; overflow-y: auto;
  background: radial-gradient(1200px 700px at 50% 30%, #12303a 0%, #0b0e1a 70%);
}
.card {
  width: min(430px, 94vw); padding: 22px 22px 14px;
  background: rgba(15, 20, 42, .92); border: 1px solid #2a3560;
  border-radius: 16px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
  text-align: center;
}
.neon-title {
  margin: 4px 0 6px; font-size: clamp(28px, 7vw, 40px); font-weight: 900;
  letter-spacing: .06em; color: #5effd6;
  text-shadow: 0 0 18px rgba(94, 255, 214, .45);
}
.tagline { margin: 0 0 14px; color: #aab6e8; font-size: 14px; }
.instructions {
  margin: 14px 0 4px; font-size: 12.5px; color: #8fa0da;
  display: grid; gap: 4px;
}
.muted { color: #7f8ec9; }

input#nameInput {
  width: 100%; padding: 11px 14px; border-radius: 10px; font-size: 15px;
  border: 1px solid #33407c; background: #101632; color: #e8ecff;
  outline: none; margin-bottom: 10px;
}

button.primary {
  width: 100%; padding: 12px; border: 0; border-radius: 10px;
  font-size: 16px; font-weight: 800; letter-spacing: .04em;
  background: linear-gradient(180deg, #5effd6, #2eb899); color: #04231c;
  cursor: pointer;
}
button.primary:active { filter: brightness(.9); }

.squad-count { color: #5effd6; font-weight: 700; margin-bottom: 8px; }
.player-list { max-height: 130px; overflow-y: auto; margin-bottom: 10px; }
.player-row {
  padding: 4px 8px; border-radius: 8px; background: #131a38;
  margin-bottom: 4px; font-size: 14px;
}
.briefing {
  text-align: left; margin: 10px 0; font-size: 13px; color: #aab6e8;
}
.briefing ul { margin: 6px 0 0 18px; padding: 0; }

.leaderboard {
  text-align: left; margin-top: 12px; padding: 10px 12px;
  background: #101632; border-radius: 10px; border: 1px solid #232d58;
}
.leaderboard h3 { margin: 0 0 6px; font-size: 13px; color: #5effd6; }
.lb-row {
  display: flex; justify-content: space-between; font-size: 12.5px;
  padding: 2px 0; color: #c6cffa;
}

.load-bar {
  height: 10px; border-radius: 6px; background: #101632; overflow: hidden;
  border: 1px solid #232d58; margin: 12px 0 6px;
}
#loadBar { height: 100%; width: 100%; background: #2eb899; transition: width .2s; }
.peers { min-height: 16px; font-size: 12px; }

.countdown {
  font-size: 84px; font-weight: 900; color: #5effd6;
  text-shadow: 0 0 30px rgba(94, 255, 214, .6);
}

.back-link { display: inline-block; margin-top: 12px; color: #7f8ec9; font-size: 13px; }
.spectator-flag {
  position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); z-index: 9; padding: 4px 12px;
  background: rgba(13, 18, 38, .85); border: 1px solid #2a3560;
  border-radius: 999px; font-size: 12px; letter-spacing: .1em; color: #9fb0f0;
}

/* audio strip repositioned by relocateAudioControls() into #hudAudio */
.audio-controls {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  justify-content: center; padding: 4px 0;
}
.audio-controls button {
  background: #16203f; color: #c6cffa; border: 1px solid #2a3560;
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.audio-controls input[type="range"] { width: 86px; accent-color: #2eb899; }
/* web/style.css pins .volume-slider position:fixed top:12px — undo it here
   or every slider lands in the corner of the screen (CLAUDE.md item 5). */
.volume-slider { position: static !important; top: auto !important; }

/* ── results: the stats table is wider than the lobby card — widen the
   card while results show; the table scrolls inside its own box ── */
.card.results-wide { width: min(720px, 96vw); }
#resultTable {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #5effd6 rgba(255, 255, 255, .12);
}
#resultTable::-webkit-scrollbar { height: 6px; }
#resultTable::-webkit-scrollbar-track { background: rgba(94, 255, 214, .12); border-radius: 3px; }
#resultTable::-webkit-scrollbar-thumb { background: rgba(94, 255, 214, .6); border-radius: 3px; }
#resultTable .fs-table { width: max-content; min-width: 100%; font-size: .86rem; }
#resultTable .fs-table th, #resultTable .fs-table td { padding: 6px 9px; }
@media (max-width: 560px) {
  #resultTable .fs-table { font-size: .78rem; }
}
