/* League broadcast theme: navigation shell, page bands, week tabs and
   scoreboard game rows. Loads after ui.css; colours and fonts come from
   tokens.css. Markup, IDs and form controls are unchanged, so every page
   script and administrative tool keeps working. */

body { overflow-x: clip; }

/* ---------- Navigation shell ---------- */

.brand-wordmark { display: none; }
.tabbar { display: none; }

@media (min-width: 821px) {
    /* Desktop: the sidebar becomes a sticky top bar. */
    .layout, body.sidebar-collapsed .layout { display: block; }
    body .sidebar, body.sidebar-collapsed .sidebar {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        gap: 28px;
        width: auto;
        height: 64px;
        padding: 0 clamp(20px, 4vw, 48px);
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
        background: rgba(4, 9, 22, .86);
        -webkit-backdrop-filter: saturate(160%) blur(14px);
        backdrop-filter: saturate(160%) blur(14px);
    }
    body .sidebar-toggle, body .mobile-page-context, body.sidebar-collapsed .mobile-page-context { display: none; }
    body .brand, body.sidebar-collapsed .brand { display: flex; align-items: center; gap: 10px; flex: none; margin: 0; }
    body .brand-logo, body.sidebar-collapsed .brand-logo {
        width: 40px; height: 40px; margin: 0; border-radius: 9px; object-fit: contain;
    }
    body .brand .eyebrow, body .brand h1 { display: none; }
    .brand-wordmark {
        display: inline;
        font: 800 23px/1 var(--font-display);
        letter-spacing: .02em;
        text-transform: uppercase;
        color: var(--color-text);
    }
    .brand-wordmark span { color: var(--color-gold); }

    body .navigation, body.sidebar-collapsed .navigation {
        display: flex;
        align-items: stretch;
        gap: 2px;
        height: 100%;
    }
    body .sidebar .navigation .nav-link, body.sidebar-collapsed .sidebar .navigation .nav-link,
    body .sidebar .nav-more-toggle {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px;
        width: auto;
        height: 100%;
        min-height: 0;
        padding: 0 14px;
        border: 0;
        border-radius: 0;
        background: none;
        color: var(--color-muted);
        font: 600 14px/1 var(--font-body);
        white-space: nowrap;
        cursor: pointer;
        transition: color .15s;
    }
    body .sidebar .navigation .nav-link.hidden { display: none; }
    body .sidebar .navigation .nav-link:hover, body .sidebar .nav-more-toggle:hover { color: var(--color-text); }
    body .sidebar .navigation .nav-link[aria-current="page"], body .sidebar .nav-more-toggle.active {
        color: var(--color-text);
        background: none;
    }
    body .sidebar .navigation .nav-link[aria-current="page"]::after, body .sidebar .nav-more-toggle.active::after {
        content: "";
        position: absolute;
        left: 14px;
        right: 14px;
        bottom: -1px;
        height: 3px;
        border-radius: 3px 3px 0 0;
        background: var(--color-gold);
    }
    body .sidebar .nav-text, body.sidebar-collapsed .sidebar .nav-text { display: inline; }
    body .sidebar .nav-short, body.sidebar-collapsed .sidebar .nav-short { display: none; }

    /* Role tools open as a menu under "Más". */
    .nav-more { position: relative; display: flex; height: 100%; }
    .nav-more-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 50;
        display: none;
        min-width: 250px;
        padding: 8px;
        border: 1px solid var(--color-border-strong);
        border-radius: var(--ui-radius);
        background: var(--color-surface);
        box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    }
    .nav-more.open .nav-more-menu { display: grid; gap: 2px; }
    body .sidebar .nav-more-menu .nav-link, body.sidebar-collapsed .sidebar .nav-more-menu .nav-link {
        height: auto;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: var(--ui-radius-small);
        color: var(--color-text);
    }
    body .sidebar .nav-more-menu .nav-link:hover { background: var(--color-gold-soft); }
    body .sidebar .nav-more-menu .nav-link[aria-current="page"] { color: var(--color-gold); background: var(--color-gold-soft); }
    body .sidebar .nav-more-menu .nav-link[aria-current="page"]::after { display: none; }

    body .session-controls, body.sidebar-collapsed .session-controls {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 0 auto;
    }
    body .session-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body .sidebar .session-controls .nav-link, body.sidebar-collapsed .sidebar .session-controls .nav-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: auto;
        height: 38px;
        min-height: 38px;
        padding: 0 16px;
        border: 1px solid var(--color-border-strong);
        border-radius: 999px;
        background: transparent;
        color: var(--color-text);
        font: 600 14px/1 var(--font-body);
        white-space: nowrap;
    }
    body .sidebar .session-controls .nav-link.hidden { display: none; }
    body .sidebar .session-controls .nav-link:hover { border-color: var(--color-gold); background: var(--color-gold-soft); }
    body .sidebar .session-controls .nav-text { display: inline; }
    body .sidebar .session-controls .nav-short { display: none; }
}

@media (max-width: 820px) {
    /* Phones: the drawer lists role tools directly; a tab bar keeps the
       four public sections one tap away. */
    .nav-more { display: grid; gap: 8px; }
    .nav-more-toggle { display: none; }
    .nav-more-menu { display: grid; gap: 8px; }
    body.sidebar-collapsed .nav-more { display: none; }

    .tabbar {
        position: fixed;
        z-index: 15;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--color-border);
        background: rgba(4, 9, 22, .94);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
    .tabbar-link {
        display: grid;
        justify-items: center;
        align-content: center;
        gap: 3px;
        min-height: 50px;
        padding: 4px 2px;
        border-radius: var(--ui-radius-small);
        color: var(--color-faint);
        font-size: 11px;
        font-weight: 600;
        text-decoration: none;
    }
    .tabbar-link svg { width: 22px; height: 22px; }
    .tabbar-link[aria-current="page"] { color: var(--color-gold); }
    .content { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
}

/* ---------- Page band ---------- */

/* The page title runs edge to edge like a broadcast lower third, with
   faint yard lines; its text stays aligned with the page column. */
.league-page > .section-header {
    --band-gutter: calc(50vw - var(--scrollbar-width, 0px) / 2 - 50%);
    position: relative;
    margin: 0 calc(-1 * var(--band-gutter));
    padding: 44px var(--band-gutter) 34px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: none;
    background:
        linear-gradient(180deg, rgba(4, 9, 22, 0) 0%, rgba(4, 9, 22, .55) 100%),
        repeating-linear-gradient(90deg, transparent 0 119px, rgba(255, 255, 255, .035) 119px 120px),
        radial-gradient(ellipse 70% 130% at 85% -20%, rgba(29, 58, 122, .8), transparent 62%),
        var(--color-navy-dark);
}
.content > .league-page > .section-header:first-child { margin-top: -32px; }
.league-page > .section-header h2 { font-size: clamp(34px, 5.2vw, 72px); margin-bottom: 10px; }
.league-page > .section-header p { color: var(--color-muted); font-size: 15px; }
.league-page > .section-header .ui-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    letter-spacing: .12em;
}
.league-page > .section-header .ui-kicker::before {
    content: "";
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--color-gold);
}
/* A page that opens with "Volver" keeps the link inside the band. */
.content > .league-page > .back-link:first-child { position: relative; z-index: 1; }
.content > .league-page > .back-link:first-child + .section-header {
    margin-top: calc(-32px - 44px - var(--ui-gap));
    padding-top: calc(32px + 44px + var(--ui-gap) + 20px);
}
@media (max-width: 820px) {
    .content > .league-page > .section-header:first-child { margin-top: -18px; }
    .content > .league-page > .back-link:first-child + .section-header {
        margin-top: calc(-18px - 44px - 16px);
        padding-top: calc(18px + 44px + 16px + 12px);
    }
    .league-page > .section-header { padding-top: 30px; padding-bottom: 24px; }
    .league-page > .section-header p { font-size: 14px; }
}

/* ---------- Games: week band ---------- */

/* The band tells the story of the week on screen; its week tabs sit on the
   band's bottom edge, and the week number fills the right side. */
.league-page > .games-hero { padding-bottom: 0; overflow: hidden; }
.games-hero::after {
    content: attr(data-week);
    position: absolute;
    top: -36px;
    right: calc(var(--band-gutter) - 12px);
    font: italic 800 340px/1 var(--font-display);
    color: rgba(255, 255, 255, .035);
    pointer-events: none;
}
.games-hero-copy { position: relative; z-index: 1; }
.games-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; min-height: 26px; margin-bottom: 14px; }
.games-hero-tags:empty { display: none; }
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}
.hero-tag-live { background: rgba(249, 115, 22, .16); color: #ffb27a; }
.hero-tag-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .25);
}
.hero-tag-gold { background: var(--color-gold-soft); color: var(--color-gold); }
.league-page > .games-hero h2 { font-size: clamp(46px, 7vw, 88px); line-height: .9; margin-bottom: 14px; }
.games-hero h2 em { font-style: italic; color: var(--color-gold); }
.games-hero-stats { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 4vw, 52px); margin: 26px 0 0; padding: 0; list-style: none; }
.games-hero-stats[hidden] { display: none; }
.games-hero-stats li { display: grid; gap: 2px; }
.games-hero-stats strong { font: 700 36px/1 var(--font-display); color: var(--color-text); }
.games-hero-stats span { color: var(--color-faint); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }

