/* Montserrat (SIL Open Font License, see fonts/montserrat-OFL.txt), the face of the logo: self-hosted, the policy refuses other font hosts. */
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-mGdvp09.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   La Bagarre — Design tokens
   ========================================================================== */
:root {
    /* Brand "Pansement de nuit": night-blue backgrounds, the beige of a sticking plaster as the only colour of the brand (the back-office goes neutral grey with a white accent) */
    --color-bg: #12161d;
    --color-bg-soft: #181d26;
    --color-surface: #212834;
    --color-surface-elevated: #2b3341;
    --color-surface-light: #f7f6f2;

    --color-accent: #f2d3ad;
    --color-accent-strong: #e8c296;
    --color-accent-soft: color-mix(in srgb, var(--color-accent) 16%, transparent);
    --color-on-accent: #2a1a0c;
    /* The ink of the brand (stamp, strips under titles, impact lines): the beige again, no second colour fights it. */
    --color-brand-ink: var(--color-accent);

    /* The bandages of the logo, drawn in the page (home, error pages). */
    --color-bandage: #f2d3ad;
    --color-bandage-pad: #e8c296;

    /* The main actions, outlined in beige: a beige fill looked switched off, a red one fought the beige around it. */
    --btn-primary-bg: transparent;
    --btn-primary-color: var(--color-accent);
    --btn-primary-border: var(--color-accent);
    --btn-primary-hover-bg: color-mix(in srgb, var(--color-accent) 16%, transparent);

    --color-text: #eef1f5;
    --color-text-muted: #9ea7b5;
    --color-text-on-light: #1b1f27;
    --color-text-muted-on-light: #5d6573;

    --color-border: rgba(238, 241, 245, 0.08);
    --color-border-strong: rgba(238, 241, 245, 0.16);

    --color-success: #7cc9a6;
    --color-warning: #f2d04c;
    --color-danger: #f0604d;
    --color-info: #86b9e3;
    --color-discord: #8a95f7;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 18px;
    --radius-full: 999px;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(5, 7, 10, 0.35);
    --shadow-md: 0 12px 28px -12px rgba(5, 7, 10, 0.55);
    --shadow-lg: 0 24px 56px -20px rgba(5, 7, 10, 0.65);
    --shadow-drop: rgba(5, 7, 10, 0.55);

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;

    /* Motion */
    --transition-fast: 150ms ease;
    --transition-base: 220ms ease;

    /* Type */
    --font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    /* An anchor lands below the sticky navbar, not under it. */
    scroll-padding-top: 6rem;
}

/* ==========================================================================
   Light theme — chosen with the button of the navbar, kept in the browser (theme_controller.js)
   ========================================================================== */
/* Paper instead of the night; the beige cannot be read on it, so the accent turns to a burnt orange, lively against the paper. */
:root[data-theme="light"] {
    color-scheme: light;

    --color-bg: #fbfaf8;
    --color-bg-soft: #f8f6f3;
    --color-surface: #ffffff;
    --color-surface-elevated: #fdfcfb;

    --color-accent: #c2410c;
    --color-accent-strong: #9a3412;
    --color-accent-soft: color-mix(in srgb, var(--color-accent) 6%, transparent);
    --color-on-accent: #ffffff;

    /* A deeper tan, edged in brown, so that the bandages stand out on the paper. */
    --color-bandage: #ebc193;
    --color-bandage-pad: #d9a971;
    --color-bandage-edge: rgba(120, 72, 30, 0.45);

    --color-text: #1b1f27;
    --color-text-muted: #5d6573;

    --color-border: rgba(27, 31, 39, 0.1);
    --color-border-strong: rgba(27, 31, 39, 0.2);

    --color-success: #1f8a5b;
    --color-warning: #9a6b00;
    --color-danger: #c8382a;
    --color-info: #2a6aa3;
    --color-discord: #4752c4;

    --shadow-sm: 0 1px 2px rgba(60, 45, 30, 0.08);
    --shadow-md: 0 12px 28px -12px rgba(60, 45, 30, 0.2);
    --shadow-lg: 0 24px 56px -20px rgba(60, 45, 30, 0.25);
    --shadow-drop: rgba(60, 45, 30, 0.28);
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-2);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 var(--space-3); }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

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

/* ==========================================================================
   Layout
   ========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.main-content {
    flex: 1;
    padding: var(--space-8) 0 var(--space-16);
}

@media (max-width: 640px) {
    .main-content { padding: var(--space-6) 0 var(--space-12); }
    .landing-hero { margin-top: calc(-1 * var(--space-6)); }
}

/* Division format builder */
.format-empty,
.format-form {
    max-width: 760px;
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
}

.format-empty h2 { margin-top: var(--space-2); }
.format-empty .btn { margin-top: var(--space-3); }
.format-divisions-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-8); font-size: 0.88rem; }
.format-copy {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}
.format-copy .btn { margin-top: 0; }

.format-timeline {
    width: 100%;
    max-width: 820px;
}

.format-phase {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: var(--space-4);
}

.format-phase:not(:last-child)::before {
    position: absolute;
    top: 40px;
    bottom: -8px;
    left: 19px;
    width: 2px;
    background: var(--color-border-strong);
    content: '';
}

.format-phase-marker {
    z-index: 1;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-weight: 800;
}

.format-phase-card {
    min-width: 0;
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.format-phase-heading,
.format-qualification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.format-phase-heading { align-items: flex-start; margin-bottom: var(--space-3); }
.format-phase-heading .page-eyebrow { display: block; }
.format-phase-heading h2 { margin: 0; overflow-wrap: anywhere; }
.format-phase-type { margin-bottom: var(--space-1); font-weight: 700; }
.format-phase-summary { margin-bottom: var(--space-2); color: var(--color-text-muted); }
.format-phase-card .text-muted { margin-bottom: 0; font-size: 0.9rem; }
.format-qualification {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: var(--space-6) 0 var(--space-4);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 700;
}

.format-action-note { margin: 0 0 var(--space-3); font-weight: 700; }
.format-action-note + .btn { margin-bottom: var(--space-2); }
.format-phase-actions { margin-top: var(--space-6); }
.format-qualification ~ .format-phase-actions,
.format-action-note ~ .format-phase-actions { margin-top: var(--space-4); }
.format-add { margin-left: 56px; }
.format-terminal { margin-left: 56px; }
.format-scoring { grid-column: 1 / -1; }
.format-scoring h2 { font-size: 1.1rem; }
.format-scoring { display: grid; gap: var(--space-3); }
.format-scoring h2, .format-scoring > p { margin: 0; }
.format-scoring-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-4); }
.format-scoring-group { margin: var(--space-4) 0 var(--space-2); font-size: 0.95rem; }
.scoring-preview table { font-variant-numeric: tabular-nums; }
.scoring-preview caption { padding: var(--space-3) var(--space-3) var(--space-1); text-align: left; color: var(--color-text-muted); font-size: 0.85rem; font-weight: 600; }
.scoring-preview th, .scoring-preview td { padding: var(--space-2) var(--space-3); text-align: left; }
.scoring-preview td:nth-child(2), .scoring-preview td:nth-child(3) { font-weight: 700; }
.scoring-preview tr.is-special th, .scoring-preview tr.is-special td { border-top: 1px solid var(--color-border-strong); }
.scoring-preview-note { color: var(--color-warning, var(--color-danger)); font-size: 0.82rem; }
.format-advanced { margin-top: var(--space-3); }
.format-advanced summary { width: fit-content; color: var(--color-info); cursor: pointer; }
.format-advanced .form-grid { margin-top: var(--space-3); }
.format-qualification-preview { grid-column: 1 / -1; }
/* A league phase: its two settings as items of the grid, explained below. */
.format-league { display: contents; }
.format-league-explain { grid-column: 1 / -1; margin: 0; }
.settings-helper { grid-column: 1 / -1; display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md, 10px); background: var(--color-bg-soft); }
.settings-helper-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.settings-helper-head h3 { margin: 0; font-size: 1rem; }
.settings-helper .settings-helper-count { display: flex; margin: 0; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: 400; }
.settings-helper .settings-helper-count input[type="number"] { width: 5.5rem; flex: none; margin: 0; }
.settings-helper-note { margin: 0; }
.settings-helper-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.settings-helper-option { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.settings-helper-option > span:first-child { flex: 1 1 16rem; min-width: 0; }
.settings-helper-option.is-recommended { border-color: var(--color-accent); background: var(--color-accent-soft); }
.settings-helper-option.is-current { border-style: dashed; }
.settings-helper-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.settings-helper-tag { padding: 1px var(--space-2); border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--color-surface); color: var(--color-text-muted); }
.settings-helper-tag.is-recommended { background: var(--color-accent); color: var(--color-bg); }
.settings-helper-tag.is-exact { color: var(--color-success, var(--color-text)); }
.settings-helper-inputs { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.settings-helper-option > span:first-child { display: grid; gap: 2px; }
.settings-helper-detail { color: var(--color-text-muted); font-size: 0.82rem; }
.settings-helper-current { color: var(--color-text-muted); font-size: 0.85rem; }
.format-type-form { max-width: 760px; }
.format-type-form fieldset { margin: 0 0 var(--space-6); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.format-type-form legend { padding: 0 var(--space-2); color: var(--color-text-muted); font-size: 0.78rem; font-weight: 800; }
.format-choice { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); border-bottom: 1px solid var(--color-border); cursor: pointer; }
.format-choice:last-child { border-bottom: 0; }
.format-choice input { width: auto; margin-top: 5px; accent-color: var(--color-accent); }
.format-choice > span { display: grid; gap: var(--space-1); }
.format-choice-description,
.format-choice small { color: var(--color-text-muted); }
.format-choice small { font-size: 0.72rem; }
.format-type-form .btn-group { margin-top: var(--space-4); }

@media (max-width: 640px) {
    .format-phase { grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-2); }
    .format-phase-marker { width: 32px; height: 32px; }
    .format-phase:not(:last-child)::before { top: 32px; left: 15px; }
    .format-phase-card { padding: var(--space-4); }
    .format-phase-heading { align-items: flex-start; }
    .format-phase-heading .badge { flex: none; }
    .format-add,
    .format-terminal { margin-left: 40px; }
    .format-phase-actions .btn { white-space: normal; }
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--color-bg-soft) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

/* The name as under the logo: wide capitals. */
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.14em; text-transform: uppercase; }

.brand-symbol {
    width: 32px;
    height: 32px;
    flex: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-link {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

/* The current page: a short accent bar under the label, rather than a filled block. */
.nav-link { position: relative; }
.nav-link.is-active { color: var(--color-text); }
.nav-link.is-active::after {
    content: '';
    position: absolute;
    right: var(--space-3);
    bottom: -2px;
    left: var(--space-3);
    height: 2px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
}

/* On the right, the navigation of the side one is on, then the account: the left tells where one is. */
.nav-primary {
    display: flex;
    align-items: center;
    gap: var(--space-5, 20px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Site · Admin, beside the logo: the side an administrator is on, the other one a click away. Text, not a control. */
.navbar-start { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.area-switch { display: inline-flex; align-items: center; gap: var(--space-3); padding-left: var(--space-4); border-left: 1px solid var(--color-border-strong); }
/* A little more room above than below its underline: its small capitals sit on the line of the name. */
.area-switch-item { padding: 4px 0 0; border-bottom: 2px solid transparent; color: var(--color-text-muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-decoration: none; text-transform: uppercase; transition: color var(--transition-fast), border-color var(--transition-fast); }
.area-switch-item:hover { color: var(--color-text); }
.area-switch-item.is-active { border-bottom-color: var(--color-accent); color: var(--color-text); }
@media (max-width: 420px) {
    /* On a small phone, the logo alone beside the switch. */
    .navbar-start:has(.area-switch) .brand-name { display: none; }
}

/* Account menu: a pill (avatar, name, chevron) opening a small panel. */
.user-menu { position: relative; }
.user-menu-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 3px var(--space-3) 3px 3px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.user-menu-button:hover,
.user-menu.is-open .user-menu-button { border-color: var(--color-accent); background: var(--color-surface-elevated); }
.user-menu-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.user-menu-chevron { width: 14px; height: 14px; color: var(--color-text-muted); transition: transform var(--transition-fast); }
.user-menu.is-open .user-menu-chevron { transform: rotate(180deg); }
.user-menu-panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    display: none;
    min-width: 240px;
    padding: var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    box-shadow: var(--shadow-lg);
}
.user-menu.is-open .user-menu-panel { display: grid; gap: 2px; }
.user-menu-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-1); padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--color-border); }
.user-menu-head .nav-avatar { width: 36px; height: 36px; font-size: 0.95rem; }
.user-menu-head span { display: grid; min-width: 0; }
.user-menu-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head small { color: var(--color-text-muted); font-size: 0.8rem; }
.user-menu-item { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.9rem; font-weight: 600; }
.user-menu-item:hover { background: var(--color-surface); color: var(--color-text); }
.user-menu-item.is-danger { color: var(--color-danger); }
.user-menu-item.is-danger:hover { background: color-mix(in srgb, var(--color-danger) 10%, transparent); color: var(--color-danger); }
.user-menu-logout { display: contents; }
button.user-menu-item { width: 100%; border: 0; background: none; font: inherit; font-size: 0.9rem; font-weight: 600; text-align: left; cursor: pointer; }
.nav-avatar {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 800;
    object-fit: cover;
}

.nav-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.nav-burger svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
    .nav-primary { display: none; }

    .nav-burger { display: inline-flex; }

    .navbar.is-open .nav-primary {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-1);
        padding: var(--space-3) var(--space-4) var(--space-4);
        background: var(--color-bg-soft);
        border-bottom: 1px solid var(--color-border);
    }

    .navbar.is-open .nav-links,
    .navbar.is-open .nav-actions {
        flex-direction: column;
        align-items: stretch;
    }

    /* In the burger panel, the account block is laid out directly: no dropdown inside a dropdown. */
    .navbar.is-open .nav-actions { padding-top: var(--space-2); border-top: 1px solid var(--color-border); }
    .user-menu-button { display: none; }
    .user-menu-panel,
    .user-menu.is-open .user-menu-panel { position: static; display: grid; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; box-shadow: none; }
    .nav-link.is-active { background: var(--color-surface); }
    .nav-link.is-active::after { display: none; }
}

