/* ---------- Fonts ---------- */

/* Self-hosted (SIL Open Font License, see fonts/OFL-*.txt), from @fontsource 5.3.0. Only the Latin subsets:
   "latin-ext" holds the Polish letters and is downloaded only when a page uses them. */

@font-face {
    font-family: "Inter Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
    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: "Inter Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
    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: "Barlow Condensed";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("fonts/barlow-condensed-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: "Barlow Condensed";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("fonts/barlow-condensed-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: "Barlow Condensed";
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("fonts/barlow-condensed-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: "Barlow Condensed";
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("fonts/barlow-condensed-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: "Barlow Condensed";
    font-style: normal;
    font-display: swap;
    font-weight: 800;
    src: url("fonts/barlow-condensed-latin-800-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: "Barlow Condensed";
    font-style: normal;
    font-display: swap;
    font-weight: 800;
    src: url("fonts/barlow-condensed-latin-ext-800-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;
}

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

/* "Stadion nocą" in red: one dark theme with a coral accent (the light theme was dropped on purpose). */
:root {
    color-scheme: dark;

    --bg: #160b0d;
    --surface: #1f1114;
    --surface-2: #2a161a;
    --border: #33191e;
    --text: #fbeff0;
    --muted: #d0aab0;
    --accent: #ff5a4f;
    --accent-hover: #ff7a70;
    --accent-text: #1a0607;
    --accent-soft: #3d1a20;
    --accent-label: #ff7a70;
    --hero-bg: radial-gradient(120% 90% at 50% 0%, #4a1820 0%, #26101a 60%, #1a0c0f 100%);
    --hero-border: #4d2028;
    --control: #1a0d10;
    --control-border: #4a242b;
    /* The home page pitch: a glow that fades into --bg, faint markings and see-through controls on it. */
    --pitch-bg: radial-gradient(120% 70% at 50% 18%, #5a1d27 0%, #2c111a 55%, #160b0d 100%);
    --pitch-line: rgba(255, 235, 236, 0.11);
    --glass: rgba(26, 13, 16, 0.55);
    --accent-glow: rgba(255, 90, 79, 0.25);
    /* Danger shares the red family, so dangerous actions are never filled: outlined buttons, bordered alerts. */
    --danger: #ff8a80;
    --danger-soft: #3a1519;
    --success: #5fd39a;
    --success-soft: #163326;
    --focus: rgba(255, 90, 79, 0.45);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);

    --radius: 18px;
    --radius-small: 12px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --tap: 44px;
    --content-width: 40rem;
    --font: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Headings, team names, scores and main buttons: condensed capitals, like a stadium board. */
    --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    /* The home page pitch spans the whole window (100vw); clipping keeps a desktop scrollbar from adding a sideways scroll. */
    overflow-x: clip;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.25;
    font-weight: 650;
}

h1, h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
}

h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.01em;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

/* The home greeting sits above the next matches and stays a little smaller than page titles. */
h1.greeting {
    font-size: 2rem;
}

h1:focus {
    outline: none;
}

p {
    margin: 0;
}

a {
    color: var(--accent);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--accent-hover);
}

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

/* ---------- Layout ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    min-height: 56px;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.brand__mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
}

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-5) var(--space-4) var(--space-6);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.stack--large {
    gap: var(--space-5);
}

.stack--small {
    gap: var(--space-2);
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.back-link {
    font-size: 0.95rem;
    text-decoration: none;
}

/* ---------- Card ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-5);
}

.card--centered {
    text-align: center;
    align-items: center;
}

.muted {
    color: var(--muted);
}

.full-width {
    width: 100%;
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--tap);
    padding: 0 var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
    background: var(--accent-hover);
    color: var(--accent-text);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.button--secondary {
    background: var(--surface);
    border-color: var(--control-border);
    color: var(--text);
}

.button--secondary:hover {
    background: var(--surface-2);
    color: var(--text);
}

.button--block {
    width: 100%;
    min-height: 50px;
}

.button--small {
    min-height: 38px;
    padding: 0 var(--space-4);
    font-size: 1rem;
}

/* Never filled: a filled red button would look like the main action. */
.button--danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.button--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ---------- Forms ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
    min-width: 0;
}

.field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.input {
    width: 100%;
    min-height: var(--tap);
    padding: 0 var(--space-3);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-small);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus);
}

.input--mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--surface-2);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

@media (min-width: 30rem) {
    .form-row {
        flex-direction: row;
        align-items: flex-end;
    }
}