.week-strip {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 4px;
    margin-top: 30px;
    overflow-x: auto;
    scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }
.week-strip[hidden] { display: none; }
.content .week-strip button.week-tab {
    flex: none;
    display: grid;
    justify-items: start;
    gap: 3px;
    min-width: 92px;
    min-height: 60px;
    padding: 10px 14px 12px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--color-faint);
    text-align: left;
    transition: color .15s, background .15s;
}
.week-tab strong { font: 700 21px/1 var(--font-display); letter-spacing: .02em; }
.week-tab small { font-size: 11px; font-weight: 600; white-space: nowrap; }
.content .week-strip button.week-tab:hover { color: var(--color-text); background: rgba(255, 255, 255, .03); }
.content .week-strip button.week-tab[aria-pressed="true"] {
    color: var(--color-text);
    background: rgba(255, 255, 255, .06);
    border-bottom-color: var(--color-gold);
}
.week-tab[aria-pressed="true"] small { color: var(--color-gold); }

/* ---------- Games: filter bar ---------- */

/* One slim bar that stays under the top bar while the list scrolls. */
.content .games-filters {
    --band-gutter: calc(50vw - var(--scrollbar-width, 0px) / 2 - 50%);
    position: sticky;
    top: 64px;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    max-width: none;
    margin: calc(-1 * var(--ui-gap)) calc(-1 * var(--band-gutter)) 0;
    padding: 12px var(--band-gutter);
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: rgba(4, 9, 22, .9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: none;
}
.games-filters-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.content .games-filters .segmented {
    display: inline-flex;
    flex: none;
    padding: 3px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
}
.content .games-filters .segmented.hidden { display: none; }
.content .games-filters .segmented button {
    min-height: 32px;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 600;
}
.content .games-filters .segmented button[aria-pressed="true"] { background: var(--color-text); color: var(--color-page); }
.content .games-filters .games-filter-pill, .content .games-filters .games-youth-chip { display: block; font-size: 0; min-width: 0; }
.content .games-filters .games-youth-chip.hidden { display: none; }
.content .games-filters .games-youth-chip .readonly-control {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
}
.content .games-filters .games-filter-pill select, .content .games-filters .games-filter-pill input {
    height: 38px;
    min-height: 38px;
    padding: 0 34px 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
}
.content .games-filters .games-team-search { margin-left: auto; width: min(280px, 100%); }
.content .games-filters .games-team-search input {
    width: 100%;
    padding: 0 16px 0 38px;
    font-weight: 500;
    background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238395b0' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
}
.content .games-filters .results-count { margin: 0; color: var(--color-faint); font-size: 13px; white-space: nowrap; }
.content .games-filters button.games-filters-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 13px;
}
.content .games-filters-more { display: none; }
.content .games-filters.is-expanded .games-filters-more {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 220px));
    gap: 10px 12px;
    align-items: end;
}
.content .games-filters-more label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); }
.content .games-filters-more select { min-height: 38px; padding: 6px 12px; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }
/* The branch buttons replace the branch select, which stays the source of truth. */
.content .games-filters-more #game-filter-branch-field { display: none; }
.content .games-filters-more .games-filters-hint { grid-column: 1 / -1; margin: 0; font-size: 12px; }

/* The wide calendar layout is for administrators' boards; visitors get the
   same reading width as every other page. */
@media (min-width: 1024px) {
    body:not(.role-league_admin) .content:has(#game-calendar-management) { width: min(1200px, calc(100% - 48px)); }
}

/* ---------- Games: scoreboard rows ---------- */
/* Scoped to the games list: referee dashboards reuse the game-card class. */

.content .games-list { gap: 0; }
.content #games .game-time-group {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0 28px;
    margin: 0;
    padding: 26px 0 8px;
    border-top: 1px solid var(--color-border);
}
.content #games .game-time-group:first-child { border-top: 0; }
.content #games .game-time-group + .game-time-group { margin-top: 0; }
.content #games .game-time-heading {
    position: sticky;
    top: 150px;
    align-self: start;
    display: grid;
    gap: 4px;
    padding: 0;
    border: 0;
}
.content #games .game-time-heading time { font: 700 40px/1 var(--font-display); letter-spacing: .01em; color: var(--color-text); }
.content #games .game-time-heading h3 {
    margin: 0;
    font: 700 12px/1.3 var(--font-body);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-faint);
}
.content #games .game-time-heading .game-calendar-context { font-size: 12px; line-height: 1.4; }
.content #games .game-time-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 18px; }

.content #games .game-card {
    display: block;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: none;
    transition: border-color .15s, background-color .15s;
}
.content #games .game-card:hover { border-color: var(--color-border-strong); background-color: var(--color-surface-raised); }
.content #games .game-row {
    position: relative;
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 12px 16px;
}
.content #games .game-card-header { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.content #games .game-field { font: 700 13px/1.1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
.content #games .game-field .game-friendly-badge {
    margin-left: 6px;
    padding: 1px 6px;
    border: 0;
    border-radius: 4px;
    background: rgba(96, 165, 250, .16);
    color: #bfdbfe;
    font: 700 10px/1.6 var(--font-body);
    letter-spacing: .06em;
    vertical-align: 1px;
}
.content #games .game-division { font-size: 12px; color: var(--color-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content #games .game-card-header .game-status { margin-top: 2px; }

.content #games .game-teams { display: grid; grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr); align-items: center; gap: 16px; }
.content #games .game-team-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: none;
}
.content #games .game-team-row[data-side="home"] { justify-content: flex-end; text-align: right; }
.content #games .game-team-row[data-side="home"] .game-team-name { order: 1; }
.content #games .game-team-row[data-side="home"] .game-team-logo { order: 2; }
.content #games .game-team-row[data-side="home"] .game-team-score { order: 3; }
.content #games .game-team-row[data-side="away"] .game-team-score { order: 1; }
.content #games .game-team-row[data-side="away"] .game-team-logo { order: 2; }
.content #games .game-team-row[data-side="away"] .game-team-name { order: 3; }
.content #games .game-team-side { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.content #games .game-team-name {
    flex: 0 1 auto;
    position: relative;
    z-index: 1;
    min-width: 0;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.content #games a.game-team-name:hover { color: var(--color-gold); text-decoration: underline; }
.content #games .game-team-logo { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff; object-fit: contain; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.content #games .game-team-logo-placeholder {
    display: grid;
    place-items: center;
    border: 0;
    background: var(--color-navy-soft);
    color: var(--color-text);
    font: 700 14px/1 var(--font-display);
    letter-spacing: .04em;
}
.content #games .game-team-logo-pending {
    display: grid;
    place-items: center;
    border: 1.5px dashed var(--color-border-strong);
    background: transparent;
    box-shadow: none;
    color: var(--color-faint);
    font: 700 14px/1 var(--font-display);
}
.content #games .game-team-name-pending { font-style: italic; font-weight: 500; color: var(--color-muted); }
.content #games .game-team-score { flex: none; min-width: 0; font: 700 34px/1 var(--font-display); color: var(--color-text); text-align: center; }
.content #games .game-team-score.is-empty { display: none; }
.content #games .game-team-row[data-outcome="winner"] .game-team-name { font-weight: 700; }
.content #games .game-team-row[data-outcome="loser"] .game-team-name { color: var(--color-muted); font-weight: 500; }
.content #games .game-team-row[data-outcome="loser"] .game-team-score { color: var(--color-faint); }
.content #games .game-center { display: grid; justify-items: center; gap: 2px; color: var(--color-faint); }
.content #games .game-center b { font: italic 800 22px/1 var(--font-display); letter-spacing: .04em; }
.content #games .game-center small { font-size: 11px; font-weight: 600; }
.content #games .game-center-dash { font: 700 24px/1 var(--font-display); }

/* The whole row opens the game; team names keep their own roster links. */
.content #games .game-row .game-details-link {
    justify-self: end;
    display: inline-flex;
    color: var(--color-faint);
    text-decoration: none;
    font-size: 0;
}
.content #games .game-row .game-details-link::after { content: ""; position: absolute; inset: 0; }
.content #games .game-row .game-details-link .game-details-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.content #games .game-card:hover .game-details-link { color: var(--color-gold); }
.content #games .game-row .game-details-link:focus-visible { outline: none; }
.content #games .game-row:has(.game-details-link:focus-visible) { outline: 2px solid var(--color-gold); outline-offset: -2px; border-radius: 10px; }