/* ==========================================================================
   Admin area — distinct palette so the back-office never looks like the public site
   ========================================================================== */
.admin-area {
    /* The back-office is a workshop: neutral greys without a tint, a white accent, a lighter navbar. Colour stays for the states. */
    --color-bg: #141415;
    --color-bg-soft: #1b1b1d;
    --color-surface: #232325;
    --color-surface-elevated: #2d2d30;
    --color-text-muted: #a3a3a8;
    --color-accent: #e9e9ec;
    --color-accent-strong: #ffffff;
    --color-accent-soft: color-mix(in srgb, var(--color-accent) 12%, transparent);
    --color-on-accent: #161617;
    --btn-primary-bg: var(--color-accent);
    --btn-primary-color: var(--color-on-accent);
    --btn-primary-border: transparent;
    --btn-primary-hover-bg: var(--color-accent-strong);
}

:root[data-theme="light"] .admin-area {
    --color-bg: #f2f2f3;
    --color-bg-soft: #e9e9eb;
    --color-surface: #ffffff;
    --color-surface-elevated: #f7f7f8;
    --color-text-muted: #5f5f66;
    --color-accent: #1d1d20;
    --color-accent-strong: #000000;
    --color-on-accent: #ffffff;
}

.admin-area .navbar {
    background: var(--color-surface-elevated);
    border-top: 3px solid var(--color-accent);
    border-bottom-color: var(--color-border-strong);
}

/* ==========================================================================
   Competition status timeline (cockpit)
   ========================================================================== */
.status-timeline {
    display: grid;
    /* One column per step: four when a competition has no registration step. */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.status-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-right: var(--space-4);
}

/* connector line towards the next step */
.status-step:not(:last-child)::after {
    position: absolute;
    top: 17px;
    left: 44px;
    right: 8px;
    height: 2px;
    background: var(--color-border-strong);
    content: '';
}

.status-step.is-done:not(:last-child)::after { background: var(--color-accent); }

.status-step-marker {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 2px solid var(--color-border-strong);
    border-radius: 50%;
    background: var(--color-bg-soft);
    color: var(--color-text-muted);
    font-weight: 800;
}

.status-step.is-done .status-step-marker {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.status-step.is-current .status-step-marker {
    border-color: var(--color-accent);
    color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.status-step-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.status-step-label { font-weight: 700; color: var(--color-text-muted); }
.status-step.is-done .status-step-label,
.status-step.is-current .status-step-label { color: var(--color-text); }
.status-step.is-current .status-step-label { color: var(--color-accent); }
.status-step-meta { color: var(--color-text-muted); font-size: 0.82rem; }
.status-step-body form { margin-top: var(--space-2); }
.status-step-body .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.next-step-blockers {
    display: grid;
    gap: var(--space-3);
    justify-items: start;
    margin-top: var(--space-4);
    padding: var(--space-4) var(--space-6);
    border: 1px solid color-mix(in srgb, var(--color-warning) 30%, transparent);
    border-left: 4px solid var(--color-warning);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-warning) 6%, transparent);
}

.next-step-blockers-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    color: var(--color-warning);
    font-weight: 700;
}

.next-step-blockers-list { display: grid; gap: var(--space-2); width: 100%; }
.next-step-blocker-action { display: flex; align-items: center; gap: var(--space-3); }
.next-step-blocker-action .text-muted { font-size: 0.85rem; }

.next-step-blockers-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--color-bg-soft);
    color: var(--color-text);
}

@media (max-width: 900px) {
    .status-timeline { grid-auto-flow: row; grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-4); }
    .status-step { flex-direction: row; padding-right: 0; }
    .status-step:not(:last-child)::after { top: 40px; bottom: calc(-1 * var(--space-4) + 4px); left: 17px; right: auto; width: 2px; height: auto; }
    .status-step-body { padding-top: 6px; }
}

/* ==========================================================================
   Division progress (cockpit): every phase of a division and where it stands
   ========================================================================== */
.division-progress-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.division-progress { display: flex; flex-direction: column; gap: var(--space-4); }
.division-progress > .btn { align-self: flex-start; }
.division-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.division-progress-heading h3 { margin: 0; }
.division-progress-heading .text-muted { font-size: 0.88rem; }

.stage-progress { display: grid; gap: var(--space-4); }

.stage-progress-step {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: var(--space-3);
}

.stage-progress-step:not(:last-child)::before {
    position: absolute;
    top: 30px;
    bottom: calc(-1 * var(--space-4) + 2px);
    left: 13px;
    width: 2px;
    background: var(--color-border-strong);
    content: '';
}

.stage-progress-step.is-done:not(:last-child)::before { background: var(--color-accent); }

.stage-progress-marker {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 2px solid var(--color-border-strong);
    border-radius: 50%;
    background: var(--color-bg-soft);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.stage-progress-step.is-done .stage-progress-marker { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-on-accent); }
.stage-progress-step.is-current .stage-progress-marker { border-color: var(--color-accent); color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.stage-progress-step.is-upcoming .stage-progress-body strong { color: var(--color-text-muted); }

.stage-progress-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 3px; }
.stage-progress-body .text-muted { font-size: 0.85rem; }
.stage-progress-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.stage-progress-qualification { margin-top: var(--space-1); color: var(--color-text); font-size: 0.82rem; font-weight: 700; }

/* ==========================================================================
   Stage setup (choose participants, check settings, mark ready)
   ========================================================================== */
.stage-setup { display: grid; gap: var(--space-4); max-width: 820px; }
.stage-setup-intro { max-width: 820px; color: var(--color-text-muted); }
.stage-setup-step { display: grid; gap: var(--space-4); max-width: 820px; }
.stage-setup-step p { margin: 0; }
.stage-setup-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.stage-setup-heading h2 { display: flex; align-items: center; gap: var(--space-3); margin: 0; font-size: 1.15rem; }

.stage-setup-number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 800;
}

.stage-setup-participants {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-2);
}

/* A league phase (US 055): its pots side by side, and each player's opponents tagged with their pot. */
.league-pots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }
.league-pot h3 { margin: 0 0 var(--space-2); font-size: 1rem; }
.league-pot ol { margin: 0; padding-left: var(--space-6); display: grid; gap: var(--space-1); }
.league-opponents td { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.league-opponents th[scope="row"] { white-space: nowrap; }
.league-opponent { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); white-space: nowrap; }
.league-exact { margin: var(--space-3) 0 0; }
.league-exact.is-exact { color: var(--color-success); }
.league-pot-tag {
    display: inline-grid;
    place-items: center;
    min-width: 1.4em;
    height: 1.4em;
    border-radius: 999px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 800;
}

/* The setup checklist of a competition (US 056), on its cockpit until it starts. */
.setup { display: grid; gap: var(--space-4); }
.setup-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.setup-heading h2 { margin: 0; }
.setup-progress { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text-muted); font-size: 0.9rem; }
.setup-progress progress { width: 140px; height: 8px; accent-color: var(--color-accent); }
/* Stacked: the needed steps in red, the advised ones stay quiet, on two columns. */
.setup-group-block { display: grid; gap: var(--space-2); min-width: 0; padding-left: var(--space-3); border-left: 3px solid var(--color-danger); }
.setup-group-block--recommended { margin-top: var(--space-4); border-left-style: dashed; border-left-color: var(--color-border-strong); }
.setup-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: 0; color: var(--color-text-muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.setup-group-block--required .setup-group { color: var(--color-danger); }
.setup-group-count { padding: 1px var(--space-2); border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 0.72rem; letter-spacing: 0.02em; text-transform: none; }
.setup-group-count.is-clear { background: var(--color-success); color: var(--color-bg); }
.setup-group-hint { font-weight: 500; letter-spacing: 0.02em; text-transform: none; }
.setup-list { margin: 0; padding: 0; list-style: none; display: grid; }
.setup-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.setup-item:last-child { border-bottom: 0; }
.setup-list--grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); column-gap: var(--space-6); }
.setup-list--grid .setup-item:last-child { border-bottom: 1px solid var(--color-border); }
/* Done or later: pills on one line, under the to-do lines. */
.setup-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-1) 0 0; list-style: none; font-size: 0.82rem; }
.setup-chip, .setup-chip:last-child { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2) 2px 3px; border: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); border-radius: 999px; color: var(--color-text-muted); }
.setup-chip.is-waiting { padding-left: var(--space-2); border-style: dashed; border-color: var(--color-border-strong); color: var(--color-text); opacity: 1; }
.setup-chip a { color: inherit; text-decoration: none; }
.setup-chip a:hover { color: var(--color-text); text-decoration: underline; }
.setup-chip .setup-item-mark { width: 1rem; height: 1rem; font-size: 0.6rem; }
.setup-chips-label { margin-left: var(--space-2); color: var(--color-text-muted); font-style: italic; }
.setup-chips-label:first-child { margin-left: 0; }
.setup-item-mark { display: inline-grid; place-items: center; flex: none; width: 1.15rem; height: 1.15rem; border: 2px solid var(--color-border-strong); border-radius: 50%; font-size: 0.7rem; font-weight: 800; }
.setup-group-block--required .setup-item:not(.is-done, .is-waiting) .setup-item-mark { border-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 14%, transparent); }
.setup-group-block--required .setup-item:not(.is-done, .is-waiting) .setup-item-body strong { font-weight: 700; }
.setup-group-block--recommended .setup-item-body strong { font-weight: 500; }
.setup-item.is-done .setup-item-mark { border-color: var(--color-success); background: var(--color-success); color: var(--color-bg); }
.setup-item.is-done .setup-item-body strong { color: var(--color-text-muted); font-weight: 500; }
.setup-item.is-waiting { opacity: 0.6; }
.setup-item.is-waiting .setup-item-mark { border-style: dashed; }
.setup-item-later { color: var(--color-text-muted); font-size: 0.8rem; font-style: italic; }
.setup-item-body { display: grid; flex: 1 1 12rem; min-width: 0; font-size: 0.92rem; }
.setup-item-detail { color: var(--color-text-muted); font-size: 0.8rem; line-height: 1.35; }
.setup-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.setup-item-actions form { margin: 0; }
.setup-dismissed { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 0.85rem; }
.setup-dismissed form { margin: 0; }
.setup-dismissed-item { padding: 2px var(--space-2); border: 1px dashed var(--color-border-strong); border-radius: 999px; background: none; color: var(--color-text-muted); font: inherit; cursor: pointer; }
.setup-dismissed-item:hover { color: var(--color-text); border-color: var(--color-text-muted); }

.stage-setup-participant {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-soft);
    font-weight: 600;
    cursor: pointer;
}

.stage-setup-participant:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.stage-setup-participant input { accent-color: var(--color-accent); }
.stage-setup-participant.is-awaiting { border-style: dashed; background: transparent; color: var(--color-text-muted); }
.stage-setup-participant-note { color: var(--color-warning); font-size: 0.8rem; font-weight: 600; }
.stage-setup-participant.is-absent { border-color: color-mix(in srgb, var(--color-danger) 35%, transparent); background: color-mix(in srgb, var(--color-danger) 8%, transparent); color: var(--color-text-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--color-danger) 60%, transparent); }

/* Group stage: groups side by side, with their members (and a move control while the phase is a draft). */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}
.group-card h3 { font-size: 1rem; }
.group-members { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.group-members li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.group-move { display: flex; gap: var(--space-1); }
.group-move select { width: auto; padding: 2px var(--space-2); font-size: 0.85rem; }
.group-unassigned { margin-top: var(--space-3); }
.group-qualified { margin: 0; padding-left: var(--space-6); }
.group-standings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-4); }
.format-group-summary { margin: var(--space-2) 0 0; color: var(--color-text); font-weight: 700; }

.stage-setup-absents {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-danger) 5%, transparent);
}
.stage-setup-absents strong { color: var(--color-danger); }
.stage-setup-absents p { color: var(--color-text-muted); font-size: 0.9rem; }

.stage-setup-settings { display: grid; gap: var(--space-2); }
.stage-setup-settings li { display: flex; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); }
.stage-setup-settings li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ==========================================================================
   Live stage (cockpit): current round, its matches and the next action
   ========================================================================== */
turbo-frame { display: block; }
.live-stage { display: grid; gap: var(--space-4); }
.round-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.round-nav-item {
    display: grid;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--space-2);
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-weight: 700;
    text-decoration: none;
}
.round-nav-item:hover { border-color: var(--color-accent); color: var(--color-text); }
.round-nav-item.is-completed { color: var(--color-success); }
.round-nav-item.is-selected { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }
.round-nav.is-labelled .round-nav-item { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); font-size: 0.85rem; }
.round-nav-count { display: inline-grid; min-width: 18px; height: 18px; padding: 0 4px; place-items: center; border-radius: var(--radius-full); background: var(--color-accent); color: var(--color-on-accent); font-size: 0.72rem; }
.live-stage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.live-stage-heading h3 { margin: 0; }
.live-stage-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.live-stage-meta .text-muted { font-size: 0.88rem; }

.live-stage-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
    background: var(--color-accent-soft);
}
.live-stage-action p { margin: 0; }

/* Rows share the list's columns (subgrid) so "vs" and the actions line up from one match to the next. */
.live-matches {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap: var(--space-2) 0;
}

.live-match-group {
    grid-column: 1 / -1;
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.live-match {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-soft);
}
.live-match.is-completed { opacity: 0.8; }
.live-match-player { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.live-match-player.is-right { text-align: right; }
.live-match-player.is-winner { color: var(--color-text); }
.live-match-score { min-width: 56px; color: var(--color-text-muted); font-weight: 800; text-align: center; }
.live-match-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
/* A line that leads somewhere is a link as a whole: the result form of the player's own match, the detail of a played one. */
.live-match.is-linked { position: relative; }
.live-match.is-linked:hover { border-color: var(--color-border-strong); }
.live-match.is-reportable { border-color: var(--color-accent); }
.live-match.is-reportable:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.live-match-link { color: inherit; text-decoration: none; }
.live-match-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
/* The quick report sits above the link of the whole line. */
.live-match-quick { position: relative; z-index: 1; white-space: nowrap; text-decoration: none; }

@media (max-width: 640px) {
    .live-matches { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .live-match-actions { grid-column: 1 / -1; justify-content: space-between; }
}

/* ==========================================================================
   Match result form: "Player A [2] – [1] Player B"
   ========================================================================== */
.match-result { max-width: 720px; }
.match-result form { display: grid; gap: var(--space-6); }
.match-result [hidden] { display: none !important; }

.match-result-types { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; border: 0; }

.match-result-type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-full);
    background: var(--color-bg-soft);
    font-weight: 600;
    cursor: pointer;
}
.match-result-type input { accent-color: var(--color-accent); }
.match-result-type:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }

