/* Sketch Stadium: a night match under floodlights. */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  --night: #0d1530; --night2: #131d3f; --stands: #22336b; --panel: #16214a; --panel2: #1c2a5a;
  --chalk: #f4f1e8; --muted: #aab3cf; --line: #f4f1e826; --lime: #c6f432; --amber: #ffc53d; --coral: #ff5a5f;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", -apple-system, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--chalk); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  background: radial-gradient(1200px 520px at 12% -10%, #ffc53d14, transparent 60%), radial-gradient(1200px 520px at 88% -10%, #ffc53d14, transparent 60%), var(--night); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; letter-spacing: -.01em; }
main { flex: 1 0 auto; }

/* The bar */
.bar { height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line);
  background: #0d1530e6; position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 19px var(--display); white-space: nowrap; }
.brand img { display: block; width: 36px; height: 36px; }
.bar nav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 14px; min-width: 0; }
.bar nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.bar nav a:hover { color: var(--chalk); }
.built { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; letter-spacing: .04em; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--lime); color: #10200a; font: 700 15px var(--body); text-decoration: none; }
.button:hover { filter: brightness(1.06); }
.button.ghost { background: transparent; color: var(--chalk); border: 1px solid var(--line); }

/* A game: the board (scorebug, pitch, hint, your box) and the side */
.stadium { width: 100%; max-width: 1320px; margin: 0 auto; padding: 18px 24px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 24px; align-items: start; --chrome: 236px; }
.watching .stadium { --chrome: 372px; }
.board { width: min(100%, max(320px, calc(100vh - var(--chrome)))); justify-self: center; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.scorebug { height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.live-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px #ff5a5f33; }
.status { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { flex: none; font: 700 20px var(--mono); color: var(--amber); font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.clock.low { color: var(--coral); }
.pitch { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; padding: 10px; background: var(--stands);
  box-shadow: 0 0 0 3px var(--lime), 0 18px 60px #00000080, 0 0 80px #ffc53d1a; }
.canvas { display: block; width: 100%; height: 100%; border-radius: 10px; background: #fff; image-rendering: auto; }
.hintbar { min-height: 52px; flex-wrap: wrap; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.hint { font: 700 22px var(--mono); letter-spacing: .06em; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.hint-label { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.mine { padding: 14px 16px; border-radius: 12px; background: var(--panel2); border: 1px solid #c6f43255; min-width: 0; }
.mine .who { margin: 0 0 8px; color: var(--muted); }
.mine .who strong { color: var(--chalk); }
.guess label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); margin-bottom: 6px; }
.guess .row { display: flex; gap: 8px; }
.guess input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--night); color: var(--chalk); font: 600 16px var(--body); }
.guess input:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.guess button { flex: none; height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--lime); color: #10200a; font: 700 15px var(--body); cursor: pointer; }
.drawing-note { margin: 0; font-weight: 600; }
.note { margin: 8px 0 0; min-height: 1.55em; color: var(--amber); font-weight: 600; }
.note:empty { display: none; }

.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.panel h2 { font-size: 13px; font-family: var(--body); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.panel ol { list-style: none; margin: 0; padding: 0; }
.scores li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.scores li:first-child { border-top: 0; }
.scores .name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scores .house { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.scores .pen { flex: none; color: var(--coral); font-weight: 800; }
.scores .pts { flex: none; min-width: 2.2ch; text-align: right; font: 700 18px var(--mono); color: var(--amber); }
.scores li.drawing .name { color: var(--coral); }
.scores li.you .name::after { content: " (yours)"; color: var(--lime); font-weight: 600; }
.scores li.left { opacity: .45; }
.feed ol { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.feed li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 6px 10px; border-radius: 10px; background: #0d153080; min-width: 0; overflow-wrap: anywhere; }
.feed li.new { animation: pop .35s ease-out; }
.feed .by { font-weight: 700; color: var(--muted); }
.feed .by em { font-style: normal; font-size: 11px; color: var(--amber); }
.feed .text { font-weight: 600; }
.feed li.right { background: #c6f43226; }
.feed li.right .text { color: var(--lime); }
.feed li.empty { color: var(--muted); background: none; padding-left: 0; }
.result p { margin: 0 0 6px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.foot { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot .links { display: flex; gap: 16px; }

/* Plain pages */
.gone, .leaders, .matchlist { width: 100%; max-width: 820px; margin: 0 auto; padding: 56px 24px; }
.gone h1, .leaders h1, .matchlist h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 14px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--lime); }
.lede { color: var(--muted); font-size: 17px; max-width: 640px; }
.leaders table { width: 100%; border-collapse: collapse; margin: 24px 0 32px; }
.leaders th { text-align: left; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.leaders td { padding: 10px; border-bottom: 1px solid var(--line); }
.leaders .num { text-align: right; font-family: var(--mono); }
.leaders .rank { width: 3ch; font: 700 15px var(--mono); color: var(--muted); }
.leaders .name { font-weight: 700; overflow-wrap: anywhere; }
.leaders .pts { color: var(--amber); font-weight: 700; }
.leaders tbody tr:nth-child(-n+3) .rank { color: var(--amber); }
.empty { color: var(--muted); }

/* The landing page */
.landing { overflow-x: hidden; }
.lights { position: absolute; top: 0; left: 0; right: 0; height: 520px; overflow: hidden; pointer-events: none; }
.lights span { position: absolute; top: -140px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, #ffc53d2b, transparent 65%); pointer-events: none; }
.lights span:first-child { left: -160px; } .lights span:last-child { right: -160px; }
.landing main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.landing section { padding: 56px 0; border-top: 1px solid var(--line); }
.landing section.hero { border-top: 0; }
.landing h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 18px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6.4vw, 78px); line-height: .98; letter-spacing: -.03em; margin-bottom: 22px; }
.hero h1 span { color: var(--lime); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art { position: relative; padding: 14px; border-radius: 22px; background: var(--stands); box-shadow: 0 0 0 3px var(--lime), 0 30px 80px #00000080, 0 0 120px #ffc53d22; }
.demo { display: block; width: 100%; height: auto; border-radius: 12px; }
.demo path { stroke-dasharray: 200; stroke-dashoffset: 200; animation: sketch 7s ease-in-out infinite; }
.demo .d2 { animation-delay: .5s; } .demo .d3 { animation-delay: 1s; } .demo .d4 { animation-delay: 1.5s; } .demo .d5 { animation-delay: 2s; }
@keyframes sketch { 0% { stroke-dashoffset: 200; } 25%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.demo-guesses { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.demo-guesses li { padding: 7px 12px; border-radius: 10px; background: #0d1530b3; font-weight: 600; }
.demo-guesses b { color: var(--muted); margin-right: 6px; }
.demo-guesses li.right { color: var(--lime); background: #c6f43226; }
.matches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.matches a { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; height: 100%; }
.matches a:hover { border-color: var(--lime); }
.m-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.m-status { font-weight: 800; overflow-wrap: anywhere; min-width: 0; }
.m-badge { white-space: nowrap; padding: 2px 9px; border-radius: 999px; background: var(--amber); color: #10200a; font-size: 12px; font-weight: 800; }
.m-player { color: var(--chalk); font-weight: 600; }
.m-house { font-size: 12px; color: var(--muted); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head a { color: var(--lime); font-weight: 700; text-decoration: none; }
.matchlist h2 { font-size: 24px; margin: 36px 0 14px; }
.m-players { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.m-watch { color: var(--lime); font-weight: 700; font-size: 14px; margin-top: auto; }
.quiet { color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { padding: 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: #10200a; font: 800 15px var(--display); margin-bottom: 12px; }
.steps h3 { font-size: 20px; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }
.mini-board { list-style: none; margin: 0 0 12px; padding: 0; max-width: 520px; }
.mini-board li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-board .rank { width: 2ch; font-family: var(--mono); color: var(--muted); }
.mini-board .name { flex: 1; font-weight: 700; }
.mini-board .pts { font: 700 16px var(--mono); color: var(--amber); }

@media (max-width: 860px) {
  .stadium { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 20px; gap: 16px; }
  .board { width: 100%; }
  .feed ol { max-height: none; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .bar { padding: 0 14px; }
  .brand span { font-size: 17px; }
  .built { display: none; }
  .hint { font-size: 18px; }
  .clock { font-size: 18px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .landing main { padding: 0 16px; }
  .foot { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo path { animation: none; stroke-dashoffset: 0; }
  .feed li.new { animation: none; }
}
