/*
 * BOT design system – CodeWeek 2026 public pages.
 *
 * Story: BOT, the school's central system (named after the school's monogram,
 * Bláthy Ottó Titusz), crashed; every solved main task powers a module back
 * on. The pages look like the restore console of BOT: a dark monitoring
 * screen, the six letter colours of the pixel BLÁTHY logo as neon accents,
 * glass panels with the two-dot title bar of the CodeWeek logo.
 * Status is never shown by colour alone (LED + text label).
 *
 * Plain CSS, no build step. Sections:
 *   fonts · tokens · base · layout (header, footer) · panels · buttons ·
 *   chips (badges, team, LED, pips) · scroll regions · tables · stats ·
 *   hero · phase · modules · podium · ranking · feed · first solvers · tabs ·
 *   task cards · race chart · team page · achievements · winner · terminal ·
 *   message · verification · docs · TV mode · motion · print
 *
 * Every animation is decorative and switched off by prefers-reduced-motion.
 */

/* -------------------------------------------------------------- fonts */

/*
 * Self-hosted (no third-party requests): IBM Plex Sans, IBM Plex Mono and
 * Pixelify Sans, SIL Open Font License 1.1 (fonts/OFL-*.txt), woff2 files
 * from the @fontsource packages (v5.3.0). latin + latin-ext subsets, so
 * Hungarian ő/ű come from the same family; the browser only downloads the
 * subsets and weights a page actually uses.
 */

@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-ext-700-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Pixelify Sans"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("fonts/pixelify-sans-latin-ext-700-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Pixelify Sans"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("fonts/pixelify-sans-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------- tokens */

:root {
    color-scheme: dark;

    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --font-pixel: "Pixelify Sans", "IBM Plex Mono", ui-monospace, monospace;

    /* The six letters of the BLÁTHY logo (fills, stripes). */
    --b-ink: #f3f0e8;
    --b-orange: #f29f05;
    --b-yellow: #ffe500;
    --b-green: #5fe000;
    --b-red: #e01b1b;
    --b-blue: #0a84ff;

    /* The same hues tuned for text and thin lines on the dark background (AA). */
    --orange: #ffad33;
    --yellow: #ffe94d;
    --green: #86f04a;
    --red: #ff6b61;
    --blue: #5cb0ff;
    --magenta: #ff7ad9;
    --violet: #b49bff;

    --bg: #05070b;
    --surface: #0d1118;
    --surface-2: #131823;
    --surface-3: #1a2030;
    --glass: rgba(13, 17, 24, .78);
    --line: rgba(160, 174, 196, .11);
    --line-2: rgba(160, 174, 196, .2);
    --line-3: rgba(160, 174, 196, .34);
    --text: #e9edf5;
    --text-2: #b9c2d2;
    --text-3: #8f99ab;
    --accent: #72b9ff;
    --ok: var(--green);
    --warn: var(--orange);
    --bad: var(--red);
    --led-off: #283041;
    --code-bg: #070a0f;
    --code-ink: #e3e8f2;

    --medal-1: #ffe500;
    --medal-2: #d4dceb;
    --medal-3: #f29f05;

    --stripe: linear-gradient(90deg, var(--b-ink) 0 16.66%, var(--b-orange) 16.66% 33.33%, var(--b-yellow) 33.33% 50%, var(--b-green) 50% 66.66%, var(--b-red) 66.66% 83.33%, var(--b-blue) 83.33%);
    --neon: linear-gradient(90deg, var(--orange), var(--yellow) 32%, var(--green) 62%, var(--blue));

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --gap: clamp(14px, 2vw, 26px);
    --wrap: 1360px;
    --header-h: 0px;
    --shadow: 0 1px 0 rgba(255, 255, 255, .045) inset, 0 22px 44px -28px rgba(0, 0, 0, .95);
    --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 760px) {
    :root { --header-h: 66px; }
}

/* --------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    background: var(--bg);
}

body {
    position: relative;
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font: 400 1rem/1.55 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

/* Ambient light + a dotted grid that fades out downwards. */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60rem 32rem at -10% -20%, rgba(10, 132, 255, .12), transparent 70%),
        radial-gradient(50rem 28rem at 110% -10%, rgba(242, 159, 5, .09), transparent 70%),
        radial-gradient(rgba(160, 174, 196, .085) 1px, transparent 1.6px) 0 0 / 24px 24px;
    -webkit-mask-image: linear-gradient(#000, rgba(0, 0, 0, .25) 70vh);
    mask-image: linear-gradient(#000, rgba(0, 0, 0, .25) 70vh);
}

::selection { background: rgba(255, 229, 0, .28); color: #fff; }

img, svg { max-width: 100%; height: auto; }
.invert { filter: invert(1) hue-rotate(180deg); }

a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; color: #a3d1ff; }

:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--font-mono); }

.num, .table td.num, time { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-3); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap;
}

.skip {
    position: absolute; left: 12px; top: -100px; z-index: 100;
    background: var(--yellow); color: #111;
    padding: 10px 14px; border-radius: var(--radius-xs); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.icon { width: 1em; height: 1em; flex: none; fill: currentColor; shape-rendering: crispEdges; vertical-align: -.12em; }

/* ------------------------------------------------------------- layout */

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 clamp(14px, 3vw, 36px);
}

.stripe { display: flex; height: 3px; }
.stripe i { flex: 1; background: currentColor; box-shadow: 0 0 14px 1px currentColor; }
.stripe i:nth-child(1) { color: var(--b-ink); box-shadow: 0 0 10px rgba(243, 240, 232, .5); }
.stripe i:nth-child(2) { color: var(--b-orange); }
.stripe i:nth-child(3) { color: var(--b-yellow); }
.stripe i:nth-child(4) { color: var(--b-green); }
.stripe i:nth-child(5) { color: var(--b-red); }
.stripe i:nth-child(6) { color: var(--b-blue); }

.site-header {
    position: relative; z-index: 40;
    background: rgba(5, 7, 11, .8);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) {
    .site-header { position: sticky; top: 0; }
}
.site-header .wrap {
    display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap;
    min-height: 62px; padding-top: 8px; padding-bottom: 8px;
}
.brand {
    display: inline-flex; align-items: center; gap: 12px;
    color: var(--text); text-decoration: none; margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand img { width: 42px; height: auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font: 700 1.32rem/1 var(--font-pixel); letter-spacing: .12em; }
.brand__o { color: var(--orange); }
.brand__t { color: var(--green); }
.brand__sub { font: 500 .68rem/1.3 var(--font-mono); color: var(--text-3); letter-spacing: .14em; text-transform: uppercase; }
.brand__sub i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--b-green); box-shadow: 0 0 8px var(--b-green); vertical-align: 1px; font-style: normal; }

.nav { display: flex; gap: 2px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav a {
    position: relative; display: inline-flex; align-items: center; min-height: 40px;
    padding: 6px 13px; border-radius: 999px;
    color: var(--text-2); text-decoration: none; font-weight: 500; font-size: .94rem;
    transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .07); }
.nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px;
    background: var(--neon);
}
@media (max-width: 759px) {
    .site-header nav { width: 100%; }
    .nav { flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; padding: 0 0 4px; scrollbar-width: none; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 6px 11px; font-size: .9rem; white-space: nowrap; }
}

main { display: block; padding: var(--gap) 0 calc(var(--gap) * 2.5); }
main:focus { outline: none; }

.site-footer {
    position: relative;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(13, 17, 24, .7), rgba(5, 7, 11, .95));
    padding: 30px 0 40px;
    font-size: .92rem;
    color: var(--text-2);
}
.site-footer::before {
    content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
    background: var(--stripe); opacity: .55;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; }
.site-footer nav a { color: var(--text-2); }
.site-footer nav a:hover { color: var(--text); }
.logo-plate {
    display: inline-block; background: #fff; border-radius: var(--radius-xs);
    padding: 6px 10px; line-height: 0; box-shadow: 0 0 0 1px var(--line-2), 0 8px 24px -12px rgba(255, 255, 255, .25);
}
.logo-plate img { width: 140px; }

.grid { display: grid; gap: var(--gap); }
.grid--main { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
    .grid--main { grid-template-columns: minmax(0, 1.85fr) minmax(340px, 1fr); align-items: start; }
}
.stack { display: grid; gap: var(--gap); align-content: start; min-width: 0; }

.section { margin-top: calc(var(--gap) * 2); }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap;
    margin: 0 0 16px;
}
.section-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0; letter-spacing: -.02em; }
.section-head h2 .accent { background: var(--neon); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font: 600 .72rem/1.2 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--neon); border-radius: 2px; }
.kicker {
    display: inline-block; font: 600 .72rem/1.3 var(--font-mono);
    letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
}
.group-title { margin: 26px 0 12px; }

/* ------------------------------------------------------------- panels */

.panel {
    position: relative; min-width: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 140px), var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel__bar {
    display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
    min-height: 46px; padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    font: 600 .74rem/1.25 var(--font-mono);
    letter-spacing: .13em; text-transform: uppercase; color: var(--text-2);
}
/* the two dots of the CodeWeek logo window */
.panel__bar::before {
    content: ""; flex: none;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--dot, var(--text-3)); box-shadow: 12px 0 0 var(--line-3);
    margin-right: 14px;
}
.panel--live { --dot: var(--b-red); }
.panel--live .panel__bar::before { animation: live-dot 2s ease-in-out infinite; }
.panel--ok { --dot: var(--b-green); }
.panel--mark { --dot: var(--b-yellow); }
.panel--blue { --dot: var(--b-blue); }
.panel__title { margin: 0; font: inherit; letter-spacing: inherit; color: var(--text); }
.panel__meta { margin-left: auto; color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: .02em; }
.panel__body { padding: 18px; }
.panel__body--flush { padding: 0; }
.panel__foot { padding: 11px 16px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--text-3); }

@keyframes live-dot {
    0%, 100% { box-shadow: 12px 0 0 var(--line-3), 0 0 0 0 rgba(224, 27, 27, .7); }
    50% { box-shadow: 12px 0 0 var(--line-3), 0 0 0 5px rgba(224, 27, 27, 0); }
}

