/* Fonts: self-hosted from public/fonts/{family}/. Oxanium is a variable font (one file covers
   all weights), Rajdhani has one static file per weight; browsers only download the weights a page uses. */
/* Rajdhani has no italic files; browsers slant it artificially if needed. */
@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Oxanium has no italic file; browsers slant it artificially if needed. */
@font-face {
    font-family: "Oxanium";
    src: url("/fonts/Oxanium/Oxanium-VariableFont_wght.ttf") format("truetype");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-body:           "Rajdhani", system-ui, sans-serif;
    --font-body-weight:    400;
    --font-heading:        "Oxanium", system-ui, sans-serif;
    --font-heading-weight: 700;

    /* Brand colors */
    --color-primary:      #900000;
    --color-primary-dark: #700000;
    --color-surface:      #FFFFFF;   /* secondary color */
    --color-accent:       #65655E;

    /* Derived neutrals and states */
    --color-bg:           #F5F5F3;
    --color-border:       #DCDCD7;
    --color-text:         #1F1F1C;
    --color-primary-soft: #F6E6E6;   /* light tint of the primary color */
    --color-success:      #2E7D32;
    --color-success-soft: #E8F3E9;

    --radius:     10px;
    --shadow:     0 1px 2px rgb(31 31 28 / 6%), 0 4px 16px rgb(31 31 28 / 6%);
    --max-width:  1300px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Elements hidden by JS or HTML (data-show-if, data-js-only, the autosubmit
   button) stay hidden even if their class sets display (.form-grid, .button,
   .filter-form). */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: var(--font-body-weight);
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

a {
    color: var(--color-primary);
}

a:hover {
    color: var(--color-primary-dark);
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Main content: at most 1300px wide, centered */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 16px;
}

.site-main {
    flex: 1;
    padding-block: 32px;
}

/* Header: no background of its own, scrolls away with the page (on phones
   it stays at the top, see below). Text and icons in the primary color. */
.site-header {
    color: var(--color-primary);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 12px;
}

.site-brand img {
    display: block;
    width: auto;
    height: 64px;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-icon,
.header-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.header-icon:hover,
.header-menu summary:hover {
    background: rgb(0 0 0 / 5%);
    color: inherit;
}

.site-header .icon {
    width: 22px;
    height: 22px;
}

/* Header over a title image (pages with $hasHero, home): lies on the image,
   white instead of the primary color. */
.site-header-on-hero {
    position: absolute;
    inset-inline: 0;
    top: 0;
    z-index: 10;
    color: var(--color-surface);
}

.site-header-on-hero .header-icon:hover,
.site-header-on-hero .header-menu summary:hover {
    background: rgb(255 255 255 / 15%);
}

.site-main-hero {
    padding-top: 0;
}

/* Menus in the header (language; on phones the sections of the page): a
   <details> element, so they open without JavaScript; common.js only closes
   them on a click elsewhere, on a link or Escape. */
.header-menu {
    position: relative;
}

.header-menu summary {
    list-style: none;
    cursor: pointer;
    font-weight: 500;
}

.header-menu summary::-webkit-details-marker {
    display: none;
}

.header-menu summary .icon:last-child {
    width: 16px;
    height: 16px;
    transition: transform 0.15s;
}

.header-menu[open] summary .icon:last-child {
    transform: rotate(180deg);
}

.header-menu ul {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    min-width: 160px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header-menu li a {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--color-text);
    text-decoration: none;
}

.header-menu li a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.header-menu li a[aria-current] {
    color: var(--color-primary);
    font-weight: 600;
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    border-top: 3px solid var(--color-primary);
    color: var(--color-accent);
    font-size: 0.875rem;
}

.site-footer-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px 48px;
    padding-block: 32px 16px;
}

.footer-club {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.footer-logo {
    width: 96px;
    height: auto;
}

.site-footer address {
    font-style: normal;
}

.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a,
.logout-form button {
    color: var(--color-text);
    text-decoration: none;
}

.footer-links a:hover,
.logout-form button:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-links .footer-admin {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.logout-form {
    margin: 0;
}

.logout-form button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.footer-copyright {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* On phones and small tablets (where the section menu is in the header) the
   header stays at the top, so its menus are always at hand; over the title
   image (home) on a dark bar. */
@media (max-width: 900px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 950;
        background: var(--color-bg);
    }

    .site-header-on-hero {
        position: fixed;
        background: var(--color-primary-dark);
    }
}

@media (max-width: 720px) {
    .site-brand img {
        height: 48px;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
    }
}

/* Cookie notice (templates/footer.php): floating box at the bottom of the
   window, stays in place while scrolling and lies above the page content. */
.cookie-notice {
    position: fixed;
    inset-inline: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 720px;
    margin-inline: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 0.875rem;
}

.cookie-notice-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 16px 20px;
}

.cookie-notice p {
    flex: 1 1 280px;
    margin: 0;
}

.cookie-notice form {
    margin: 0;
}

/* Sections of content pages (home, team page) */
.page-section {
    margin-top: 48px;
}

.section-title {
    margin-bottom: 20px;
    font-size: 1.75rem;
    color: var(--color-primary);
}

.empty-note {
    color: var(--color-accent);
}

.section-subtitle {
    margin: -12px 0 20px;
    color: var(--color-accent);
}

/* Link to the page of a section below it (all news, history, schedule …) */
.section-more {
    margin-top: 24px;
}

/* Link back to the overview above a single page (news article, game) */
.back-link {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

/* Cards in a responsive grid (teams, news, downloads) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    overflow: hidden;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
}

/* Card that is a link as a whole (teams on the landing page, downloads):
   <li class="card"><a class="card-link"> picture, then .card-body </a></li> */
.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card-link:hover strong {
    color: var(--color-primary);
}

/* Picture on top of a card: .card-photo fills it, .card-logo and
   .card-icon (an icon from Helpers::icon()) sit centred on a light area. */
.card-photo,
.card-logo,
.card-icon {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
}

.card-photo {
    object-fit: cover;
}

.card-logo {
    padding: 24px;
    object-fit: contain;
    background: var(--color-bg);
}

.card-icon {
    display: grid;
    place-items: center;
    color: var(--color-primary);
    background: var(--color-bg);
}

.card-icon .icon {
    width: 72px;
    height: 72px;
    stroke-width: 1.5;
}

.card-meta {
    color: var(--color-accent);
    font-size: 0.875rem;
}

/* History: a vertical line with the events, oldest first (templates/timeline.php;
   start page and history page) */
.timeline-list {
    position: relative;
    margin: 0;
    padding: 0 0 0 28px;
    list-style: none;
}

.timeline-list::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 7px;
    width: 2px;
    background: var(--color-border);
}

.timeline-event {
    position: relative;
    padding-bottom: 28px;
}

.timeline-event::before {
    content: "";
    position: absolute;
    top: 6px;
    left: -27px;
    width: 14px;
    height: 14px;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    background: var(--color-surface);
}

.timeline-event time {
    color: var(--color-accent);
    font-size: 0.875rem;
}

.timeline-event h3 {
    margin: 2px 0 4px;
    font-size: 1.125rem;
}

.timeline-event p {
    margin: 0;
    max-width: 65ch;
}

/* Sponsor logos, grouped by tier (templates/sponsor-list.php; start page and sponsors page) */
.sponsor-tier {
    margin: 24px 0 12px;
    font-size: 1rem;
    color: var(--color-accent);
}

.sponsor-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sponsor-list img {
    display: block;
    max-width: 160px;
    max-height: 64px;
    object-fit: contain;
}

.sponsor-tier-1 img {
    max-width: 240px;
    max-height: 96px;
}

/* People in a grid (board, players, coaches): templates/person-card.php */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.person-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.person-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    margin-bottom: 8px;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--color-surface);
}