.match-score {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
}

.match-score-player { margin: 0; overflow-wrap: anywhere; font-size: 1.15rem; font-weight: 800; }
.match-score-player.is-a { text-align: right; }
.match-score-player.is-b { text-align: left; }

.match-score .match-score-input {
    width: 4.5rem;
    padding: var(--space-3) var(--space-2);
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
}

.match-score-separator { color: var(--color-text-muted); font-size: 1.6rem; font-weight: 800; }

.match-result-winner { margin: 0; padding: 0; border: 0; }
.match-result-winner legend { margin-bottom: var(--space-3); font-weight: 700; }
.match-result-actions { display: flex; justify-content: flex-end; }

/* With a Map Pool: the score first, then the optional detail, one vertical block per map. */
.match-result-heading { margin: 0 0 calc(-1 * var(--space-3)); padding: 0; font-size: 1rem; font-weight: 700; }
.match-maps { display: grid; gap: var(--space-3); margin: 0; padding: 0; border: 0; }
.match-maps legend:not(.sr-only) { float: left; width: 100%; margin-bottom: var(--space-3); }
.match-maps legend .text-muted { font-weight: 400; }
.match-maps > .btn { justify-self: start; }
.match-maps-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.match-map {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
}
.match-map-number { margin: 0; color: var(--color-text-muted); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.match-map-winner { display: flex; grid-column: 2; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.match-map-winner .text-muted { font-size: 0.85rem; }
.match-map-winner .match-result-type { padding: var(--space-1) var(--space-3); }

/* The Map Pool on the public overview of a competition. */
/* The copy button sits over the summary's right end, outside it: copying neither folds nor unfolds the pool. */
.map-pool { position: relative; }
.map-pool-copy { position: absolute; top: var(--space-6); right: var(--space-6); }
.map-pool-heading { display: grid; gap: var(--space-1); padding-right: 6rem; cursor: pointer; list-style: none; }
.map-pool-heading::-webkit-details-marker { display: none; }
.map-pool-heading h2 { display: flex; align-items: center; gap: var(--space-2); }
.map-pool-heading h2::before { content: ""; width: 0.5em; height: 0.5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--transition-fast); }
.map-pool-details[open] .map-pool-heading h2::before { transform: rotate(45deg); }
.map-pool-details[open] .map-pool-heading { margin-bottom: var(--space-3); }
.map-pool-details[open] .map-pool-codes { display: none; }
.map-pool-count { padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--color-bg-soft); color: var(--color-text-muted); font-size: 0.8rem; font-weight: 700; }
.map-pool-codes { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.03em; }
@media (prefers-reduced-motion: reduce) { .map-pool-heading h2::before { transition: none; } }
.map-pool h2 { margin: 0; font-size: 1.1rem; }
.map-pool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
/* A card per map, as in the veto: its minimap, then its abbreviation and name. */
.map-pool-list li {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    font-weight: 600;
}
.map-pool-name { overflow-wrap: anywhere; }
.map-pool-list strong { color: var(--color-text); font-weight: 800; letter-spacing: 0.03em; }
.map-pool-list .text-muted { font-size: 0.85rem; font-weight: 500; }
/* On a phone, three maps a row: the minimaps stay readable, the pool takes a third of the height. */
@media (max-width: 560px) {
    .map-pool-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
    .map-pool-list li { padding: var(--space-1); gap: var(--space-1); font-size: 0.8rem; }
    .map-pool-list .text-muted { display: block; font-size: 0.72rem; }
}

/* The result of a match: score line, then the maps played. */
.match-detail { display: grid; gap: var(--space-4); }

/* The maps played as a scoreboard: one line per map, a check in the winner's column. */
.match-detail-maps { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.match-detail-maps th,
.match-detail-maps td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); }
.match-detail-maps tbody tr:last-child > * { border-bottom: 0; }
.match-detail-maps thead th { color: var(--color-text-muted); font-size: 0.75rem; font-weight: 700; text-align: center; }
.match-detail-maps thead th:first-child,
.match-detail-maps tbody th { text-align: left; }
.match-detail-maps tbody th { font-weight: 500; }
.match-detail-maps td { width: 6.5rem; text-align: center; }
.match-detail-maps td.is-won span {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: var(--radius-full);
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-weight: 800;
}
.match-detail-map-short { display: inline-block; min-width: 2.6rem; margin-right: var(--space-2); color: var(--color-text); font-weight: 800; }

@media (max-width: 560px) {
    .match-detail-maps th,
    .match-detail-maps td { padding: var(--space-2); }
    .match-detail-maps td { width: 4.5rem; }
    .match-detail-map-short { min-width: 0; }
}

/* ==========================================================================
   Dialog: content loaded into its "modal" Turbo Frame (see base.html.twig)
   ========================================================================== */
.modal {
    width: min(560px, calc(100vw - 2 * var(--space-4)));
    max-height: calc(100dvh - 2 * var(--space-4));
    padding: var(--space-6);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: inherit;
    box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(5, 7, 10, 0.7); backdrop-filter: blur(2px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.modal-header h2 { margin: var(--space-1) 0; }
.modal-header p { margin: 0; font-size: 0.9rem; }
.modal-close {
    display: inline-flex;
    flex: none;
    padding: var(--space-2);
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}
.modal-close:hover { background: var(--color-bg-soft); color: inherit; }
.modal-close svg { width: 20px; height: 20px; }

@media (max-width: 560px) {
    .modal { padding: var(--space-4); }
    .match-map { grid-template-columns: minmax(0, 1fr); }
    .match-map-winner { grid-column: 1; }
    /* Names on the first row, each score under its player's name: placed one by one, not left to the auto-flow. */
    .match-score { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); row-gap: var(--space-2); }
    .match-score-player.is-a { grid-column: 1; grid-row: 1; text-align: left; }
    .match-score-player.is-b { grid-column: 3; grid-row: 1; text-align: right; }
    .match-score .match-score-input { width: 100%; grid-row: 2; }
    .match-score .match-score-input.is-a { grid-column: 1; }
    .match-score-separator { grid-column: 2; grid-row: 2; }
    .match-score .match-score-input.is-b { grid-column: 3; }
}

/* ==========================================================================
   Swiss round pairings editor
   ========================================================================== */
.pairings { display: grid; gap: var(--space-4); max-width: 760px; }
.pairings [hidden] { display: none !important; }
.pairings-list { display: grid; gap: var(--space-2); }

.pairings-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-soft);
}

.pairings-number { color: var(--color-text-muted); font-weight: 800; text-align: center; }
.pairings-versus { color: var(--color-text-muted); font-weight: 800; text-transform: uppercase; font-size: 0.8rem; }
.pairings-bye { color: var(--color-info); font-size: 0.88rem; font-weight: 600; }
.pairings-status { min-height: 1.4em; margin: 0; color: var(--color-text-muted); font-size: 0.88rem; }

.pairings-slot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: grab;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), opacity var(--transition-fast);
}
.pairings-slot:hover { border-color: var(--color-accent); }
.pairings-slot:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.pairings-slot.is-dragging { opacity: 0.4; }
.pairings-slot.is-drop-target { border-style: dashed; border-color: var(--color-accent); background: var(--color-accent-soft); }
.pairings-slot.is-picked { border-color: var(--color-accent); background: var(--color-accent-soft); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.pairings-slot.is-swapped { animation: pairings-swapped 900ms ease; }
.pairings-handle { color: var(--color-text-muted); }
.pairings-player { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.pairings-seed { color: var(--color-text-muted); font-size: 0.8rem; }
.pairings-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes pairings-swapped {
    from { background: var(--color-accent-soft); border-color: var(--color-accent); }
    to { background: var(--color-surface); }
}

@media (max-width: 560px) {
    .pairings-row { grid-template-columns: 28px minmax(0, 1fr); }
    .pairings-versus { grid-column: 2; }
    .pairings-row > .pairings-slot:last-child,
    .pairings-bye { grid-column: 2; }
}

/* ==========================================================================
   Public competition pages: header, my participation, course, overview blocks
   ========================================================================== */
.competition-header h1 { margin: var(--space-2) 0; }
.competition-header-status { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.competition-header-summary { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; color: var(--color-text); font-weight: 600; }
.competition-header-summary > span + span::before { content: '·'; margin-right: var(--space-4); color: var(--color-text-muted); }

.my-participation { display: grid; gap: var(--space-4); border-color: color-mix(in srgb, var(--color-accent) 25%, transparent); }
.my-participation h2 { margin: 0; }
.my-participation-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); }
.my-next-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
    background: var(--color-accent-soft);
}
.my-next-match > div { display: grid; gap: 2px; }
.my-next-match .badge { justify-self: start; }
.my-next-match strong { font-size: 1.1rem; }
.my-next-match.is-warning { border-left-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 8%, transparent); }

.overview-division > h2 { margin-bottom: var(--space-4); }

.phase-track {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}
.phase-track-step {
    display: flex;
    flex: 1 1 220px;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.phase-track-step.is-current { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.phase-track-step.is-upcoming { opacity: 0.75; }
.phase-track-marker {
    display: grid;
    flex: none;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 2px solid var(--color-border-strong);
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 800;
}
.phase-track-step.is-current .phase-track-marker { border-color: var(--color-accent); color: var(--color-accent); }
.phase-track-step.is-done .phase-track-marker { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-on-accent); }
.phase-track-body { display: grid; gap: 2px; min-width: 0; }
.phase-track-body .text-muted { font-size: 0.85rem; }
.phase-track-state { font-size: 0.85rem; font-weight: 600; }
.phase-track-step.is-current .phase-track-state { color: var(--color-accent); }
.phase-track-link-area { display: flex; flex: 1; align-items: flex-start; gap: var(--space-3); margin: calc(-1 * var(--space-4)); padding: var(--space-4); border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.phase-track-link-area:hover { background: var(--color-surface-elevated); }
.phase-track-link-area:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.phase-track-cta { margin-top: var(--space-1); color: var(--color-accent); font-size: 0.82rem; font-weight: 700; }
.phase-track-link { display: flex; align-items: center; color: var(--color-accent); font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
/* The arrow follows the track: sideways while the steps sit in a row, downwards once they stack. */
.phase-track-link::before { content: '→'; margin-right: var(--space-1); }

.public-matches { display: grid; gap: var(--space-4); }
.public-matches > h2 { margin: 0; }
.phase-switch { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.phase-switch-item {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-full);
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
}
.phase-switch-item:hover { border-color: var(--color-accent); }
.phase-switch-item.is-selected { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }
.phase-switch-item .text-muted { font-weight: 500; }
.view-switch { display: inline-flex; align-self: start; padding: 3px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-bg-soft); }
.view-switch-item { padding: var(--space-1) var(--space-4); border-radius: var(--radius-full); color: var(--color-text-muted); font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.view-switch-item:hover { color: var(--color-text); }
.view-switch-item.is-selected { background: var(--color-accent-soft); color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.round-nav-caption { display: inline-flex; align-items: center; margin-right: var(--space-1); color: var(--color-text-muted); font-size: 0.85rem; font-weight: 700; }

.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--space-4); align-items: start; }
.overview-block { display: grid; gap: var(--space-4); justify-items: stretch; }
/* The ghost link lines up with the content above it, not with its own invisible padding. */
.overview-block > .btn { justify-self: start; }
.overview-block > .btn-ghost { margin-left: -0.8rem; }
.overview-block-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
.overview-block-heading h3 { margin: 0; }
.overview-block-heading .text-muted { font-size: 0.88rem; }
.overview-note { margin: 0; font-size: 0.85rem; }
.overview-standings-link { margin-bottom: var(--space-4); color: var(--color-text-muted); }
.overview-bracket { margin-top: var(--space-4); }
.overview-bracket-tree { overflow-x: auto; }
.overview-bracket-tree > .section:last-child { margin-bottom: 0; }

.compact-standings { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.compact-standings th { color: var(--color-text-muted); font-size: 0.75rem; font-weight: 700; text-align: left; text-transform: uppercase; }
.compact-standings th, .compact-standings td { padding: var(--space-2); border-bottom: 1px solid var(--color-border); }
.compact-standings th:nth-child(n+3), .compact-standings td:nth-child(n+3) { text-align: right; }
.compact-standings td:first-child { width: 2.5rem; color: var(--color-text-muted); font-weight: 800; }
.compact-standings tr.is-qualified td:first-child { color: var(--color-success); }
.compact-standings tr.is-cutoff td { border-bottom: 2px solid var(--color-text-muted); }
.compact-standings tr.is-me td { background: var(--color-accent-soft); }

@media (max-width: 640px) {
    .competition-header-summary { flex-direction: column; }
    .competition-header-summary > span + span::before { content: none; }
    .phase-track { flex-direction: column; }
    .phase-track-link::before { content: '↓'; }
    .phase-track-step { flex-basis: auto; }
}

/* ==========================================================================
   Seeding (drag & drop)
   ========================================================================== */
.seeding { max-width: 640px; }

.seeding-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.seeding-toolbar .text-muted { font-size: 0.85rem; }

.seeding-list {
    display: grid;
    gap: var(--space-2);
}

.seeding-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.seeding-item[draggable="true"] { cursor: grab; }
.seeding-item.is-dragging { opacity: 0.5; border-style: dashed; border-color: var(--color-accent); }

.seeding-handle { color: var(--color-text-muted); font-size: 1.1rem; line-height: 1; }

.seeding-seed {
    display: grid;
    flex: none;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-weight: 800;
}

.seeding-division {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding: var(--space-2) var(--space-1);
    border-bottom: 2px solid var(--color-accent);
    font-size: 1.05rem;
}
.seeding-division:first-child { margin-top: 0; }
.seeding-division.is-unassigned { border-bottom-color: var(--color-border); }

.seeding-distribute { margin-bottom: var(--space-6); }
.seeding-distribute-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.seeding-distribute-fields label { display: grid; gap: var(--space-1); }
.seeding-distribute-fields input { width: 6rem; }

.seeding-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); flex: 1; min-width: 0; }
.seeding-moves { flex: none; }

.seeding-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-6) 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

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