@media (min-width: 30rem) {
    .form-row--top {
        align-items: flex-start;
    }
}

/* Checkbox list, e.g. the competitions of a match */
.checkbox-group {
    margin: 0;
    padding: 0;
    border: none;
    gap: var(--space-2);
}

.checkbox-group legend {
    padding: 0;
    margin-bottom: var(--space-1);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--tap);
    padding: 0 var(--space-3);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-small);
    background: var(--surface);
    cursor: pointer;
}

.checkbox input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent);
}

/* ---------- Alerts and badges ---------- */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-small);
    background: var(--surface-2);
}

/* Bordered and bold, so an error never reads as a plain accent-coloured note. */
.alert--error {
    border: 1px solid var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 600;
}

/* ---------- Login page ---------- */

.login-steps {
    margin: 0;
    padding-left: var(--space-5);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* The whole link is selected with one tap, so it is easy to copy out of a messenger. */
.login-link {
    display: block;
    width: 100%;
    padding: var(--space-3);
    border-radius: var(--radius-small);
    background: var(--control);
    border: 1px solid var(--control-border);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
    user-select: all;
    -webkit-user-select: all;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.badge--accent {
    background: var(--accent-soft);
    color: var(--accent-label);
}

.badge--success {
    background: var(--success-soft);
    color: var(--success);
}

/* ---------- Next match and prediction ---------- */

.eyebrow {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Match cards glow like a pitch under floodlights; their label takes the accent. */
.match-hero {
    text-align: center;
    background: var(--hero-bg);
    border-color: var(--hero-border);
}

.match-hero .eyebrow {
    color: var(--accent-label);
}

.fixture {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-3);
    /* Teams are centred in equal columns so they sit symmetrically around "vs", whatever the card's alignment. */
    text-align: center;
}

.fixture__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

/* Team flag (4:3 rectangle, slightly rounded) or initials in the same box */
.team-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 1.875rem;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
    /* A hairline keeps white flag edges (e.g. Poland, Japan) visible on a white card. */
    box-shadow: 0 0 0 1px var(--control-border);
}

.fixture .team-badge {
    width: 3.25rem;
    height: 2.4rem;
    border-radius: 6px;
}

.team-badge--initials {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Crests have all kinds of shapes and transparent backgrounds: shown whole, without the flag's hairline. */
.team-badge--crest {
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
}

.team-badge--small {
    width: 1.5rem;
    height: 1.125rem;
    border-radius: 3px;
    font-size: 0.6rem;
}

.fixture__vs {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fixture__score {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.last-result__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.fixture__time {
    font-variant-numeric: tabular-nums;
}

/* Sized to fit the narrowest phones (320px); roomier from 23rem (368px) up, where the bigger row still fits. */
.score-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.score-input__separator {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--muted);
}

/* − value + in one row, as on a scoreboard. */
.stepper {
    display: flex;
    align-items: center;
    gap: 2px;
}

.stepper__button {
    flex: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-small);
    background: var(--control);
    color: var(--text);
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.stepper__button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* No padding and a fixed box: iOS Safari pads inputs on its own, which clipped two-digit scores. */
.stepper__value {
    flex: none;
    width: 2.75rem;
    height: 3.5rem;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.stepper__value::-webkit-outer-spin-button,
.stepper__value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (min-width: 23rem) {
    .score-input {
        gap: var(--space-3);
    }

    .stepper {
        gap: var(--space-1);
    }

    .stepper__button {
        width: var(--tap);
        height: var(--tap);
    }

    .stepper__value {
        width: 3.5rem;
        font-size: 2.6rem;
    }
}

.stepper__value:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus);
}

.your-prediction strong {
    font-variant-numeric: tabular-nums;
}

/* ---------- Home page pitch ---------- */

/* The greeting and the next match share one pitch: a glow across the whole window that fades into the page,
   and markings within the content column that fade out halfway, so the prediction sits on plain turf. */
.pitch {
    position: relative;
    isolation: isolate;
}

.pitch::before {
    content: "";
    position: absolute;
    z-index: -2;
    /* From the header down, over the whole window width. */
    top: calc(-1 * var(--space-5));
    bottom: calc(-1 * var(--space-5));
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: var(--pitch-bg);
}

.pitch__lines {
    position: absolute;
    z-index: -1;
    top: calc(-1 * var(--space-5));
    left: calc(-1 * var(--space-4));
    width: calc(100% + 2 * var(--space-4));
    height: auto;
    fill: none;
    stroke: var(--pitch-line);
    stroke-width: 2;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 34%, transparent 58%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 34%, transparent 58%);
    pointer-events: none;
}

.match-pitch {
    text-align: center;
}

/* Two centred lines: what it is, then which competition. */
.match-pitch__heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.match-pitch__eyebrow {
    color: var(--accent-label);
}

.match-pitch__competition {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.15;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

/* Big flags or crests, smaller names, and the kick-off time between the teams instead of "vs". */
.fixture--pitch .fixture__team {
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}

.fixture--pitch .team-badge {
    width: 4.5rem;
    height: 3.375rem;
    border-radius: 8px;
    box-shadow: 0 0 0 1px var(--control-border), 0 10px 24px rgba(0, 0, 0, 0.25);
}

.fixture--pitch .team-badge--crest {
    box-shadow: none;
    border-radius: 0;
}

.fixture__kickoff {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.fixture__kickoff-time {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.fixture__kickoff-day {
    font-size: 0.8rem;
}

/* Controls on the pitch let the turf show through; the main button glows a little. */
.match-pitch .stepper__button,
.match-pitch .button--secondary {
    background: var(--glass);
}

.match-pitch .button:not(.button--secondary):not(.button--danger) {
    box-shadow: 0 10px 28px var(--accent-glow);
}

/* ---------- Carousel ---------- */

/* Slides in a row with native horizontal scrolling and snapping, so swiping works without script;
   carousel.js only scrolls to a slide for the arrows and dots. Slides are exactly one viewport wide. */
.carousel__viewport {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.carousel__viewport::-webkit-scrollbar {
    display: none;
}

.carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.carousel__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.carousel__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-small);
    background: var(--glass);
    color: var(--text);
    cursor: pointer;
}

.carousel__arrow:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent-label);
}

.carousel__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel__arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.carousel__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

/* A 24px target around an 8px dot. */
.carousel__dot {
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.carousel__dot::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--control-border);
    transition: background-color 0.15s, transform 0.15s;
}