/* ------------------------------------------------------------ buttons */

.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 44px; padding: 10px 20px;
    border: 1px solid var(--line-3); border-radius: 12px;
    background: rgba(255, 255, 255, .04); color: var(--text);
    font: 600 .95rem/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
    transition: transform .2s var(--ease), border-color .2s, background-color .2s, box-shadow .2s;
}
.btn:hover { color: var(--text); text-decoration: none; transform: translateY(-1px); border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .07); }
.btn:active { transform: translateY(1px); }
.btn .icon { font-size: 1.1em; }
.btn--primary {
    color: #0b0d12; border: 0;
    background: linear-gradient(100deg, var(--b-yellow), #ffd23d 40%, var(--b-orange));
    box-shadow: 0 0 0 1px rgba(255, 229, 0, .35), 0 10px 30px -10px rgba(255, 200, 0, .55);
}
.btn--primary:hover { color: #0b0d12; background: linear-gradient(100deg, #fff26a, #ffd23d 40%, #ffb12b); box-shadow: 0 0 0 1px rgba(255, 229, 0, .5), 0 14px 34px -10px rgba(255, 200, 0, .7); }
.btn--ink { background: var(--text); color: #0b0d12; border-color: var(--text); }
.btn--ink:hover { background: #fff; color: #0b0d12; }
.btn--mark { background: var(--b-yellow); color: #0b0d12; border-color: var(--b-yellow); }
.btn--mark:hover { background: #fff26a; color: #0b0d12; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-2); }
.btn--small { min-height: 36px; padding: 6px 13px; font-size: .86rem; border-radius: 9px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------- badges and chips */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px;
    font: 600 .66rem/1.6 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
    white-space: nowrap; vertical-align: middle;
}
.badge .icon { font-size: 1.15em; }
.badge--solid { background: var(--text); color: #0b0d12; border-color: var(--text); }
.badge--mark { background: rgba(255, 229, 0, .14); color: var(--yellow); border-color: rgba(255, 229, 0, .45); }
.badge--ok { color: var(--ok); background: rgba(134, 240, 74, .08); border-color: rgba(134, 240, 74, .4); }
.badge--warn { color: var(--warn); }
.badge--bad { color: var(--bad); }
.badge--muted { color: var(--text-3); border-color: var(--line-3); }
.badge--winner { color: #0b0d12; background: linear-gradient(100deg, var(--b-yellow), var(--b-orange)); border-color: transparent; box-shadow: 0 0 18px -2px rgba(255, 229, 0, .6); }
.badge--provisional { color: var(--yellow); border-style: dashed; }

.stars { font-size: 1em; letter-spacing: .08em; white-space: nowrap; color: var(--yellow); text-shadow: 0 0 10px rgba(255, 229, 0, .35); }
.stars .off { color: var(--led-off); text-shadow: none; }

.team { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; vertical-align: middle; }
.team__swatch {
    flex: none; width: 12px; height: 12px;
    background: var(--team, #8a8a8a); border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 0 10px -1px var(--team, transparent);
}
.team__name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.team__members { display: block; font-size: .8rem; color: var(--text-3); font-weight: 400; }

/* Square status LED, always paired with a text label. */
.led {
    display: inline-block; flex: none; width: 9px; height: 9px;
    background: var(--led-off); border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}
.led--ok { background: var(--b-green); box-shadow: 0 0 0 1px rgba(134, 240, 74, .5), 0 0 10px rgba(95, 224, 0, .8); }
.led--warn { background: var(--b-orange); box-shadow: 0 0 0 1px rgba(255, 173, 51, .5), 0 0 10px rgba(242, 159, 5, .7); }
.led--bad { background: var(--b-red); box-shadow: 0 0 0 1px rgba(255, 107, 97, .5), 0 0 10px rgba(224, 27, 27, .8); }
.led--live { background: #ff3b30; border-radius: 50%; box-shadow: 0 0 0 0 rgba(255, 59, 48, .7), 0 0 10px rgba(255, 59, 48, .9); animation: led-pulse 1.8s ease-out infinite; }

@keyframes led-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .65), 0 0 10px rgba(255, 59, 48, .9); }
    70% { box-shadow: 0 0 0 9px rgba(255, 59, 48, 0), 0 0 10px rgba(255, 59, 48, .9); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0), 0 0 10px rgba(255, 59, 48, .9); }
}
@keyframes blink { 50% { opacity: 0; } }

.status { display: inline-flex; align-items: center; gap: 7px; font: 600 .72rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.status--ok { color: var(--ok); }
.status--warn { color: var(--warn); }
.status--off { color: var(--text-3); }

/* 10 module pips (one per main task) */
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pip { width: 7px; height: 15px; background: var(--led-off); border-radius: 2px; }
.pip.is-on { background: var(--b-green); box-shadow: 0 0 6px rgba(95, 224, 0, .55); }

.meter { height: 6px; background: rgba(255, 255, 255, .06); border-radius: 99px; overflow: hidden; }
.meter > span {
    display: block; height: 100%; min-width: 3px; border-radius: inherit;
    background: linear-gradient(90deg, var(--acc, var(--b-green)), color-mix(in srgb, var(--acc, var(--b-green)) 60%, #fff));
    box-shadow: 0 0 10px color-mix(in srgb, var(--acc, var(--b-green)) 70%, transparent);
    transform-origin: left; animation: meter-in 1.1s var(--ease) both;
}
@keyframes meter-in { from { transform: scaleX(0); } }

/* ----------------------------------------------------- scroll regions */
/*
 * <x-scroll>: a keyboard-focusable region (role=region + aria-label) with a
 * max height on wider screens, sticky table headers and a fade at the edge
 * that still has content (classes set by site.js). Below 720px the region
 * does not scroll inside the page: long lists are cut to a few rows with a
 * "Mutasd mind" button instead (site.js), no scroll-inside-scroll traps.
 */

.scroller { position: relative; min-width: 0; border-radius: inherit; }
.scroller__viewport {
    --ft: 0px; --fb: 0px; --hd: 0px;
    max-height: var(--max, min(70vh, 640px));
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-3) transparent;
    -webkit-mask-image: linear-gradient(to bottom, #000 var(--hd), transparent var(--hd), #000 calc(var(--hd) + var(--ft)), #000 calc(100% - var(--fb)), transparent);
    mask-image: linear-gradient(to bottom, #000 var(--hd), transparent var(--hd), #000 calc(var(--hd) + var(--ft)), #000 calc(100% - var(--fb)), transparent);
}
.scroller.has-more-top > .scroller__viewport { --ft: 38px; }
.scroller.has-more-bottom > .scroller__viewport { --fb: 54px; }
.scroller__viewport::-webkit-scrollbar { width: 10px; height: 10px; }
.scroller__viewport::-webkit-scrollbar-thumb { background: var(--line-3); border: 3px solid transparent; border-radius: 10px; background-clip: padding-box; }
.scroller__viewport::-webkit-scrollbar-track { background: transparent; }
.scroller__viewport:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; border-radius: 6px; }
@supports selector(:has(*)) {
    .scroller__viewport:focus-visible { outline: none; }
    .scroller:has(> .scroller__viewport:focus-visible) { box-shadow: inset 0 0 0 2px var(--yellow); border-radius: 8px; }
}
/* "more below" hint */
.scroller__hint {
    position: absolute; left: 50%; bottom: 8px; z-index: 3; transform: translate(-50%, 6px);
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
    font: 600 .66rem/1.5 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2);
    background: rgba(13, 17, 24, .9); border: 1px solid var(--line-2); border-radius: 99px;
    opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.scroller.has-more-bottom:not(.is-scrolled) > .scroller__hint { opacity: 1; transform: translate(-50%, 0); }
.scroller__more {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    min-height: 46px; padding: 10px 16px; margin: 0;
    border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
    background: rgba(255, 255, 255, .025); color: var(--accent);
    font: 600 .9rem/1.2 var(--font-sans); cursor: pointer;
}
.scroller__more:hover { background: rgba(255, 255, 255, .05); color: #a3d1ff; }
.scroller__more:focus-visible { outline-offset: -3px; }

@media (max-width: 719px) {
    .scroller[data-collapse] > .scroller__viewport { max-height: none; -webkit-mask-image: none; mask-image: none; overflow-y: hidden; }
    .scroller[data-collapse] > .scroller__hint { display: none; }
}

/* wide content (guide tables, team page tables) */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }

/* ------------------------------------------------------------- tables */

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .94rem; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th {
    position: sticky; top: 0; z-index: 2;
    background: #121722;
    font: 600 .68rem/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-3); white-space: nowrap; border-bottom: 1px solid var(--line-2);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .25s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .028); }
.table .num { text-align: right; white-space: nowrap; }
.table .rank { width: 3.6em; text-align: right; font: 700 .98rem/1 var(--font-mono); color: var(--text-2); }
.table strong { color: var(--text); }
.table .team__name { overflow-wrap: break-word; }
@media (max-width: 640px) {
    .table th, .table td { padding: 9px 9px; }
    .hide-sm { display: none; }
}

.rank__n {
    display: inline-grid; place-items: center; min-width: 2em; height: 2em; padding: 0 .3em;
    border-radius: 8px; font: 700 .95rem/1 var(--font-mono);
}
.is-top1 .rank__n, .is-top2 .rank__n, .is-top3 .rank__n { color: #0b0d12; }
.is-top1 .rank__n { background: var(--medal-1); box-shadow: 0 0 14px -2px var(--medal-1); }
.is-top2 .rank__n { background: var(--medal-2); box-shadow: 0 0 12px -3px var(--medal-2); }
.is-top3 .rank__n { background: var(--medal-3); box-shadow: 0 0 12px -3px var(--medal-3); }

/* ------------------------------------------------------------ stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.stat {
    position: relative; overflow: hidden;
    border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px 11px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
}
.stat::after { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--acc, rgba(255, 255, 255, .35)), transparent); }
.stat:nth-child(4n+1) { --acc: var(--b-yellow); }
.stat:nth-child(4n+2) { --acc: var(--b-green); }
.stat:nth-child(4n+3) { --acc: var(--b-blue); }
.stat:nth-child(4n+4) { --acc: var(--b-orange); }
.stat__value { display: block; font: 700 clamp(1.6rem, 3vw, 2.2rem)/1.05 var(--font-mono); letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__value small { font-size: .5em; letter-spacing: 0; color: var(--text-2); font-weight: 600; }
.stat__label { display: block; font: 600 .66rem/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }

/* ------------------------------------------------------------- empty */

.empty {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 0; padding: 20px 18px; color: var(--text-2); font-size: .94rem;
}
.empty::before {
    content: ""; flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 3px;
    border: 1px solid var(--line-3);
    background: repeating-linear-gradient(45deg, var(--line-3) 0 2px, transparent 2px 5px);
}

/* -------------------------------------------------------------- hero */

.hero {
    position: relative; isolation: isolate; overflow: hidden;
    padding: clamp(34px, 5.5vw, 80px) 0 clamp(34px, 5vw, 70px);
    margin-top: calc(var(--gap) * -1);
    border-bottom: 1px solid var(--line);
}
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero__bg::before {
    content: ""; position: absolute; inset: -30% -10% 0;
    background:
        radial-gradient(38% 46% at 16% 34%, rgba(242, 159, 5, .17), transparent 70%),
        radial-gradient(34% 44% at 84% 22%, rgba(10, 132, 255, .22), transparent 70%),
        radial-gradient(30% 40% at 58% 96%, rgba(95, 224, 0, .1), transparent 70%);
    animation: aurora 18s ease-in-out infinite alternate;
}
/* perspective grid floor */
.hero__bg::after {
    content: ""; position: absolute; left: -60%; right: -60%; bottom: -1px; height: 62%;
    background-image:
        linear-gradient(rgba(92, 176, 255, .5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(92, 176, 255, .5) 1px, transparent 1px);
    background-size: 72px 72px;
    transform: perspective(420px) rotateX(64deg);
    transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .9), transparent 80%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, .9), transparent 80%);
    opacity: .28;
    animation: grid-run 4s linear infinite;
}
/* scan lines */
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .022) 0 1px, transparent 1px 4px);
}
@keyframes grid-run { to { background-position: 0 72px, 0 0; } }
@keyframes aurora {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

.hero__grid { display: grid; gap: calc(var(--gap) * 1.4); align-items: center; }
@media (min-width: 1000px) { .hero__grid { grid-template-columns: minmax(0, 1.2fr) minmax(380px, .95fr); } }
.hero__intro { min-width: 0; }

.chip-live {
    display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
    padding: 6px 14px 6px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2);
    font: 600 .7rem/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
}

/*
 * BOT wordmark (the school's monogram, Bláthy Ottó Titusz): three pixel
 * letters in the palette of the BLÁTHY logo (B ink and T green as in the
 * logo, O orange), powering on one by one, plus a small sublabel with the
 * six-colour stripe of the logo.
 */
.wordmark {
    display: flex; align-items: flex-end;
    font: 700 clamp(5rem, 22vw, 9rem)/.9 var(--font-pixel);
    letter-spacing: .05em; margin: 14px 0 22px;
    color: var(--text); white-space: nowrap;
    filter: drop-shadow(0 0 28px rgba(92, 176, 255, .2));
}
.wordmark > span {
    --o: var(--b-ink);
    display: inline-block;
    text-shadow:
        2px 0 var(--o), -2px 0 var(--o), 0 2px var(--o), 0 -2px var(--o),
        2px 2px var(--o), -2px -2px var(--o), 2px -2px var(--o), -2px 2px var(--o),
        .06em .06em 0 rgba(92, 176, 255, .22), 0 0 34px var(--glow, transparent);
    animation: power-on .9s steps(1, end) both;
}
.wordmark .l1 { color: #0b0d12; --glow: rgba(243, 240, 232, .25); animation-delay: .05s; }
.wordmark .l2 { color: var(--b-orange); --glow: rgba(242, 159, 5, .55); animation-delay: .2s; }
.wordmark .l3 { color: var(--b-green); --glow: rgba(95, 224, 0, .5); animation-delay: .35s; }
.wordmark__sub {
    display: flex; flex-direction: column; gap: .75em;
    margin: 0 0 1.1em .9em;
    font: 600 clamp(.66rem, 1.05vw, .84rem)/1.2 var(--font-mono);
    letter-spacing: .22em; text-transform: uppercase; color: var(--text-2);
    animation: power-on .9s steps(1, end) .55s both;
}
.wordmark__bar { display: block; height: .55em; background: var(--stripe); box-shadow: 0 0 14px rgba(255, 229, 0, .18); }
@keyframes power-on {
    0% { opacity: 0; }
    10% { opacity: 1; }
    16% { opacity: .15; }
    24% { opacity: 1; }
    32% { opacity: .4; }
    40%, 100% { opacity: 1; }
}

.lead { font-size: clamp(1.04rem, 1.5vw, 1.22rem); color: var(--text-2); max-width: 52ch; }
.hero .lead { margin-bottom: 26px; }

/* boot log (typed by site.js, complete without it) */
.bootlog {
    max-width: 600px; margin: 0 0 24px; padding: 13px 16px 12px;
    font: 500 .85rem/1.7 var(--font-mono); color: var(--text-2);
    background: rgba(5, 8, 12, .72); border: 1px solid var(--line-2); border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02), inset 0 0 50px rgba(95, 224, 0, .04);
}
.bootlog p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bootlog .ok { color: var(--green); text-shadow: 0 0 8px rgba(95, 224, 0, .45); }
.bootlog .warn { color: var(--orange); }
.bootlog .dim { color: var(--text-3); }
.bootlog .hl { color: var(--text); }
.cursor { display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; background: var(--green); vertical-align: -.18em; box-shadow: 0 0 8px rgba(95, 224, 0, .6); animation: blink 1.05s steps(1) infinite; }
.bootlog.is-typing p { visibility: hidden; }
.bootlog.is-typing p.is-shown { visibility: visible; }

/* status card on the right of the hero */
.status-card { overflow: hidden; }
.status-card .panel__body { display: grid; gap: 18px; }
.status-card__row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 420px) { .status-card__row { grid-template-columns: 1fr; justify-items: start; } }
.status-card .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ring { position: relative; display: grid; place-items: center; width: var(--size, 132px); aspect-ratio: 1; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring__track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 9; }
.ring__bar {
    fill: none; stroke: url(#ring-gradient) var(--b-green); stroke-width: 9; stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(95, 224, 0, .55));
    animation: ring-in 1.6s var(--ease) both .2s;
}
.ring__ticks { fill: none; stroke: var(--bg); stroke-width: 11; stroke-dasharray: .6 9.4; }
@keyframes ring-in { from { stroke-dasharray: 0 100; } }
.ring__label { position: relative; text-align: center; line-height: 1.05; }
.ring__value { display: block; font: 700 1.9rem/1 var(--font-mono); letter-spacing: -.04em; color: var(--text); }
.ring__value small { font-size: .55em; color: var(--text-3); letter-spacing: 0; }
.ring__caption { display: block; margin-top: 4px; font: 600 .6rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }

/* ------------------------------------------------------------ phase */

.phase__label { display: flex; align-items: center; gap: 10px; font: 700 .8rem/1.2 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text); }
.phase__when { margin: 8px 0 0; color: var(--text-2); }
.phase__when .team { vertical-align: baseline; }
.phase .small.muted { margin: 10px 0 0; }

.countdown { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 2px; }
.countdown__cell {
    position: relative; min-width: 68px; padding: 10px 8px 7px; text-align: center; overflow: hidden;
    background: linear-gradient(180deg, #1a2030, #0c1017); border: 1px solid var(--line-2); border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.countdown__cell::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .55); }
.countdown__cell b { display: block; font: 700 clamp(1.7rem, 3.6vw, 2.5rem)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); text-shadow: 0 0 18px rgba(255, 229, 0, .3); }
.countdown__cell b.is-tick { animation: digit-tick .35s var(--ease); }
.countdown__cell small { display: block; margin-top: 4px; font: 600 .62rem/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
@keyframes digit-tick { from { transform: translateY(-30%); opacity: .2; } }

/* ------------------------------------------------- module board */

.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
/* ten modules: 5 or 2 columns, never an orphan row */
@media (max-width: 859px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.module {
    --acc: var(--text-3);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 6px;
    min-width: 0; min-height: 132px; padding: 14px 14px 13px;
    border: 1px dashed var(--line-3); border-radius: 14px;
    background: rgba(13, 17, 24, .6); color: var(--text-2);
    transition: border-color .3s, box-shadow .3s, transform .25s var(--ease);
}
.module__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module__num { font: 700 1.55rem/1 var(--font-pixel); color: var(--text-3); letter-spacing: .02em; }
.module__name { font-weight: 650; font-size: .98rem; color: var(--text); line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; margin: 0; }
.module__task { font-size: .82rem; color: var(--text-3); }
.module__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }
.module__meter { margin-top: 4px; }
.module.is-active { --acc: var(--b-orange); border-style: solid; border-color: rgba(255, 173, 51, .45); }
.module.is-on {
    --acc: var(--b-green);
    border: 1px solid rgba(134, 240, 74, .42);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(95, 224, 0, .13), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, .03), transparent),
        var(--surface);
    box-shadow: 0 0 0 1px rgba(95, 224, 0, .06), 0 14px 34px -20px rgba(95, 224, 0, .65);
    animation: module-on 1.1s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + .25s);
}
.module.is-on .module__num { color: var(--green); text-shadow: 0 0 14px rgba(95, 224, 0, .65); }
.module.is-on::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .07) 50%, transparent 60%);
    transform: translateX(-100%);
    animation: sheen 1.6s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + .6s);
}
.module:hover { transform: translateY(-2px); }
@keyframes module-on {
    0% { filter: brightness(.35) saturate(0); }
    30% { filter: brightness(1.8) saturate(1.4); }
    45% { filter: brightness(.7); }
    100% { filter: none; }
}
@keyframes sheen { to { transform: translateX(100%); } }