.site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.site-footer-community { display: inline-flex; align-items: center; gap: 0.35em; margin-left: 0.2em; color: inherit; font-weight: 700; text-decoration: none; vertical-align: bottom; }
/* The logo of FrenchCraft, its white letter turned to ink on the light theme. */
.site-footer-community img { width: auto; height: 1.15em; }
.site-footer-community .is-light, :root[data-theme="light"] .site-footer-community .is-dark { display: none; }
:root[data-theme="light"] .site-footer-community .is-light { display: block; }
.site-footer-community:hover { color: var(--color-text); text-decoration: underline; }
.site-footer-legal a { color: inherit; }
.site-footer-legal a:hover { color: var(--color-text); }

/* Small links a thumb must still hit: a touch area grows around them, unseen, so that their look does not change
   (24 × 24 px at least, WCAG 2.2; about 44 px high on a touch screen). Their neighbours are far enough not to overlap. */
.site-footer-legal a, .site-footer-community, a.page-eyebrow, .area-switch-item { position: relative; }
a.page-eyebrow { display: inline-block; }
.site-footer-legal a::after, .site-footer-community::after, a.page-eyebrow::after, .area-switch-item::after {
    content: "";
    position: absolute;
    inset: -6px -6px;
}
@media (pointer: coarse) {
    .site-footer-legal a::after, .site-footer-community::after, a.page-eyebrow::after, .area-switch-item::after { inset: -14px -6px; }
}

/* The legal notice and the privacy policy: running text. */
.legal-page { max-width: 70ch; }
.legal-page h2 { font-size: 1.15rem; }
.legal-page ul { padding-left: var(--space-6); display: grid; gap: var(--space-2); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.1;
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-color);
    border-color: var(--btn-primary-border);
}

.btn-primary:hover { background: var(--btn-primary-hover-bg); }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.btn-secondary:hover { background: var(--color-surface-elevated); }

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.btn-danger {
    background: transparent;
    color: var(--color-danger);
    border-color: color-mix(in srgb, var(--color-danger) 40%, transparent);
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1.02rem; }
/* The calls to action of the landing (log in, contact the team): filled with the ink of the brand, the loudest buttons of the page. */
.btn-ink { border-color: var(--color-brand-ink); background: var(--color-brand-ink); color: var(--color-bg); font-weight: 800; }
.btn-ink:hover { border-color: color-mix(in srgb, var(--color-brand-ink) 85%, var(--color-text)); background: color-mix(in srgb, var(--color-brand-ink) 85%, var(--color-text)); color: var(--color-bg); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ==========================================================================
   Badges & status
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-strong);
    white-space: nowrap;
}

.badge-accent { background: var(--color-accent-soft); color: var(--color-accent); border-color: transparent; }
.badge-success { background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success); border-color: transparent; }
.badge-warning { background: color-mix(in srgb, var(--color-warning) 14%, transparent); color: var(--color-warning); border-color: transparent; }
.badge-danger { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); border-color: transparent; }
.badge-info { background: color-mix(in srgb, var(--color-info) 14%, transparent); color: var(--color-info); border-color: transparent; }
.badge-neutral { background: var(--color-surface); color: var(--color-text-muted); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.competition-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.competition-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.competition-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
}

.competition-card h3 { font-size: 1.05rem; margin: 0; }

.competition-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.competition-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   Page header / hero / sections
   ========================================================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.page-header h1 { margin-bottom: var(--space-1); }

.page-eyebrow {
    color: var(--color-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-1);
}

.page-subtitle {
    color: var(--color-text-muted);
    max-width: 60ch;
}

.section { margin-bottom: var(--space-8); }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-12) 0 var(--space-8);
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    max-width: 18ch;
}

.hero-lede {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    max-width: 55ch;
}

.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ==========================================================================
   Landing page
   ========================================================================== */
/* A fight poster: the two fighters rush in from each side and clash, the bandages of the logo are slapped on the
   blow, then the title comes up over their feet. Halftone dots behind, like a printed poster. */
.landing-hero {
    position: relative;
    /* Full width and the whole first screen, right under the header (4rem): the words at the bottom, over the bodies of the
       fighters; the rest of the page starts below the screen. The main content keeps its own top padding below it. */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: calc(100svh - 4rem);
    margin: calc(-1 * var(--space-8)) 0 var(--space-12);
    /* Room under the buttons for the nudge downwards. */
    padding-bottom: clamp(5rem, 11vh, 6.5rem);
    background: radial-gradient(ellipse 60% 55% at 50% 30%, color-mix(in srgb, var(--color-accent) 14%, transparent), transparent 70%);
    overflow: hidden;
    isolation: isolate;
    text-align: center;
}
/* The printed dots, around the clash. */
.landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--color-text) 14%, transparent) 1.2px, transparent 1.7px);
    background-size: 10px 10px;
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 30%, #000, transparent 75%);
    mask-image: radial-gradient(ellipse 60% 55% at 50% 30%, #000, transparent 75%);
}

/* The stage: the fighters, cut out, each in its half, cropped under the weapons; their bodies fade into the page under the
   title. On a wide screen the stage stops growing, so that the faces stay in the first screen. */
/* The stage, at the top of the screen and its whole width, each fighter against his edge: the whole picture, the faces in
   its upper half; the words come over the lower half. */
.landing-duel {
    /* The size of the fighters: the width of the screen, up to 1400px; wider, they stay that size and keep to the edges. */
    --scene: min(100vw, 1400px);
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: calc(var(--scene) * 941 / 1672);
    overflow: hidden;
}
/* The bodies fade out downwards into whatever is behind (transparency, not a coat of the page colour, which would draw
   the edge of the stage over the tinted background of the poster). */
.landing-duel {
    -webkit-mask-image: linear-gradient(#000 45%, transparent 92%);
    mask-image: linear-gradient(#000 45%, transparent 92%);
}
/* Each picture is a slice of a pair drawn together: its width is its share of that pair (--share, set by the page), against its edge. */
.landing-duel__fighter { position: absolute; top: 0; }
.landing-duel__fighter img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
/* Drawn looking the other way: mirrored, so that it faces its opponent (the picture only; the frame slides in). */
.landing-duel__fighter.is-mirrored img { transform: scaleX(-1); }
.landing-duel__fighter.is-left { left: 0; width: calc(var(--scene) * var(--share)); animation: landing-duel-in-left 700ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
.landing-duel__fighter.is-right { right: 0; width: calc(var(--scene) * var(--share)); animation: landing-duel-in-right 700ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
@keyframes landing-duel-in-left { from { opacity: 0; transform: translateX(-60%); } to { opacity: 1; transform: none; } }
@keyframes landing-duel-in-right { from { opacity: 0; transform: translateX(60%); } to { opacity: 1; transform: none; } }

/* The words, over the feet of the fighters. */
.landing-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-6);
    animation: landing-hero-up 500ms ease-out 900ms both;
}
/* A soft shade of the page colour behind the words: they stay readable where they cross the fighters (short screens). */
.landing-hero__content::before {
    content: "";
    position: absolute;
    inset: -2rem -8rem;
    z-index: -1;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--color-bg) 82%, transparent), transparent);
    pointer-events: none;
}
/* The nudge downwards, at the bottom of the first screen: a chevron that bobs, a link to what follows. */
.landing-hero__more {
    position: absolute;
    bottom: clamp(1rem, 3vh, 1.75rem);
    left: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--color-text-muted);
    translate: -50% 0;
    animation: landing-hero-more 1.8s ease-in-out 2.4s infinite both;
}
.landing-hero__more:hover { color: var(--color-brand-ink); }
.landing-hero__more svg { width: 28px; height: 28px; }
@keyframes landing-hero-more { 0%, 100% { transform: none; } 50% { transform: translateY(6px); } }
/* On the landing only, the links within the page (the nudge, "see the competitions") glide down instead of jumping, and
   stop under the sticky navbar (scroll-padding-top of html); not site-wide, where Turbo's own scrolling between pages
   would glide too. */
@media (prefers-reduced-motion: no-preference) {
    html:has(.landing-hero) { scroll-behavior: smooth; }
}
@keyframes landing-hero-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* An ink stamp, in the ink of the brand. */
.landing-hero__stamp {
    padding: 4px 10px;
    border: 2px solid var(--color-brand-ink);
    border-radius: 4px;
    color: var(--color-brand-ink);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transform: rotate(-3deg);
    /* A sticker on the poster: it covers the fighters behind it. */
    background: var(--color-bg);
}

.landing-hero__title {
    display: block;
    margin: 0;
    font-family: var(--font-display, var(--font-sans));
    font-weight: 900;
    line-height: 0.9;
    text-transform: uppercase;
}
/* Over the fighters: in the colour of the text, with a halo of the page colour, so that it does not melt into the picture. */
.landing-hero__title-top { display: block; margin-bottom: 0.2em; color: color-mix(in srgb, var(--color-text) 88%, transparent); font-size: clamp(1.1rem, 2.4vw, 1.9rem); letter-spacing: 0.2em; text-shadow: 0 0 3px var(--color-bg), 0 2px 14px var(--color-bg); }
/* The name and the symbol of the logo side by side, as big as the poster allows, on one line. */
.landing-hero__name { display: inline-flex; align-items: center; gap: 0.1em; font-size: clamp(1.8rem, 8vw, 7rem); }
/* The name over a strip of ink. */
.landing-hero__title-main {
    display: inline-block;
    padding: 0 0.06em;
    letter-spacing: -0.02em;
    white-space: nowrap;
    background: linear-gradient(transparent 58%, color-mix(in srgb, var(--color-brand-ink) 28%, transparent) 58% 86%, transparent 86%);
}

/* What the site is: right under the name, bold and clear, read before the details. */
.landing-hero__tagline { margin: var(--space-2) 0 0; color: var(--color-text); font-family: var(--font-display, var(--font-sans)); font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 800; }
.landing-hero__lede {
    max-width: 34rem;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 1.08rem;
}
.landing-hero__actions { justify-content: center; }

.landing-hero__symbol {
    /* The blow waits for the title to be up (inherited by the lines and the bandages). */
    --punch: 1100ms;
    position: relative;
    z-index: 1;
    flex: none;
    width: 1.35em;
    /* Taller than the letters: let it overflow the line instead of pushing the words below. */
    margin-block: -0.22em;
    height: auto;
    overflow: visible;
    fill: var(--color-bandage);
    transform: rotate(-8deg);
    filter: drop-shadow(0 6px 10px var(--shadow-drop));
    animation: landing-hero-shake 360ms linear calc(var(--punch) + 280ms) both;
}
.landing-hero__bandage rect, .landing-hero__bandage .is-hole { stroke: var(--color-bandage-edge, none); stroke-width: 0.8; }
.landing-hero__bandage .is-hole { fill: none; }
.landing-hero__impact { stroke: var(--color-brand-ink); stroke-width: 3; stroke-linecap: round; opacity: 0; animation: landing-hero-impact 700ms cubic-bezier(0.1, 0.8, 0.3, 1) calc(var(--punch) + 280ms) both; }
.landing-hero__bandage.is-under { animation: landing-hero-slam-under 340ms calc(var(--punch) + 420ms) both; }
.landing-hero__bandage.is-over { animation: landing-hero-slam-over 340ms calc(var(--punch) + 540ms) both; }
/* The second bandage hits its place at 60% of its fall: only then is the first one cut. */
.landing-hero__bandage .is-whole { animation: landing-hero-cut 1ms calc(var(--punch) + 744ms) both; }
@keyframes landing-hero-cut { to { opacity: 0; } }

@keyframes landing-hero-slam-under {
    0% { opacity: 0; transform: scale(2.6) rotate(-28deg); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
    60% { opacity: 1; transform: scale(0.88) rotate(2deg); animation-timing-function: ease-out; }
    80% { transform: scale(1.05) rotate(-1deg); }
    100% { opacity: 1; transform: none; }
}
@keyframes landing-hero-slam-over {
    0% { opacity: 0; transform: scale(2.8) rotate(32deg); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
    60% { opacity: 1; transform: scale(0.85) rotate(-3deg); animation-timing-function: ease-out; }
    80% { transform: scale(1.06) rotate(1deg); }
    100% { opacity: 1; transform: none; }
}
/* The lines burst out of the blow, fall back around the symbol, then fade once the bandages are on. */
@keyframes landing-hero-impact {
    0% { opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1.4); }
    60% { opacity: 0.7; transform: none; }
    100% { opacity: 0; transform: none; }
}
/* The whole symbol takes the blow: a short, dying shake. */
@keyframes landing-hero-shake {
    0%, 100% { transform: rotate(-8deg); }
    12% { transform: rotate(-8deg) translate(-9px, 5px); }
    25% { transform: rotate(-8deg) translate(8px, -6px); }
    38% { transform: rotate(-8deg) translate(-6px, -3px); }
    52% { transform: rotate(-8deg) translate(5px, 4px); }
    66% { transform: rotate(-8deg) translate(-3px, 1px); }
    82% { transform: rotate(-8deg) translate(1px, -1px); }
}



@media (prefers-reduced-motion: reduce) {
    .landing-duel__fighter, .landing-hero__content, .landing-hero__symbol, .landing-hero__impact, .landing-hero__bandage, .landing-hero__more { animation: none; }
    .landing-hero__impact, .landing-hero__bandage .is-whole { display: none; }
}

/* The error pages: a smaller fight poster, the code under a bandage of the logo. */
.error-poster {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-8);
    margin: var(--space-8) 0;
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
    border-radius: 2rem;
    background:
        radial-gradient(circle at 80% 50%, color-mix(in srgb, var(--color-accent) 12%, transparent), transparent 45%),
        linear-gradient(135deg, var(--color-surface), var(--color-bg));
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    isolation: isolate;
}
.error-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--color-text) 16%, transparent) 1.2px, transparent 1.7px);
    background-size: 10px 10px;
    -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
    mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
}

