/* geekz intro: the Game Board. One stylesheet for every page.
   The table is the game-box blue; boards and pages are printed card; the four home colours belong to the four
   challenge families; lime is the only "act" colour (one big action per screen). */

@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: block; }

:root {
  --table: #1c2a6b;          /* the game-box blue the board lies on */
  --table-deep: #141f52;
  --card: #fbfcff;           /* printed card */
  --card-sunk: #eef1f8;
  --ink: #141a33;
  --ink-soft: #3c4566;
  --line: #d7dcea;
  --act: #9fef00;            /* geekz lime: the one action */
  --act-hover: #b6ff2e;
  --act-ink: #0d1a00;
  --red: #d62839;   --red-tint: #fde7e9;
  --yellow: #f4b400; --yellow-tint: #fff4cf;
  --blue: #1f62e0;  --blue-tint: #e4ecff;
  --green: #138a4a; --green-tint: #def5e8;
  --wrong: #b3261e;
  --radius: 14px;
  --shadow: 0 10px 24px rgba(8, 14, 48, .28), 0 2px 4px rgba(8, 14, 48, .18);
  --shadow-soft: 0 4px 12px rgba(8, 14, 48, .14);
  --display: "Fredoka", "Atkinson Hyperlegible", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --table: #0c1230; --table-deep: #070b1f;
    --card: #182042; --card-sunk: #111836;
    --ink: #eef1fb; --ink-soft: #b4bcd8; --line: #2c3765;
    --red-tint: #3b1720; --yellow-tint: #3a3010; --blue-tint: #14234d; --green-tint: #0f3221;
    --wrong: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--body); font-size: 1.25rem; line-height: 1.6; color: var(--ink);
  background: var(--table);
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.5px);
  background-size: 22px 22px;
}
::selection { background: var(--act); color: var(--act-ink); }
:focus-visible { outline: 3px solid var(--act); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
code, .code { font-family: var(--mono); font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg.i { width: 1.2em; height: 1.2em; vertical-align: -.22em; flex: none; }

/* ── Top bar ─────────────────────────────── */
:root { --page: min(100% - 2rem, max(80vw, 60rem)); }
.bar { display: flex; align-items: center; gap: 1rem; width: var(--page); margin-inline: auto; padding: 1rem 0; color: #fff; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 700; font-size: 1.6rem; text-decoration: none; color: #fff; }
.logo svg { width: 2rem; height: 2rem; }
.bar .spacer { flex: 1; }
.bar a.navlink { color: #fff; text-decoration: none; font-weight: 700; padding: .45rem .8rem; border-radius: 999px; }
.bar a.navlink:hover { background: rgba(255,255,255,.12); }
.me { display: inline-flex; align-items: center; gap: .6rem; background: rgba(255,255,255,.1); border-radius: 999px; padding: .35rem .5rem .35rem .9rem; min-height: 2.6rem; }
.me .name { font-weight: 700; }
.me .pts { font-family: var(--display); font-weight: 700; background: #fff; color: var(--ink); border-radius: 999px; padding: .1rem .7rem; font-variant-numeric: tabular-nums; }
.iconbtn { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 999px; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.iconbtn:hover { background: rgba(255,255,255,.22); }
.textbtn { border: 0; background: none; color: #fff; font: inherit; font-weight: 700; cursor: pointer; padding: .45rem .6rem; border-radius: 999px; }
.textbtn:hover { background: rgba(255,255,255,.12); }

/* ── Buttons and fields ───────────────────── */
.btn-act {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.6rem; padding: .75rem 1.8rem;
  border: 0; border-radius: 999px; background: var(--act); color: var(--act-ink);
  font-family: var(--display); font-weight: 700; font-size: 1.45rem; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 0 #6fae00, 0 10px 18px rgba(8,14,48,.3); transition: transform .12s ease-out, box-shadow .12s ease-out, background .12s;
}
.btn-act:hover { background: var(--act-hover); }
.btn-act:active { transform: translateY(4px); box-shadow: 0 2px 0 #6fae00, 0 4px 8px rgba(8,14,48,.3); }
.btn-act[disabled] { opacity: .55; cursor: progress; }
.btn-plain {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 3.1rem; padding: .55rem 1.3rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-plain:hover { border-color: var(--ink-soft); }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 700; }
.input {
  width: 100%; min-height: 3.5rem; padding: .65rem 1.1rem; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-size: 1.3rem; caret-color: var(--blue);
}
.input::placeholder { color: var(--ink-soft); opacity: .75; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent); }

/* ── Notices ──────────────────────────────── */
.notice { display: flex; gap: .8rem; align-items: center; margin: 0 0 1.2rem; background: var(--yellow-tint); color: var(--ink); border-radius: var(--radius); padding: .9rem 1.2rem; box-shadow: var(--shadow-soft); }
.notice svg { color: #a37800; width: 1.6rem; height: 1.6rem; }
.wrap { width: var(--page); margin-inline: auto; padding: .4rem 0 3rem; }

/* ── The board (home) ─────────────────────── */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: clamp(1rem, 3vw, 2.5rem); max-width: 76rem; margin: 0 auto; align-items: start; }
.board {
  position: relative; aspect-ratio: 1; width: min(100%, 44rem); justify-self: center; background: var(--card); border-radius: 22px; padding: 3%;
  box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1.25fr 1fr; grid-template-rows: 1fr 1.25fr 1fr; gap: 3%;
}
.home-base { border-radius: 16px; position: relative; display: grid; place-items: center; }
.home-base::after { content: ""; width: 62%; aspect-ratio: 1; border-radius: 50%; background:
  radial-gradient(circle at 30% 30%, var(--card) 0 13%, transparent 14%), radial-gradient(circle at 70% 30%, var(--card) 0 13%, transparent 14%),
  radial-gradient(circle at 30% 70%, var(--card) 0 13%, transparent 14%), radial-gradient(circle at 70% 70%, var(--card) 0 13%, transparent 14%), rgba(0,0,0,.12); }
.home-base.red { background: var(--red); } .home-base.yellow { background: var(--yellow); } .home-base.blue { background: var(--blue); } .home-base.green { background: var(--green); }
.arm { display: flex; gap: 6%; padding: 4%; border-radius: 16px; }
.arm.top, .arm.bottom { flex-direction: row; align-items: stretch; }
.arm.left, .arm.right { flex-direction: column; }
.arm.red { background: var(--red-tint); } .arm.yellow { background: var(--yellow-tint); } .arm.blue { background: var(--blue-tint); } .arm.green { background: var(--green-tint); }
.goal { border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 8%;
  background: conic-gradient(var(--blue) 0 25%, var(--yellow) 0 50%, var(--green) 0 75%, var(--red) 0); }
.goal-inner { background: var(--card); border-radius: 50%; width: 100%; aspect-ratio: 1; display: grid; place-content: center; gap: .1rem; box-shadow: inset 0 2px 6px rgba(0,0,0,.12); }
.goal .count { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 4.4vw, 2.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.goal .of { font-size: .85rem; color: var(--ink-soft); font-weight: 700; }

.station {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .1rem;
  padding: .5rem .6rem; border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none;
  border: 3px solid var(--c); box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 70%, #000), var(--shadow-soft);
  transition: transform .14s ease-out, box-shadow .14s ease-out;
}
.station:hover { transform: translateY(-2px); box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 70%, #000), var(--shadow-soft); }
.station .num { position: absolute; top: -.75rem; left: -.6rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff; font-family: var(--display); font-weight: 700; font-size: .95rem; box-shadow: var(--shadow-soft); }
.station.yellow .num { color: var(--ink); }
.station .sname { font-family: var(--display); font-weight: 700; font-size: clamp(.86rem, 1.55vw, 1.08rem); line-height: 1.1; }
.station .tech { font-size: clamp(.72rem, 1.2vw, .85rem); color: var(--ink-soft); }
.station .spts { font-family: var(--display); font-weight: 700; font-size: .85rem; color: var(--c); }
.station.yellow .spts { color: #8a6500; }
.station.solved { background: color-mix(in srgb, var(--c) 10%, var(--card)); }
.station .tick { position: absolute; right: .3rem; top: .3rem; width: 1.6rem; height: 1.6rem; color: var(--c); }
.station .stime { font-size: .75rem; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.station.current { outline: 4px solid var(--act); outline-offset: 3px; }
.red { --c: var(--red); } .yellow { --c: var(--yellow); } .blue { --c: var(--blue); } .green { --c: var(--green); }

.pawn { position: absolute; width: 2.4rem; height: 2.9rem; right: -.5rem; bottom: -.9rem; z-index: 3; filter: drop-shadow(0 4px 4px rgba(8,14,48,.35)); pointer-events: none; }
.pawn.hop { animation: hop .55s cubic-bezier(.2,.9,.3,1.3); }
@keyframes hop { 0% { transform: translateY(0) } 40% { transform: translateY(-1.4rem) } 100% { transform: translateY(0) } }

.panel { background: var(--card); border-radius: 22px; padding: 1.6rem; box-shadow: var(--shadow); display: grid; gap: 1.1rem; position: sticky; top: 1rem; }
.panel h2 { font-size: 1.9rem; }
.panel .meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .2rem .75rem; font-weight: 700; font-size: .95rem; background: var(--card-sunk); }
.chip.c { background: var(--c); color: #fff; } .chip.c.yellow { color: var(--ink); }
.panel .teaser { font-size: 1.15rem; }
.rankline { display: flex; align-items: center; gap: .7rem; padding-top: 1rem; border-top: 2px dashed var(--line); }
.rankline .rank { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.rankline .next { color: var(--ink-soft); font-size: .95rem; }
.done-card { display: grid; gap: .8rem; }

@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; }
  .panel { position: static; }
}
/* Phones: the board becomes the track, stations in order. */
@media (max-width: 560px) {
  .board { aspect-ratio: auto; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.2rem 1rem; }
  .home-base, .goal { display: none; }
  .arm { display: contents; }
  .station { order: var(--o); min-height: 4.6rem; padding-left: 1.6rem; }
  .station .sname { font-size: 1.15rem; } .station .tech { font-size: .9rem; }
}

/* ── Home: the six challenges in order ─────── */
.intro { display: grid; gap: 1.6rem; }
.intro-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem); gap: 1.6rem; align-items: end; }
.intro-top .copy { display: grid; gap: 1rem; }
@media (max-width: 860px) { .intro-top { grid-template-columns: 1fr; } }
.intro h1 { color: #fff; font-size: clamp(2.6rem, 5.5vw, 4.2rem); }
.intro .lead { color: #e6eaff; font-size: clamp(1.3rem, 1.8vw, 1.5rem); line-height: 1.55; max-width: 52ch; }
.intro .lead code { background: rgba(255,255,255,.14); border-radius: 6px; padding: .05rem .35rem; color: #fff; }
.progress { display: grid; gap: .7rem; background: var(--card); border-radius: 22px; padding: 1.3rem 1.5rem; font-weight: 700; font-size: 1.3rem; box-shadow: var(--shadow); }
.progress .ptitle { font-family: var(--display); font-size: 1.6rem; }
.progress .dot { width: 1.9rem; height: 1.9rem; border-width: 3px; }
.progress .dots { gap: .5rem; }
.dots { display: inline-flex; gap: .35rem; }
.dot { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2.5px solid var(--c); }
.dot.on { background: var(--c); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { position: relative; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-band { background: var(--c); color: #fff; display: flex; align-items: center; gap: .8rem; padding: .65rem 1.2rem; font-weight: 700; font-size: 1.15rem; }
.card.yellow .card-band { color: var(--ink); }
.card-band .num { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--card); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 1.5rem; }
.card-band .cpts { margin-left: auto; }
.card-body { padding: 1.2rem 1.4rem 1.5rem; display: grid; gap: .65rem; flex: 1; align-content: start; }
.card-body h2 { font-size: clamp(1.75rem, 2.2vw, 2.1rem); }
.card-body .learn { color: var(--ink-soft); font-size: 1.1rem; }
.card-body .btn-act, .card-body .btn-plain { justify-self: start; margin-top: .3rem; }
.card .here { justify-self: start; background: var(--act); color: var(--act-ink); font-weight: 700; border-radius: 999px; padding: .15rem .8rem; font-size: 1.05rem; }
.pawn-on { position: absolute; right: 1.1rem; top: 3.7rem; width: 3rem; height: 3.6rem; filter: drop-shadow(0 4px 4px rgba(8,14,48,.3)); }
.pawn-on svg { width: 100%; height: 100%; }
.pawn-on.hop { animation: hop .6s cubic-bezier(.2,.9,.3,1.3); }
.card.next { outline: 4px solid var(--act); outline-offset: 3px; }
.card.solved .card-body { opacity: .8; }
.card.solved .btn-plain svg { color: var(--green); }
.done-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.4rem; display: grid; gap: .6rem; justify-items: start; }
.done-card h2 { font-size: 2.2rem; }

/* ── A challenge page ─────────────────────── */
.page { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.page-head { background: var(--c); color: #fff; padding: 1.6rem clamp(1.2rem, 3vw, 2.4rem) 1.5rem; display: grid; gap: .7rem; border-radius: 22px 22px 0 0; }
.page-head.yellow { color: var(--ink); }
.page-head .back { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; text-decoration: none; width: fit-content; opacity: .92; }
.page-head .back:hover { opacity: 1; text-decoration: underline; }
.page-head h1 { font-size: clamp(2.6rem, 5vw, 3.8rem); }
.page-head .facts { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-head .facts span { background: rgba(255,255,255,.2); border-radius: 999px; padding: .2rem .9rem; font-weight: 700; font-size: 1.15rem; }
.page-head.yellow .facts span { background: rgba(0,0,0,.08); }
.page-body { padding: 1.8rem clamp(1.2rem, 3vw, 2.4rem) 2.2rem; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 1fr); column-gap: clamp(1.5rem, 4vw, 3.5rem); row-gap: 1.5rem; align-items: start; }
.page-body > * { grid-column: 1; min-width: 0; }
.page-body > p { max-width: 62ch; font-size: 1.3rem; line-height: 1.65; }
.page-body > .rail { grid-column: 2; grid-row: 1 / span 30; position: sticky; top: 1rem; display: grid; gap: 1.2rem; }
.railcard { background: var(--card-sunk); border-radius: 18px; padding: 1.2rem 1.3rem; display: grid; gap: .6rem; }
.railcard h3 { font-size: 1.45rem; }
.railcard .dots { gap: .45rem; } .railcard .dot { width: 1.6rem; height: 1.6rem; border-width: 3px; }
.railcard .flagsample { font-family: var(--mono); font-size: 1.25rem; background: var(--table-deep); color: #e8edff; border-radius: 10px; padding: .5rem .8rem; width: fit-content; }
@media (max-width: 980px) { .page-body { grid-template-columns: minmax(0, 1fr); } .page-body > .rail { grid-column: 1; grid-row: auto; position: static; } }
.mission { background: var(--card-sunk); border-radius: var(--radius); padding: 1.3rem 1.5rem; display: grid; gap: .7rem; }
.mission h2 { font-size: 1.6rem; }
.mission ol, .mission ul { margin: 0; padding-left: 1.6rem; display: grid; gap: .6rem; font-size: 1.25rem; }
.mission li::marker { font-family: var(--display); font-weight: 700; color: var(--blue); }
kbd { font-family: var(--mono); font-size: .85em; background: var(--card); border: 2px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: .02rem .4rem; }
.codebox { font-family: var(--mono); background: var(--table-deep); color: #e8edff; border-radius: 12px; padding: 1.1rem 1.3rem; overflow-x: auto; white-space: pre; font-size: 1.15rem; line-height: 1.6; }
.codebox.big { font-size: clamp(1.2rem, 2.6vw, 1.7rem); text-align: center; white-space: normal; word-break: break-all; letter-spacing: .02em; }
details.hint { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.3rem; }
details.hint summary { font-family: var(--display); font-weight: 700; font-size: 1.35rem; cursor: pointer; }
details.hint[open] summary { margin-bottom: .6rem; }
details.hint > div { display: grid; gap: .5rem; }
.scene { border-radius: var(--radius); background: var(--card-sunk); padding: 2.2rem 1.5rem; text-align: center; display: grid; gap: .4rem; justify-items: center; }
.scene .art { width: min(16rem, 70%); }
.scene .title { font-family: var(--display); font-weight: 700; font-size: 1.7rem; }
.scene .small { color: var(--ink-soft); font-size: 1.1rem; }
.blend { color: var(--card-sunk); font-size: .6rem; margin: 0; } /* Spy Photo: text the same colour as its background */

.flagform { background: color-mix(in srgb, var(--act) 14%, var(--card)); border: 3px solid var(--act); border-radius: 18px; padding: 1.2rem 1.3rem; display: grid; gap: .8rem; }
.flagform h2 { font-size: 1.75rem; display: flex; align-items: center; gap: .5rem; }
.flagrow { display: flex; gap: .7rem; flex-wrap: wrap; }
.flagrow .input { flex: 1 1 14rem; font-family: var(--mono); }
.result { min-height: 1.6em; font-weight: 700; font-size: 1.25rem; }
.result.ok { color: var(--green); } .result.no { color: var(--wrong); }

/* Caesar workspace */
.alpha { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: .3rem; font-family: var(--mono); font-weight: 700; font-size: 1.2rem; text-align: center; }
.alpha div { border-radius: 6px; padding: .15rem 0; }
.alpha .top { background: var(--blue-tint); color: var(--blue); }
.alpha .bot { background: var(--green-tint); color: var(--green); margin-bottom: .45rem; }
.decode { display: flex; flex-wrap: wrap; gap: .35rem; }
.decode .ch { display: grid; gap: .2rem; justify-items: center; font-family: var(--mono); font-weight: 700; }
.decode .ch span { color: var(--blue); }
.decode input { width: 2.5rem; height: 2.9rem; text-align: center; font: inherit; font-size: 1.3rem; border: 2px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.decode input.good { border-color: var(--green); background: var(--green-tint); }
.decode .fixed { height: 2.6rem; display: grid; place-items: center; color: var(--ink-soft); }
.decoded { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--green); min-height: 1.6em; word-break: break-all; }

/* ── Login ────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; align-items: stretch; margin-top: 1rem; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.howto { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 2rem clamp(1.2rem, 3vw, 2.2rem); display: grid; gap: 1.1rem; align-content: start; }
.howto h2 { font-size: 2.2rem; }
.howto ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 1rem; }
.howto li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; font-size: 1.25rem; }
.howto li b { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--c); color: #fff; font-family: var(--display); font-size: 1.5rem; }
.howto li.yellow b { color: var(--ink); }
.howto .art { width: min(100%, 22rem); justify-self: center; }
.gate { margin: 0; align-content: start; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 2rem clamp(1.2rem, 4vw, 2.2rem); display: grid; gap: 1.2rem; }
.gate h1 { font-size: 2.6rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--card-sunk); border-radius: 999px; padding: .3rem; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 700; padding: .6rem; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-soft); }
.gate form { display: grid; gap: 1rem; }
.gate .note { font-size: 1.05rem; color: var(--ink-soft); }
.gate .err { color: var(--wrong); font-weight: 700; min-height: 1.4em; }

/* ── Leaderboard (projector) ──────────────── */
.lb { display: grid; gap: 1.3rem; }
.lb-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; color: #fff; }
.lb-head h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.lb-head .sub { opacity: .9; font-size: 1.35rem; }
.lb-head select { min-height: 2.8rem; border-radius: 999px; border: 0; padding: .4rem 1rem; font: inherit; font-weight: 700; }
.lanes { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(.8rem, 2vw, 1.4rem); display: grid; gap: .55rem; }
.lane { display: grid; grid-template-columns: 3.4rem minmax(10rem, 18rem) 1fr 6.5rem; align-items: center; gap: 1.2rem; padding: .6rem .9rem; border-radius: 14px; }
.lane:nth-child(odd) { background: var(--card-sunk); }
.lane .pos { font-family: var(--display); font-weight: 700; font-size: 2.3rem; text-align: center; font-variant-numeric: tabular-nums; }
.lane .who { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 2.1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane .rk { display: block; font-family: var(--body); font-size: 1.05rem; color: var(--ink-soft); font-weight: 700; }
.lane .track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; align-items: center; position: relative; }
.lane .cell { height: 2.6rem; border-radius: 10px; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; position: relative; }
.lane .cell.on { background: var(--c); border-color: var(--c); color: #fff; }
.lane .cell.on.yellow { color: var(--ink); }
.lane .cell svg { width: 1.2rem; height: 1.2rem; }
.lane .goalcell { height: 2.6rem; width: 2.6rem; justify-self: center; border-radius: 50%; background: conic-gradient(var(--blue) 0 25%, var(--yellow) 0 50%, var(--green) 0 75%, var(--red) 0); opacity: .35; }
.lane .goalcell.in { opacity: 1; }
.lane .lp { position: absolute; width: 1.9rem; height: 2.3rem; top: -.35rem; z-index: 2; transition: left .6s cubic-bezier(.2,.9,.3,1.2); filter: drop-shadow(0 3px 3px rgba(8,14,48,.35)); }
.lane .lp.hop { animation: hop .55s cubic-bezier(.2,.9,.3,1.3); }
.lane .score { font-family: var(--display); font-weight: 700; font-size: 2.3rem; text-align: right; font-variant-numeric: tabular-nums; }
.lane.top1 .pos { color: #b38600; }
.lb-empty { text-align: center; padding: 2rem; font-size: 1.2rem; color: var(--ink-soft); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: #fff; font-size: 1.15rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 1rem; height: 1rem; border-radius: 4px; background: var(--c); display: inline-block; }
@media (max-width: 760px) {
  .lane { grid-template-columns: 2.2rem 1fr 4rem; }
  .lane .track { grid-column: 1 / -1; }
}

/* ── Admin ────────────────────────────────── */
.admin { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.admin-menu { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 1rem; display: grid; gap: .3rem; position: sticky; top: 1rem; }
.admin-menu a, .admin-menu button { display: block; text-align: left; padding: .65rem .9rem; border-radius: 12px; color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; border: 0; background: none; cursor: pointer; }
.admin-menu a:hover, .admin-menu button:hover { background: var(--card-sunk); }
.admin-main { display: grid; gap: 1.4rem; }
@media (max-width: 760px) { .admin { grid-template-columns: 1fr; } .admin-menu { position: static; } }
.box { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 1.6rem; display: grid; gap: 1rem; }
.box h2 { font-size: 1.9rem; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: end; }
.row .field { flex: 1 1 16rem; }
.state { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; }
.state i { width: .9rem; height: .9rem; border-radius: 50%; background: var(--ink-soft); display: inline-block; }
.state.live i { background: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 2px solid var(--line); }
th { font-family: var(--display); font-weight: 700; }

/* ── Celebrations ─────────────────────────── */
.toast { position: fixed; left: 50%; top: 1.2rem; transform: translateX(-50%); z-index: 50; background: var(--card); color: var(--ink); border-radius: 18px;
  box-shadow: var(--shadow); padding: 1.1rem 1.6rem; display: flex; gap: .8rem; align-items: center; font-family: var(--display); font-weight: 700; font-size: 1.55rem;
  animation: drop .45s cubic-bezier(.2,.9,.3,1.2); max-width: calc(100vw - 2rem); }
.toast svg { width: 2rem; height: 2rem; flex: none; }
.toast.fb { background: var(--red); color: #fff; }
@keyframes drop { from { transform: translate(-50%, -140%); } to { transform: translate(-50%, 0); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -2rem; width: .7rem; height: 1.1rem; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

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