/* ------------------------------------------------------------ podium */

.podium {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end;
    margin: 0; padding: 58px 16px 16px; list-style: none;
    border-bottom: 1px solid var(--line);
    background: radial-gradient(60% 120% at 50% 0%, rgba(255, 229, 0, .07), transparent 70%);
}
.podium__card {
    --medal: var(--medal-2);
    position: relative; min-width: 0;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
    padding: 20px 12px 14px; border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 13%, transparent), rgba(255, 255, 255, .015) 70%);
    border: 1px solid color-mix(in srgb, var(--medal) 38%, transparent);
    box-shadow: 0 18px 40px -26px color-mix(in srgb, var(--medal) 80%, transparent);
}
.podium__card--1 { --medal: var(--medal-1); order: 2; padding-top: 30px; padding-bottom: 20px; }
.podium__card--2 { --medal: var(--medal-2); order: 1; }
.podium__card--3 { --medal: var(--medal-3); order: 3; }
.podium__rank {
    position: absolute; top: -1px; left: 50%; transform: translate(-50%, -50%);
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    background: var(--medal); color: #0b0d12; font: 700 1.25rem/1 var(--font-pixel);
    box-shadow: 0 0 0 4px var(--surface), 0 0 22px -2px var(--medal);
}
.podium__card--1 .podium__rank { width: 46px; height: 46px; font-size: 1.5rem; }
.podium__crown { position: absolute; top: -52px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; color: var(--medal-1); filter: drop-shadow(0 0 8px rgba(255, 229, 0, .7)); }
.podium .team { justify-content: center; }
.podium .team__name { font-size: 1.02rem; }
.podium__card--1 .team__name { font-size: 1.18rem; }
.podium__members { font-size: .78rem; color: var(--text-3); overflow-wrap: anywhere; }
.podium__score { font: 700 1.5rem/1 var(--font-mono); color: var(--text); letter-spacing: -.03em; }
.podium__score small { font-size: .55em; color: var(--text-3); }
.podium__time { font: 500 .75rem/1.3 var(--font-mono); color: var(--text-3); }
@media (max-width: 719px) {
    .podium { gap: 8px; padding: 50px 10px 14px; }
    .podium__card { padding: 24px 6px 10px; gap: 5px; border-radius: 12px; }
    .podium__card--1 { padding-top: 30px; }
    .podium__members, .podium .pips, .podium__time { display: none; }
    .podium .team { flex-direction: column; gap: 5px; }
    .podium .team__name, .podium__card--1 .team__name { font-size: .84rem; line-height: 1.25; }
    .podium__score { font-size: 1.15rem; }
    .podium__rank { width: 30px; height: 30px; font-size: 1rem; border-radius: 9px; }
    .podium__card--1 .podium__rank { width: 36px; height: 36px; font-size: 1.15rem; }
    .podium__crown { top: -42px; width: 18px; height: 18px; }
    .podium .badge { font-size: .56rem; padding: 0 6px; }
}