.carousel__dot--current::after {
    background: var(--accent);
    transform: scale(1.35);
}

.carousel__counter {
    margin-top: calc(-1 * var(--space-2));
    font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
    .carousel__dot::after {
        transition: none;
    }
}

/* ---------- Admin navigation ---------- */

.admin-nav {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-1);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.admin-nav__link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: var(--radius-small);
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
}

.admin-nav__link:hover {
    color: var(--text);
}

.admin-nav__link--active,
.admin-nav__link--active:hover {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: var(--shadow);
}

.field-error {
    color: var(--danger);
    font-size: 0.9rem;
}

.alert--success {
    background: var(--success-soft);
    color: var(--success);
}

/* ---------- Matches (admin) ---------- */

/* Admin match list grouped by competition */
.match-group__title {
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.match-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.match-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
}

.match-card--past .match-card__info {
    opacity: 0.65;
}

.match-card__result {
    align-self: flex-start;
}

.result-editor {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.result-editor__score {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.4rem;
    font-weight: 700;
}

.result-editor__goals {
    width: 4.5rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.match-card--editing {
    gap: var(--space-4);
}

/* The competitions a match is in, shown on its card in the admin list */
.match-card__competitions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.competition-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.competition-chip .competition-logo {
    width: 1.1rem;
    height: 1.1rem;
}

.match-card__info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.match-card__teams {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.match-card__time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 36rem) {
    .match-card:not(.match-card--editing) {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-4);
    }
}

/* ---------- Users (admin) ---------- */

.copy-row {
    display: flex;
    gap: var(--space-2);
}

.copy-row .input {
    flex: 1;
}

.user-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.user-card {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow);
}

.user-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.user-card__name {
    font-weight: 650;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.user-card__meta {
    font-size: 0.9rem;
}

/* The participant editor spans the whole card, also in the two-column desktop layout. */
.participants-editor {
    grid-column: 1 / -1;
}

@media (min-width: 36rem) {
    .user-card {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .user-card__actions {
        grid-column: 2;
        grid-row: 1 / span 2;
        justify-content: flex-end;
    }
}

/* ---------- Blazor ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-3) var(--space-6) var(--space-3) var(--space-4);
    background: var(--danger-soft);
    color: var(--danger);
    border-top: 1px solid var(--border);
}

#blazor-error-ui .reload {
    color: inherit;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: var(--space-4);
    top: var(--space-3);
    cursor: pointer;
}

/* Everyone's predictions for a locked match */
.prediction-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-variant-numeric: tabular-nums;
    /* A table-like list: never inherit the centring of match cards. */
    text-align: left;
}

.prediction-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--border);
}

