/* Skyline Sprint — night-deck UI: navy glass, cyan line, signal yellow */

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

#game {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; z-index: 0;
}
#tags {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* ── corner tools ────────────────────────────────────────────────── */
#corner {
  position: fixed; z-index: 30; display: flex; gap: 6px;
  top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right));
}
#corner button {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: rgba(13, 20, 46, .78); color: #dfeaff; font-size: 16px; font-weight: 800;
  border: 1px solid rgba(120, 190, 255, .35);
}
#corner button:hover { background: rgba(30, 44, 92, .9); }
body.running #howBtn { display: none; }

/* ── HUD ─────────────────────────────────────────────────────────── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.hud-score {
  position: absolute; top: calc(10px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 0 14px rgba(0, 0, 0, .35);
}
.sc-main { font-size: 40px; font-weight: 900; line-height: 1; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; }
.sc-mult {
  display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 8px;
  font-size: 18px; vertical-align: middle; background: #ffd23a; color: #2a1c00;
  text-shadow: none; animation: pulse .5s ease-in-out infinite alternate;
}
@keyframes pulse { to { transform: scale(1.12); } }
.sc-sub { margin-top: 3px; font-size: 14px; font-weight: 700; color: #d6e4ff;
  font-variant-numeric: tabular-nums; }
.sc-spark { color: #ffd84a; }
.sc-best { font-size: 11px; color: #a9bde0; margin-top: 2px; }
.power { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; width: 132px; }
.pw {
  display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 6px;
  padding: 3px 7px 3px 4px; border-radius: 9px; background: rgba(10, 16, 40, .72);
  border: 1px solid var(--c); font-size: 11px; font-weight: 800; text-shadow: none;
}
.pw i { font-style: normal; width: 20px; height: 20px; border-radius: 6px; background: var(--c);
  color: #0b1024; display: grid; place-items: center; font-size: 12px; }
.pw .bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.pw .bar b { display: block; height: 100%; background: var(--c); }
.pw .lbl { display: flex; justify-content: space-between; margin-bottom: 2px; color: #eaf2ff; }

.hud-board {
  position: absolute; top: calc(54px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 3px; width: 178px;
}
.hb-row {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center;
  gap: 7px; font-size: 12px; padding: 3px 8px; border-radius: 8px;
  background: rgba(10, 16, 40, .7); color: #eaf2ff;
}
.hb-row .hb-dot { width: 9px; height: 9px; border-radius: 50%; }
.hb-clock { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-align: right;
  color: #ffe9a8; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); padding-right: 4px; }
.hb-row .hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-row .hb-name .mg-name-title { display: block; font-size: 9.5px; opacity: .75; }
.hb-row.me { outline: 2px solid #2fd3ff; }
.hb-row.dead { opacity: .5; }
.hb-row.watch { outline: 2px dashed #ffd23a; }
.hb-row .hb-pts { font-weight: 800; font-variant-numeric: tabular-nums; }

.hud-district {
  position: absolute; left: 50%; top: 17%; transform: translateX(-50%);
  text-align: center; white-space: nowrap; opacity: 0; transition: opacity .4s;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 0 24px rgba(0, 0, 0, .5);
}
.hud-district.on { opacity: 1; }
.hud-district .d-name { font-size: clamp(24px, 6vw, 44px); font-weight: 900; letter-spacing: .12em;
  text-transform: uppercase; }
.hud-district .d-sub { font-size: 13px; color: #ffe9a8; letter-spacing: .2em; }

.hud-coach {
  position: absolute; left: 50%; top: 31%; transform: translateX(-50%);
  display: none; padding: 8px 18px; border-radius: 14px; text-align: center;
  background: rgba(10, 16, 40, .78); border: 2px solid #ffd23a; white-space: nowrap;
}
.hud-coach.on { display: block; animation: coach .35s ease-in-out infinite alternate; }
@keyframes coach { to { transform: translateX(-50%) scale(1.06); } }
.hud-coach .c-arrow { font-size: 34px; line-height: 1; color: #ffd23a; font-weight: 900; }
.hud-coach .c-word { font-size: 19px; font-weight: 900; letter-spacing: .1em; }
.hud-coach .c-how { font-size: 11px; color: #c8d8f5; margin-top: 1px; }

.hud-count {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  font-size: clamp(72px, 22vw, 150px); font-weight: 900; color: #fff;
  text-shadow: 0 6px 0 #10367a, 0 0 40px rgba(47, 211, 255, .7);
}
.hud-count.go { color: #ffd23a; text-shadow: 0 6px 0 #7a4a00, 0 0 40px rgba(255, 210, 58, .8); }

.hud-toast {
  position: absolute; left: calc(12px + env(safe-area-inset-left));
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column-reverse; gap: 4px; align-items: flex-start;
  max-width: 62vw;
}
.toast {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(10, 16, 40, .84); color: #eaf2ff; border: 1px solid rgba(120, 190, 255, .4);
  animation: toast-in .18s ease-out, toast-out .4s ease-in 3.2s forwards;
}
.toast.big { font-size: 15px; font-weight: 800; border-color: #ffd23a; color: #ffe9a8; }
@keyframes toast-in { from { transform: translateX(-16px); opacity: 0; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.hud-drone {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: min(420px, 86vw); padding: 7px 12px 9px; border-radius: 12px; text-align: center;
  background: rgba(70, 8, 14, .82); border: 2px solid #ff3b3b;
}
.dr-label { font-size: 12px; font-weight: 800; letter-spacing: .05em; color: #ffd9d9; }
.dr-bar { height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
#droneFill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3b3b, #ffb13b); }
/* the drone's searchlight on the edges of the screen while it is on you */
#hud::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 110px 26px rgba(255, 40, 40, .5); transition: opacity .25s;
}
body.drone-on #hud::before { opacity: 1; animation: siren .5s ease-in-out infinite alternate; }
@keyframes siren { to { opacity: .45; } }