/* ----------------------------------------------------------- ranking */

.ranking-table .team { align-items: center; }
.ranking-table td:nth-child(2) { min-width: 200px; }
.time-short { display: none; }
@media (max-width: 640px) {
    .ranking-table td:nth-child(2) { min-width: 0; }
    .ranking-table .team__members { display: none; }
    .ranking-table .badge { font-size: .56rem; padding: 0 6px; }
    .time-long { display: none; }
    .time-short { display: inline; }
    .table thead th { letter-spacing: .05em; }
    .race__legend li { font-size: .74rem; padding: 3px 8px 3px 6px; }
    .race__legend .num { display: none; }
    .race__legend .name { max-width: 11ch; }
}
.ranking-table tbody tr { scroll-margin-top: 3.4rem; scroll-margin-bottom: 1rem; }
.ranking-table tr.is-finished td:first-child { box-shadow: inset 3px 0 0 var(--b-green); }
.ranking-table tr.is-finished .rank { color: var(--green); }
.ranking-table tr:target td, .ranking-table tr.is-target td { animation: row-target 2.4s ease-out 2; background: rgba(255, 229, 0, .1); }
.ranking-table tr.is-target td:first-child { box-shadow: inset 4px 0 0 var(--b-yellow); }
@keyframes row-target { 0%, 100% { background: rgba(255, 229, 0, .1); } 50% { background: rgba(255, 229, 0, .24); } }
.ranking-table .pips { gap: 2px; }
.moved-up td { animation: moved-up 2.2s ease-out; }
.moved-down td { animation: moved-down 2.2s ease-out; }
.row-new td { animation: moved-up 2.2s ease-out; }
@keyframes moved-up { from { background: rgba(95, 224, 0, .22); } }
@keyframes moved-down { from { background: rgba(255, 107, 97, .16); } }
.rank-delta { display: inline-flex; align-items: center; margin-right: 4px; font-size: .7rem; vertical-align: 1px; }
.rank-delta--up { color: var(--green); }
.rank-delta--down { color: var(--red); }

.refresh-note { display: none; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 229, 0, .06); font-size: .9rem; }
.refresh-note.is-visible { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------- feed */

.feed { list-style: none; margin: 0; padding: 0; }
.feed__item {
    --k: var(--text-3);
    position: relative;
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 1px 12px; align-items: start;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.feed__item:last-child { border-bottom: 0; }
.feed__icon {
    grid-row: 1 / span 3;
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    color: var(--k);
    background: color-mix(in srgb, var(--k) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--k) 36%, transparent);
}
.feed__icon .icon { width: 20px; height: 20px; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--k) 60%, transparent)); }
.feed__kind { grid-column: 2; grid-row: 1; font: 600 .64rem/1.5 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--k); }
.feed__item > time { grid-column: 3; grid-row: 1; font: 500 .74rem/1.5 var(--font-mono); color: var(--text-3); white-space: nowrap; }
.feed__body { grid-column: 2 / span 2; grid-row: 2; min-width: 0; color: var(--text-2); font-size: .93rem; line-height: 1.45; }
.feed__body .team { margin-right: 2px; }
.feed__text { color: var(--text-2); }
.feed__detail { display: block; margin-top: 2px; font-size: .8rem; color: var(--text-3); }
.feed__item--join { --k: #c4cddc; }
.feed__item--solve { --k: var(--green); }
.feed__item--first { --k: var(--yellow); }
.feed__item--side { --k: var(--orange); }
.feed__item--egg { --k: var(--magenta); }
.feed__item--badge { --k: var(--violet); }
.feed__item--finish { --k: var(--yellow); }
.feed__item--arena { --k: var(--blue); }
.feed__item.is-highlight { background: linear-gradient(90deg, color-mix(in srgb, var(--k) 12%, transparent), transparent 75%); }
.feed__item.is-highlight::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--k); box-shadow: 0 0 12px var(--k); }
.feed__item--finish.is-highlight::before { background: linear-gradient(var(--b-orange), var(--b-yellow), var(--b-green), var(--b-blue)); }
.feed__item.is-new { animation: feed-in .7s var(--ease) both; }
@keyframes feed-in {
    0% { opacity: 0; transform: translateY(-14px); background-color: rgba(255, 229, 0, .16); }
    60% { opacity: 1; transform: none; }
    100% { background-color: transparent; }
}
.feed-wrap[data-stale] .panel__meta { color: var(--warn); }

/* ------------------------------------------------- first-solve list */

.firsts { list-style: none; margin: 0; padding: 0; }
.firsts li {
    display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 1px 12px; align-items: center;
    padding: 9px 16px; border-bottom: 1px solid var(--line);
}
.firsts li:last-child { border-bottom: 0; }
.firsts__num {
    grid-row: 1 / span 2; display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
    border-radius: 10px; font: 700 .82rem/1 var(--font-mono); color: var(--text-3);
    background: rgba(255, 255, 255, .03); border: 1px dashed var(--line-3);
}
.firsts li.is-claimed .firsts__num { color: var(--yellow); border: 1px solid rgba(255, 229, 0, .4); background: rgba(255, 229, 0, .08); text-shadow: 0 0 10px rgba(255, 229, 0, .45); }
.firsts__task { font-weight: 600; font-size: .92rem; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.firsts__who { grid-column: 2 / 3; font-size: .86rem; min-width: 0; }
.firsts time { grid-row: 1 / span 2; grid-column: 3; font: 500 .74rem/1.35 var(--font-mono); color: var(--text-3); text-align: right; white-space: nowrap; }
.firsts .is-open { color: var(--text-3); font-style: italic; }

/* ------------------------------------------------------------- tabs */

.tabs [role="tablist"] { display: none; }
.tabs.is-enhanced [role="tablist"] {
    display: flex; gap: 4px; padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto; scrollbar-width: none;
}
.tabs.is-enhanced [role="tablist"]::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
    appearance: none; cursor: pointer; flex: none;
    min-height: 40px; padding: 8px 15px;
    border: 1px solid transparent; border-radius: 999px;
    background: transparent; color: var(--text-2);
    font: 600 .88rem/1.2 var(--font-sans); white-space: nowrap;
    transition: color .2s, background-color .2s, border-color .2s;
}
.tabs [role="tab"]:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); background: var(--surface-3); border-color: var(--line-3); box-shadow: inset 0 -2px 0 var(--b-yellow); }
.tabs [role="tabpanel"] + [role="tabpanel"] { border-top: 1px solid var(--line); }
.tabs.is-enhanced [role="tabpanel"] + [role="tabpanel"] { border-top: 0; }
.tabs.is-enhanced .tab-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tabs [role="tabpanel"]:focus-visible { outline-offset: -3px; }
.tab-heading { font-size: 1rem; padding: 16px 18px 0; margin: 0; }
.tab-note { margin: 0; padding: 10px 18px 14px; font-size: .84rem; color: var(--text-3); border-top: 1px solid var(--line); }

.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.scenarios > div + div { border-left: 1px solid var(--line); }
@media (max-width: 820px) { .scenarios > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.scenario-title { font: 600 .74rem/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); padding: 14px 16px 8px; margin: 0; }

/* ------------------------------------------------------ task cards */