/* Finals and third-place games carry the gold of the trophy. */
.game-bracket-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-gold);
    font: 800 15px/1.05 var(--font-display);
    letter-spacing: .05em;
    text-transform: uppercase;
}
.content #games .game-card.game-card-bracket {
    border-color: rgba(244, 197, 66, .3);
    background: linear-gradient(90deg, rgba(244, 197, 66, .1), rgba(244, 197, 66, 0) 46%), var(--color-surface);
}
.content #games .game-card.game-card-friendly { border-left: 1px solid var(--color-border); background: var(--color-surface); }

/* Admin and scorekeeper tools stay in each game, folded under the row. */
.content #games .game-card .game-admin-panel { margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.content #games .game-card .game-admin-panel > summary {
    display: list-item;
    width: auto;
    min-height: 0;
    padding: 7px 16px;
    line-height: 1.4;
    color: var(--color-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}
.content #games .game-card .game-admin-panel[open] > .game-admin-controls { padding: 4px 16px 16px; }

@media (max-width: 820px) {
    .content .games-filters { top: 68px; margin-top: -16px; }
    .content #games .game-time-heading { top: 0; position: static; }
}

@media (max-width: 760px) {
    .league-page > .games-hero h2 { font-size: 46px; }
    .games-hero::after { font-size: 210px; top: -14px; }
    .games-hero-stats strong { font-size: 28px; }
    .week-strip { margin: 22px calc(-1 * var(--band-gutter)) 0; padding: 0 var(--band-gutter); }
    .week-strip::after { content: ""; flex: none; width: var(--band-gutter); }
    .content .week-strip button.week-tab { min-width: 78px; }

    /* Phones: branch buttons, then category and search, then count and "Más filtros". */
    .games-filters-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .content .games-filters .segmented, .content .games-filters .games-youth-chip { grid-column: 1 / -1; }
    .content .games-filters .segmented { width: 100%; }
    .content .games-filters .segmented button { flex: 1; padding: 0 8px; }
    .content .games-filters .games-filter-pill select, .content .games-filters .games-filter-pill input { width: 100%; }
    .content .games-filters .games-team-search { margin-left: 0; width: auto; }
    .content .games-filters .results-count { align-self: center; }
    .content .games-filters button.games-filters-toggle { justify-self: end; }
    .content .games-filters.is-expanded .games-filters-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .content #games .game-time-group { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
    .content #games .game-time-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 12px; }
    .content #games .game-time-heading time { font-size: 32px; }
    .content #games .game-time-heading .game-calendar-context { flex-basis: 100%; }

    .content #games .game-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
    .content #games .game-card-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
    .content #games .game-teams { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
    .content #games .game-team-row[data-side="home"] { grid-row: 1; justify-content: flex-start; text-align: left; }
    .content #games .game-team-row[data-side="away"] { grid-row: 2; }
    .content #games .game-team-row .game-team-logo { order: 1 !important; width: 32px; height: 32px; }
    .content #games .game-team-row .game-team-name { order: 2 !important; -webkit-line-clamp: 1; }
    .content #games .game-team-row .game-team-score { order: 3 !important; margin-left: auto; font-size: 28px; }
    .content #games .game-center { grid-column: 2; grid-row: 1 / 3; }
    .content #games .game-card-final .game-center { display: none; }
    /* The chevron hides; its link still covers the row, so a tap anywhere opens the game. */
    .content #games .game-row .game-details-link { position: static; width: 0; height: 0; }
    .content #games .game-row .game-details-link svg { display: none; }
}

/* ---------- Shared page system ---------- */
/* The games page language, applied to every page: band tags and numbers,
   a slim sticky filter bar, condensed section titles, number strips instead
   of boxed metrics, flat cards and scoreboard tables. */

/* Band tags and numbers (the games band uses its own ids). */
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hero-tags:empty { display: none; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 4vw, 52px); margin: 26px 0 0; padding: 0; list-style: none; }
.hero-stats[hidden] { display: none; }
.hero-stats li { display: grid; gap: 2px; }
.hero-stats strong { font: 700 36px/1 var(--font-display); color: var(--color-text); }
.hero-stats span { color: var(--color-faint); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }

/* Filter bar: the games bar for any page (division pickers, directory search). */
.content .filter-bar {
    --band-gutter: calc(50vw - var(--scrollbar-width, 0px) / 2 - 50%);
    position: sticky;
    top: 64px;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    max-width: none;
    margin: 0 calc(-1 * var(--band-gutter));
    padding: 12px var(--band-gutter);
    border: 0;
    border-block: 1px solid var(--color-border);
    border-radius: 0;
    background: rgba(4, 9, 22, .9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: none;
}
/* Right under the band, the bar joins it. */
.content .league-page > .section-header + .filter-bar { margin-top: calc(-1 * var(--ui-gap)); border-top: 0; }
.content .filter-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0; grid-template-columns: none; }
/* Outranks the form label rule in ui.css; the text stays for screen readers. */
.content .filter-bar label:not(.role-choice):not(.privacy-consent) { display: block; min-width: 0; font-size: 0; }
.content .filter-bar label.hidden { display: none; }
.content .filter-bar .segmented-source { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.content .filter-bar select, .content .filter-bar input {
    width: auto;
    height: 38px;
    min-height: 38px;
    padding: 0 34px 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
}
.content .filter-bar .readonly-control {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
}
.content .filter-bar .filter-search { order: 5; margin-left: auto; width: min(280px, 100%); }
.content .filter-bar .filter-search input {
    width: 100%;
    padding: 0 16px 0 38px;
    font-weight: 500;
    background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238395b0' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
}
.content .filter-bar .results-count { order: 6; margin: 0; color: var(--color-faint); font-size: 13px; white-space: nowrap; }
.content .filter-bar button.secondary-button { order: 7; min-height: 38px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 13px; }
/* Division filters apply on change; the submit button stays for keyboards. */
.content .filter-bar button[type="submit"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.content .filter-bar .form-hint, .content .filter-bar .form-message { flex-basis: 100%; margin: 0; font-size: 12px; }
.content .filter-bar .form-message:empty, .content .filter-bar .form-hint.hidden { display: none; }
.content .filter-bar .segmented, .content .games-filters .segmented {
    display: inline-flex;
    flex: none;
    padding: 3px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
}
.content .filter-bar .segmented[hidden] { display: none; }
.content .filter-bar .segmented button {
    min-height: 32px;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 600;
}
.content .filter-bar .segmented button[aria-pressed="true"] { background: var(--color-text); color: var(--color-page); }
@media (max-width: 820px) {
    .content .filter-bar { top: 68px; }
    .content .league-page > .section-header + .filter-bar, #teams-directory .filter-bar.teams-directory-filters { margin-top: -16px; }
}
@media (max-width: 760px) {
    .content .filter-bar, .content .filter-bar form { gap: 8px; }
    .content .filter-bar .segmented { width: 100%; }
    .content .filter-bar .segmented button { flex: 1; padding: 0 8px; }
    .content .filter-bar .filter-search { order: 0; margin-left: 0; width: 100%; flex-basis: 100%; }
    .content .filter-bar label:not(.filter-search):not(.segmented-source) { flex: 1 1 0; }
    .content .filter-bar label select { width: 100%; }
}

/* Section titles read like the games time slots. */
.league-page > section > h3:first-child,
.league-page > section > header > h3,
.league-page .dashboard-section-heading h3,
.league-page .teams-directory-heading h3,
.league-page .referee-directory-heading h3 {
    margin: 0 0 6px;
    font: 800 26px/1.05 var(--font-display);
    letter-spacing: .01em;
    text-transform: uppercase;
    color: var(--color-text);
}

/* Metrics are a strip of large numbers, not a row of boxes. */
/* Every metric carries its own rule on the left, so wrapped rows match. */
.league-page .stat-grid { gap: 14px 0; padding: 14px 0; border-block: 1px solid var(--color-border); }
.content .stat-item {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 2px 18px;
    border: 0;
    border-left: 2px solid var(--color-border-strong);
    border-radius: 0;
    background: none;
    box-shadow: none;
}
.content .stat-item span { order: 2; color: var(--color-faint); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.content .stat-item strong { order: 1; font: 700 40px/1 var(--font-display); color: var(--color-text); }
@media (max-width: 820px) {
    .content .stat-item { padding: 2px 12px; }
    .content .stat-item strong { font-size: 32px; }
}

/* Tool panels: slim gold bars that open in place. */
.ui-disclosure > summary, .ui-action-hub > summary {
    min-height: 50px;
    padding: 13px 18px;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.league-page .form-panel, .league-page .filters-panel:not(.filter-bar):not(.games-filters), .league-page .ui-action-hub {
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: none;
}

/* Tables: scoreboard rows with condensed numbers. */
.content table th {
    background: var(--color-navy);
    color: var(--color-muted);
    font-size: 11px;
    letter-spacing: .07em;
}
.content table td { padding-top: 14px; padding-bottom: 14px; }
.content .standings-table td:not(:first-child), .content .standings-table th:not(:first-child) { text-align: center; }
.content .standings-table td:not(:first-child) { font: 600 18px/1 var(--font-display); color: var(--color-text); }
.content .standings-table td:last-child { color: var(--color-gold); }
.content .standings-position { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--color-faint); }
.content .standings-table tbody tr:first-child .standings-position { color: var(--color-gold); }
.content .standings-team-name { font-weight: 600; color: var(--color-text); }
.content table td a:not(.secondary-link):not(.link-button) { color: var(--color-text); font-weight: 600; text-decoration: none; }
.content table td a:not(.secondary-link):not(.link-button):hover { color: var(--color-gold); text-decoration: underline; }

/* ---------- Teams directory: grouped like the schedule ---------- */

.content #teams.teams-grid { display: block; }
/* The directory filters keep older ID rules (style.css); the bar wins here. */
#teams-directory .filter-bar.teams-directory-filters { display: flex; margin-top: calc(-1 * var(--ui-gap)); }
#teams-directory .filter-bar label:not(.hidden) { font-size: 0; }
#teams-directory .filter-bar input, #teams-directory .filter-bar select { min-height: 38px; font-size: 13px; }
.content #teams-directory .team-card h3 { color: var(--color-text); }
.team-division {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 0 28px;
    padding: 26px 0 14px;
    border-top: 1px solid var(--color-border);
}
.team-division:first-child { border-top: 0; }
.team-division-heading { position: sticky; top: 150px; align-self: start; display: grid; gap: 4px; }
.content .team-division-heading h3 { margin: 0; font: 800 26px/1.05 var(--font-display); letter-spacing: .01em; text-transform: uppercase; color: var(--color-text); }
.team-division-heading span { color: var(--color-faint); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.team-division-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding-bottom: 12px; }
.content #teams-directory .team-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 68px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: none;
    transition: border-color .15s, background-color .15s;
}
.content #teams-directory .team-card:hover { border-color: var(--color-border-strong); background-color: var(--color-surface-raised); transform: none; }
.content #teams-directory .team-card-main { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.content #teams-directory .team-card .team-logo { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: contain; }
.content #teams-directory .team-card .team-logo-placeholder { background: var(--color-navy-soft); color: var(--color-text); font: 700 16px/1 var(--font-display); }
.content #teams-directory .team-card-copy { display: grid; gap: 4px; min-width: 0; }
.content #teams-directory .team-card h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content #teams-directory .team-card-copy p { display: none; }
.content #teams-directory .team-card .team-status-active { display: none; }
.content #teams-directory .team-card .team-status { justify-self: start; }
.content #teams-directory .team-manage-link {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
}
@media (max-width: 760px) {
    .team-division { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
    .team-division-heading { position: static; display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
    .content .team-division-heading h3 { font-size: 24px; }
    .team-division-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Leaders: the leader stands out, like a broadcast graphic ---------- */

.content .leaderboard-panel { border-radius: 12px; box-shadow: none; overflow: hidden; }
.content .leaderboard-heading h3 { font: 800 24px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.leaderboard-table tbody tr:first-child { background: linear-gradient(90deg, rgba(244, 197, 66, .09), rgba(244, 197, 66, 0) 70%); }
.leaderboard-table tbody tr:first-child td { padding-top: 18px; padding-bottom: 18px; background: none; }
.leaderboard-table tbody tr:first-child .stat-value strong { font-size: 38px; color: var(--color-gold); }
.leaderboard-table tbody tr:first-child .leaderboard-photo { width: 56px; height: 56px; }
.leaderboard-table .rank-cell { font: 700 20px/1 var(--font-display); color: var(--color-faint); }
.leaderboard-table tbody tr:first-child .rank-cell { color: var(--color-gold); }
.leaderboard-table .stat-value strong { color: var(--color-text); }

/* Panels sit flatter so the content, not the boxes, carries the page. */
.content .roster-player { border-radius: 12px; box-shadow: none; }

/* ---------- Dashboards and admin tools ---------- */

/* A player's teams: name and division on the left, standing as a number. */
.content .dashboard-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.content .dashboard-teams .team-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: none;
}
.content .dashboard-teams .team-card h4 { margin: 0 0 4px; font-size: 16px; }
.content .dashboard-teams .team-card h4 a { color: var(--color-text); text-decoration: none; }
.content .dashboard-teams .team-card h4 a:hover { color: var(--color-gold); }
.content .dashboard-teams .team-card p { margin: 0; color: var(--color-faint); font-size: 13px; }
.content .dashboard-teams .team-card > strong { flex: none; font: 700 30px/1 var(--font-display); color: var(--color-gold); }

/* Referee assignment cards keep their tags compact. */
.content .referee-game-card .game-friendly-badge { justify-self: start; width: fit-content; }

/* ---------- Users and roles: one card per person ---------- */

.content .user-list { display: grid; gap: 8px; }
.content .user-card {
    display: grid;
    grid-template-columns: minmax(240px, 1.3fr) minmax(0, 1.6fr) minmax(200px, 1fr) auto;
    align-items: center;
    gap: 14px 22px;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
}
.content .user-card:hover { border-color: var(--color-border-strong); }
.content .user-identity { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 4px 12px; min-width: 0; }
.content .user-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-navy-soft);
    color: var(--color-text);
    font: 700 15px/1 var(--font-display);
    letter-spacing: .04em;
}
.content .user-identity > div { display: grid; gap: 2px; min-width: 0; }
.content .user-identity strong { font-size: 15px; color: var(--color-text); }
.content .user-identity a { text-decoration: none; }
.content .user-identity a:hover strong { color: var(--color-gold); }
.content .user-identity small, .content .user-email { color: var(--color-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content .user-status {
    grid-column: 2;
    justify-self: start;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}
.content .user-status-active { background: rgba(52, 211, 153, .12); color: #6ee7b7; }
.content .user-status-inactive { background: rgba(255, 255, 255, .07); color: var(--color-muted); }
.content .user-status-pending { background: rgba(249, 115, 22, .15); color: #ffb27a; }

.content .user-roles { margin: 0; padding: 0; border: 0; min-width: 0; }
.content .user-roles legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.content .user-roles .role-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.content label.role-toggle { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.content label.role-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.content label.role-toggle span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 600;
    transition: background-color .15s, border-color .15s, color .15s;
}
.content label.role-toggle input:checked + span { border-color: rgba(244, 197, 66, .5); background: var(--color-gold-soft); color: var(--color-gold); }
.content label.role-toggle input:checked + span::before { content: "✓"; margin-right: 6px; font-weight: 800; }
.content label.role-toggle input:focus-visible + span { outline: 2px solid var(--color-gold); outline-offset: 2px; }

.content .official-aka-editor { display: flex; align-items: center; gap: 8px; min-width: 0; }
.content .official-aka-editor label { flex: 1; min-width: 0; font-size: 0; }
.content .official-aka-editor input { width: 100%; min-height: 34px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.content .user-card button:not(.link-button):not(.team-delete-button) { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12px; white-space: nowrap; }

.content .user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.content .user-more { position: relative; }
.content .user-more > summary {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}
.content .user-more > summary::-webkit-details-marker { display: none; }
.content .user-more > summary::after { content: "▾"; margin-left: 6px; }
.content .user-more[open] > summary { border-color: var(--color-gold); color: var(--color-gold); }
.content .user-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    display: grid;
    gap: 6px;
    min-width: 210px;
    padding: 8px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--ui-radius);
    background: var(--color-surface-raised);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.content .user-more-menu button:not(.link-button):not(.team-delete-button) { justify-content: flex-start; width: 100%; }

@media (max-width: 1100px) {
    .content .user-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .content .user-roles { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .content .user-card { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    .content .user-actions { justify-content: flex-start; }
    .content .user-more-menu { left: 0; right: auto; }
}
.content .official-aka-editor.not-applicable { color: var(--color-faint); font-size: 12px; }

/* ---------- Referee dashboard: assignments as scoreboard rows ---------- */

.content .referee-dashboard-games { gap: 8px; }
.content .referee-game-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    grid-template-areas: "when copy result" "panel panel panel";
    align-items: center;
    gap: 6px 22px;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: none;
}
.content .referee-game-card.game-card-friendly { border-left: 1px solid var(--color-border); background: var(--color-surface); }
.content .assignment-when { grid-area: when; display: grid; gap: 2px; align-self: start; }
.content .assignment-when strong { font: 700 34px/1 var(--font-display); color: var(--color-text); }
.content .assignment-when span { color: var(--color-faint); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.content .referee-game-copy { grid-area: copy; display: grid; gap: 6px; min-width: 0; }
.content .assignment-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.content .assignment-position {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-gold-soft);
    color: var(--color-gold);
    font: 800 13px/1.2 var(--font-display);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.content .referee-game-card .game-friendly-badge { padding: 2px 8px; border: 0; background: rgba(96, 165, 250, .16); color: #bfdbfe; font-size: 11px; }
.content .referee-game-card h4 { margin: 0; font-size: 18px; line-height: 1.25; }
.content .referee-game-card h4 a { color: var(--color-text); text-decoration: none; }
.content .referee-game-card h4 a:hover { color: var(--color-gold); }
.content .referee-game-card .matchup-versus { margin: 0 6px; color: var(--color-faint); font: italic 800 15px/1 var(--font-display); }
.content .referee-game-copy > p { margin: 0; color: var(--color-faint); font-size: 13px; }
.content .referee-game-card .game-crew { margin: 2px 0 0; }
.content .referee-game-card .game-crew ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.content .referee-game-card .game-crew li {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: none;
}
.content .referee-game-card .game-crew li span { color: var(--color-faint); font-size: 11px; }
.content .referee-game-card .game-crew li b { font-size: 12px; font-weight: 600; }
.content .referee-game-result { grid-area: result; display: grid; justify-items: end; gap: 8px; text-align: right; }
.content .referee-game-result strong { font: 700 26px/1 var(--font-display); color: var(--color-text); }
.content .referee-game-result .secondary-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(244, 197, 66, .45);
    border-radius: 999px;
    color: var(--color-gold);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.content .referee-game-result .secondary-link:hover { background: var(--color-gold-soft); }
.content .referee-game-card .referee-score-panel { grid-area: panel; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-border); }
.content .referee-game-card .referee-score-panel > summary { color: var(--color-gold); font-size: 12px; font-weight: 700; cursor: pointer; }
.content .referee-history-panel { border: 1px solid var(--color-border); border-top: 3px solid #34d399; border-radius: 12px; background: var(--color-surface); box-shadow: none; }
@media (max-width: 700px) {
    .content .referee-game-card { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when result" "copy copy" "panel panel"; }
    .content .assignment-when { display: flex; align-items: baseline; gap: 10px; }
    .content .assignment-when strong { font-size: 28px; }
}

/* ---------- Referee directory: trading cards ---------- */

.content .referee-directory-tools { justify-content: flex-start; }
.content .referee-directory-title { margin: 0; font: 800 22px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.content .referee-directory-tools .referee-search-label { display: block; width: min(280px, 100%); font-size: 0; }
.content .referee-directory-tools .referee-search-label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.referee-roster-page .referee-roster-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.content .referee-roster-page .referee-roster-card {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 14px;
    min-height: 220px;
    padding: 24px 16px 18px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background:
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(29, 58, 122, .55), transparent 70%),
        var(--color-surface);
    text-align: center;
}
.content .referee-roster-page .referee-profile-link:hover .referee-roster-card { border-color: rgba(244, 197, 66, .45); }
.referee-card-photo { position: relative; display: grid; width: 96px; height: 96px; }
.referee-card-photo > * { grid-area: 1 / 1; }
.content .referee-roster-page .referee-card-photo img { position: relative; z-index: 1; }
/* Outranks referee_directory.css (loaded after this file), which sizes photos at 52 px. */
.content .referee-roster-page .referee-card-photo img, .content .referee-roster-page .referee-card-photo .referee-photo-placeholder {
    width: 96px;
    height: 96px;
    flex: none;
    margin: 0;
    border: 2px solid rgba(244, 197, 66, .55);
    border-radius: 50%;
    object-fit: cover;
}
.referee-roster-page .referee-card-photo .referee-photo-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #234372, #101e36);
    color: var(--color-gold);
    font: 800 30px/1 var(--font-display);
}
.referee-roster-page .referee-card-identity { display: grid; justify-items: center; gap: 4px; }
.content .referee-roster-page .referee-roster-card .referee-card-identity h3 { margin: 0; font: 800 24px/1.05 var(--font-display); letter-spacing: .02em; text-transform: uppercase; color: var(--color-text); }
.referee-roster-page .referee-roster-card p { margin: 0; color: var(--color-faint); font-size: 12px; }
.referee-roster-page .referee-profile-action { margin-top: 6px; color: var(--color-gold); font-size: 12px; font-weight: 700; }
@media (max-width: 820px) {
    .referee-roster-page .referee-roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content .referee-roster-page .referee-roster-card { min-height: 190px; padding: 18px 10px 14px; }
    .referee-card-photo, .content .referee-roster-page .referee-card-photo img, .content .referee-roster-page .referee-card-photo .referee-photo-placeholder { width: 72px; height: 72px; }
    .content .referee-roster-page .referee-roster-card .referee-card-identity h3 { font-size: 20px; }
    .content .referee-directory-tools .referee-search-label { width: 100%; flex-basis: 100%; }
}

/* ---------- Team roster: player trading cards ---------- */

.content .roster-team-logo { width: 104px; height: 104px; flex: none; border-radius: 18px; background: #fff; object-fit: contain; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.content .roster-header { gap: 24px; }
.content #roster-deadline-message:not(:empty) { border: 0; border-left: 3px solid var(--color-gold); border-radius: 0; background: none; color: var(--color-muted); font-size: 13px; padding: 2px 0 2px 12px; }
.content .team-staff { display: flex; flex-wrap: wrap; gap: 10px 36px; padding: 0; border: 0; background: none; }
.content .team-staff > div { display: grid; gap: 2px; padding: 0 0 0 14px; border: 0; border-left: 2px solid var(--color-border-strong); }
.content .team-staff span { color: var(--color-faint); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.content .team-staff strong { color: var(--color-text); font-size: 15px; }
.content .roster-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.content .roster-player {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 14px;
    min-height: 200px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background:
        radial-gradient(ellipse 80% 70% at 100% 0%, rgba(244, 197, 66, .09), transparent 60%),
        var(--color-surface);
}
.content .roster-player:hover { border-color: rgba(244, 197, 66, .4); }
.content .roster-player .roster-player-photo { width: 84px; height: 84px; border: 2px solid rgba(244, 197, 66, .5); border-radius: 50%; object-fit: cover; }
.content .roster-player .profile-placeholder { display: grid; place-items: center; background: linear-gradient(145deg, #234372, #101e36); color: var(--color-gold); font: 800 26px/1 var(--font-display); }
.content .roster-player .jersey-number {
    position: absolute;
    top: 12px;
    right: 16px;
    margin: 0;
    color: var(--color-gold);
    font-size: 54px;
    line-height: 1;
    letter-spacing: 0;
}
.content .roster-player-identity { display: grid; gap: 4px; text-decoration: none; }
.content .roster-player h3 { margin: 0; color: var(--color-text); font-size: 17px; line-height: 1.2; -webkit-line-clamp: 2; }
.content .roster-player-identity:hover h3 { color: var(--color-gold); }
.content .roster-player p { margin: 0; color: var(--color-faint); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
/* Manager tools stay full width under the card. */
.content .roster-player > form, .content .roster-player > .roster-player-actions { grid-column: 1 / -1; }
@media (max-width: 760px) {
    .content .roster-team-logo { width: 72px; height: 72px; border-radius: 14px; }
    .content .roster-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .content .roster-player { min-height: 180px; padding: 14px; }
    .content .roster-player .roster-player-photo { width: 64px; height: 64px; }
    .content .roster-player .jersey-number { font-size: 40px; top: 10px; right: 12px; }
    .content .roster-player h3 { font-size: 15px; }
}

/* ---------- Phone navigation: slim top bar, five tabs, bottom sheet ---------- */
/* The sidebar element is the slim top bar while collapsed and a bottom sheet
   while open; the existing open/close, Escape, backdrop and focus handling in
   layout.js keep working. */
@media (max-width: 820px) {
    body.sidebar-collapsed .sidebar {
        height: calc(56px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 16px 0;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        border-bottom: 1px solid var(--color-border);
        background: rgba(4, 9, 22, .86);
        -webkit-backdrop-filter: saturate(160%) blur(14px);
        backdrop-filter: saturate(160%) blur(14px);
        box-shadow: none;
    }
    body .sidebar-toggle { display: none; }
    body.sidebar-collapsed .brand-logo { width: 34px; height: 34px; border-radius: 0; }
    body.sidebar-collapsed .mobile-page-context { gap: 0; }
    body.sidebar-collapsed .mobile-page-context span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
    body.sidebar-collapsed .mobile-page-context strong { font: 800 18px/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }

    /* Content starts under the slimmer bar. */
    .content { padding-top: calc(56px + env(safe-area-inset-top) + 16px); }
    .content .filter-bar, .content .games-filters { top: calc(56px + env(safe-area-inset-top)); }
    .content > .league-page > .section-header:first-child { margin-top: -16px; }
    .content > .league-page > .back-link:first-child + .section-header {
        margin-top: calc(-16px - 44px - 16px);
        padding-top: calc(16px + 44px + 16px + 12px);
    }

    /* The open menu is a bottom sheet. */
    body:not(.sidebar-collapsed) .sidebar {
        inset: auto 0 0 0;
        width: 100%;
        height: auto;
        max-height: min(84vh, 680px);
        padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
        overflow-y: auto;
        border: 0;
        border-top: 1px solid var(--color-border-strong);
        border-radius: 22px 22px 0 0;
        background: var(--color-surface);
        box-shadow: 0 -24px 60px rgba(0, 0, 0, .55);
        transform: none;
        animation: sheet-rise .22s ease-out;
    }
    body:not(.sidebar-collapsed) .sidebar::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 16px;
        border-radius: 2px;
        background: var(--color-border-strong);
    }
    body:not(.sidebar-collapsed) .brand { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
    body:not(.sidebar-collapsed) .brand-logo { width: 40px; height: 40px; margin: 0; }
    body:not(.sidebar-collapsed) .brand .eyebrow, body:not(.sidebar-collapsed) .brand h1 { display: none; }
    body:not(.sidebar-collapsed) .brand-wordmark { display: inline; font: 800 22px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; color: var(--color-text); }
    body:not(.sidebar-collapsed) .brand-wordmark span { color: var(--color-gold); }
    body:not(.sidebar-collapsed) .mobile-page-context { display: none; }
    body:not(.sidebar-collapsed) .sidebar-backdrop { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); background: rgba(0, 0, 0, .55); }

    /* The four sections live in the tab bar; the sheet shows role tools as tiles. */
    body:not(.sidebar-collapsed) .navigation > .nav-link { display: none; }
    body:not(.sidebar-collapsed) .nav-more-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    body:not(.sidebar-collapsed) .nav-more-menu .nav-link {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        min-height: 86px;
        padding: 14px;
        border: 1px solid var(--color-border);
        border-radius: 14px;
        background: rgba(255, 255, 255, .03);
        color: var(--color-text);
        font-size: 13px;
        font-weight: 600;
        text-align: left;
    }
    body:not(.sidebar-collapsed) .nav-more-menu .nav-link.hidden { display: none; }
    body:not(.sidebar-collapsed) .nav-more-menu .nav-link[aria-current="page"] { border-color: rgba(244, 197, 66, .5); background: var(--color-gold-soft); color: var(--color-gold); }
    body:not(.sidebar-collapsed) .nav-more-menu .nav-short { display: inline-flex; order: -1; width: 24px; height: 24px; color: var(--color-gold); }
    body:not(.sidebar-collapsed) .nav-more-menu .nav-short svg { width: 24px; height: 24px; }
    body:not(.sidebar-collapsed) .nav-more-menu .nav-text { display: inline; }

    /* Session at the foot of the sheet. */
    body:not(.sidebar-collapsed) .session-controls {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        margin-top: 18px;
        padding-top: 16px;
        border-top: 1px solid var(--color-border);
    }
    body:not(.sidebar-collapsed) .session-user { flex: 1; font-size: 15px; }
    body:not(.sidebar-collapsed) .session-user:empty { display: none; }
    body:not(.sidebar-collapsed) .navigation:not(:has(.nav-more:not(.hidden))) + .session-controls { margin-top: 0; padding-top: 0; border-top: 0; }
    body:not(.sidebar-collapsed) .session-controls .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: auto;
        min-height: 44px;
        padding: 0 18px;
        border: 1px solid var(--color-border-strong);
        border-radius: 999px;
        background: transparent;
        color: var(--color-text);
        font-size: 14px;
        font-weight: 600;
    }
    body:not(.sidebar-collapsed) .session-controls .nav-link.hidden { display: none; }
    body:not(.sidebar-collapsed) #login-link { flex: 1; border-color: var(--color-gold); background: var(--color-gold); color: var(--color-page); }
    body:not(.sidebar-collapsed) .session-controls .nav-text { display: inline; }
    body:not(.sidebar-collapsed) .session-controls .nav-short { display: none; }

    /* Five tabs. */
    .tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .content ~ .tabbar .tabbar-more, .tabbar .tabbar-more { min-height: 50px; border: 0; background: none; font: 600 11px/1.2 var(--font-body); cursor: pointer; }
    .tabbar-more[aria-expanded="true"] { color: var(--color-gold); }
}
@keyframes sheet-rise { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { body:not(.sidebar-collapsed) .sidebar { animation: none; } }

@media (max-width: 820px) { .tabbar-more.active { color: var(--color-gold); } }

/* ---------- Live game: broadcast scoreboard, compact timeline ---------- */
/* Prefixed with .content so it outranks live_game.css, which loads later. */

.content .live-match { gap: 18px; padding: 0; border: 0; background: none; }
.content .live-section-heading h3 { font: 800 26px/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.content .live-section-heading h4 { margin: 0; font: 800 20px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.content .live-state { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--color-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.content .live-state[data-state="live"] { background: rgba(249, 115, 22, .16); color: #ffb27a; }
.content .live-state[data-state="live"]::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--color-orange);
    vertical-align: 1px;
    animation: live-pulse 1.6s ease-in-out infinite;
}
.content .live-state[data-state="completed"] { background: var(--color-gold-soft); color: var(--color-gold); }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .55); } 60% { box-shadow: 0 0 0 7px rgba(249, 115, 22, 0); } }

/* Scoreboard: logos, names and big numbers, the clock in the middle. */
.content .live-scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border: 1px solid rgba(244, 197, 66, .22);
    border-radius: 16px;
    background:
        repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, .03) 79px 80px),
        radial-gradient(ellipse 70% 120% at 50% -30%, rgba(29, 58, 122, .85), transparent 65%),
        var(--color-navy-dark);
}
.content .live-scoreboard > .live-team { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; text-align: left; }
.content .live-scoreboard > .live-team-away { grid-template-columns: auto minmax(0, 1fr) 56px; text-align: right; }
.content .live-team-logo {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--color-navy-soft);
    color: var(--color-text);
    font: 800 20px/1 var(--font-display);
}
.content .live-team-logo:has(img) { background: #fff; }
.content .live-team-logo img { width: 100%; height: 100%; object-fit: contain; }
.content .live-scoreboard .live-team > span:not(.live-team-logo) { color: var(--color-text); font-size: 17px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.content .live-scoreboard strong { color: var(--color-text); font: 800 64px/1 var(--font-display); }
.content .live-score-center { display: grid; justify-items: center; gap: 6px; }
.content .live-scoreboard .live-score-separator { margin: 0; color: var(--color-faint); font: 700 28px/1 var(--font-display); }
.content .live-clock-display { color: var(--color-gold); font: 700 15px/1 var(--font-display); letter-spacing: .08em; white-space: nowrap; }
.content .live-clock-display:empty { display: none; }
.content #live-update-status { margin: -8px 0 0; color: var(--color-faint); font-size: 12px; text-align: center; }

/* Field coverage sits in a flat card like the rest of the page. */
.content .live-field-panel { border-color: var(--color-border); border-radius: 14px; }

/* Timeline: minute, accent, one line of text, small actions. */
.content .live-content-grid h4 { margin: 0 0 12px; font: 800 20px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.content .live-timeline { gap: 0; border-top: 1px solid var(--color-border); }
.content .live-event {
    --accent: var(--color-border-strong);
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 4px 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-left: 3px solid var(--accent);
    border-radius: 0;
    background: none;
}
.content .live-event[data-kind-group="score"] { --accent: var(--color-gold); background: linear-gradient(90deg, rgba(244, 197, 66, .07), transparent 55%); }
.content .live-event[data-kind-group="defense"] { --accent: #60a5fa; }
.content .live-event[data-kind-group="pause"] { --accent: var(--color-faint); }
.content .live-event time { color: var(--color-text); font: 700 20px/1 var(--font-display); }
.content .live-event time small { margin-top: 3px; color: var(--color-faint); font: 700 10px/1 var(--font-body); letter-spacing: .08em; }
.content .live-event h4 { margin: 0 0 2px; font-size: 14px; }
.content .live-event[data-kind-group="score"] h4 { color: var(--color-gold); }
.content .live-event p { margin: 0; color: var(--color-muted); font-size: 13px; }
.content .live-event-actions { display: flex; gap: 6px; }
.content .live-event button.live-event-action {
    min-height: 30px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
}
.content .live-event button.live-event-action:hover { border-color: var(--color-gold); color: var(--color-gold); }
.content .live-event button.live-event-void-action:hover { border-color: rgba(248, 113, 113, .6); color: #fecaca; }

/* Capture controls: one surface, grouped, with the submit always in reach. */
.content #live-capture-panel { border-radius: 14px; background: var(--color-surface); }
.content .live-control-label { color: var(--color-faint); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.content .live-event-form .live-team-buttons button, .content .live-event-form .live-kind-buttons button { border-radius: 12px; }
.content .live-capture-footer { border: 1px solid rgba(244, 197, 66, .3); border-radius: 14px; background: rgba(4, 9, 22, .92); }
.content #live-moments, .content #live-finish-controls, .content .live-cancel-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}
.content #live-moments.hidden, .content #live-finish-controls.hidden, .content .live-cancel-controls.hidden { display: none; }
.content #live-moments h4, .content .live-cancel-controls h4 { flex-basis: 100%; margin: 0; font-size: 14px; }
.content #live-moments .form-help, .content .live-cancel-controls p { flex-basis: 100%; margin: 0; font-size: 12px; }
.content #live-moments button, .content #live-finish-controls button, .content .live-cancel-controls button { min-height: 40px; border-radius: 999px; }
.content #attendance-action { justify-self: start; min-height: 44px; padding: 0 20px; border: 1px solid var(--color-gold); border-radius: 999px; background: transparent; color: var(--color-gold); font-weight: 700; }
.content #attendance-action:hover { background: var(--color-gold-soft); }

@media (max-width: 760px) {
    .content .live-scoreboard { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 4; box-shadow: 0 -12px 0 var(--color-page), 0 12px 28px rgba(0, 0, 0, .45); grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 14px; }
    .content .live-scoreboard > .live-team, .content .live-scoreboard > .live-team-away { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; text-align: center; }
    .content .live-scoreboard > .live-team-away > strong { order: 3; }
    .content .live-scoreboard > .live-team-away > .live-team-logo { order: -1; }
    .content .live-team-logo { width: 36px; height: 36px; font-size: 14px; }
    .content .live-scoreboard .live-team > span:not(.live-team-logo) { font-size: 12px; }
    .content .live-scoreboard strong { font-size: 40px; }
    .content .live-event { grid-template-columns: 52px minmax(0, 1fr); padding-left: 10px; }
    .content .live-event-actions { grid-column: 2; }
    /* The capture submit stays above the tab bar while choosing players. */
    .content .live-capture-footer { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 3; box-shadow: 0 -10px 30px rgba(0, 0, 0, .45); }
}
@media (prefers-reduced-motion: reduce) { .content .live-state[data-state="live"]::before { animation: none; } }

/* ---------- Loading placeholders and empty states ---------- */

.skeleton { display: grid; gap: 10px; }
.skeleton-item {
    display: grid;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}
.skeleton-game { grid-template-columns: 70px minmax(0, 1fr) 54px minmax(0, 1fr); }
.skeleton-row { grid-template-columns: 26px minmax(0, 1fr) 48px 48px; padding: 12px 16px; }
.skeleton-card { grid-template-columns: 48px minmax(0, 1fr) 60px; }
.skeleton-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.skeleton-bar {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .11) 50%, rgba(255, 255, 255, .05) 100%) 0 0 / 220% 100%;
    animation: skeleton-sweep 1.4s ease-in-out infinite;
}
.skeleton-short { width: 70%; }
.skeleton-score { height: 26px; }
.skeleton-dot { width: 22px; height: 22px; border-radius: 50%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
@keyframes skeleton-sweep { from { background-position: 100% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-bar { animation: none; } }
@media (max-width: 640px) {
    .skeleton-game { grid-template-columns: 48px minmax(0, 1fr) 40px; }
    .skeleton-game > :last-child { display: none; }
}

.content .empty-state-rich { display: grid; justify-items: center; gap: 4px; padding: 34px 22px; }
.content .empty-state-rich .empty-state-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, rgba(244, 197, 66, .22), rgba(244, 197, 66, .06));
    color: var(--color-gold);
}
.content .empty-state-rich .empty-state-icon svg { width: 28px; height: 28px; }
.content .empty-state-rich h3, .content .empty-state-rich h4, .content .empty-state-rich h5 {
    margin: 0 0 4px;
    font: 800 22px/1.05 var(--font-display);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.content .empty-state-rich h5 { font-size: 18px; }
.content .empty-state-rich .empty-state-action {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-top: 14px;
    padding: 0 18px;
    border: 1px solid var(--color-gold);
    border-radius: 999px;
    background: transparent;
    color: var(--color-gold);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.content .empty-state-rich .empty-state-action:hover { background: var(--color-gold-soft); }

/* ---------- Home ---------- */

.home-hero::after {
    content: attr(data-week);
    position: absolute;
    top: -36px;
    right: calc(var(--band-gutter) - 12px);
    font: italic 800 340px/1 var(--font-display);
    color: rgba(255, 255, 255, .035);
    pointer-events: none;
}
.league-page > .home-hero { overflow: hidden; }
.home-hero-copy { position: relative; z-index: 1; }
.league-page > .home-hero h2 { font-size: clamp(52px, 8vw, 104px); line-height: .9; margin-bottom: 12px; }
.league-page > .home-hero p { font-size: 17px; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.content .home-cta {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid var(--color-gold);
    border-radius: 999px;
    background: var(--color-gold);
    color: var(--color-page);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}
.content .home-cta-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.content .home-cta:hover { filter: brightness(1.08); }
.content .home-cta-ghost:hover { border-color: var(--color-gold); color: var(--color-gold); filter: none; }

.home-section { display: grid; gap: 16px; margin-top: 40px; }
.home-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.home-section-heading h3 { margin: 0; font: 800 clamp(24px, 3vw, 32px)/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.content .home-section-link { color: var(--color-gold); font-size: 14px; font-weight: 700; text-decoration: none; }
.content .home-section-link::after { content: " →"; }

.home-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.home-game-grid:empty { display: none; }
.content .home-game {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 14px 16px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.content .home-game:hover { border-color: rgba(244, 197, 66, .45); transform: translateY(-1px); }
.home-game-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--color-faint); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.home-game-meta > :first-child { flex: none; color: var(--color-gold); }
.home-game-meta > :last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-game-team { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.home-game-team:not(.is-winner) .home-game-score { color: var(--color-muted); }
.home-game[data-status="completed"] .home-game-team:not(.is-winner) .home-game-name { color: var(--color-muted); }
.home-game-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-game-score { font: 800 26px/1 var(--font-display); }
.home-game-logo {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--color-navy-soft);
    color: var(--color-text);
    font: 800 12px/1 var(--font-display);
}
.home-game-logo:has(img) { background: #fff; }
.home-game-logo img { width: 100%; height: 100%; object-fit: contain; }
.home-game-pending { color: var(--color-muted); font-weight: 600; }
.home-game-flag { position: absolute; top: 12px; right: 14px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--color-muted); font-size: 11px; font-weight: 700; }
.home-game[data-status="postponed"] .home-game-meta > :last-child { visibility: hidden; }

.home-results { display: grid; gap: 12px; }
.content .home-featured {
    display: grid;
    gap: 10px;
    padding: 22px 24px;
    border: 1px solid rgba(244, 197, 66, .3);
    border-radius: 16px;
    background:
        repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, .03) 79px 80px),
        radial-gradient(ellipse 70% 140% at 0% 0%, rgba(244, 197, 66, .14), transparent 60%),
        var(--color-navy-dark);
    color: var(--color-text);
    text-decoration: none;
}
.home-featured-kicker { color: var(--color-gold); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.home-featured-division { color: var(--color-faint); font-size: 13px; }
.home-featured-match { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.home-featured-team { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.home-featured-team .home-game-logo { width: 48px; height: 48px; font-size: 16px; }
.home-featured-name { min-width: 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.home-featured-team strong { font: 800 54px/1 var(--font-display); }
.home-featured-team:not(.is-winner) strong, .home-featured-team:not(.is-winner) .home-featured-name { color: var(--color-muted); }
.home-featured-cta { justify-self: start; color: var(--color-gold); font-size: 14px; font-weight: 700; }
.home-featured-cta::after { content: " →"; }

.content .home-division-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.content .home-division-form > label { margin: 0; }
.content .home-category-field select { min-height: 38px; border-radius: 999px; }
.home-leaders-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; align-items: start; }
.home-panel { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); }
.home-panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.home-panel-heading h4 { margin: 0; font: 800 20px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.content .home-panel-heading a { color: var(--color-gold); font-size: 13px; font-weight: 700; text-decoration: none; }
.home-panel .skeleton-item { padding: 10px 0; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; background: none; }
.home-panel .empty-state { border: 0; background: none; }

.home-standings { display: grid; margin: 0; padding: 0; list-style: none; }
.home-standings li {
    display: grid;
    grid-template-columns: 22px 32px minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
}
.home-standings li:last-child { border-bottom: 0; }
.home-standings li:first-child .home-standings-rank { color: var(--color-gold); }
.home-standings-rank { font: 800 20px/1 var(--font-display); color: var(--color-faint); }
.content .home-standings a { min-width: 0; overflow: hidden; color: var(--color-text); font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.home-standings-record { font: 700 18px/1 var(--font-display); }
.home-standings-diff { color: var(--color-muted); font: 700 16px/1 var(--font-display); text-align: right; }

.home-leader-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.home-leader-list > .skeleton, .home-leader-list > .empty-state { grid-column: 1 / -1; }
.content .home-leader {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .02);
    color: var(--color-text);
    text-decoration: none;
}
.content .home-leader:hover { border-color: rgba(244, 197, 66, .45); }
.home-leader-photo { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 50%; background: var(--color-navy-soft); font: 800 16px/1 var(--font-display); }
.home-leader-photo img { width: 100%; height: 100%; object-fit: cover; }
.home-leader-copy { display: grid; min-width: 0; gap: 2px; }
.home-leader-copy small { color: var(--color-gold); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.home-leader-copy strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.home-leader-copy span { overflow: hidden; color: var(--color-faint); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-leader-value { display: grid; justify-items: end; }
.home-leader-value strong { font: 800 30px/1 var(--font-display); }
.home-leader-value small { color: var(--color-faint); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

@media (max-width: 900px) { .home-leaders-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
    .home-hero::after { font-size: 210px; top: -14px; }
    .league-page > .home-hero h2 { font-size: 56px; }
    .home-section { margin-top: 30px; }
    .home-game-grid, .home-leader-list { grid-template-columns: minmax(0, 1fr); }
    .content .home-featured { padding: 18px; }
    .home-featured-match { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .home-featured-team strong { font-size: 42px; }
    .home-featured-team .home-game-logo { width: 40px; height: 40px; }
    .home-featured-team { grid-template-columns: 40px minmax(0, 1fr) auto; }
}

/* The logo links to the home page. */
.brand-home { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-home:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 4px; border-radius: 8px; }
/* The home division picker reuses the filter bar controls inside the page column. */
.content .filter-bar.home-division-form { position: static; margin: 0; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

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

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.content .share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.content .share-button svg { width: 18px; height: 18px; color: var(--color-gold); }
.content .share-button:hover { border-color: var(--color-gold); color: var(--color-gold); }

/* ---------- Team season (roster page) ---------- */

.team-season { display: grid; gap: 14px; }
.team-season[hidden] { display: none; }
.team-season-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px clamp(22px, 4vw, 48px);
    margin: 0;
    padding: 18px 20px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    list-style: none;
}
.team-season-stats[hidden] { display: none; }
.team-season-stats li { display: grid; gap: 4px; }
.team-season-stats strong { font: 800 34px/1 var(--font-display); color: var(--color-text); }
.team-season-stats li:first-child strong { color: var(--color-gold); }
.team-season-stats span { color: var(--color-faint); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.team-streak-chips { display: flex; gap: 4px; }
.team-season-stats .team-streak-chips b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: var(--color-muted);
    font: 800 15px/1 var(--font-display);
}
.team-season-stats .team-streak-chips b[data-result="G"] { background: var(--color-gold); color: var(--color-page); }
.team-season-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 14px; align-items: start; }
.team-schedule { display: grid; margin: 0; padding: 0; list-style: none; }
.team-schedule > li { border-bottom: 1px solid var(--color-border); }
.team-schedule > li:last-child { border-bottom: 0; }
.content .team-game {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    color: var(--color-text);
    text-decoration: none;
}
.content .team-game:hover .team-game-name { color: var(--color-gold); }
.team-game-when { display: grid; color: var(--color-muted); font: 700 15px/1.15 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.team-game-when small { overflow: hidden; color: var(--color-gold); font: 600 11px/1.3 var(--font-body); text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.team-game-opponent { display: grid; grid-template-columns: 18px 32px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.team-game-side { color: var(--color-faint); font-size: 12px; font-weight: 700; }
.team-game-name { min-width: 0; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.team-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: var(--color-muted);
    font: 700 16px/1 var(--font-display);
    white-space: nowrap;
}
.team-result b { font-weight: 800; }
.team-result[data-result="win"] { background: var(--color-gold-soft); color: var(--color-gold); }
.team-result[data-result="scheduled"] { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); font-size: 14px; }
.team-result[data-result="postponed"] { font: 600 12px/1 var(--font-body); }
.team-leader-list { grid-template-columns: minmax(0, 1fr); }
.team-schedule .skeleton-item { padding: 10px 0; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; background: none; }
.content .roster-heading { margin: 8px 0 0; font: 800 clamp(24px, 3vw, 32px)/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
@media (max-width: 900px) { .team-season-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .team-season-stats { gap: 14px 22px; padding: 16px; }
    .team-season-stats strong { font-size: 28px; }
    .content .team-game { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 8px; }
    .team-game-opponent { grid-template-columns: 14px 28px minmax(0, 1fr); gap: 6px; }
    .team-game-opponent .home-game-logo { width: 28px; height: 28px; }
    .team-result { padding: 0 9px; font-size: 15px; }
}

/* ---------- Player card (public profile) ---------- */

.content .player-hero .player-card { display: flex; align-items: center; gap: clamp(20px, 4vw, 40px); }
.player-card-photo { position: relative; flex: none; }
.content .player-hero .profile-photo {
    width: clamp(120px, 16vw, 176px);
    height: clamp(120px, 16vw, 176px);
    border: 3px solid var(--color-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(244, 197, 66, .08), 0 18px 40px rgba(0, 0, 0, .45);
    object-fit: cover;
    font: 800 clamp(40px, 5vw, 60px)/1 var(--font-display);
}
.player-card-jersey {
    position: absolute;
    right: -6px;
    bottom: 2px;
    min-width: 54px;
    padding: 6px 10px;
    border-radius: 12px;
    background: var(--color-gold);
    color: var(--color-page);
    font: 800 26px/1 var(--font-display);
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}
.player-card-jersey[hidden] { display: none; }
.player-card-copy { min-width: 0; }
.content .player-card-team { margin: 0 0 8px; color: var(--color-gold); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.content .player-card-team:empty { display: none; }
.league-page > .player-hero h2 { font-size: clamp(40px, 6vw, 76px); line-height: .95; overflow-wrap: anywhere; }
.player-season, .player-weekly { display: grid; gap: 12px; }
.player-season-scope select { min-height: 38px; border-radius: 999px; }
.content .player-stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.content .player-stat-grid .stat-item:nth-child(-n + 5) strong { color: var(--color-text); font-size: 44px; }
.content .player-stat-grid .stat-item:first-child { border-color: rgba(244, 197, 66, .45); background: linear-gradient(160deg, rgba(244, 197, 66, .12), transparent 70%), var(--color-surface); }
.content .player-stat-grid .stat-item:first-child strong { color: var(--color-gold); }
.player-weekly-list { display: grid; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); overflow: hidden; }
.player-weekly-list > .empty-state { border: 0; }
.player-weekly-row {
    position: relative;
    display: grid;
    grid-template-columns: 90px repeat(5, minmax(0, 1fr)) minmax(0, 1.2fr);
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--color-border);
    font: 700 20px/1 var(--font-display);
    text-align: center;
}
.player-weekly-row:last-child { border-bottom: 0; }
.player-weekly-row:not(.player-weekly-head)::before {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: var(--share, 0%);
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), rgba(244, 197, 66, .2));
}
.player-weekly-head { padding-block: 10px; color: var(--color-faint); font: 700 11px/1 var(--font-body); letter-spacing: .07em; text-transform: uppercase; }
.player-weekly-week { color: var(--color-gold); text-align: left; }
.player-weekly-head > :first-child { text-align: left; }
.player-weekly-cell.is-points { color: var(--color-text); font-size: 24px; }
@media (max-width: 640px) {
    .content .player-hero .player-card { flex-direction: column; align-items: flex-start; }
    .player-weekly-row { grid-template-columns: 44px repeat(5, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 4px; padding: 11px 12px; font-size: 17px; }
    .player-weekly-cell.is-points { font-size: 20px; }
    .player-weekly-head { font-size: 9px; letter-spacing: .04em; }
    .content .player-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content .player-stat-grid .stat-item:nth-child(-n + 5) strong { font-size: 36px; }
}

/* Game-by-game rows open the game; the opponent sits under the week. */
.content a.player-weekly-row { color: var(--color-text); text-decoration: none; }
.content a.player-weekly-row:hover { background: rgba(255, 255, 255, .03); }
.player-weekly-week small { display: block; margin-top: 3px; overflow: hidden; color: var(--color-faint); font: 600 11px/1.2 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.player-weekly-row { grid-template-columns: 150px repeat(5, minmax(0, 1fr)) minmax(0, 1.2fr); }
@media (max-width: 640px) { .player-weekly-row { grid-template-columns: 74px repeat(5, minmax(0, 1fr)) minmax(0, 1.3fr); } }