.person-card img.person-placeholder {
    padding: 24px;
    object-fit: contain;
}

.person-card span {
    color: var(--color-accent);
    font-size: 0.9375rem;
}

/* Training times: templates/training-list.php */
.training-list {
    display: grid;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.training {
    display: grid;
    grid-template-columns: 120px 140px 1fr;
    gap: 4px 16px;
    padding: 12px 16px;
    background: var(--color-surface);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
}

.training-location {
    color: var(--color-accent);
}

.training-teams {
    grid-column: 1 / -1;
    color: var(--color-accent);
    font-size: 0.875rem;
}

/* Gamedays: templates/gameday.php */
.gameday {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-surface);
    border-radius: 8px;
}

.gameday > span {
    display: flex;
    flex-direction: column;
}

.gameday-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.gameday-meta {
    color: var(--color-accent);
    font-size: 0.9375rem;
}

.gameday-past {
    opacity: 0.6;
}

@media (max-width: 720px) {
    .training {
        grid-template-columns: 1fr 1fr;
    }

    .training-location {
        grid-column: 1 / -1;
    }
}

/* Games by date (templates/game-days.php; home, schedule, liveticker):
   own gamedays (templates/gameday.php) and games from LeagueSphere */
.gameday-list {
    display: grid;
    gap: 24px;
}