.error-poster__content { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.error-poster__stamp {
    padding: 4px 10px;
    border: 2px solid var(--color-danger);
    border-radius: 4px;
    color: var(--color-danger);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transform: rotate(-3deg);
}
.error-poster__eyebrow { margin: 0; color: var(--color-accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.error-poster__title {
    margin: 0;
    font-family: var(--font-display, var(--font-sans));
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    text-wrap: balance;
}
.error-poster__lede { max-width: 32rem; margin: 0 0 var(--space-2); color: var(--color-text-muted); font-size: 1.05rem; }

.error-poster__code {
    position: relative;
    display: grid;
    place-items: center;
    font-family: var(--font-display, var(--font-sans));
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    color: color-mix(in srgb, var(--color-text) 88%, transparent);
}
.error-poster__code > span { transform: rotate(-4deg); }
.error-poster__bandage {
    position: absolute;
    top: 58%;
    width: 105%;
    height: auto;
    transform: rotate(-16deg) scaleY(0.75);
    filter: drop-shadow(0 10px 18px var(--shadow-drop));
    animation: error-poster-slap 420ms cubic-bezier(0.2, 0.9, 0.3, 1.2) 150ms both;
}
.error-poster__bandage .is-strip { fill: var(--color-bandage); }
.error-poster__bandage .is-pad { fill: var(--color-bandage-pad); }
.error-poster__bandage .is-hole { fill: color-mix(in srgb, var(--color-bg) 55%, var(--color-bandage)); }

@keyframes error-poster-slap {
    from { opacity: 0; transform: translate(80px, -40px) rotate(10deg) scale(1.2); }
    to { opacity: 1; transform: rotate(-16deg) scaleY(0.75); }
}
@media (prefers-reduced-motion: reduce) {
    .error-poster__bandage { animation: none; }
}
@media (max-width: 720px) {
    .error-poster { grid-template-columns: minmax(0, 1fr); padding: var(--space-6); }
    .error-poster__code { order: -1; justify-self: center; font-size: 5.5rem; }
}

.landing-hero__note { margin: 0; color: var(--color-text-muted); font-size: 0.85rem; }

/* Under the hero, each block of the landing is set apart by the same gap. */
.landing-steps, .landing-competitions, .landing-organizer { margin-bottom: var(--space-12); }
/* Room under the heading: the big numbers of the steps would otherwise touch it. */
.landing-section-head { display: grid; gap: var(--space-1); margin-bottom: var(--space-8); }
.landing-section-head h2 { margin: 0; }
.landing-section-eyebrow { color: var(--color-text-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* How it works: three steps side by side, one under the other on a phone. */
.landing-steps__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); margin: 0; padding: 0; list-style: none; }
/* No box: the steps are read, not clicked, so they must not look like the competition tiles that follow. */
.landing-step { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: var(--space-4); row-gap: var(--space-1); }
.landing-step h3 { margin: 0; font-size: 1.15rem; }
.landing-step p { margin: 0; color: var(--color-text-muted); }
/* The number of the step, big and in the ink of the brand like the title of the hero, beside its title and text. */
.landing-step__number { grid-row: span 2; align-self: center; min-width: 0.75em; text-align: center; color: var(--color-brand-ink); font-family: var(--font-display, var(--font-sans)); font-size: 3.5rem; font-weight: 900; line-height: 0.85; }
/* A playful touch on hover: the number takes a jab and tilts back, springy. Only the number moves: no frame, no pointer, nothing that looks clickable. */
.landing-step__number { transition: transform 260ms cubic-bezier(0.3, 1.8, 0.5, 1); }
.landing-step:hover .landing-step__number { transform: rotate(-10deg) scale(1.12); }
@media (prefers-reduced-motion: reduce) { .landing-step__number { transition: none; } .landing-step:hover .landing-step__number { transform: none; } }

/* For the organizers: what La Bagarre does for them on the left, whom to write to on the right. */
.landing-organizer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-6); padding: var(--space-6) var(--space-8); border: 1px dashed color-mix(in srgb, var(--color-brand-ink) 45%, transparent); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--color-brand-ink) 6%, transparent); }
.landing-organizer__text { display: grid; justify-items: start; gap: var(--space-3); max-width: 46rem; }
.landing-organizer h2, .landing-organizer p { margin: 0; }
.landing-organizer__stamp { padding: 3px 9px; border: 2px solid var(--color-brand-ink); border-radius: 4px; color: var(--color-brand-ink); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; transform: rotate(-2deg); }

/* The competitions under the hero: the ones open for registration, then the ones under way (tiles shared with the player home). */
.landing-live + .landing-live { margin-top: var(--space-8); }
.landing-live h2 { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.landing-live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 4px var(--color-accent-soft); animation: landing-live-pulse 2s ease-in-out infinite; }
@keyframes landing-live-pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .landing-live-dot { animation: none; } }
.competition-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--space-3); }
.competition-tile {
    display: grid;
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.competition-tile:hover { border-color: var(--color-accent); background: var(--color-surface-elevated); }
.competition-tile .competition-banner { border-radius: 0; }
.competition-tile-body { display: grid; gap: var(--space-1); padding: var(--space-4); }
.competition-tile strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.competition-tile-accent { color: var(--color-text); font-weight: 700; }
.competition-tile-full { justify-self: start; margin-top: var(--space-1); }
/* The game over the title of a competition card (see competition/_game_label). */
.competition-game { display: block; color: var(--color-text-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.competition-card .competition-game { margin-bottom: calc(-1 * var(--space-2)); }

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
}

.empty-state h3 { color: var(--color-text); }

@media (max-width: 760px) {
    /* On a phone, the symbol goes behind the title, in a corner. */
    /* On a phone, the stage is cropped on the two faces: the picture is drawn half as wide again, its edges cut off. */
    /* On a phone, the picture in the flow, at the top, the words centred in the rest of the screen. */
    .landing-hero { justify-content: flex-start; }
    .landing-hero::before, .landing-hero__content::before { display: none; }
    .landing-duel { position: relative; width: 100%; height: auto; aspect-ratio: 16 / 10; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
    .landing-duel__fighter.is-left { left: -25%; width: calc(150% * var(--share)); }
    .landing-duel__fighter.is-right { right: -25%; width: calc(150% * var(--share)); }
    .landing-hero__content { margin: auto 0; padding: 0 var(--space-5, 20px); }
    .landing-hero__actions { flex-direction: column; align-items: stretch; width: 100%; }
    .landing-steps__list { grid-template-columns: minmax(0, 1fr); }
    .landing-organizer { grid-template-columns: minmax(0, 1fr); justify-items: start; padding: var(--space-6); }
    .landing-steps__list { gap: var(--space-6); }
    .landing-step__number { font-size: 3rem; }
}

/* ==========================================================================
   Tabs (sub navigation)
   ========================================================================== */
/* One scrollable row: wrapped tabs would leave the active underline floating mid-list. */
.tabs {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    /* The base line is drawn inside: nothing sticks out, so no browser adds a vertical scrollbar. */
    box-shadow: inset 0 -1px 0 var(--color-border);
    margin-bottom: var(--space-6);
}

.tab {
    flex: none;
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

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

.tab.is-active {
    color: var(--color-text);
    border-color: var(--color-accent);
}

/* More hides on that side of a row that scrolls sideways (see scroll_row_controller): the tabs, a bracket fade out there. */
.has-more-end { mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.has-more-start { mask-image: linear-gradient(to left, #000 calc(100% - 3rem), transparent); }
.has-more-start.has-more-end { mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

thead th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

tbody tr:hover { background: var(--color-surface-elevated); }

tbody tr.is-highlighted { background: var(--color-accent-soft); }

/* ==========================================================================
   Forms
   ========================================================================== */
form { display: block; }

.form-grid {
    display: grid;
    gap: var(--space-6);
    max-width: 640px;
}

/* form_widget(form) wraps every row in one <div id="form_name">: space those rows too */
.form-grid > div[id] {
    display: grid;
    gap: var(--space-4);
}

.form-grid div:has(> input[type="checkbox"]) {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-2);
}

.form-grid div:has(> input[type="checkbox"]) > label { margin-bottom: 0; cursor: pointer; }
/* The box itself big enough to tick with a thumb; its label, beside it, ticks it too. */
.form-grid div:has(> input[type="checkbox"]) > input[type="checkbox"] { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--color-accent); cursor: pointer; }
@media (pointer: coarse) {
    .form-grid div:has(> input[type="checkbox"]) > input[type="checkbox"] { width: 1.5rem; height: 1.5rem; }
}

.form-grid textarea { min-height: 7rem; resize: vertical; }

/* A group of fields inside a form (the extra registration fields): spaced like the rows around it. */
.form-fields { display: grid; gap: var(--space-4); }
.form-fields label.required::after { content: ' *'; color: var(--color-text-muted); }

/* Expanded single choice (Oui / Non): options side by side, each radio before its label. */
.form-radios { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
/* The question carries the asterisk of a required answer, not each of its choices. */
.form-fields .form-radios label.required::after { content: none; }
.form-radios label { display: inline; margin: 0 0 0 var(--space-1); font-weight: 500; cursor: pointer; }
.form-radios input[type="radio"] { accent-color: var(--color-accent); cursor: pointer; }

.card + .section { margin-top: var(--space-6); }

label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: var(--space-1);
    color: var(--color-text);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* .help-text is what Symfony renders for a field "help". */
.form-help,
.help-text {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-top: var(--space-1);
}

.form-errors {
    color: var(--color-danger);
    font-size: 0.82rem;
    margin: var(--space-1) 0 0;
    padding: 0;
    list-style: none;
    font-weight: 600;
}

/* An error of the whole form: an alert at its top (see templates/form/errors.html.twig). */
.form-errors-global { margin-bottom: var(--space-3); font-weight: 600; scroll-margin: var(--space-6); }
.form-errors-global p { margin: 0; }

.form-row { margin-bottom: var(--space-4); }

/* ==========================================================================
   Flash messages
   ========================================================================== */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    /* Top and bottom only: the sides stay those of .container, which centres it with the content. */
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
}

.flash-success { background: color-mix(in srgb, var(--color-success) 12%, transparent); color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 30%, transparent); }
.flash-error { background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); }
.flash-warning { background: color-mix(in srgb, var(--color-warning) 12%, transparent); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 30%, transparent); }
.flash-info { background: color-mix(in srgb, var(--color-info) 12%, transparent); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 30%, transparent); }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}

.flash-close:hover { opacity: 1; }

/* ==========================================================================
   Callouts / alerts (checklist warnings, blockers…)
   ========================================================================== */
.callout {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
}

.callout-warning { border-color: color-mix(in srgb, var(--color-warning) 35%, transparent); background: color-mix(in srgb, var(--color-warning) 8%, transparent); color: var(--color-warning); }
.callout-danger { border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); }
.callout-info { border-color: color-mix(in srgb, var(--color-info) 35%, transparent); background: color-mix(in srgb, var(--color-info) 8%, transparent); color: var(--color-text); }

/* ==========================================================================
   Stat chips (cockpit / dashboard numbers)
   ========================================================================== */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
}

.stat {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
}

.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--color-text); }
.stat-label { color: var(--color-text-muted); font-size: 0.8rem; }
.stat-link { color: inherit; text-decoration: none; transition: border-color var(--transition-fast); }
.stat-link:hover { border-color: var(--color-accent); }
.discord-roles form { display: grid; gap: var(--space-4); }
.discord-roles select { width: auto; max-width: 100%; }
/* The Discord page (US 065): its state, then its steps in the order they are set. */
.discord-state dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.discord-state dt { margin-bottom: var(--space-1); color: var(--color-text-muted); font-size: 0.8rem; font-weight: 600; }
.discord-state dd { margin: 0; }
.discord-step h2 { display: flex; align-items: center; gap: var(--space-2); }
.discord-step-number { display: inline-grid; place-items: center; flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--color-surface); color: var(--color-accent); font-size: 0.85em; }
.discord-step.is-waiting > :not(h2) { opacity: 0.75; }
.discord-step-actions { margin-top: var(--space-4); }
.discord-channels { display: grid; gap: var(--space-4); }
.discord-channel-input { display: flex; gap: var(--space-2); align-items: center; }
.discord-channel-input input { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
   Bracket
   ========================================================================== */
.bracket {
    display: flex;
    align-items: stretch;
    gap: var(--space-8);
    overflow-x: auto;
    padding: var(--space-4) var(--space-1) var(--space-6);
}

.bracket-scroll-hint { margin: calc(-1 * var(--space-3)) 0 0; color: var(--color-text-muted); font-size: 0.82rem; font-weight: 600; text-align: right; }

.bracket-round {
    display: flex;
    flex: 0 0 15rem;
    flex-direction: column;
}

/* Round names share one band at the top, whatever the number of matches below them. */
.bracket-round h2 {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 2.2rem;
    margin: 0 0 var(--space-3);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    text-align: center;
}

.bracket-slots {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-around;
    gap: var(--space-4);
}

/* Tree layout: every column is as tall as the first one and splits it in equal slots, so a match sits exactly
   between the two matches that feed it. Lines: the match goes right (::after), then up or down to its pair's middle
   (.bracket-link), and the next match comes in from the left (::before). */
.bracket.has-links { --bracket-gap: 2rem; --bracket-line: 2px solid var(--color-border-strong); gap: var(--bracket-gap); }
.bracket.has-links .bracket-slots { gap: 0; justify-content: stretch; }
.bracket-slot { --span: 1; position: relative; display: flex; flex: var(--span) var(--span) 0; align-items: center; min-height: calc(var(--span) * 4.6rem); padding: var(--space-1) 0; }
.bracket-slot > .bracket-match { width: 100%; }
.bracket-slot.has-next::after,
.bracket-slot.has-previous::before { content: ''; position: absolute; top: 50%; width: calc(var(--bracket-gap) / 2); border-top: var(--bracket-line); }
.bracket-slot.has-next::after { left: 100%; }
.bracket-slot.has-previous::before { right: 100%; }
.bracket-link { position: absolute; left: calc(100% + var(--bracket-gap) / 2); border-left: var(--bracket-line); }
.bracket-slot.link-top .bracket-link { top: 50%; bottom: 0; }
.bracket-slot.link-bottom .bracket-link { top: 0; bottom: 50%; }
/* A round skipped by a feeder: the line simply crosses the empty column. */
.bracket-through { position: absolute; top: 50%; right: 0; left: 0; border-top: var(--bracket-line); }

.bracket-match {
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    overflow: hidden;
}

.bracket-match div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 1.9rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.85rem;
}

.bracket-match div + div {
    border-top: 1px solid var(--color-border);
}