.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 14px; }
.task-card {
    --acc: var(--b-yellow);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 8px; padding: 18px 16px 15px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 6%, transparent), transparent 55%), var(--surface);
    border: 1px solid var(--line-2); border-radius: 14px;
    transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.task-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--acc); box-shadow: 0 0 14px var(--acc); opacity: .85; }
.task-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--acc) 50%, transparent); box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--acc) 75%, transparent); }
.task-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-card__num { font: 700 1.7rem/1 var(--font-pixel); color: var(--acc); text-shadow: 0 0 16px color-mix(in srgb, var(--acc) 50%, transparent); }
.task-card__title { font-weight: 700; font-size: 1.06rem; margin: 0; color: var(--text); }
.task-card__module { font: 500 .74rem/1.3 var(--font-mono); letter-spacing: .04em; color: var(--text-3); }
.task-card__summary { font-size: .88rem; color: var(--text-2); margin: 0; }
.task-card__foot { margin-top: auto; padding-top: 6px; display: grid; gap: 7px; font-size: .82rem; color: var(--text-3); }
.task-card__foot strong { color: var(--text); }
.task-card--side { --acc: var(--b-orange); }
.task-card--arena { --acc: var(--b-blue); }

/* ----------------------------------------------- race chart (timeline) */

.race { margin: 0; padding: 16px 18px 6px; }
.race__plot { position: relative; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); grid-template-rows: var(--plot-h, clamp(210px, 26vw, 320px)) auto; }
.race__y { position: relative; grid-row: 1; grid-column: 1; font: 500 .68rem/1 var(--font-mono); color: var(--text-3); }
.race__y span { position: absolute; right: 8px; transform: translateY(-50%); }
.race__svg { grid-row: 1; grid-column: 2; width: 100%; height: 100%; overflow: visible; display: block; }
.race__grid line { stroke: rgba(255, 255, 255, .06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.race__grid line.is-base { stroke: var(--line-3); }
.race__grid line.is-goal { stroke: rgba(95, 224, 0, .35); stroke-dasharray: 4 5; }
.race__series { transition: opacity .25s; }
.race__line { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--c) 70%, transparent)); }
.race__line { stroke-dasharray: 3000; stroke-dashoffset: 0; animation: draw-line 2.2s var(--ease) both .2s; }
@keyframes draw-line { from { stroke-dashoffset: 3000; } }
.timeline__mark { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: square; vector-effect: non-scaling-stroke; }
.timeline__mark.is-final { stroke: var(--b-green); stroke-width: 13; filter: drop-shadow(0 0 6px rgba(95, 224, 0, .9)); }
.timeline__penalty { fill: none; stroke: var(--red); stroke-width: 8; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; opacity: .9; }
.race.has-focus .race__series { opacity: .12; }
.race.has-focus .race__series.is-focus { opacity: 1; }
.race.has-focus .race__series.is-focus .race__line { stroke-width: 3.6; }
.race__x { position: relative; grid-row: 2; grid-column: 2; height: 26px; border-top: 1px solid var(--line-2); }
.race__tick { position: absolute; top: 7px; transform: translateX(-50%); font: 500 .68rem/1.2 var(--font-mono); color: var(--text-3); white-space: nowrap; }
.race__tick:first-child { transform: none; }
.race__tick:last-child { transform: translateX(-100%); }
.race__legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0 0 12px; list-style: none; }
.race__legend li {
    display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%;
    padding: 4px 10px 4px 8px; border-radius: 999px;
    border: 1px solid var(--line-2); background: rgba(255, 255, 255, .025);
    font-size: .8rem; color: var(--text-2); cursor: default; transition: border-color .2s, background-color .2s;
}
.race__legend li:hover, .race__legend li:focus-visible, .race__legend li.is-focus { border-color: var(--c); background: rgba(255, 255, 255, .06); color: var(--text); }
.race__key { width: 16px; height: 4px; border-radius: 2px; background: var(--c, #8a8a8a); box-shadow: 0 0 8px var(--c, transparent); flex: none; }
.race__legend b { font: 700 .72rem/1 var(--font-mono); color: var(--text-3); }
.race__legend .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 18px 14px; font-size: .78rem; color: var(--text-3); }
.legend__key { display: inline-flex; align-items: center; gap: 7px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--text-2); display: inline-block; }
.legend__swatch.is-final { background: var(--b-green); box-shadow: 0 0 8px rgba(95, 224, 0, .8); }
.legend__swatch.is-penalty { background: repeating-linear-gradient(90deg, var(--red) 0 2px, transparent 2px 4px); }

/* ------------------------------------------------- team page header */

.mission {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; gap: var(--gap); align-items: center;
    padding: clamp(20px, 3vw, 32px); margin-bottom: var(--gap);
    border: 1px solid var(--line-2); border-radius: 20px;
    background:
        radial-gradient(80% 140% at 0% 0%, color-mix(in srgb, var(--team, #5cb0ff) 22%, transparent), transparent 60%),
        radial-gradient(60% 120% at 100% 100%, rgba(10, 132, 255, .12), transparent 60%),
        var(--surface);
    box-shadow: var(--shadow);
}
.mission::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(rgba(160, 174, 196, .08) 1px, transparent 1.6px) 0 0 / 18px 18px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
    mask-image: linear-gradient(90deg, transparent, #000 60%);
}
@media (min-width: 1200px) { .mission { grid-template-columns: minmax(0, 1fr) auto minmax(300px, 420px); } }
.mission h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); margin: 8px 0 6px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 16px; letter-spacing: -.02em; }
.mission h1 .team__swatch { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 0 24px var(--team); }
.mission__members { color: var(--text-2); margin: 0 0 16px; }
.mission__gauge { display: flex; align-items: center; gap: 18px; }
.mission__gauge .ring { --size: 150px; }
.mission__gauge p { margin: 0; max-width: 22ch; font-size: .9rem; color: var(--text-2); }
.mission .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mission .stat { background: rgba(5, 7, 11, .45); }
@media (min-width: 700px) and (max-width: 1199px) {
    .mission { grid-template-columns: minmax(0, 1fr) auto; }
    .mission .stats { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


.notice {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 18px; margin-bottom: var(--gap);
    border: 1px solid var(--line-2); border-left: 4px solid var(--text-3); border-radius: 12px;
    background: var(--surface); color: var(--text-2);
}
.notice strong { color: var(--text); }
.notice--mark { border-left-color: var(--b-yellow); background: linear-gradient(90deg, rgba(255, 229, 0, .07), transparent 60%), var(--surface); }
.notice--bad { border-left-color: var(--b-red); background: linear-gradient(90deg, rgba(224, 27, 27, .1), transparent 60%), var(--surface); }
.notice--ok { border-left-color: var(--b-green); background: linear-gradient(90deg, rgba(95, 224, 0, .09), transparent 60%), var(--surface); }
.notice > :last-child { margin-bottom: 0; }

/* rich module cards on the team page */
.module--card { min-height: 0; gap: 8px; }
.module--card .module__name { font-size: 1rem; }
.mstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin: 6px 0 2px; padding: 9px 0 0; border-top: 1px solid var(--line); }
.mstats div { min-width: 0; }
.mstats dt { font: 600 .58rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.mstats dd { margin: 1px 0 0; font: 600 .86rem/1.3 var(--font-mono); color: var(--text); white-space: nowrap; }
.mstats dd .muted { font-weight: 500; }
.mstats .is-wide { grid-column: 1 / -1; }
.module__link { font-size: .82rem; font-weight: 600; }
@media (max-width: 560px) {
    .board--cards { grid-template-columns: minmax(0, 1fr); }
    .board--cards .mstats { grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 4px 10px; }
    .board--cards .mstats .is-wide { grid-column: auto; }
    .board--cards .mstats dt { font-size: .54rem; letter-spacing: .06em; }
}

.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.quest {
    position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
    padding: 14px; border-radius: 14px; border: 1px dashed var(--line-3); background: rgba(13, 17, 24, .6);
}
.quest.is-on { border: 1px solid rgba(255, 173, 51, .45); background: radial-gradient(120% 90% at 0% 0%, rgba(242, 159, 5, .14), transparent 62%), var(--surface); box-shadow: 0 14px 34px -22px rgba(242, 159, 5, .7); }
.quest.is-active { border-style: solid; border-color: var(--line-3); }
.quest__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quest__num { font: 700 1.2rem/1 var(--font-pixel); color: var(--orange); }
.quest__title { margin: 0; font-size: .98rem; color: var(--text); }
.quest .mstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.arena-game + .arena-game { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.arena-game__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; }
.arena-game__head strong { color: var(--text); }
.arena-game .table td { padding: 8px 10px; }
.arena-game .table td.num:last-child { white-space: normal; min-width: 9em; }
.arena-game .table td.num:last-child .muted { display: inline-block; font-size: .8rem; line-height: 1.35; margin-top: 2px; }
@media (max-width: 640px) {
    .arena-game .table, .arena-game .table tbody { display: block; }
    .arena-game .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
    .arena-game .table tr:last-child { border-bottom: 0; }
    .arena-game .table td, .arena-game .table td:first-child, .arena-game .table td:last-child { padding: 0; border: 0; }
    .arena-game .table td.num:last-child { grid-column: 1 / -1; text-align: left; min-width: 0; }
}
.arena-game .table td:first-child { padding-left: 0; }
.arena-game .table td:last-child { padding-right: 0; }

.quicklinks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quicklinks li { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); }
.quicklinks code { font-size: .84rem; color: var(--text); overflow-wrap: anywhere; }
.quicklinks .method { color: var(--green); font-weight: 600; margin-right: 6px; }
@media (max-width: 640px) { .quicklinks li { grid-template-columns: minmax(0, 1fr) auto; } .quicklinks li > span:first-child { grid-column: 1 / -1; } }

.copy {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 11px; cursor: pointer;
    font: 600 .74rem/1.2 var(--font-mono); letter-spacing: .04em; color: var(--text-2);
    background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); border-radius: 8px;
    transition: background-color .2s, color .2s, border-color .2s;
}
.copy:hover { background: rgba(255, 255, 255, .09); color: var(--text); }
.copy.is-done { background: rgba(95, 224, 0, .16); color: var(--green); border-color: rgba(95, 224, 0, .5); }

.viz .panel__body { overflow-x: auto; }
.viz .card, .viz .card-body { background: none; border: 0; padding: 0; }
.viz .d-flex { display: flex; flex-wrap: wrap; gap: 8px; }
.viz .justify-content-between { justify-content: space-between; }
.viz .align-items-center { align-items: center; }
.viz .text-muted { color: var(--text-3); }
.viz .text-center { text-align: center; }
.viz .mb-0 { margin-bottom: 0; }
.viz .mb-2 { margin-bottom: 8px; }
.viz .mt-2 { margin-top: 8px; }
.viz h4 { font-size: 1.05rem; }

/* ----------------------------------------------------- achievements */

.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.ach {
    position: relative;
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 13px; align-items: start;
    padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 17, 24, .55);
}
.ach__icon {
    grid-row: span 2; width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center;
    color: var(--text-3); background: rgba(255, 255, 255, .03); border: 1px dashed var(--line-3);
}
.ach__icon .icon { width: 22px; height: 22px; }
.ach__title { font-weight: 700; line-height: 1.25; color: var(--text-2); }
.ach__desc { font-size: .82rem; color: var(--text-3); }
.ach__desc time { display: inline-block; margin-top: 4px; font: 500 .72rem/1.3 var(--font-mono); color: var(--text-3); }
.ach.is-on { border-color: rgba(255, 229, 0, .3); background: radial-gradient(100% 120% at 0% 0%, rgba(255, 229, 0, .09), transparent 60%), var(--surface); }
.ach.is-on .ach__title { color: var(--text); }
.ach.is-on .ach__icon { color: #0b0d12; background: linear-gradient(135deg, var(--b-yellow), var(--b-orange)); border: 0; box-shadow: 0 0 20px -4px rgba(255, 229, 0, .7); }
.ach.is-on.is-egg { border-color: rgba(255, 122, 217, .35); background: radial-gradient(100% 120% at 0% 0%, rgba(255, 122, 217, .1), transparent 60%), var(--surface); }
.ach.is-on.is-egg .ach__icon { background: linear-gradient(135deg, var(--magenta), var(--violet)); box-shadow: 0 0 20px -4px rgba(255, 122, 217, .7); }
.ach.is-secret { border-style: dashed; grid-column: 1 / -1; }
.ach.is-secret .ach__title { font-family: var(--font-mono); letter-spacing: .24em; color: var(--text-3); }
.egg-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.egg-slots span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px dashed var(--line-3); color: var(--text-3); font: 700 .8rem/1 var(--font-pixel); }
.egg-slots span.is-on { border: 1px solid rgba(255, 122, 217, .5); background: rgba(255, 122, 217, .14); color: var(--magenta); box-shadow: 0 0 12px -3px var(--magenta); }

