/* The game is played by ear; this page is for sighted helpers, spectators and streams.
   Everything visual is aria-hidden or mirrored in speech. */

:root {
  --bg: #f3f1ec;
  --bg-2: #e9e6df;
  --panel: #ffffff;
  --fg: #1b1a17;
  --muted: #6a675f;
  --border: #dcd8cf;
  --accent: #d9480f;
  --accent-soft: #fbe3d7;
  --good: #2f9e44;
  --warn: #e8590c;
  --bad: #c92a2a;
  --wall: #3b3a36;
  --floor-rock: #e4e0d6;
  --floor-hard: #d4cfc2;
  --floor-sand: #ece2c9;
  --floor-grass: #cfe0c0; --floor-dirt: #dccbb0; --floor-wood: #d9c2a0; --floor-boards: #cdb38e; --floor-marble: #eceef0;
  --me: #d9480f;
  --enemy: #1c7ed6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e;
    --bg-2: #171715;
    --panel: #1b1b19;
    --fg: #f1efe9;
    --muted: #a19d93;
    --border: #2e2d2a;
    --accent: #ff7a3d;
    --accent-soft: #3a2116;
    --good: #51cf66;
    --warn: #ff922b;
    --bad: #ff6b6b;
    --wall: #4a4843;
    --floor-rock: #23221f;
    --floor-hard: #2c2a26;
    --floor-sand: #2a2620;
    --floor-grass: #1f2a1c; --floor-dirt: #2d261d; --floor-wood: #30261a; --floor-boards: #352a1c; --floor-marble: #2f3134;
    --me: #ff7a3d;
    --enemy: #4dabf7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0e; --bg-2: #171715; --panel: #1b1b19; --fg: #f1efe9; --muted: #a19d93; --border: #2e2d2a;
  --accent: #ff7a3d; --accent-soft: #3a2116; --good: #51cf66; --warn: #ff922b; --bad: #ff6b6b;
  --wall: #4a4843; --floor-rock: #23221f; --floor-hard: #2c2a26; --floor-sand: #2a2620;
  --floor-grass: #1f2a1c; --floor-dirt: #2d261d; --floor-wood: #30261a; --floor-boards: #352a1c; --floor-marble: #2f3134;
  --me: #ff7a3d; --enemy: #4dabf7;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }

.shell { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font: 700 16px/1 "Space Grotesk", Inter, sans-serif; letter-spacing: .01em;
}
.mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent) 0 3px, transparent 4px),
              radial-gradient(circle at center, transparent 0 6px, var(--accent) 7px 8px, transparent 9px),
              radial-gradient(circle at center, transparent 0 10px, color-mix(in srgb, var(--accent) 50%, transparent) 11px 12px, transparent 13px);
}
.pill {
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill[data-state="online"]::before { background: var(--good); }
.pill[data-state="connecting"]::before { background: var(--warn); }
.pill[data-state="offline"]::before { background: var(--bad); }

main, main:focus-visible { outline: none; }
/* Anything with the hidden attribute stays hidden, whatever display a class gives it. */
[hidden] { display: none !important; }

/* ---- start ---- */
.hero {
  max-width: 640px; margin: 7vh auto 0; padding: 40px 36px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  font: 700 clamp(30px, 6vw, 44px)/1.08 "Space Grotesk", Inter, sans-serif;
  margin: 0 0 16px; letter-spacing: -.01em;
}
.lead { font-size: 17px; color: var(--muted); margin: 0 0 22px; max-width: 52ch; }
.tips { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 8px; }
.tips li { padding-left: 22px; position: relative; color: var(--muted); }
.tips li::before {
  content: ""; position: absolute; left: 4px; top: .6em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.tips strong { color: var(--fg); font-weight: 600; }

.primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 26px; font-weight: 600; font-size: 16px; cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .6; cursor: progress; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.status-line { margin: 14px 0 0; color: var(--muted); min-height: 1.5em; font-variant-numeric: tabular-nums; }

/* ---- game layout ---- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.stage, .side {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stage { position: relative; min-height: 420px; padding: 20px; }
.side { padding: 16px 18px; max-height: 640px; overflow: auto; }
.side h2 { margin: 0 0 10px; font: 600 13px/1 Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---- menus ---- */
.menu-panel { max-width: 520px; margin: 24px auto; }
.menu-panel[hidden] { display: none; }
.menu-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 4px; }
.menu-list li {
  padding: 12px 16px; border-radius: 10px; border: 1px solid transparent; color: var(--muted);
  transition: background .12s ease, color .12s ease;
}
.menu-list li.current {
  background: var(--accent-soft); color: var(--fg); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 600;
}
.menu-list li.current::before { content: "\25B8"; color: var(--accent); margin-right: 10px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }

/* The game menu floats over the arena. */
.stage.in-game .menu-panel:not([hidden]) {
  position: absolute; inset: 0; margin: 0; max-width: none; padding: 48px 20%;
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(3px);
  border-radius: var(--radius); z-index: 5;
}
@media (max-width: 600px) { .stage.in-game .menu-panel:not([hidden]) { padding: 32px 16px; } }

/* ---- notice and forms ---- */
.notice { text-align: center; padding: 64px 16px; }
.notice p { font-size: 17px; margin: 0 0 20px; }
.card-form { max-width: 440px; margin: 40px auto; display: grid; gap: 10px; }
.card-form label { font-weight: 600; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
input {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
}
.chat-bar { margin-top: 12px; display: grid; gap: 6px; }
.chat-bar label { font-size: 13px; color: var(--muted); }
.chat-bar input { width: 100%; }

/* ---- HUD ---- */
.hud { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 14px; }
.stat { display: flex; align-items: center; gap: 8px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.value { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { width: 120px; height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 100%; background: var(--good); border-radius: inherit; transition: width .2s ease, background .2s ease; }
.bar-fill.low { background: var(--bad); }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 7px; height: 14px; border-radius: 2px; background: var(--accent); display: block; }
.pips i.spent { background: var(--bg-2); }
.pips.reloading i { animation: pulse .6s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

/* ---- arena ---- */
.arena-wrap { display: flex; justify-content: center; }
.arena {
  --cols: 16;
  position: relative; display: grid; gap: 1px; padding: 2px;
  width: min(100%, 680px); background: var(--bg-2); border-radius: 10px;
}
.tile { aspect-ratio: 1; border-radius: 2px; }
.tile.wall { background: var(--wall); }
.tile.rock { background: var(--floor-rock); }
.tile.hard { background: var(--floor-hard); }
.tile.sand { background: var(--floor-sand); }
.tile.grass { background: var(--floor-grass); }
.tile.dirt { background: var(--floor-dirt); }
.tile.wood { background: var(--floor-wood); }
.tile.boards { background: var(--floor-boards); }
.tile.marble { background: var(--floor-marble); }
.tile.none { background: transparent; }

.marker { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.marker.me { width: calc(74% / var(--cols)); aspect-ratio: 1; z-index: 3; }
.marker.me .body {
  position: absolute; inset: 0; border-radius: 50%; background: var(--me);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--me) 25%, transparent);
}
.marker.me .nose {
  position: absolute; left: 50%; top: -55%; width: 0; height: 0; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--me);
}
.marker.other {
  width: calc(74% / var(--cols)); aspect-ratio: 1; border-radius: 50%; background: var(--enemy); z-index: 2;
  display: grid; place-items: center; color: #fff; font: 700 10px/1 "JetBrains Mono", monospace;
  transition: opacity .4s ease;
}
.marker.other.dead { background: var(--muted); }
.marker.other.ally { background: var(--good); }
.scoreboard li.team-red { box-shadow: inset 3px 0 0 #e03131; }
.scoreboard li.team-blue { box-shadow: inset 3px 0 0 #1c7ed6; }
.marker.bullet { width: calc(22% / var(--cols)); aspect-ratio: 1; border-radius: 50%; background: var(--fg); z-index: 4; }
.marker.item {
  width: calc(60% / var(--cols)); aspect-ratio: 1; border-radius: 3px; z-index: 1;
  display: grid; place-items: center; font: 700 9px/1 "JetBrains Mono", monospace;
  background: var(--good); color: var(--bg);
}
.marker.item.weapon { background: var(--accent); }
.marker.grenade { width: calc(40% / var(--cols)); aspect-ratio: 1; border-radius: 50%; background: var(--enemy); outline: 2px solid var(--fg); z-index: 4; }
.value.muted { color: var(--muted); }
.marker.ambience { width: calc(38% / var(--cols)); aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--muted); opacity: .6; z-index: 1; }

.scoreboard { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.scoreboard li {
  padding: 6px 12px; border-radius: 999px; background: var(--bg-2); font-size: 13px; font-variant-numeric: tabular-nums;
}
.scoreboard li.me { background: var(--accent-soft); font-weight: 600; }

/* ---- messages ---- */
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.log li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.log li:first-child { color: var(--fg); font-weight: 500; }
.log li:not(:first-child) { color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- site links ---- */
a { color: var(--accent); }
a.brand { color: var(--fg); text-decoration: none; }
.site-nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.site-nav a {
  display: inline-block; padding: 6px 12px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.site-nav a:hover { color: var(--fg); background: var(--bg-2); }
.site-nav a[aria-current="page"] { color: var(--fg); background: var(--accent-soft); }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.secondary {
  background: var(--bg-2); color: var(--fg); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 18px; font-weight: 600; cursor: pointer;
}
.secondary:hover { border-color: var(--muted); }

/* ---- the tournament on the start screen ---- */
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-links a { font-weight: 600; }
.tourney {
  max-width: 640px; margin: 20px auto 0; padding: 28px 36px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.tourney h2 { font: 700 22px/1.2 "Space Grotesk", Inter, sans-serif; margin: 0 0 10px; }
.tourney p { margin: 0 0 12px; color: var(--muted); }
.tourney p:last-child { margin-bottom: 0; }
@media (max-width: 600px) { .hero, .tourney { padding: 28px 20px; } }

/* ---- leaderboard page ---- */
.board-page { max-width: 820px; margin: 0 auto; }
.board-head { padding: 24px 0 8px; }
.board-head h1 { font: 700 clamp(28px, 5vw, 40px)/1.1 "Space Grotesk", Inter, sans-serif; margin: 0 0 12px; }
.board-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.board-actions .status-line { margin: 0; }
.board-page h2 { font: 700 20px/1.2 "Space Grotesk", Inter, sans-serif; margin: 0 0 12px; }
.board-page section { margin-top: 28px; }

.champions { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.champ {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow);
}
.champ.overall { grid-column: 1 / -1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.champ-mode { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.champ-name { font: 700 18px/1.3 "Space Grotesk", Inter, sans-serif; overflow-wrap: anywhere; }
.champ.overall .champ-name { font-size: 26px; }
.champ-name.none { font: 500 15px/1.4 Inter, sans-serif; color: var(--muted); }
.champ-pts { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.board-jump ul { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.board-jump a {
  display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--fg); text-decoration: none; font-size: 13px; font-weight: 500; background: var(--panel);
}
.board-jump a:hover { border-color: var(--accent); }

.standings { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.standings li {
  display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; grid-template-areas: "place who pts" "place detail detail";
  gap: 0 12px; padding: 10px 16px; border-top: 1px solid var(--border); align-items: baseline;
}
.standings li:first-child { border-top: 0; }
.standings li.top { background: var(--accent-soft); }
.standings .place { grid-area: place; font: 700 15px/1.4 "JetBrains Mono", monospace; color: var(--muted); }
.standings li.top .place { color: var(--accent); }
.standings .who { grid-area: who; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.standings .name { font-weight: 600; overflow-wrap: anywhere; }
.standings .rank { font-size: 12px; font-weight: 600; color: var(--muted); padding: 1px 8px; border-radius: 999px; background: var(--bg-2); }
.standings .pts { grid-area: pts; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.standings .detail { grid-area: detail; font-size: 13px; color: var(--muted); }
.trial { color: var(--muted); font-style: italic; margin: -4px 0 12px; max-width: 68ch; }
.empty { color: var(--muted); margin: 0; padding: 14px 16px; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); }
.plain-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.rules p { margin: 0 0 10px; max-width: 68ch; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* The arena dashboard (dashboard.html). */
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.dash-stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.dash-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.dash-stat-value { font: 700 28px/1.1 "Space Grotesk", Inter, sans-serif; font-variant-numeric: tabular-nums; }
.dash-stat-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card { padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card h3 { font: 700 16px/1.3 "Space Grotesk", Inter, sans-serif; margin: 0 0 6px; }
.card p { margin: 4px 0 0; overflow-wrap: anywhere; }
.board-page h3 { font: 700 16px/1.3 "Space Grotesk", Inter, sans-serif; margin: 20px 0 10px; }
.days { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.day { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.day-name { font-weight: 600; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--bg-2); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent); border-radius: 3px; }

/* The dashboard's listening section and replay search (dashboard_listen.js). */
.player { margin: 24px 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.player-controls, .replay-search { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 12px 0; }
.player.live .replay-only { display: none !important; }
.player .hint, #replaysAbout { color: var(--muted); font-size: 14px; }
.pbp { max-height: 22em; overflow-y: auto; }
.pbp button, #moments button { background: none; border: 0; padding: 2px 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pbp button:hover, #moments button:hover, .pbp button:focus-visible, #moments button:focus-visible { text-decoration: underline; }
.button-link { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none; }
.replay-item { margin: 0 0 12px; }
.replay-item .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.player .arena-panel { margin-top: 16px; }
