/* Turf Rush — neon paint arena */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #0a0c16;
  color: #eef1ff;
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#glCanvas, #fxCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none;
}
#glCanvas { z-index: 0; }
#fxCanvas { z-index: 1; }

/* ── HUD ─────────────────────────────────────────────────────────── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.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(10, 13, 28, .78); border: 1px solid rgba(120, 140, 255, .18);
  border-radius: 14px; padding: 8px 14px; min-width: 110px;
  backdrop-filter: blur(6px);
}
.hud-timer { text-align: right; margin-left: auto; }
.tr-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #8b98d8; }
.tr-value { font-size: 26px; font-weight: 900; color: #fff; line-height: 1.1; letter-spacing: -.02em; }
.tr-unit { font-size: 14px; color: #aab5ee; margin-left: 2px; }
.tr-sub { font-size: 11px; color: #93a2dd; margin-top: 2px; }
.boost-bar {
  height: 5px; margin-top: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, .1); overflow: hidden;
}
#boostFill {
  height: 100%; width: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #4de08a, #2ee6d6);
  transition: width .12s linear;
}
#boostFill.low { background: linear-gradient(90deg, #ff4f6d, #ff8a3d); }

.hud-board {
  position: absolute; top: calc(96px + env(safe-area-inset-top)); left: 10px;
  display: flex; flex-direction: column; gap: 4px; width: 168px;
}
.hb-row {
  display: grid; grid-template-columns: 12px 1fr auto; align-items: center;
  gap: 7px; font-size: 12px; padding: 4px 8px; border-radius: 9px;
  background: rgba(10, 13, 28, .66); color: #dfe4ff;
  position: relative; overflow: hidden;
}
.hb-row .hb-bar {
  position: absolute; left: 0; top: 0; bottom: 0; opacity: .22; z-index: 0;
}
.hb-row > * { position: relative; z-index: 1; }
.hb-row .hb-dot { width: 10px; height: 10px; border-radius: 3px; }
.hb-row .hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-row.me { outline: 1px solid rgba(255, 255, 255, .45); }
.hb-row.dead { opacity: .45; }
.hb-row .hb-pct { font-weight: 700; font-variant-numeric: tabular-nums; }

.hud-toast {
  position: absolute; top: calc(96px + env(safe-area-inset-top)); right: 10px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
  max-width: 55vw;
}
.toast {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(10, 13, 28, .8); color: #dfe4ff;
  border: 1px solid rgba(120, 140, 255, .18);
  animation: toast-in .18s ease-out, toast-out .4s ease-in 2.8s forwards;
}
.toast b { font-weight: 800; }
@keyframes toast-in { from { transform: translateX(16px); opacity: 0; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

.hud-center {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.hud-center .big {
  font-size: clamp(28px, 7vw, 46px); font-weight: 900; color: #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, .35), 0 3px 0 rgba(0, 0, 0, .5);
  letter-spacing: .04em;
}
.hud-center .small { font-size: 14px; color: #b9c3f5; margin-top: 4px; }

#minimap {
  position: absolute; right: calc(10px + env(safe-area-inset-right));
  bottom: calc(52px + env(safe-area-inset-bottom));
  width: 160px; height: 120px; border-radius: 8px;
  border: 1px solid rgba(120, 140, 255, .25);
  background: rgba(8, 10, 20, .8); image-rendering: pixelated;
}

#boostBtn {
  position: absolute; left: calc(18px + env(safe-area-inset-left));
  bottom: calc(60px + env(safe-area-inset-bottom));
  width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid #4de08a; background: rgba(77, 224, 138, .16);
  color: #c8ffe0; font-size: 14px; font-weight: 900; letter-spacing: .08em;
  pointer-events: auto; touch-action: manipulation; display: none;
}
#boostBtn:active, #boostBtn.held { background: rgba(77, 224, 138, .45); }
@media (pointer: coarse) { #boostBtn { display: block; } }

/* ── 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(900px 500px at 15% 10%, rgba(255, 79, 109, .16), transparent 60%),
    radial-gradient(800px 500px at 85% 90%, rgba(63, 169, 255, .16), transparent 60%),
    radial-gradient(700px 400px at 70% 15%, rgba(77, 224, 138, .12), transparent 60%),
    #0a0c16;
}
.card {
  width: min(440px, 94vw); padding: 22px 22px 14px;
  background: rgba(12, 15, 30, .92); border: 1px solid rgba(120, 140, 255, .2);
  border-radius: 18px; box-shadow: 0 16px 60px rgba(0, 0, 0, .55);
  text-align: center;
}
.neon-title {
  margin: 4px 0 6px; font-size: clamp(30px, 7.5vw, 44px); font-weight: 900;
  letter-spacing: .04em; color: #fff;
  text-shadow: 0 0 22px rgba(255, 255, 255, .25);
}
.title-accent {
  margin-left: .18em;
  background: linear-gradient(90deg, #ff4f6d, #ffc53d, #4de08a, #3fa9ff, #b76cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.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(90deg, #ff4f6d, #ff8a3d); color: #fff;
  cursor: pointer; box-shadow: 0 6px 22px rgba(255, 79, 109, .3);
}
button.primary:active { filter: brightness(.9); }

.squad-count { color: #ffc53d; 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: #ffc53d; }
.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: linear-gradient(90deg, #ff4f6d, #ffc53d); transition: width .2s; }
.peers { min-height: 16px; font-size: 12px; }

.countdown {
  font-size: 84px; font-weight: 900; color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, .5);
}

.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 in the HUD: pinned bottom-centre so it never covers play. */
#hudAudio {
  position: absolute; left: 0; right: 0;
  bottom: calc(4px + env(safe-area-inset-bottom));
  transform: none;
}
.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: #ff8a3d; }
/* 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 ─────────────────────────────────────────────────────── */
.card.results-wide { width: min(760px, 96vw); }
#resultTable {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #ffc53d rgba(255, 255, 255, .12);
}
#resultTable::-webkit-scrollbar { height: 6px; }
#resultTable::-webkit-scrollbar-track { background: rgba(255, 197, 61, .12); border-radius: 3px; }
#resultTable::-webkit-scrollbar-thumb { background: rgba(255, 197, 61, .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; }
  .hud-board { width: 132px; }
  #minimap { width: 120px; height: 90px; }
}