/* ----------------------------------------------------- winner page */

.celebrate { text-align: center; padding: clamp(44px, 8vw, 110px) 0 clamp(36px, 6vw, 70px); }
.celebrate .trophy { width: 72px; height: 72px; color: var(--b-yellow); filter: drop-shadow(0 0 24px rgba(255, 229, 0, .7)); animation: float 4s ease-in-out infinite; }
.celebrate > .wrap { position: relative; z-index: 1; }
.celebrate h1 { font: 700 clamp(1.9rem, 5vw, 3.9rem)/1.08 var(--font-pixel); margin: 18px auto 18px; max-width: 20ch; letter-spacing: .01em; }
.celebrate h1 .accent { background: var(--neon); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255, 229, 0, .25)); }
.celebrate .team-name { overflow-wrap: anywhere; }
.celebrate .lead { margin: 0 auto 14px; }
.celebrate .btn-row { justify-content: center; margin-top: 26px; }
.celebrate .chip-live { margin: 0 auto; }
@keyframes float { 50% { transform: translateY(-8px); } }
.winner-stats { margin: var(--gap) 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat__value--time { font-size: clamp(1.05rem, 1.8vw, 1.35rem); padding: .35em 0 .2em; }

.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.confetti i {
    position: absolute; top: -20px; width: 9px; height: 13px; border-radius: 2px;
    animation: fall linear infinite;
}
.confetti i:nth-child(5n+1) { background: var(--b-orange); }
.confetti i:nth-child(5n+2) { background: var(--b-yellow); }
.confetti i:nth-child(5n+3) { background: var(--b-green); }
.confetti i:nth-child(5n+4) { background: var(--b-red); }
.confetti i:nth-child(5n) { background: var(--b-blue); }
.confetti i:nth-child(3n) { width: 7px; height: 7px; }
@keyframes fall {
    0% { transform: translate3d(0, 0, 0) rotate(0); }
    100% { transform: translate3d(var(--dx, 30px), 110vh, 0) rotate(720deg); }
}

/* ---------------------------------------------------------- terminal */

.terminal {
    background: var(--code-bg); color: var(--code-ink);
    border: 1px solid var(--line-2); border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 0 60px rgba(95, 224, 0, .03);
    font-family: var(--font-mono); font-size: .88rem; overflow: hidden;
}
.terminal .panel__bar { color: var(--text-2); --dot: var(--b-green); }
.terminal table { width: 100%; border-collapse: collapse; }
.terminal th, .terminal td { padding: 8px 14px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .05); white-space: nowrap; }
.terminal thead th { color: var(--text-3); font-weight: 600; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.terminal .ok { color: var(--green); font-weight: 600; text-shadow: 0 0 10px rgba(95, 224, 0, .55); }
.terminal .num { text-align: right; font-variant-numeric: tabular-nums; }
.terminal .dim { color: var(--text-3); }
.terminal tfoot td { color: var(--yellow); font-weight: 600; border-bottom: 0; }
.terminal tbody tr { animation: log-line .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + .3s); }
@keyframes log-line { from { opacity: 0; transform: translateX(-8px); } }

/* ------------------------------------------------- message (404) */

.message { position: relative; max-width: 760px; margin: clamp(20px, 6vw, 70px) auto; }
.panic {
    position: relative; overflow: hidden; padding: clamp(22px, 4vw, 40px);
    border: 1px solid rgba(255, 107, 97, .3); border-radius: 20px;
    background: radial-gradient(90% 120% at 0% 0%, rgba(224, 27, 27, .14), transparent 60%), var(--surface);
    box-shadow: var(--shadow), 0 0 80px -40px rgba(224, 27, 27, .6);
}
.panic::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px); }
.panic__tag { display: inline-flex; align-items: center; gap: 10px; font: 600 .74rem/1.3 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.message__code {
    font: 700 clamp(4.4rem, 17vw, 9rem)/.9 var(--font-pixel); color: var(--text); margin: 14px 0 8px;
    text-shadow: 3px 0 rgba(224, 27, 27, .75), -3px 0 rgba(10, 132, 255, .75);
    animation: glitch 3.2s steps(1) infinite;
}
@keyframes glitch {
    0%, 92%, 100% { text-shadow: 3px 0 rgba(224, 27, 27, .75), -3px 0 rgba(10, 132, 255, .75); transform: none; }
    94% { text-shadow: -5px 0 rgba(224, 27, 27, .8), 5px 0 rgba(10, 132, 255, .8); transform: translateX(2px) skewX(-6deg); }
    96% { text-shadow: 6px 0 rgba(224, 27, 27, .8), -2px 0 rgba(95, 224, 0, .8); transform: translateX(-3px); }
}
.message h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.message .terminal { padding: 14px 16px; margin: 18px 0 24px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; }
.panic__trace { margin: 18px 0 24px; padding: 14px 16px; font: 500 .8rem/1.7 var(--font-mono); color: var(--text-3); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.panic__trace .bad { color: var(--red); }
.panic__trace .ok { color: var(--green); }

/* ---------------------------------------------- e-mail verification */

.verify { max-width: 720px; margin: clamp(16px, 5vw, 60px) auto; }
.verify .panel__body { padding: clamp(20px, 4vw, 36px); }
.verify__state { display: inline-flex; align-items: center; gap: 10px; font: 700 .76rem/1.3 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.verify__state--ok { color: var(--green); }
.verify__state--bad { color: var(--red); }
.verify h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 12px 0 14px; }
.verify__desc { color: var(--text-2); margin-bottom: 22px; overflow-wrap: anywhere; }
.verify__desc a { color: var(--accent) !important; }
.verify__desc b { color: var(--text); }
.token-box { display: grid; gap: 8px; margin: 22px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); }
.token-box code { font-size: .95rem; color: var(--yellow); overflow-wrap: anywhere; }
.token-box__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }

/* ----------------------------------------------------- docs (info) */

.read-progress { position: fixed; left: 0; right: 0; top: var(--header-h); z-index: 60; height: 3px; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--neon); box-shadow: 0 0 12px rgba(255, 229, 0, .5); transform-origin: left; transform: scaleX(var(--p, 0)); }