.gameday-date h3 {
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.gameday-date ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gameday-date ul + ul {
    margin-top: 8px;
}

/* A select that filters a page (team in the admin overview, team of the
   schedule); with data-autosubmit it sends itself (common.js). */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* A label with its select, kept on one line when the form wraps */
.filter-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-form select {
    width: auto;
    min-width: 220px;
}

/* Page numbers (templates/pagination.php): news archive, audit log */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
}

.pagination a:hover {
    color: var(--color-primary);
}

.pagination a[aria-current] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-surface);
}

/* Long pages with a section navigation (templates/section-nav.php, home and
   team page): sections on the left, the navigation on the right; on phones
   a menu button in the header instead (.section-menu, templates/header.php). */
.section-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 48px;
}

.section-layout-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.section-layout-main > section {
    scroll-margin-top: 16px;
}

.section-nav {
    grid-column: 2;
    grid-row: 1;
}

.section-nav ul {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 64px 0 0;
    padding: 0 0 0 16px;
    list-style: none;
    border-left: 2px solid var(--color-border);
}

.section-nav a {
    display: block;
    padding: 4px 0;
    color: var(--color-accent);
    text-decoration: none;
    transition: font-size 0.15s, color 0.15s;
}

.section-nav a:hover,
.section-nav a[aria-current] {
    color: var(--color-primary);
}

/* With JS (initSectionNav() in common.js) the section in view is marked. */
.section-nav a[aria-current] {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Round "back to top" button at the bottom right. */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 900;
    display: inline-flex;
    padding: 12px;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-surface);
    box-shadow: var(--shadow);
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    color: var(--color-surface);
}

.section-menu {
    display: none;
}

@media (max-width: 900px) {
    .section-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-nav {
        display: none;
    }

    .section-menu {
        display: block;
    }

    .section-layout-main > section {
        scroll-margin-top: 88px;
    }
}

/* A list or table that shows a part (.expandable-preview) and opens to the
   whole (<details class="expandable-full">): games and tables of the team
   page. The summary below the part says "show all" or, when open, "show less";
   while open, the part is hidden. */
.expandable-full summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 0;
    color: var(--color-primary);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.expandable-full summary::-webkit-details-marker {
    display: none;
}

.expandable-full summary .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.15s;
}

.expandable-full[open] summary .icon {
    transform: rotate(180deg);
}

.expandable-full[open] .expandable-more,
.expandable-full:not([open]) .expandable-less,
.expandable:has(> .expandable-full[open]) > .expandable-preview {
    display: none;
}

.expandable-full[open] summary {
    margin: 0 0 8px;
}

/* Games from LeagueSphere (templates/game-list.php): when, home/away,
   opponent, result; finished and running games are links */
.game-row {
    display: grid;
    grid-template-columns: minmax(7rem, 12rem) 1.5rem 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--color-surface);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

a.game-row:hover {
    box-shadow: var(--shadow);
}

a.game-row:hover .game-opponent {
    color: var(--color-primary);
}

.game-when {
    display: flex;
    flex-direction: column;
    color: var(--color-accent);
    font-size: 0.9375rem;
}

.game-when strong {
    color: var(--color-text);
}

.game-league {
    font-size: 0.8125rem;
    overflow-wrap: break-word;
}

.game-venue {
    color: var(--color-accent);
    text-decoration: none;
}

.game-opponent {
    min-width: 0;
    overflow-wrap: break-word;
}