.prediction-list__item:last-child {
    border-bottom: none;
}

.prediction-list__item--me {
    background: var(--accent-soft);
    border-radius: var(--radius-small);
}

.prediction-list__name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Fixed-width columns so predictions and points line up from row to row. */
.prediction-list__score {
    flex: none;
    width: 5rem;
    text-align: right;
    white-space: nowrap;
}

.prediction-list__item .badge {
    flex: none;
    min-width: 2.75rem;
    text-align: center;
}

/* Competition page */
.section-title {
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.finished-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
}

.finished-match__date {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.finished-match__teams {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Name on the left, the team's goals on the right; the name column shrinks and wraps instead of pushing. */
.finished-match__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
}

.finished-match__team {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.finished-match__goals {
    min-width: 1.5rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.finished-match__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
}

.finished-match__mine {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
}

/* My competitions card on the home page */
.standing-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.standing-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.standing-list__item:last-child {
    border-bottom: none;
}

.standing-list__name {
    flex: 1 1 12rem;
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.standing-list__place {
    font-size: 0.9rem;
}

.standing-list__points {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Country select with a flag preview in the admin team form */
.country-picker {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.country-picker .input {
    flex: 1;
    min-width: 0;
}

/* Competition logos */
.competition-logo {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    vertical-align: middle;
}

.competition-logo--large {
    width: 2.75rem;
    height: 2.75rem;
}

.competition-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.standing-list__name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* Credits for the picture sources */
.site-footer {
    margin-top: var(--space-6);
    padding: var(--space-4) 0 var(--space-5);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8rem;
}

/* Only the vertical spacing of .container is replaced; its "margin: 0 auto" keeps the text centred on the page. */
.site-footer .container {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    text-align: center;
}

/* Links below the cards on the home page */
.home-actions {
    display: flex;
    justify-content: center;
}

.site-footer a {
    color: inherit;
}

/* Ranking */
.ranking {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.ranking th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--border);
}

.ranking td {
    padding: var(--space-3) var(--space-2);
    border-bottom: 1px solid var(--border);
}

.ranking tbody tr:last-child td {
    border-bottom: none;
}

.ranking__position {
    width: 2.5rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
}

.ranking__name {
    overflow-wrap: anywhere;
}

/* The place column, header included, is centred like the number columns. */
.ranking .ranking__position {
    text-align: center;
}

.ranking .ranking__number {
    width: 4rem;
    text-align: center;
}

.ranking abbr {
    text-decoration: none;
    cursor: help;
}

.ranking .ranking__number strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
}

/* Podium: the place number glows gold, silver or bronze; every other place stays neutral. */
.ranking__row--gold {
    --medal: #f5c542;
    --medal-glow: rgba(245, 197, 66, 0.28);
}

.ranking__row--silver {
    --medal: #d3dae3;
    --medal-glow: rgba(211, 218, 227, 0.22);
}

.ranking__row--bronze {
    --medal: #dd955c;
    --medal-glow: rgba(221, 149, 92, 0.24);
}

.ranking__row--gold .ranking__position,
.ranking__row--silver .ranking__position,
.ranking__row--bronze .ranking__position {
    color: var(--medal);
    text-shadow: 0 0 12px var(--medal-glow);
    /* Centred on the cell, as the place number is, so the number sits in the middle of its glow. */
    background-image: radial-gradient(circle at 50% 50%, var(--medal-glow) 0, transparent 1.4rem);
}

/* The "…" row of a shortened home page ranking */
.ranking__gap td {
    padding-top: var(--space-1);
    padding-bottom: var(--space-1);
    text-align: center;
    letter-spacing: 0.2em;
}

/* Competition name above each ranking in the home page carousel */
.ranking-slide__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.3rem;
    overflow-wrap: anywhere;
}

.ranking__row--me td {
    background: var(--accent-soft);
}

.ranking__row--me td:first-child {
    border-top-left-radius: var(--radius-small);
    border-bottom-left-radius: var(--radius-small);
}

.ranking__row--me td:last-child {
    border-top-right-radius: var(--radius-small);
    border-bottom-right-radius: var(--radius-small);
}

.blazor-error-boundary {
    padding: var(--space-4);
    border-radius: var(--radius-small);
    background: var(--danger-soft);
    color: var(--danger);
}

.blazor-error-boundary::after {
    content: "Wystąpił błąd.";
}