.docs { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 1040px) {
    .docs { grid-template-columns: 290px minmax(0, 1fr); }
    .docs__side { position: sticky; top: calc(var(--header-h) + 18px); max-height: calc(100vh - var(--header-h) - 36px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; padding-bottom: 6px; }
}
.docs__side { display: grid; gap: 14px; min-width: 0; }
.task-meta { padding: 18px; display: grid; gap: 10px; overflow: hidden; }
.task-meta::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--stripe); opacity: .8; }
.task-meta__num { font: 700 2.8rem/1 var(--font-pixel); color: var(--yellow); text-shadow: 0 0 22px rgba(255, 229, 0, .45); }
.task-meta__title { font-weight: 700; font-size: 1.15rem; margin: 0; color: var(--text); }
.task-meta dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 4px 0 0; font-size: .88rem; }
.task-meta dt { color: var(--text-3); font: 600 .66rem/1.9 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.task-meta dd { margin: 0; font-weight: 500; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

.toc summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: center; gap: 10px; min-height: 46px;
    padding: 10px 16px; font: 600 .74rem/1.25 var(--font-mono); letter-spacing: .13em; text-transform: uppercase; color: var(--text);
}
.toc summary::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--b-blue); box-shadow: 12px 0 0 var(--line-3); margin-right: 14px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; margin-left: auto; font-size: 1rem; color: var(--text-3); }
.toc[open] summary::after { content: "−"; }
.toc[open] summary { border-bottom: 1px solid var(--line); }
.toc ol { list-style: none; margin: 0; padding: 8px 0 10px; counter-reset: toc; }
.toc li { position: relative; }
.toc a {
    position: relative; display: block; padding: 6px 16px 6px 18px;
    color: var(--text-2); text-decoration: none; font-size: .9rem; line-height: 1.35;
    transition: color .2s, background-color .2s;
}
.toc a::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: transparent; transition: background-color .2s, box-shadow .2s; }
.toc a:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.toc a.is-current { color: var(--text); font-weight: 600; background: linear-gradient(90deg, rgba(255, 229, 0, .08), transparent); }
.toc a.is-current::before { background: var(--b-yellow); box-shadow: 0 0 10px var(--b-yellow); }
.toc .lvl-3 a { padding-left: 32px; font-size: .84rem; color: var(--text-3); }
.toc .lvl-3 a.is-current { color: var(--text); }
.side-links { display: grid; gap: 8px; }
.side-links .btn { justify-content: flex-start; }
@media (max-width: 1039px) {
    .docs__side { gap: 10px; }
    .task-meta { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 14px; padding: 14px 16px; }
    .task-meta .eyebrow { grid-column: 1 / -1; }
    .task-meta__num { font-size: 2.1rem; }
    .task-meta dl { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px 12px; }
    .side-links { display: flex; flex-wrap: wrap; }
    .side-links .btn { min-height: 40px; padding: 7px 14px; font-size: .88rem; }
}
@media (max-width: 420px) {
    .task-meta dl { grid-template-columns: auto minmax(0, 1fr); }
}

.docs__main { padding: clamp(20px, 3.6vw, 52px); overflow: hidden; }
.docs__main::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--stripe); opacity: .65; border-radius: var(--radius) var(--radius) 0 0; }

.prose { max-width: 80ch; font-size: 1.03rem; line-height: 1.75; color: var(--text-2); counter-reset: h2; }
.prose > :first-child { margin-top: 0; }
.prose strong { color: var(--text); }
.prose h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 0 0 .7em; color: var(--text); letter-spacing: -.025em; line-height: 1.1; }
.prose h1::after { content: ""; display: block; width: 84px; height: 3px; margin-top: 16px; border-radius: 3px; background: var(--neon); box-shadow: 0 0 14px rgba(255, 229, 0, .35); }
.prose h2 { font-size: 1.55rem; margin: 2.4em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--line); color: var(--text); }
.prose h2::before {
    counter-increment: h2; content: counter(h2, decimal-leading-zero);
    display: block; margin-bottom: .5em;
    font: 600 .72rem/1 var(--font-mono); letter-spacing: .16em; color: var(--yellow);
}
.prose h3 { font-size: 1.18rem; margin: 1.9em 0 .55em; color: var(--text); }
.prose h4 { font-size: 1.02rem; margin: 1.6em 0 .45em; color: var(--text); }
.prose h1, .prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: calc(var(--header-h) + 18px); }
.prose .anchor {
    margin-left: .35em; color: var(--text-3); text-decoration: none; font-weight: 400;
    opacity: 0; transition: opacity .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.15em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--text-3); }
.prose ul > li::marker { color: var(--yellow); }
.prose blockquote {
    position: relative;
    margin: 0 0 1.4em; padding: 12px 18px 12px 48px;
    border: 1px solid rgba(92, 176, 255, .25); border-radius: 12px;
    background: linear-gradient(90deg, rgba(10, 132, 255, .09), rgba(10, 132, 255, .02));
    color: var(--text-2);
}
.prose blockquote::before {
    content: "i"; position: absolute; left: 16px; top: 14px;
    display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
    font: 700 .78rem/1 var(--font-mono); color: #0b0d12; background: var(--blue);
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote.is-warn { border-color: rgba(255, 173, 51, .35); background: linear-gradient(90deg, rgba(242, 159, 5, .11), rgba(242, 159, 5, .02)); }
.prose blockquote.is-warn::before { content: "!"; background: var(--orange); }
.prose blockquote.is-meta {
    padding: 10px 16px; border-color: var(--line-2); background: rgba(255, 255, 255, .03);
    font: 500 .86rem/1.6 var(--font-mono); color: var(--text-2);
}
.prose blockquote.is-meta::before { display: none; }
.prose blockquote.is-meta strong { color: var(--yellow); }
.prose p.is-hint { padding: 12px 16px; border: 1px dashed rgba(255, 229, 0, .35); border-radius: 12px; background: rgba(255, 229, 0, .05); }
.prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-3), transparent); margin: 2.6em 0; }
.prose img { border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; line-height: 1.5; }
.prose .table-scroll { margin: 0 0 1.4em; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(0, 0, 0, .18); }
.prose th, .prose td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: #121722; color: var(--text); font-weight: 600; font-size: .86rem; border-bottom: 1px solid var(--line-2); }
.prose tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .018); }
.prose tbody tr:hover td { background: rgba(255, 255, 255, .035); }
.prose tr:last-child td { border-bottom: 0; }
.prose :not(pre) > code {
    font: 500 .86em/1.4 var(--font-mono); color: #ffd98a;
    background: rgba(255, 255, 255, .055); border: 1px solid var(--line); border-radius: 5px; padding: .1em .38em;
    overflow-wrap: anywhere;
}
.prose a { overflow-wrap: anywhere; }
.prose a code { color: inherit; }
.prose td code, .prose th code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 560px) {
    .prose table.is-stackable, .prose table.is-stackable tbody, .prose table.is-stackable tr, .prose table.is-stackable td { display: block; width: 100%; }
    .prose table.is-stackable thead { display: none; }
    .prose table.is-stackable tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .prose table.is-stackable tr:last-child { border-bottom: 0; }
    .prose table.is-stackable td { padding: 2px 0; border: 0; background: none !important; }
    .prose table.is-stackable td[data-label]::before { content: attr(data-label); display: block; margin-top: 4px; font: 600 .62rem/1.5 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
    .prose table.is-stackable tbody tr:nth-child(even) { background: rgba(255, 255, 255, .018); }
}

.code-block { position: relative; margin: 0 0 1.4em; border: 1px solid var(--line-2); border-radius: 12px; background: var(--code-bg); overflow: hidden; box-shadow: 0 16px 36px -26px rgba(0, 0, 0, .9); }
.code-block__bar { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 6px 4px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .025); }
.code-block__bar::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--b-green); box-shadow: 12px 0 0 var(--line-3); margin-right: 14px; flex: none; }
.prose pre, .code-block pre {
    margin: 0 0 1.4em; padding: 16px 18px; overflow-x: auto;
    background: var(--code-bg); color: var(--code-ink);
    border: 1px solid var(--line-2); border-radius: 12px;
    font: 400 .87rem/1.65 var(--font-mono); tab-size: 4;
    scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.code-block pre { margin: 0; border: 0; border-radius: 0; }
.code-block pre:focus-visible { outline-offset: -3px; }
.prose pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.code-block__lang { font: 600 .66rem/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.copy-btn {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 11px; cursor: pointer;
    font: 600 .72rem/1.2 var(--font-mono); color: var(--text-2);
    background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); border-radius: 7px;
    transition: background-color .2s, color .2s;
}
.copy-btn:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.copy-btn.is-done { background: rgba(95, 224, 0, .16); color: var(--green); border-color: rgba(95, 224, 0, .5); }

/* Prism tokens, recoloured with the logo palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6f7a8e; font-style: italic; }
.token.punctuation { color: #9aa5b8; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.attr-name, .token.header-name { color: var(--blue); }
.token.boolean, .token.number, .token.null { color: var(--yellow); }
.token.string, .token.char, .token.attr-value, .token.url, .token.inserted { color: var(--green); }
.token.operator, .token.entity, .token.variable { color: #e3e8f2; }
.token.keyword, .token.method, .token.selector, .token.important, .token.atrule { color: var(--orange); }
.token.function, .token.class-name, .token.builtin { color: var(--magenta); }
.token.deleted { color: var(--red); }
.token.bold, .token.important { font-weight: 700; }
.token.request-line .token.keyword { color: var(--green); font-weight: 600; }
.token.status-line .token.number { color: var(--yellow); font-weight: 600; }

/* ------------------------------------------------------ TV mode */

body.is-tv { font-size: clamp(15px, 1.02vw, 26px); cursor: none; height: 100vh; overflow: hidden; }
body.is-tv::before { -webkit-mask-image: none; mask-image: none; }
body.is-tv .site-header, body.is-tv .site-footer, body.is-tv .skip { display: none; }
body.is-tv main > .stripe { position: fixed; left: 0; right: 0; top: 0; z-index: 5; }
body.is-tv main { height: 100vh; padding: 0; }
.tv {
    height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: .9em;
    padding: 1.1em 1.4em 0;
}
.tv-head { display: flex; align-items: center; gap: 1.2em 2em; min-width: 0; }
.tv-head .wordmark { font-size: clamp(2.8rem, 4.3vw, 5.6rem); margin: 0; flex: none; }
.tv-head .wordmark__sub { font-size: clamp(.68rem, .74vw, 1.05rem); margin-bottom: .9em; }
.tv-head .phase { min-width: 0; flex: 1 1 auto; }
.tv-head .phase__when { margin-top: 4px; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-head .countdown { margin: 4px 0 0; }
.tv-head .countdown__cell { min-width: 3.6em; padding: .35em .5em .3em; }
.tv-head .countdown__cell b { font-size: 1.8em; }
.tv-stats { display: flex; gap: .6em; flex: none; }
.tv-stats .stat { min-width: 6.5em; padding: .5em .8em .45em; }
.tv-stats .stat__value { font-size: 1.9em; }
.tv-stats .stat__label { font-size: .62em; }
.tv-head .clock { flex: none; font: 700 clamp(1.8rem, 2.8vw, 3.4rem)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); text-shadow: 0 0 20px rgba(92, 176, 255, .35); }
.tv-grid { display: grid; gap: 1em; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); min-height: 0; }
.tv-col { display: grid; gap: 1em; min-height: 0; }
.tv-col--rank { grid-template-rows: minmax(0, 1fr); }
.tv-col--rank:has(> .tv-countdown) { grid-template-rows: auto minmax(0, 1fr); }
.tv-countdown { display: grid; justify-items: center; gap: .6em; padding: 1.4em 1em 1.6em; text-align: center; background: radial-gradient(80% 140% at 50% 0%, rgba(255, 229, 0, .1), transparent 65%), var(--surface); }
.tv-col > .tv-countdown { align-items: center; }
.tv:has(.tv-countdown) .tv-head .countdown { display: none; }
.tv-countdown .countdown { gap: .6em; margin: 0; }
.tv-countdown .countdown__cell { min-width: 3.4em; padding: .5em .6em .45em; border-radius: 16px; }
.tv-countdown .countdown__cell b { font-size: clamp(2.6rem, 5vw, 5.6rem); }
.tv-countdown .countdown__cell small { font-size: .8em; }
.tv-col--side { grid-template-rows: auto minmax(0, 1fr); }
.tv-col > .panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tv-col > .panel > :not(.panel__bar) { flex: 1 1 auto; min-height: 0; }
.tv-col > .panel > .panel__foot, .tv-col > .panel > .refresh-note { flex: none; }
.tv .scroller { height: 100%; }
.tv .scroller__viewport { max-height: 100%; height: 100%; overflow: hidden; }
.tv .scroller__hint, .tv .scroller__more { display: none; }
.tv .ranking-table { font-size: 1.12em; }
.tv .ranking-table td, .tv .ranking-table th { padding: .42em .8em; }
.tv .ranking-table .team__members { display: none; }
.tv .ranking-table .team__name { font-size: 1.05em; }
.tv .ranking-table .pip { width: .42em; height: .95em; }
.tv .panel__foot { display: none; }
.tv .board { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .5em; }
.tv .module { min-height: 0; padding: .55em .65em .5em; gap: .2em; animation: none; border-radius: 12px; }
.tv .module::after { display: none; }
.tv .module__head .status { display: none; }
.tv .module__num { font-size: 1.15em; }
.tv .module__name { font-size: .78em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; hyphens: none; }
.tv .module__task { display: none; }
.tv .module__foot { font-size: .7em; }
.tv .module__meter { margin-top: 2px; }
.tv .race { padding: .7em 1em 0; --plot-h: 17vh; }
.tv .race__legend { gap: 4px; margin-top: 6px; padding-bottom: 4px; }
.tv .race__legend li { padding: 1px 8px 1px 6px; font-size: .62em; }
.tv .race__legend .num { display: none; }
.tv .legend { display: none; }
.tv .firsts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tv .firsts li { padding: .4em .9em; }
.tv .firsts li:nth-child(odd) { border-right: 1px solid var(--line); }
.tv .firsts li:nth-last-child(-n+2) { border-bottom: 0; }
.tv .firsts__task { font-size: .9em; }
.tv .firsts__num { width: 2.1em; height: 2.1em; }
.tv .firsts time { font-size: .7em; }