.hud-watch {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(60px + env(safe-area-inset-bottom));
  padding: 8px 12px; border-radius: 14px; text-align: center; pointer-events: auto;
  background: rgba(10, 16, 40, .86); border: 1px solid rgba(255, 210, 58, .6);
  width: max-content; max-width: 94vw;
}
.watch-label { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.watch-row { display: flex; gap: 6px; justify-content: center; }
.ghost-btn {
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 800; font-size: 13px;
  background: rgba(47, 211, 255, .14); color: #dff6ff; border: 1px solid rgba(47, 211, 255, .6);
}

/* audio in the HUD: one small button in the corner that opens the full strip
   (mute SFX, SFX volume, mute music, music volume, skip). The strip itself
   would sit on the lanes, and on a phone under the swiping thumb. */
#hudAudioWrap {
  position: absolute; pointer-events: auto;
  right: calc(8px + env(safe-area-inset-right));
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; flex-direction: row-reverse; align-items: center; gap: 6px;
}
#audioToggle {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: rgba(13, 20, 46, .78); color: #dfeaff; font-size: 17px; font-weight: 800;
  border: 1px solid rgba(120, 190, 255, .35);
}
#hudAudio { display: none; max-width: calc(100vw - 60px); }
#hudAudioWrap.open #hudAudio { display: block; }
#hudAudio .mps-audio { flex-wrap: nowrap; padding: 4px 8px; background: rgba(10, 16, 40, .86); }
#hudAudio .mps-audio-slider { width: 76px; flex: 0 0 76px; }
#hudAudio .mps-audio-btn { min-height: 30px; padding: 5px 8px; }
/* 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; }

/* ── how to play ─────────────────────────────────────────────────── */
#howOverlay {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 20, .78); overflow-y: auto; padding: 14px;
}
.how-card {
  width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 18px 20px 16px;
  border-radius: 16px; background: #131b3c; border: 2px solid #2fd3ff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.how-card h2 { margin: 0 0 12px; font-size: 21px; color: #fff; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.how-key {
  padding: 9px 6px; border-radius: 12px; text-align: center; background: #1b2550;
  font-size: 12.5px; font-weight: 700;
}
.how-key span { display: block; margin-top: 6px; }
.how-key i { display: block; font-style: normal; color: #9fb4de; font-size: 11px; margin-top: 2px; }
.kc {
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 2px;
  border-radius: 7px; background: #eaf2ff; color: #131b3c; font-size: 17px;
  box-shadow: 0 3px 0 #7f90bd;
}
.how-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.how-list li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; color: #d8e4ff; }
.how-list li b { color: #fff; }
.sw { width: 30px; height: 18px; border-radius: 4px; display: block; }
.sw-bar { background: repeating-linear-gradient(90deg, #e5352f 0 6px, #f4f4f4 6px 12px); height: 9px; }
.sw-pipe { background: #ff8a2a; border-radius: 9px; height: 11px; }
.sw-pod { background: #3a8fd9; border-bottom: 5px solid #ffc83a; }
.sw-slide { background: #ff4a3d; box-shadow: inset 0 -5px 0 #fff4c8; }
.sw-gap { background: #060915; border: 2px solid #ffd23a; }
.how-note { margin: 8px 0; font-size: 12.5px; line-height: 1.45; color: #c2d2f2; }
.how-note b { color: #fff; }
.how-pick { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; margin: 10px 0; color: #d8e4ff; }
.pk {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; margin-right: 4px;
  border-radius: 6px; color: #0b1024; font-size: 11px;
}
.pk-spark { background: #ffd84a; } .pk-magnet { background: #ff4d5e; } .pk-mult { background: #ffd23a; }
.pk-shield { background: #4fb6ff; } .pk-boots { background: #6be06b; } .pk-glider { background: #c58bff; }

/* ── overlays / lobby card ───────────────────────────────────────── */
#lobbyOverlay {
  position: fixed; inset: 0; display: flex; align-items: flex-start;
  justify-content: center; z-index: 10; overflow-y: auto; padding: 16px 0;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(47, 211, 255, .28), transparent 62%),
    linear-gradient(180deg, #121a44 0%, #1b1a4f 45%, #3a1d57 78%, #ff9d5c 140%);
}
.card {
  width: min(470px, calc(100vw - 24px)); padding: 18px 18px 14px; margin: auto;
  background: rgba(14, 20, 48, .94); color: #eaf2ff;
  border: 2px solid rgba(47, 211, 255, .55); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  text-align: center;
}
.sky-title {
  margin: 4px 0 6px; font-size: clamp(30px, 8.4vw, 46px); font-weight: 900;
  letter-spacing: .06em; color: #fff; font-style: italic;
  text-shadow: 3px 3px 0 #1f6fd6, 6px 6px 0 rgba(47, 211, 255, .35);
}
.sky-title.small { font-size: clamp(22px, 6vw, 30px); }
.title-accent { margin-left: .22em; color: #ffd23a; }
.tagline { margin: 4px 0 14px; color: #b9c9ea; font-size: 14px; line-height: 1.4; }
.instructions { margin: 12px 0 4px; font-size: 12.5px; color: #9fb4de; display: grid; gap: 4px; }
.instructions b { color: #fff; }
.muted { color: #93a7d0; font-size: 13px; }

input#nameInput {
  width: 100%; padding: 11px 14px; border-radius: 10px; font-size: 15px;
  border: 2px solid rgba(47, 211, 255, .5); background: #0b1024; color: #fff;
  outline: none; margin-bottom: 10px; -webkit-user-select: text; user-select: text;
}
button.primary {
  width: 100%; padding: 12px; border: 0; border-radius: 11px;
  font-size: 16px; font-weight: 900; letter-spacing: .04em;
  background: linear-gradient(180deg, #37dcff, #1c8fe6); color: #06142e;
  cursor: pointer; box-shadow: 0 4px 0 #0f4f96;
}
button.primary.alt { background: linear-gradient(180deg, #ffe066, #ffb22a); color: #2a1c00; box-shadow: 0 4px 0 #9a6200; }
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #0f4f96; }
button.primary:disabled { opacity: .55; cursor: default; }
button.ghost {
  margin-top: 8px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid rgba(120, 190, 255, .5); color: #cfe1ff; font-weight: 700;
}
.best-line { font-size: 12.5px; color: #ffe9a8; min-height: 16px; margin-bottom: 8px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin-bottom: 10px; }
.mode-box {
  padding: 10px; border-radius: 13px; background: #18214a; border: 1px solid rgba(120, 190, 255, .22);
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.mode-box h3 { margin: 0; font-size: 15px; color: #fff; letter-spacing: .05em; text-transform: uppercase; }
.mode-box p { margin: 0; font-size: 12px; color: #a9bde0; line-height: 1.35; }
.mode-box .primary { margin-top: auto; padding: 10px; font-size: 14.5px; }
.heat-count { font-size: 11px; color: #9fb4de; font-weight: 600; letter-spacing: 0; text-transform: none; }
.player-list { max-height: 112px; overflow-y: auto; display: grid; gap: 3px; }
.player-row {
  padding: 4px 7px; border-radius: 7px; background: #0f1736; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; color: #9fb4de; }
.settings-row select {
  width: 100%; margin-top: 2px; padding: 5px; border-radius: 7px; background: #0b1024; color: #fff;
  border: 1px solid rgba(120, 190, 255, .35); font-size: 12.5px;
}
.settings-row select:disabled { opacity: .7; }
@media (max-width: 430px) { .modes { grid-template-columns: 1fr; } }

.leaderboard { margin-top: 12px; text-align: left; }
.lb-panel, .lb-card {
  --lb-panel: #101838;
  --lb-text: #eaf2ff;
  --lb-dim: rgba(234, 242, 255, .62);
  --lb-accent: #ffd23a;
  --lb-edge: rgba(47, 211, 255, .45);
}
.peers { min-height: 16px; font-size: 12.5px; margin-top: 8px; }
.back-link { display: inline-block; margin-top: 12px; color: #8fb6ff; font-size: 13px; }
#lobbyChat { --chat-bg: #101838; margin: 4px 0; }

/* ── results ─────────────────────────────────────────────────────── */
.card.results-wide { width: min(760px, calc(100vw - 24px)); }
.result-note { font-size: 14px; color: #ffe9a8; margin: 2px 0 10px; min-height: 18px; }
#resultTable { overflow-x: auto; }
#resultTable .fs-table { width: max-content; min-width: 100%; font-size: .86rem; }
#resultTable .fs-table th, #resultTable .fs-table td { padding: 6px 9px; }
/* the shared table sizes the name by percentage of an auto-width cell, which
   collapses to one letter beside a BOT tag on a phone: a name is the one
   column that must not be the one to give way */
#resultTable .fs-table .fs-name-col { min-width: 8.5em; }
#resultTable, #resultAwards {
  --fs-panel: #101838;
  --fs-text: #eaf2ff;
  --fs-dim: rgba(234, 242, 255, .62);
  --fs-accent: #ffd23a;
  --fs-edge: rgba(47, 211, 255, .4);
}
#resultTable { background: #101838; border-radius: 10px; padding: 4px; }
#resultsPane .primary { margin-top: 12px; }

@media (max-width: 560px) {
  .sc-main { font-size: 32px; }
  .hud-board { width: 132px; top: calc(52px + env(safe-area-inset-top)); }
  .hud-board .hb-row:nth-child(n+6) { display: none; }   /* the clock + the top four */
  .hb-row { font-size: 11px; padding: 2px 6px; }
  .power { width: 116px; }
  #resultTable .fs-table { font-size: .78rem; }
  #hudAudio .mps-audio-slider { width: 46px; flex-basis: 46px; }
  #hudAudio .mps-audio { gap: 5px; }
  .hud-coach { top: 27%; }
  .how-grid { gap: 5px; }
}
@media (max-height: 520px) {
  .hud-count { top: 42%; }
  .hud-drone { bottom: calc(54px + env(safe-area-inset-bottom)); }
}