.game-score-logo {
    flex: none;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.game-result {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.game-won .game-result {
    color: var(--color-success);
}

.game-lost .game-result {
    color: var(--color-primary);
}

.badge-live {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-surface);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Past seasons on the team page: one <details class="season"> each */
.season {
    margin-bottom: 8px;
    background: var(--color-surface);
    border-radius: var(--radius);
}

.season > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    cursor: pointer;
    list-style: none;
}

.season > summary::-webkit-details-marker {
    display: none;
}

.season[open] > summary .icon {
    transform: rotate(180deg);
}

.season-body {
    padding: 0 8px 8px;
}

.season-body .subsection-title,
.season-body .subsection-title:first-of-type {
    margin-top: 16px;
}

.game-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.season .game-row,
.season .table-scroll {
    background: var(--color-bg);
}

/* Tables of numbers (.data-table: league tables, statistics); scroll
   sideways on phones */
.table-scroll {
    overflow-x: auto;
    background: var(--color-surface);
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: right;
    white-space: nowrap;
}

.data-table thead th {
    border-bottom: 2px solid var(--color-border);
    color: var(--color-accent);
    font-weight: 500;
}

.data-table abbr {
    text-decoration: none;
}

.data-table tbody tr + tr > * {
    border-top: 1px solid var(--color-border);
}

/* League table (templates/standings-table.php) */
.standings .standings-team {
    width: 100%;
    text-align: left;
}

.standings-ours td {
    background: var(--color-primary-soft);
    font-weight: 600;
}

.standings-group th {
    padding-top: 16px;
    text-align: left;
}

/* Heading inside a section: league of a table, statistics of a past season */
.subsection-title {
    margin: 24px 0 8px;
    font-size: 1.125rem;
}

.subsection-title:first-of-type {
    margin-top: 0;
}

/* Team statistics (templates/team-stats.php): value, then total and per
   game of our team and of the opponents */
.stats tbody th,
.stats .stats-player {
    width: 100%;
    min-width: 8rem;
    text-align: left;
    white-space: normal;
    font-weight: 500;
}

.stats thead th[scope="colgroup"] {
    border-bottom: 0;
    padding-bottom: 0;
    text-align: center;
    color: var(--color-text);
}

.stats-hint {
    color: var(--color-accent);
    font-size: 0.875rem;
    font-weight: 400;
}

/* Choice of the competition (templates/stats-variants.php); shown by JS */
.stats-filter {
    margin-bottom: 16px;
}

.stats-competition {
    margin: 16px 0 8px;
    font-weight: 600;
}

.stats-note {
    margin: 8px 0 0;
    color: var(--color-accent);
    font-size: 0.875rem;
}

/* Head of a game (templates/game-header.php): home, score, away */
.game-score {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--color-surface);
    border-radius: var(--radius);
}

.game-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-weight: 500;
}

.game-team img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.game-possession {
    display: inline-flex;
    margin-left: 4px;
    color: var(--color-primary);
    vertical-align: middle;
}

.game-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--color-accent);
    font-size: 0.875rem;
}