.ticker {
    position: relative; display: flex; align-items: center; gap: 0; height: 3.2em; margin: 0 -1.4em;
    border-top: 1px solid var(--line-2); background: rgba(5, 7, 11, .92); overflow: hidden;
}
.ticker__label {
    position: relative; z-index: 2; flex: none; height: 100%; display: flex; align-items: center; gap: .6em;
    padding: 0 1.2em 0 1.4em; font: 700 .8em/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: #0b0d12;
    background: var(--b-yellow); box-shadow: 8px 0 30px 10px rgba(5, 7, 11, .95);
}
.ticker__label .led { background: #0b0d12; box-shadow: none; }
.ticker__track { flex: 1 1 auto; min-width: 0; height: 100%; overflow: hidden; display: flex; align-items: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker .feed { display: flex; align-items: center; height: 100%; width: max-content; padding-left: 2em; }
.ticker .feed.is-running { animation: ticker var(--ticker-duration, 60s) linear infinite; }
.ticker .feed__item { display: inline-flex; align-items: center; gap: .6em; padding: 0 2.2em 0 0; border: 0; white-space: nowrap; background: none; }
.ticker .feed__item::before { display: none; }
.ticker .feed__icon { width: 1.7em; height: 1.7em; border-radius: 7px; }
.ticker .feed__icon .icon { width: 1.1em; height: 1.1em; }
.ticker .feed__kind, .ticker .feed__detail { display: none; }
.ticker .feed__body { font-size: 1em; }
.ticker .feed__item > time { font-size: .8em; }
.ticker .feed__item.is-highlight .feed__text { color: var(--yellow); }
.ticker .empty { padding: 0 1.2em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* celebration overlay (first solve / finish arriving live) */
.celebration {
    position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none;
    background: radial-gradient(60% 60% at 50% 50%, rgba(5, 7, 11, .55), rgba(5, 7, 11, .85));
    animation: fade-in .4s ease both;
}
.celebration.is-leaving { animation: fade-out .6s ease both; }
.celebration__card {
    position: relative; z-index: 2; max-width: min(90vw, 1100px); padding: 1.6em 2.6em; text-align: center;
    border: 1px solid rgba(255, 229, 0, .5); border-radius: 24px;
    background: radial-gradient(100% 140% at 50% 0%, rgba(255, 229, 0, .18), transparent 60%), rgba(13, 17, 24, .95);
    box-shadow: 0 0 0 1px rgba(255, 229, 0, .15), 0 0 120px -20px rgba(255, 229, 0, .6);
    animation: pop-in .7s var(--ease) both;
}
.celebration__kicker { display: inline-flex; align-items: center; gap: .5em; font: 700 .9em/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); }
.celebration__kicker .icon { width: 1.4em; height: 1.4em; }
.celebration__team { display: block; margin: .35em 0 .2em; font: 700 clamp(2rem, 4.6vw, 4.6rem)/1.05 var(--font-pixel); color: var(--text); overflow-wrap: anywhere; }
.celebration__text { display: block; font-size: clamp(1rem, 1.8vw, 1.7rem); color: var(--text-2); }
.celebration .confetti i { animation-duration: 3.2s; animation-iteration-count: 1; animation-fill-mode: both; }
body:not(.is-tv) .celebration { place-items: start end; padding: calc(var(--header-h) + 16px) 16px 0; background: none; }
body:not(.is-tv) .celebration__card { padding: 16px 22px; max-width: min(420px, calc(100vw - 32px)); border-radius: 16px; text-align: left; }
body:not(.is-tv) .celebration__team { font-size: 1.5rem; }
body:not(.is-tv) .celebration__text { font-size: .95rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.85) translateY(10px); } 60% { opacity: 1; transform: scale(1.03); } 100% { transform: none; } }

@media (max-width: 1100px) {
    body.is-tv { height: auto; overflow: auto; cursor: auto; }
    body.is-tv main { height: auto; }
    .tv { height: auto; }
    .tv { padding: 1em .9em 0; }
    .tv-head { flex-wrap: wrap; }
    .tv-head .phase__when { white-space: normal; }
    .tv-stats { flex: 1 1 100%; flex-wrap: wrap; }
    .tv .board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .tv-grid { grid-template-columns: 1fr; }
    .ticker { margin: 0 -.9em; }
    .tv .scroller__viewport { height: auto; max-height: 70vh; overflow: auto; }
    .ticker { position: sticky; bottom: 0; }
}
@media (max-width: 640px) {
    .tv .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tv-stats .stat { min-width: 0; flex: 1 1 40%; }
    .tv-head .wordmark { font-size: 3.2rem; }
}

/* --------------------------------------------------- preferences */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .confetti, .hero__bg::after { display: none; }
    .cursor { animation: none !important; }
    .ticker .feed.is-running { animation: none !important; }
}

@media (forced-colors: active) {
    .led, .pip, .timeline__mark, .team__swatch, .race__key { forced-color-adjust: none; }
    .panel, .btn, .module, .ach, .task-card, .quest { border: 1px solid CanvasText; }
}

@media print {
    :root { color-scheme: light; --text: #000; --text-2: #222; --text-3: #444; --line: #ccc; --line-2: #999; --surface: #fff; }
    .prose pre, .code-block pre { white-space: pre-wrap; overflow-wrap: anywhere; }
    html, body { background: #fff !important; color: #000; }
    body::before, .hero__bg, .hero::after, .read-progress, .confetti, .docs__main::before, .task-meta::before { display: none !important; }
    .site-header, .site-footer, .stripe, .skip, .btn-row, .copy-btn, .copy, .docs__side, .scroller__more, .scroller__hint { display: none !important; }
    .panel, .module, .terminal, .code-block, .prose blockquote, .prose .table-scroll { box-shadow: none !important; background: #fff !important; border-color: #999 !important; }
    .docs { display: block; }
    .docs__main { padding: 0; border: 0; }
    .prose, .prose strong, .prose h1, .prose h2, .prose h3, .prose h4, .prose h2::before, .prose blockquote, .prose blockquote.is-meta strong { color: #000 !important; }
    .prose a { color: #000; }
    .prose th { background: #eee !important; color: #000 !important; }
    .prose td { background: none !important; }
    .prose :not(pre) > code { color: #000; background: #eee; border-color: #ccc; }
    .code-block, .code-block__bar, .prose pre, .code-block pre { background: #f6f6f6 !important; color: #000 !important; }
    .token { color: #000 !important; font-style: normal !important; }
    .scroller__viewport { max-height: none !important; overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; }
}
}

/* In-place refreshed regions (site.js): no replayed entrance animations,
   only the modules that just came online power on. */
.is-live-swapped .module.is-on, .is-live-swapped .module.is-on::after, .is-live-swapped .meter > span,
.is-live-swapped .race__line, .is-live-swapped .ring__bar { animation: none; }
.is-live-swapped .module.is-on.is-new-on { animation: module-on 1.1s var(--ease) both; }
.is-live-swapped .module.is-on.is-new-on::after { animation: sheen 1.6s var(--ease) both .4s; }