/* A match to play: a thin accent bar on the left is enough, the rest of the card stays calm. */
.bracket-match.is-playable { border-left: 3px solid var(--color-accent); }
.bracket-match.is-completed { opacity: 0.85; }
.bracket-match.is-waiting { border-style: dashed; }
.bracket-match.is-linked { position: relative; }
.bracket-match.is-linked:hover { border-color: var(--color-text-muted); }
.bracket-match.is-reportable { border-color: var(--color-accent); }
.bracket-match.is-reportable:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.bracket-match-link { position: absolute; inset: 0; }
.bracket-match div strong { font-variant-numeric: tabular-nums; }
.bracket-match div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-starting-score { color: var(--color-accent); font-weight: 800; text-decoration: none; cursor: help; white-space: nowrap; }
.bracket-match-advantage { flex: none; margin-right: auto; margin-left: var(--space-1); padding: 0 0.35em; border-radius: var(--radius-sm); background: var(--color-bg-soft); color: var(--color-text-muted); font-size: 0.72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bracket-match-advantage.is-ahead { background: var(--color-accent-soft); color: var(--color-accent); }
.bracket-match-tag { flex: none; color: var(--color-text-muted); font-size: 0.68rem; font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.8; }
.bracket-round.is-current h2 { color: var(--color-accent); }

.bracket-match .winner {
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-weight: 700;
}

.bracket-match small {
    display: block;
    padding: 0.3rem 0.75rem;
    text-align: right;
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .bracket-round { flex: 0 0 13rem; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.flow > * + * { margin-top: var(--space-4); }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.text-warning { color: var(--color-warning); }

/* A slot whose player is not known yet ("To Be Determined"): present but in the background. */
.is-tbd { color: var(--color-text-muted); font-style: italic; font-weight: 500; opacity: 0.6; }

/* ==========================================================================
   Podium (public overview, once the last phase is over)
   ========================================================================== */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: var(--space-3); margin: 0 auto var(--space-6); max-width: 640px; }
.podium-step { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; gap: var(--space-2); min-width: 0; text-align: center; }
.podium-medal { font-size: 1.8rem; line-height: 1; }
.podium-names { display: grid; gap: 2px; max-width: 100%; }
.podium-names strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-names strong.is-me { color: var(--color-accent); }
.podium-block {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding-top: var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-bottom: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 1.4rem;
    font-weight: 800;
}
.podium-block small { margin-left: var(--space-1); font-size: 0.7rem; font-weight: 600; align-self: center; }
.podium-step.is-rank-1 .podium-block { height: 7rem; border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }
.podium-step.is-rank-2 .podium-block { height: 5rem; }
.podium-step.is-rank-3 .podium-block { height: 3.75rem; }
.podium-step.is-rank-1 .podium-names strong { font-size: 1.15rem; }

/* A phase tab whose phase has not started yet: visible so visitors know what comes next, but not clickable. */
.tab.is-upcoming { color: var(--color-text-muted); opacity: 0.55; cursor: default; }
.tab.is-upcoming small { margin-left: var(--space-1); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Division picker of public pages (competitions with several divisions). */
.division-switch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6); }
.division-switch-caption { margin-right: var(--space-1); color: var(--color-text-muted); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* Content reloaded in place (Turbo frame), e.g. when switching division: dim it while it loads. */
turbo-frame#competition-content { display: block; transition: opacity var(--transition-fast); }
turbo-frame#competition-content[aria-busy="true"] { opacity: 0.55; pointer-events: none; }

/* Activity feed: one line per event, grouped by day on the public page, the latest ones on the cockpit. */
.activity-day + .activity-day { margin-top: var(--space-6); }
.activity-day-label { margin-bottom: var(--space-2); color: var(--color-text-muted); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.activity-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.activity-item { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.activity-item + .activity-item { border-top: 1px solid var(--color-border); }
.activity-time { flex: none; min-width: 3rem; color: var(--color-text-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.activity-icon { flex: none; width: 1.5rem; text-align: center; }
.activity-message { min-width: 0; overflow-wrap: anywhere; }
.activity-item.is-champion .activity-message { color: var(--color-accent); font-weight: 700; }
.activity-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-6); }

/* ==========================================================================
   Player home: what to do, my competitions, recent activity
   ========================================================================== */
/* What to do now, in the voice of the home poster: its printed dots and its strip of ink under the title. */
.home-todo {
    position: relative;
    margin-bottom: var(--space-8);
    padding: var(--space-6);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    isolation: isolate;
}
.home-todo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--color-text) 14%, transparent) 1.2px, transparent 1.7px);
    background-size: 10px 10px;
    -webkit-mask-image: linear-gradient(100deg, transparent 45%, #000 100%);
    mask-image: linear-gradient(100deg, transparent 45%, #000 100%);
}
.home-todo h2 {
    justify-self: start;
    display: inline-block;
    margin-bottom: var(--space-4);
    padding: 0 0.1em;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: linear-gradient(transparent 45%, color-mix(in srgb, var(--color-brand-ink) 28%, transparent) 45% 92%, transparent 92%);
}
.admin-todo.is-empty { margin: 0 0 var(--space-8); color: var(--color-text-muted); }

.home-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.home-action {
    display: grid;
    align-content: start;
    gap: var(--space-1);
    padding: var(--space-4);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
}
.home-action.is-check_in { border-left-color: var(--color-info); }
.home-action-kicker { color: var(--color-accent); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
/* US 054: on the home of the administration, a dispute is a problem and a late match a warning. */
.home-action.is-dispute { border-left-color: var(--color-danger); }
.home-action.is-dispute .home-action-kicker { color: var(--color-danger); }
.home-action.is-late_matches { border-left-color: var(--color-warning); }
.home-action.is-late_matches .home-action-kicker { color: var(--color-warning); }
.admin-todo .home-action { overflow: hidden; }
/* The visual of the competition across the top of the card, cropped rather than shrunk. */
.competition-banner.admin-action-banner { aspect-ratio: auto; height: 72px; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-2); border-radius: 0; }
.home-action.is-check_in .home-action-kicker { color: var(--color-info); }
.home-action-title { margin: 0; font-size: 1.15rem; }
.home-action-meta { margin: 0; color: var(--color-text-muted); font-size: 0.88rem; }
.home-action-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; }

.home-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-8); align-items: start; }
.home-columns h2 { margin-bottom: var(--space-4); }
.home-competitions { display: grid; gap: var(--space-3); }
.home-competitions.is-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.home-competition {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.home-competition:hover { border-color: var(--color-accent); background: var(--color-surface-elevated); }
.home-competition.is-completed { opacity: 0.75; }
.home-competition-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.home-competition-head strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.home-competition-rank { color: var(--color-text); font-weight: 800; }
.home-more { margin-top: var(--space-3); margin-left: -0.8rem; }

.home-activity { display: grid; margin: 0; padding: 0; list-style: none; }
.home-activity li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.home-activity li:last-child { border-bottom: 0; }
.home-activity time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.home-activity a { display: block; color: var(--color-text-muted); font-size: 0.82rem; }
.home-activity a:hover { color: var(--color-accent); }

.home-open { margin-top: var(--space-8); }
.home-open h2 { margin-bottom: var(--space-4); }
.home-welcome { max-width: 560px; padding: var(--space-8); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); }
.home-welcome p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
    .home-columns { grid-template-columns: 1fr; }
    .home-todo { padding: var(--space-4); }
}

/* ==========================================================================
   Competition banner: the uploaded visual (cropped to fit), or the La Bagarre default one
   ========================================================================== */
.competition-banner {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 1;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}
.competition-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.competition-banner.is-default {
    background:
        radial-gradient(circle at 80% 50%, color-mix(in srgb, var(--color-accent) 12%, transparent), transparent 40%),
        linear-gradient(135deg, var(--color-surface-elevated), var(--color-bg-soft) 70%);
}
/* The symbol only shows through: a watermark, not a second logo. */
.competition-banner.is-default::before {
    content: '';
    position: absolute;
    top: -25%;
    right: 6%;
    width: auto;
    height: 150%;
    aspect-ratio: 1;
    background: url("../images/logo-symbol-gSIBqJ0.svg") no-repeat center / contain;
    opacity: 0.1;
    transform: rotate(-8deg);
}
/* A beige watermark vanishes on paper: it needs more ink there. */
:root[data-theme="light"] .competition-banner.is-default::before { opacity: 0.45; }
/* Full width, a fixed band: the visual is cropped rather than shrunk. */
.competition-header-banner { aspect-ratio: auto; height: clamp(120px, 20vw, 240px); margin-bottom: var(--space-6); }
/* Without an uploaded visual, the band stays a slim accent rather than an empty poster. */
.competition-header-banner.is-default { height: clamp(72px, 9vw, 112px); }
.match-page-banner { height: clamp(96px, 14vw, 180px); }
.match-page-banner.is-default { height: clamp(56px, 7vw, 88px); }
.competition-banner-preview { max-width: 480px; margin-bottom: var(--space-4); }

/* Cockpit: the banner as a thumbnail in the top right corner, a shortcut to the edit form. */

.cockpit-header-side { display: flex; align-items: flex-start; gap: var(--space-3); }
.duplicate-from { display: grid; gap: var(--space-2); }
.duplicate-from select { width: auto; max-width: 100%; }
.cockpit-banner { position: relative; display: block; flex: none; width: 168px; border-radius: var(--radius-md); text-decoration: none; }
.cockpit-banner .competition-banner { border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); transition: border-color var(--transition-fast); }
.cockpit-banner:hover .competition-banner { border-color: var(--color-accent); }
.cockpit-banner-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-text-muted); font-size: 0.8rem; font-weight: 700; }
.cockpit-banner:hover .cockpit-banner-hint { color: var(--color-accent); }
@media (max-width: 560px) {
    .cockpit-banner { width: 120px; }
}

/* ==========================================================================
   Registration fields: the organizers' list, and the answers as people read them
   ========================================================================== */
.registration-fields { display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.registration-field {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.registration-field-order { display: flex; flex-direction: column; }
.registration-field-order .btn { padding: 0 var(--space-2); line-height: 1.4; }
.registration-field-body { display: grid; flex: 1; gap: 2px; min-width: 0; }
.registration-field-body .text-muted { font-size: 0.85rem; }

.registration-summary h2,
.registration-summary h3 { margin: 0; }
.registration-summary .section-title { margin-bottom: var(--space-2); }
.registration-summary dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--space-3); margin: var(--space-3) 0 0; }
.registration-summary dt { color: var(--color-text-muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.registration-summary dd { margin: 2px 0 0; overflow-wrap: anywhere; }

.registration-field.is-disabled .registration-field-body strong { opacity: 0.6; }

@media (max-width: 560px) {
    .registration-field { flex-wrap: wrap; }
}

/* ==========================================================================
   Setup reminder: on each page of a competition until it starts, how far its setup is and the next step (the list is on the cockpit)
   ========================================================================== */
.setup-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.setup-reminder-progress { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--color-text-muted); font-size: 0.88rem; text-decoration: none; }
.setup-reminder-progress strong { color: var(--color-text); }
.setup-reminder-progress progress { width: 120px; height: 8px; accent-color: var(--color-accent); }
.setup-reminder-progress:hover span { color: var(--color-text); text-decoration: underline; }
.setup-reminder-here { color: var(--color-text-muted); font-size: 0.88rem; font-weight: 600; }

/* ==========================================================================
   Map veto: configuration of a stage, and the veto of a match
   ========================================================================== */
.format-veto { display: grid; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-soft); }
.format-veto:has(.format-veto-switch input:checked) { border-color: var(--color-accent); }
.format-veto-switch { display: flex; align-items: flex-start; gap: var(--space-3); margin: 0; cursor: pointer; }
.format-veto-switch input { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--color-accent); }
.format-veto-switch > span { display: grid; gap: 2px; }
.format-veto-switch .text-muted { font-size: 0.85rem; font-weight: 400; }
.format-options { display: grid; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.format-options > legend { padding: 0; margin-bottom: var(--space-2); }
.format-veto-sequence, .map-veto-sequence-input { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: 0.15em; }

.veto { display: grid; gap: var(--space-4); }
.veto h2, .veto h3 { margin: 0; }
.veto h3 { font-size: 0.95rem; }
.veto-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.veto-heading p { margin: var(--space-1) 0 0; font-size: 0.9rem; }
.veto .callout { margin: 0; }
.veto-actions { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; counter-reset: veto; }
.veto-actions li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--color-bg-soft); }
.veto-actions li.is-ban > span:last-child { color: var(--color-text-muted); }
.veto-action-verb { flex: none; width: 3rem; font-size: 0.72rem; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: 0.05em; }
.veto-actions li.is-ban .veto-action-verb { color: var(--color-danger); }
.veto-actions li.is-pick .veto-action-verb { color: var(--color-accent); }
.veto-turn { margin: 0; font-weight: 700; }
.veto-turn .text-muted { font-weight: 500; }
.veto-turn-help { margin: calc(-1 * var(--space-2)) 0 0; font-size: 0.85rem; }
.veto-form { display: grid; gap: var(--space-3); }
.veto-form > .btn { justify-self: start; }
.veto-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.veto-map { display: block; margin: 0; }
.veto-map input { position: absolute; opacity: 0; pointer-events: none; }
.veto-map > span {
    display: grid;
    gap: 2px;
    height: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    font-weight: 600;
}
.veto-map strong { color: var(--color-text); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; }
.veto-form .veto-map > span { cursor: pointer; }
.veto-form .veto-map:hover > span { border-color: var(--color-text-muted); }
.veto-map input:checked + span { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }
.veto-map input:focus-visible + span { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.veto-maps.is-readonly .veto-map > span { color: var(--color-text-muted); }
.veto-remaining-title { color: var(--color-text-muted); font-size: 0.8rem !important; text-transform: uppercase; letter-spacing: 0.05em; }
.match-map-name { font-weight: 700; }
.map-veto { display: grid; gap: var(--space-3); }
.map-veto h2 { margin: 0; font-size: 1.1rem; }
.map-veto p { margin: 0; }
.map-veto .callout { margin: 0; }
.map-veto-form { display: grid; gap: var(--space-1); }
.map-veto-form label { font-weight: 700; }
.map-veto-field { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.map-veto-field input { flex: 1 1 12rem; max-width: 20rem; text-transform: uppercase; }
.map-veto-preview { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.map-veto-preview div { display: flex; gap: var(--space-2); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-bg-soft); }
.map-veto-preview dt { color: var(--color-text); font-weight: 800; }
.map-veto-preview dd { margin: 0; font-family: ui-monospace, monospace; }
.map-pick { display: grid; gap: var(--space-3); }
.map-pick h2, .map-order-title { margin: 0; font-size: 1.1rem; }
.map-order-title { margin-bottom: var(--space-3); }
.map-pick-form { display: grid; gap: var(--space-3); }
.map-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: var(--space-2); }
.map-pick-option { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg-soft); font-weight: 600; cursor: pointer; }
.map-pick-option input { flex: none; accent-color: var(--color-accent); }
.map-pick-option > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.map-pick-option strong { color: var(--color-text); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; }
.map-pick-option:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.map-pick-note { margin: 0; font-size: 0.85rem; }