.game-score-center strong {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: var(--font-heading-weight);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Game log (templates/game-log.php) and ticker entries: home entries on the
   left, away entries on the right; events with name and headshot
   (templates/game-event.php) */
.game-log-half {
    margin: 24px 0 8px;
    font-size: 1.125rem;
}

.game-log-list,
.live-ticks {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-log-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(100%, 520px);
    padding: 10px 14px;
    background: var(--color-surface);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
}

.game-log-away {
    justify-self: end;
    border-left: 0;
    border-right: 3px solid var(--color-accent);
}

.game-log-team {
    color: var(--color-accent);
    font-size: 0.8125rem;
}

.game-log-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-event {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-headshot {
    flex: none;
    width: 48px;
    height: 48px;
    object-fit: contain;
    object-position: bottom;
}

.game-player {
    margin-left: 4px;
}

.game-detail {
    margin-left: 4px;
    color: var(--color-accent);
}

.game-points {
    margin-left: 6px;
    color: var(--color-success);
    font-weight: 600;
}

/* Live box (templates/live-box.php): home and team page */
.live-game + .live-game {
    margin-top: 24px;
}

.live-ticks {
    margin-top: 12px;
}

.live-ticks li {
    display: grid;
    grid-template-columns: 3rem minmax(0, 10rem) 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--color-surface);
    border-radius: 8px;
}

.live-ticks time {
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

/* "Data: LeagueSphere" under every section with its data */
.source-note {
    margin: 12px 0 0;
    color: var(--color-accent);
    font-size: 0.8125rem;
}

/* Note while data from LeagueSphere is loaded for the first time (templates/cache-loading.php) */
.cache-loading {
    margin-bottom: 24px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius);
    color: var(--color-accent);
}

.cache-loading p {
    margin: 0;
}

@media (max-width: 720px) {
    .game-row {
        /* The result moves below the opponent, so names keep their width. */
        grid-template-columns: minmax(0, 6.5rem) 1.25rem minmax(0, 1fr);
        grid-template-areas: "when venue opponent" "when venue result";
        row-gap: 4px;
        gap: 8px;
        padding: 10px 12px;
    }

    .game-when {
        grid-area: when;
        min-width: 0;
    }

    .game-venue {
        grid-area: venue;
    }

    .game-opponent {
        grid-area: opponent;
    }

    .game-result {
        grid-area: result;
        gap: 4px;
    }

    .game-score-logo {
        width: 22px;
        height: 22px;
    }

    .game-score {
        gap: 8px;
        padding: 16px 8px;
    }

    .game-team img {
        width: 44px;
        height: 44px;
    }

    .game-score-center strong {
        font-size: 1.75rem;
    }

    .live-ticks li {
        grid-template-columns: 3rem 1fr;
    }

    .live-ticks .game-log-team {
        display: none;
    }
}

/* Legal pages (templates/legal-page.php): imprint and privacy policies */
.legal {
    max-width: 75ch;
}

.legal h1 {
    font-size: 2rem;
}

.legal h2 {
    margin-top: 1.75em;
    font-size: 1.25rem;
}

.legal-note {
    max-width: 75ch;
    padding: 12px 16px;
    border-left: 3px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
    background: var(--color-primary-soft);
}

/* Keeps the line breaks of a multi-line text from the database. */
.pre-line {
    white-space: pre-line;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--color-primary);
    color: var(--color-surface);
    font: inherit;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
    background: var(--color-primary-dark);
    color: var(--color-surface);
}

.button-secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.button-secondary:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

/* Form controls */
input:not([type="checkbox"], [type="radio"], [type="file"]),
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--color-primary);
}

/* Messages above content (admin area, public forms) */
.banner {
    padding: 12px 16px;
    border-left: 4px solid;
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.banner-success {
    border-color: var(--color-success);
    background: var(--color-success-soft);
}

.banner-error {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

/* Public forms (PublicForm, templates/form-field.php) */
.form-page {
    max-width: 760px;
}

.form-page .banner {
    margin-block: 16px 24px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.form .button {
    align-self: flex-start;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 20px;
    border: 0;
    border-radius: var(--radius);
    background: var(--color-surface);
}

.form-section > legend {
    float: left;
    width: 100%;
    margin-bottom: 4px;
    padding: 0;
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    font-size: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.form-field > label,
.form-choices legend {
    font-weight: 500;
}

.form-choices legend {
    padding: 0;
    margin-bottom: 4px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: var(--font-body-weight);
    cursor: pointer;
}

.form-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

.form-required {
    color: var(--color-primary);
}

.form-hint,
.form-note {
    margin: 0;
    color: var(--color-accent);
    font-size: 0.875rem;
}

.form-warning {
    color: var(--color-primary-dark);
}

.form-error-text {
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.has-error input:not([type="checkbox"], [type="radio"]),
.has-error select,
.has-error textarea {
    border-color: var(--color-primary);
}

.has-error .form-check {
    color: var(--color-primary-dark);
}

/* The honeypot of PublicForm: invisible for people, bots fill it in. */
.form-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sepa-text {
    padding: 12px 16px;
    border-left: 3px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
    background: var(--color-bg);
    font-size: 0.9375rem;
}

.sepa-text p {
    margin: 0 0 8px;
}

.sepa-text p:last-child {
    margin-bottom: 0;
}

.travel-amount {
    margin: 0;
    font-weight: 500;
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 16px;
    }
}

/* Translated database texts (Helpers::translated()) */
.entry-missing {
    color: var(--color-primary);
}

.translation-fallback {
    color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