/* A ban is red, a pick keeps the accent colour: the chosen map and the button say which. */
.veto-form.is-ban .veto-map input:checked + span { border-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); }
.veto-form.is-ban .veto-map input:checked + span strong { color: var(--color-danger); }
.veto-form.is-ban .veto-map > span { position: relative; }
.veto-form.is-ban .veto-map input:checked + span::after { content: '✕'; position: absolute; top: var(--space-2); right: var(--space-3); font-weight: 800; }
.veto-form.is-ban .veto-map input:focus-visible + span { outline-color: var(--color-danger); }
.veto-form.is-ban .btn-danger:not(:disabled) { background: var(--color-danger); color: var(--color-bg); border-color: var(--color-danger); }

/* The maps of the match as tiles: short name big, then Map 1 or whose loser pick it is. */
.veto-match-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.veto-match-maps li {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: var(--space-3) var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    text-align: center;
}
.veto-match-maps strong { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1.2; overflow-wrap: anywhere; }
.veto-match-maps span { color: var(--color-text-muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.veto-match-maps small { max-width: 100%; overflow: hidden; color: var(--color-text-muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.veto-match-maps li.is-first { border-color: var(--color-accent); background: var(--color-accent-soft); }
.veto-match-maps li.is-first strong, .veto-match-maps li.is-first span { color: var(--color-accent); }
/* A grand final advantage: the map left is not played. */
.veto-match-maps li.is-unplayed { opacity: 0.6; border-style: dashed; }

/* Reporting after a veto: map by map, its name and who won it; the score follows, it is not typed. */
.is-veto .match-map { grid-template-columns: minmax(0, 1fr) auto; }
.match-map-label { display: grid; gap: 2px; min-width: 0; }
.match-map-label .match-map-name { overflow-wrap: anywhere; }
.match-map-label small { font-size: 0.78rem; }
.is-veto .match-map-winner { grid-column: auto; }
.match-score.is-computed { padding: var(--space-4); }
.match-score.is-computed .match-score-input { border-color: transparent; background: transparent; pointer-events: none; }
.match-score.is-computed .match-score-input::-webkit-inner-spin-button, .match-score.is-computed .match-score-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.match-score.is-computed .match-score-input { -moz-appearance: textfield; appearance: textfield; }
@media (max-width: 560px) {
    .is-veto .match-map { grid-template-columns: minmax(0, 1fr); }
}

/* The page of a match: the players head it; its main part follows its state, the veto over goes aside. */
.match-page-header h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); }
.match-page-versus { color: var(--color-text-muted); font-size: 0.8em; font-variant-numeric: tabular-nums; }
/* The score of a match played: the figure of the page, as large as the players, in white between their colours. */
.match-page-draw { display: block; color: var(--color-text-muted); font-size: 0.6em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.match-page-versus.is-score { margin: 0 var(--space-3); color: var(--color-text); font-size: 1em; font-weight: 800; white-space: nowrap; }
.match-page-score-separator { color: var(--color-text-muted); font-weight: 400; }
.match-page-header .page-eyebrow abbr { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.match-page-header .page-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.match-page { display: grid; gap: var(--space-4); align-items: start; }
.match-page.has-aside { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.match-page-main, .match-page-aside { display: grid; gap: var(--space-4); min-width: 0; }
.match-page-title { margin: 0 0 var(--space-2); font-size: 1.1rem; }
.match-page-help { margin: calc(-1 * var(--space-1)) 0 var(--space-4); font-size: 0.9rem; }
.report-modal-page { margin: var(--space-4) 0 0; font-size: 0.9rem; text-align: right; }
@media (max-width: 860px) {
    .match-page.has-aside { grid-template-columns: minmax(0, 1fr); }
}
/* Banned: muted red, struck through, after the maps to play. */
.veto-match-maps li.is-banned { border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); background: color-mix(in srgb, var(--color-danger) 6%, transparent); }
.veto-match-maps li.is-banned strong { color: var(--color-danger); text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.85; }
.veto-match-maps li.is-banned span { color: var(--color-danger); opacity: 0.85; }
.match-result-actions .btn[hidden] { display: none; }

/* The timeline of a match (veto, match, result): the steps share the width, the last one takes only its own, so that
   the line runs to the end. */
.match-timeline { display: flex; padding: var(--space-4) var(--space-6); }
.match-timeline .status-step { flex: 1 1 0; min-width: 0; }
.match-timeline .status-step:last-child { flex: 0 0 auto; padding-right: 0; }
/* Label and its info on one line, to stay low. */
.match-timeline .status-step-body { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); row-gap: 0; }
.status-step.is-skipped .status-step-marker { border-style: dashed; }
@media (max-width: 900px) {
    .match-timeline { flex-direction: column; gap: var(--space-4); padding: var(--space-4); }
    .match-timeline .status-step { flex: none; }
}

/* The factions of a match: each player and where their choice stands (blind until both chose). */
.match-page-faction { color: var(--color-text-muted); font-size: 0.55em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.match-page-faction.is-icon { display: inline-flex; vertical-align: middle; cursor: help; }
.factions { display: grid; gap: var(--space-4); }
.factions h2 { margin: 0; }
.factions .veto-heading p { margin: var(--space-1) 0 0; font-size: 0.9rem; }
.factions .callout { margin: 0; }
.factions-players { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.factions-players li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-bg-soft); }
.factions-players li > span { display: inline-flex; align-items: center; gap: var(--space-1); }
.factions-players li.is-chosen { border-color: var(--color-accent); }
.factions-players li.is-chosen > span { color: var(--color-accent); font-weight: 700; }
.factions-players li.is-waiting > span { color: var(--color-text-muted); }
.veto-form .btn[hidden] { display: none; }

/* An option of the result form (an administrator's way out of the veto): the box, then what it does. */
.match-result-advantage { margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-accent); border-radius: var(--radius-md); background: var(--color-accent-soft); font-weight: 600; }
.match-result-option { display: flex; align-items: flex-start; gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-soft); cursor: pointer; }
.match-result-option input { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--color-accent); }
.match-result-option > span { display: grid; gap: 2px; }
.match-result-option .text-muted { font-size: 0.85rem; font-weight: 400; }
.match-result-option:has(input:checked) { border-color: var(--color-accent); }
.match-maps > .btn[hidden] { display: none; }

/* The users, for the administrators. */
.user-search { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.user-search input { flex: 1 1 16rem; max-width: 24rem; }
.user-list .nav-avatar { flex: none; width: 36px; height: 36px; }

/* The administrators of a competition: who, then of which divisions. */
.competition-admins { display: grid; gap: var(--space-3); }
.competition-admins > .btn { justify-self: start; }
.competition-admin { flex-wrap: wrap; }
.competition-admin-pick { display: flex; flex: 1 1 16rem; align-items: center; gap: var(--space-3); margin: 0; cursor: pointer; }
.competition-admin-pick input { flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--color-accent); }
.competition-admin-pick .nav-avatar { flex: none; width: 32px; height: 32px; }
.competition-admin-divisions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.competition-admin:not(:has(.competition-admin-pick input:checked)) .competition-admin-divisions { display: none; }
.competition-admins-title { margin: 0 0 var(--space-3); font-size: 1.1rem; }
.competition-admins-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.competition-admins-list li { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-bg-soft); }
.competition-admins-list li > span { display: grid; line-height: 1.2; }
.competition-admins-list .nav-avatar { flex: none; width: 32px; height: 32px; }
.discord-link { flex: none; margin-left: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-full); background: rgba(88, 101, 242, 0.15); color: var(--color-discord); font-size: 0.75rem; font-weight: 700; text-decoration: none; }
.discord-link:hover { background: rgba(88, 101, 242, 0.28); }

/* A choice among a few options, each with what it means (e.g. who enters the players of a competition). */
.option-cards-field { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.option-cards-field legend { margin-bottom: var(--space-2); padding: 0; font-weight: 700; }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-2); }
.option-card { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; padding: var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg-soft); cursor: pointer; }
.option-card input { flex: none; margin-top: 0.2rem; accent-color: var(--color-accent); }
.option-card > span { display: grid; gap: 2px; }
.option-card .text-muted { font-size: 0.85rem; font-weight: 400; line-height: 1.35; }
.option-card:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.option-card:has(input:checked) strong { color: var(--color-accent); }
.option-card:has(input:disabled) { cursor: default; opacity: 0.75; }
.option-cards-note { margin: 0; font-size: 0.85rem; }

/* Picking an account by searching it. */
.user-picker { display: grid; gap: var(--space-2); }
.user-picker > label { font-weight: 700; }
.user-picker-search { position: relative; }
.user-picker-search input { width: 100%; }
.user-picker-results { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; right: 0; display: grid; margin: 0; padding: var(--space-1); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-lg); list-style: none; }
.user-picker-results li.text-muted { padding: var(--space-2) var(--space-3); font-size: 0.9rem; }
.user-picker-results button { width: 100%; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.user-picker-results button:hover, .user-picker-results button:focus-visible { background: var(--color-accent-soft); color: var(--color-accent); }
.user-picker-chosen { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-accent); border-radius: var(--radius-md); background: var(--color-accent-soft); font-weight: 600; }
.user-picker-results[hidden], .user-picker-chosen[hidden], .user-picker-search[hidden] { display: none; }

/* The BO by round of a cup: a row of small selects per bracket. */
.cup-format { display: grid; gap: var(--space-2); margin: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-soft); }
.cup-format legend { padding: 0 var(--space-2); font-weight: 700; }
.cup-format-scroll { overflow-x: auto; }
.cup-format-table { border-collapse: collapse; }
.cup-format-table th { padding: 0 var(--space-2) var(--space-1); color: var(--color-text-muted); font-size: 0.8rem; font-weight: 600; text-align: left; white-space: nowrap; }
.cup-format-table tbody th { padding-left: 0; color: var(--color-text); font-weight: 700; }
.cup-format-table td { padding: var(--space-1) var(--space-2); }
.cup-format-table td:first-child, .cup-format-table thead th:first-child { padding-left: 0; }
.cup-format-table td[rowspan] { border-left: 1px solid var(--color-border); vertical-align: middle; }
.cup-format-table select { width: auto; min-width: 5.5em; padding-block: var(--space-1); }
.bracket-round-bo { margin-left: var(--space-1); color: var(--color-text-muted); font-size: 0.7em; font-weight: 700; letter-spacing: 0.04em; }

/* US 036: the replays of a match (in its scoreboard, or joined to it) and the dispute of its result. */
.match-played { display: grid; gap: var(--space-4); }
.match-detail-maps td.match-detail-replay { width: auto; text-align: right; white-space: nowrap; }
.match-replays { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.match-replay { display: inline-flex; align-items: center; gap: var(--space-1); }
.match-replay-link { font-size: 0.9rem; font-weight: 600; }
.match-replay-delete,
.match-replay-upload { display: inline; margin: 0; }
.match-replay-delete button { padding: 0 var(--space-1); border: 0; background: none; color: var(--color-text-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.match-replay-delete button:hover { color: var(--color-danger); }
.match-replay-upload label { position: relative; cursor: pointer; }
/* The hidden file field stays inside its button: left where it falls, it widened the page on a phone. */
.match-replay-upload label .sr-only { top: 0; left: 0; }
.match-dispute { flex-direction: column; gap: var(--space-2); }
.match-dispute p { margin: 0; color: var(--color-text); }
.match-dispute .text-muted { color: var(--color-text-muted); }
.match-dispute-form { display: grid; gap: var(--space-2); width: 100%; }
.match-dispute-toggle summary { width: fit-content; color: var(--color-text-muted); font-size: 0.85rem; cursor: pointer; }
.match-dispute-toggle[open] summary { margin-bottom: var(--space-2); }
.cockpit-disputes { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.cockpit-dispute { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.cockpit-dispute p { margin: 0; }

/* US 036: the replays sent with the result, one per map or joined to the match. */
.match-map-replay { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 0.85rem; }
.match-result-replays { display: grid; gap: var(--space-2); }
.match-replay-input { max-width: 100%; color: var(--color-text-muted); font-size: 0.85rem; }
.match-replay-input::file-selector-button { margin-right: var(--space-2); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font: inherit; cursor: pointer; }

/* US 037: the minimap of a map (a square tile, cropped to the centre, or its short name without one) and the image
   of a faction (US 052: a small square, cropped to the centre, next to its name). */
.map-thumb { display: inline-grid; flex: none; place-items: center; aspect-ratio: 1; border-radius: var(--radius-sm, 6px); object-fit: cover; vertical-align: middle; }
.map-thumb.is-sm { width: 1.75rem; margin-right: var(--space-2); }
.map-thumb.is-md { width: 3.5rem; }
.map-thumb.is-lg { width: 100%; }
.map-thumb.is-empty { border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; }
.map-thumb.is-sm.is-empty { font-size: 0.55rem; }
.map-thumb.is-lg.is-empty { aspect-ratio: 2 / 1; font-size: 1.4rem; background: linear-gradient(135deg, var(--color-surface), var(--color-bg-soft)); }
.faction-icon { display: inline-block; flex: none; border-radius: var(--radius-sm, 6px); object-fit: cover; vertical-align: -0.2em; margin-right: 0.3em; }
.faction-choice { display: grid; justify-items: center; gap: var(--space-1); text-align: center; }
.faction-choice .faction-icon { margin: 0; }
.map-form-preview { display: flex; align-items: center; gap: var(--space-3); }
.map-form-preview .map-thumb { width: 6rem; }

/* The veto as cards: the minimap above the name; a ban greys its map out. */
.veto-map > span:has(> .map-thumb) { align-content: start; gap: var(--space-2); padding: var(--space-2); }
.veto-map-name { overflow-wrap: anywhere; }
.veto-match-maps .map-thumb { margin-bottom: var(--space-1); }
.veto-match-maps .map-thumb.is-lg.is-empty { font-size: 1.1rem; }
.veto-match-maps li:has(.map-thumb) { padding: var(--space-2); }
.veto-match-maps li:has(.map-thumb) strong { font-size: 1.1rem; }
.veto-match-maps li.is-banned .map-thumb { filter: grayscale(1); opacity: 0.45; }
.veto-actions .map-thumb { margin-right: var(--space-1); }
.match-detail-maps th.match-detail-map { white-space: nowrap; }
/* Drawn by CSS: the tile adds no text to its map's name. */
.map-thumb.is-empty::before { content: attr(data-label); }

/* The picks & bans explained under the Map Pool of a competition, with the order of the turns BO by BO. */
.map-pool-veto { display: grid; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.map-pool-veto h3 { margin: 0; font-size: 1rem; }
.map-pool-veto p { margin: 0; font-size: 0.9rem; }
.map-pool-veto-steps { display: grid; gap: var(--space-1); margin: 0; padding-left: 1.25rem; font-size: 0.9rem; }
.map-pool-veto-orders { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.map-pool-veto-orders li { padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-bg-soft); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }
.map-pool-veto-bo { margin-right: var(--space-1); color: var(--color-text); font-weight: 800; }

/* The maps played of a match: a card each, its minimap, its winner. */
.match-played-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.match-played-map {
    display: grid;
    align-content: start;
    gap: 2px;
    padding: var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    text-align: center;
}
.match-played-map-visual { position: relative; display: block; margin-bottom: var(--space-2); }
.match-played-map-visual .map-thumb { display: grid; margin: 0; }
.match-played-map-number {
    position: absolute;
    top: var(--space-1);
    left: var(--space-1);
    display: grid;
    place-items: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 var(--space-1);
    border-radius: var(--radius-full);
    background: rgba(5, 7, 10, 0.75);
    color: #eef1f5;
    font-size: 0.8rem;
    font-weight: 800;
}
.match-played-map-name { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.match-played-map-winner { overflow: hidden; font-size: 0.85rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.match-played-map-winner span[aria-label] { color: var(--color-text); }
.match-played-map-replay { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--color-border); }
.match-played-map-replay .btn { width: 100%; }
.match-played-map-replay .match-replay-upload { display: block; }


/* A finished veto, beside the result: one short line per ban and pick. */
.veto-actions li.is-compact { gap: var(--space-2); padding: var(--space-1) var(--space-2); font-size: 0.88rem; }
.veto-actions li.is-compact > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-page-aside { display: grid; align-content: start; gap: var(--space-4); }

/* Taking a participant out of a competition under way (US 038). */
.withdrawal-form { display: grid; gap: var(--space-5, 20px); }
.withdrawal-choice { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.withdrawal-choice legend, .withdrawal-effects h2 { margin-bottom: var(--space-2); font-size: 1rem; font-weight: 700; }
.withdrawal-effects { display: grid; gap: var(--space-2); }
.withdrawal-effects p { margin: 0; }
.withdrawal-matches { display: grid; gap: var(--space-1); margin: 0; padding-left: 1.25rem; }
.participant-out { display: inline-block; margin-left: var(--space-1); padding: 0 0.45em; border: 1px solid color-mix(in srgb, var(--color-danger) 35%, transparent); border-radius: var(--radius-full); color: var(--color-danger); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1.6; text-transform: uppercase; vertical-align: middle; }
.match-page-header h1 .participant-out { font-size: 0.35em; }
.match-page-off-site { display: inline-flex; margin-left: var(--space-1); color: var(--color-text-muted); font-size: 0.5em; vertical-align: middle; cursor: help; }
.participant-out.is-replaced { border-color: var(--color-border-strong); color: var(--color-text-muted); text-transform: none; letter-spacing: 0; }
.match-page-status { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; }
/* The step under way is the reader's: said in the accent, it leads to the section where it is done. */
.match-your-turn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}
.match-your-turn:hover { background: var(--color-accent-strong); }
.match-your-turn span:last-child { font-weight: 800; }
.match-your-turn-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: your-turn-pulse 1.4s ease-in-out infinite; }
@keyframes your-turn-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .match-your-turn-dot { animation: none; } }
/* The section where the reader plays: framed in the accent, its title announced. */
.card.is-my-turn { border-color: var(--color-accent); box-shadow: 0 0 0 4px var(--color-accent-soft), var(--shadow-md); }
.your-turn-kicker { display: block; margin-bottom: var(--space-1); color: var(--color-accent); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 640px) {
    .match-page-header h1:has(.is-score, .match-page-faction) { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
    .match-page-header h1:has(.is-score, .match-page-faction) .match-page-versus { margin: 0; }
}

/* The calendar of a phase (US 040). */
.stage-calendar { display: grid; gap: var(--space-4); }
.stage-calendar-fill { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.stage-calendar-fill input, .stage-calendar-fill select { width: auto; }
.stage-calendar-rounds { width: 100%; border-collapse: collapse; }
.stage-calendar-rounds th, .stage-calendar-rounds td { padding: var(--space-2); border-bottom: 1px solid var(--color-border); text-align: left; }
.stage-calendar-rounds thead th { color: var(--color-text-muted); font-size: 0.75rem; text-transform: uppercase; }
.stage-calendar-rounds input { width: auto; }
.round-period { color: var(--color-text-muted); font-size: 0.85rem; font-weight: 500; }
/* The match for its players: its date, its pick & bans, its result, each with its icon; none pushed. */
.match-journey ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.match-journey a { display: flex; align-items: center; gap: var(--space-3); height: 100%; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-soft); color: inherit; text-decoration: none; }
.match-journey a:hover { border-color: var(--color-border-strong); }
.match-journey-icon { display: inline-grid; flex: none; place-items: center; width: 2.2em; height: 2.2em; border-radius: var(--radius-md); background: var(--color-accent-soft); color: var(--color-accent); }
.match-journey-text { display: grid; min-width: 0; }
.match-journey-name { font-weight: 700; }
.match-journey-check { color: var(--color-success); }
.match-journey-detail { overflow: hidden; color: var(--color-text-muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }
.match-page-main:has(> .match-journey) { gap: var(--space-8); }
.match-step { display: grid; gap: var(--space-3); }
.match-step-head { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 1.375rem; }
.match-step-head svg { color: var(--color-accent); }
.match-step-lead { margin: 0; font-weight: 700; }
.match-step-summary { margin: 0; color: var(--color-text-muted); }
.match-step .match-plan, .match-step .match-plan-form { margin-top: 0; }
/* Inside its section, the races and the veto are a part of it: a smaller title, no second "your turn", no glow. */
.match-step .veto-heading h2 { font-size: 1rem; }
.match-step .your-turn-kicker { display: none; }
.match-step .card.is-my-turn { border-color: var(--color-border); box-shadow: none; }
.match-plan { margin-top: var(--space-2); }
.match-plan summary { width: fit-content; color: var(--color-text-muted); font-size: 0.85rem; cursor: pointer; }
.match-plan-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.match-plan-form input[type="datetime-local"] { width: auto; max-width: 100%; }

/* The calendar of a competition (US 041): the matches still to plan, then the matches planned day by day. */
.agenda-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.agenda-heading h2 { margin: 0; }
.agenda-groups { display: grid; gap: var(--space-3); }
.agenda-group h3 { margin: 0 0 var(--space-2); font-size: 1rem; }
.agenda-day { margin-bottom: var(--space-4); }
.agenda-matches { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.card.agenda-matches { padding: var(--space-1) var(--space-3); }
.agenda-match { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.agenda-match:last-child { border-bottom: 0; }
.agenda-match:not(:has(.agenda-time)) { grid-template-columns: minmax(0, 1fr) auto; }
.agenda-time { color: var(--color-text); font-weight: 800; font-variant-numeric: tabular-nums; }
.agenda-players { color: var(--color-text); font-weight: 700; }
.agenda-versus { margin: 0 var(--space-1); color: var(--color-text-muted); font-weight: 500; }
.agenda-context { grid-column: -2 / -1; grid-row: 1; justify-self: end; color: var(--color-text-muted); font-size: 0.82rem; text-align: right; }
.agenda-state { grid-column: 1 / -1; justify-self: start; }
.agenda-match.is-mine .agenda-players { color: var(--color-accent); }

/* Where a competition speaks on Discord (US 043). */
.discord-channel { display: grid; gap: var(--space-1); }
.discord-channel .help-text { margin: 0; }
.discord-site-bot { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.my-notifications { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: 0.88rem; }

/* The navigation of the administration of a competition: its four sections, the public page aside, and the bar of
   its settings. */
.admin-nav { margin-bottom: var(--space-3); }
.admin-nav .admin-nav-public { margin-left: auto; color: var(--color-text-muted); }
.admin-subnav { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0 0 var(--space-5, 20px); }
.admin-subnav-item { padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); color: var(--color-text-muted); font-size: 0.85rem; font-weight: 600; }
.admin-subnav-item:hover { border-color: var(--color-border-strong); color: var(--color-text); }
.admin-subnav-item.is-active { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }

/* The language switcher of the menu (US 046). */
.locale-switch { padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); color: var(--color-text-muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; }
.locale-switch:hover { border-color: var(--color-text-muted); color: var(--color-text); }
/* The theme switch shows where it leads: a sun in the dark theme, a moon in the light one. */
.theme-switch { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: none; color: var(--color-text-muted); cursor: pointer; }
.theme-switch:hover { border-color: var(--color-text-muted); color: var(--color-text); }
.theme-switch svg { width: 16px; height: 16px; }
.theme-switch .is-moon, :root[data-theme="light"] .theme-switch .is-sun { display: none; }
:root[data-theme="light"] .theme-switch .is-moon { display: block; }
/* In the account menu: the theme to switch to, with its icon. */
.user-menu-theme { display: flex; align-items: center; gap: var(--space-2); width: 100%; border: 0; background: none; font: inherit; font-size: 0.9rem; font-weight: 600; text-align: left; cursor: pointer; }
.user-menu-theme svg { width: 16px; height: 16px; color: var(--color-text-muted); }
.user-menu-theme .is-moon, :root[data-theme="light"] .user-menu-theme .is-sun { display: none; }
:root[data-theme="light"] .user-menu-theme .is-moon { display: inline; }
:root[data-theme="light"] .user-menu-theme svg.is-moon { display: block; }

/* US 050: the hours of the page are not those of the competition. */
.time-zone-notice { margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: 0.85rem; }

/* US 051: the cash prize on Matcherino, flat on the right of the competition header, in the green of the site. */
.competition-header-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); }
.competition-cash-prize { display: flex; flex-direction: column; align-items: flex-end; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-accent-soft); text-align: right; transition: background-color 0.15s ease, transform 0.15s ease; }
/* As wide as the links under it: the side column reads as one block. */
.competition-header-side > .competition-cash-prize { align-self: stretch; }
.competition-cash-prize:hover { background: color-mix(in srgb, var(--color-accent) 22%, transparent); transform: translateY(-1px); }
.competition-cash-prize-label { color: var(--color-text-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.competition-cash-prize-amount { margin-top: 2px; color: var(--color-text); font-size: 2rem; line-height: 1.1; letter-spacing: -0.02em; }
.competition-cash-prize-cta { color: var(--color-accent); font-size: 0.85rem; font-weight: 600; }
/* Where else a competition lives (Discord, Liquipedia): a row of pills on the right, under its cash prize. */
/* A few lines at most: it takes the width left by the side column. */
.competition-header-description { max-width: none; margin: var(--space-3) 0 0; }
.competition-header > div:first-child { flex: 1 1 0; min-width: min(100%, 20rem); }
.competition-header-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin: 0; }
.competition-link { display: inline-flex; align-items: center; gap: 0.45em; padding: 0.3rem 0.75rem; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-bg-soft); color: var(--color-text); font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: border-color 0.15s ease, color 0.15s ease; }
.competition-link:hover { border-color: var(--color-accent); color: var(--color-accent); }
.competition-link-icon { flex: none; width: 1.1em; height: 1.1em; }
/* US 053: the mark of Liquipedia, in the colour of the text around it. */
.liquipedia-icon { flex: none; display: inline-block; width: 1.5em; height: 1.2em; background: currentColor; -webkit-mask: url("../images/liquipedia-u52kWc3.png") no-repeat center / contain; mask: url("../images/liquipedia-u52kWc3.png") no-repeat center / contain; }
.competition-tile-prize, .home-competition-prize { font-weight: 700; color: var(--color-text); font-size: 0.9rem; }
@media (max-width: 640px) {
    .competition-header-side, .competition-cash-prize { align-items: flex-start; text-align: left; }
    .competition-header-links { justify-content: flex-start; }
    .competition-header-side > .competition-cash-prize { align-self: flex-start; }
    .competition-header-side { width: 100%; }
}

/* ==========================================================================
   The profile of a player (US 066), and the links to it
   ========================================================================== */
/* A name that leads to a profile: as the text around it, a little bolder; the accent when pointed at. */
.player-link { color: inherit; font-weight: 600; text-decoration: none; transition: color var(--transition-fast); }
.player-link:hover, .player-link:focus-visible { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.player-identity { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.player-identity h1 { margin: 0; overflow-wrap: anywhere; }
.player-avatar { display: grid; place-items: center; flex: none; width: 72px; height: 72px; border-radius: 50%; background: var(--color-surface); color: var(--color-text-muted); font-size: 1.6rem; font-weight: 700; object-fit: cover; }
.player-competitions { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.player-competition { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.player-competition > div { display: grid; gap: 2px; min-width: 0; }
.player-competition-title { font-weight: 700; overflow-wrap: anywhere; }
.player-competition-result { justify-items: end; text-align: right; }
.player-result { font-weight: 700; }
.player-result.is-rank_1, .player-result.is-rank_2, .player-result.is-rank_3 { color: var(--color-accent); }
.player-result.is-disqualified { color: var(--color-danger); }
.player-notification { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); flex-basis: 100%; padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.player-notification > .text-muted { flex: 1 1 auto; font-size: 0.9rem; }
@media (max-width: 560px) {
    .player-avatar { width: 56px; height: 56px; }
    .player-competition-result { justify-items: start; text-align: left; }
}
