/* 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;
    size-adjust: 115%;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    size-adjust: 115%;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    size-adjust: 115%;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    size-adjust: 115%;
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/Rajdhani/Rajdhani-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    size-adjust: 115%;
}

/* 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:    500;
    --font-heading:        "Oxanium", system-ui, sans-serif;
    --font-heading-weight: 700;
    --heading-scale:       1.1;   /* factor for the size of every heading */
    --text-scale:          1.1;   /* factor for the size of all other text */

    /* 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;
    --color-warning:      #8A5A00;   /* pending, optional, outdated */
    --color-warning-soft: #FDF3E1;
    --color-warning-mark: #E0A030;   /* dots and bars */
    --color-overlay:      rgb(31 31 28 / 65%);   /* dark bar over photos */

    /* Kinds of calendar entries (templates/calendar.php, legend and entries) */
    --calendar-training:   var(--color-accent);
    --calendar-game:       var(--color-primary);
    --calendar-tournament: var(--color-warning-mark);
    --calendar-event:      var(--color-text);

    --radius:       10px;
    --radius-small: 4px;
    --shadow:     0 1px 2px rgb(31 31 28 / 6%), 0 4px 16px rgb(31 31 28 / 6%);
    --shadow-raised: 0 2px 4px rgb(31 31 28 / 8%), 0 10px 24px rgb(31 31 28 / 14%);   /* lifted on hover (logo tiles) */
    --max-width:  1300px;
    /* Room the sticky header takes at the top: anchors (#section) stop
       below it, the section navigation sticks below it. */
    --header-offset: 88px;
}

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

html {
    scroll-padding-top: var(--header-offset);
}

/* 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;
}

/* Text for screen readers only (e.g. the label of a success in the history) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

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;
    font-size: calc(1rem * var(--text-scale));
}

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;
}

/* Browser default sizes (in rem, so --text-scale on body does not add
   up), scaled; headings with a class of their own set their size as
   calc(… * var(--heading-scale)) as well. */
h1 {
    font-size: calc(2rem * var(--heading-scale));
}

h2 {
    font-size: calc(1.5rem * var(--heading-scale));
}

h3 {
    font-size: calc(1.17rem * var(--heading-scale));
}

h4 {
    font-size: calc(1rem * var(--heading-scale));
}

h5 {
    font-size: calc(0.83rem * var(--heading-scale));
}

h6 {
    font-size: calc(0.67rem * var(--heading-scale));
}

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: stays at the top while scrolling, on the page background. Text
   and icons in the primary color. Once the page is scrolled (is-scrolled,
   initHeaderScroll() in common.js) it gets smaller and a line below it. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 950;
    background: var(--color-bg);
    color: var(--color-primary);
    transition: background-color 0.2s, box-shadow 0.2s;
}

.site-header.is-scrolled {
    box-shadow: 0 1px 0 var(--color-border), 0 4px 16px rgb(31 31 28 / 6%);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-block: 12px;
    transition: padding 0.2s;
}

.site-header.is-scrolled .site-header-inner {
    padding-block: 8px;
}

.site-brand img {
    display: block;
    width: auto;
    height: 64px;
    transition: height 0.2s;
}

.site-header.is-scrolled .site-brand img {
    height: 40px;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.header-icon,
.header-menu summary,
.main-nav-link {
    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,
.main-nav-link: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, on a dark bar. With JS it is
   transparent while the page is at the top (is-top). */
.site-header-on-hero {
    position: fixed;
    inset-inline: 0;
    background: var(--color-primary-dark);
    color: var(--color-surface);
}

.site-header-on-hero.is-top {
    background: transparent;
}

.site-header-on-hero .header-icon:hover,
.site-header-on-hero .header-menu summary:hover,
.site-header-on-hero .main-nav-link:hover {
    background: rgb(255 255 255 / 15%);
}

.site-main-hero {
    padding-top: 0;
}

/* Main navigation (templates/main-nav.php): a row next to the logo; groups
   open below their name. The page or group shown is underlined. */
.main-nav {
    flex: 1;
    min-width: 0;
}

.main-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav .main-nav-link {
    padding-inline: 12px;
    font-weight: 500;
}

/* Marks of a running game, empty otherwise (see .nav-live-dot). */
.nav-live-mark:empty {
    display: none;
}

.main-nav-link[aria-current],
.main-nav-link.is-current {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* Red dot on "Games" while a game is running (the liveticker shows .badge-live). */
.nav-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #E00000;
    box-shadow: 0 0 0 2px var(--color-surface);
}

/* The menu button for narrow screens. */
.menu-toggle {
    display: none;
}

/* Menus in the header (language, groups of the main navigation): 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;
    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 form {
    margin: 0;
}

.header-menu li a,
.header-menu li button {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--color-text);
    text-decoration: none;
}

/* Language switcher: buttons of a form (pages/language.php) that look like the links. */
.header-menu li button {
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.header-menu li a:hover,
.header-menu li button:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.header-menu li a[aria-current],
.header-menu li button[aria-current] {
    color: var(--color-primary);
    font-weight: 600;
}

/* Groups of the main navigation: open to the right of their name and as
   wide as their longest link (long team names wrap at 320px). After the
   .header-menu rules, which they override. */
.main-nav-group ul {
    right: auto;
    left: 0;
    width: max-content;
    max-width: 320px;
}

.main-nav-group li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Second level of a group (inactive teams, templates/main-nav.php): last
   entry below a line, looks like the links; its list opens beside the group,
   within it on narrow screens (see below). */
.main-nav-subgroup {
    position: relative;
}

.main-nav-sublevel {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--color-border);
}

.main-nav-group .main-nav-subgroup > summary {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 0;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--color-text);
    font-weight: inherit;
}

.main-nav-group .main-nav-subgroup > summary:hover,
.main-nav-group .main-nav-subgroup[open] > summary {
    background: var(--color-bg);
    color: var(--color-primary);
}

.main-nav-group .main-nav-subgroup > summary.is-current {
    color: var(--color-primary);
    font-weight: 600;
}

.main-nav-group .main-nav-subgroup > summary .icon:last-child {
    transform: rotate(-90deg);
}

.main-nav-group .main-nav-subgroup > ul {
    top: -7px;
    left: calc(100% + 7px);
}

/* Link to another website (opens in a new tab): small arrow after the name. */
.nav-external {
    display: inline-flex;
    color: var(--color-text-muted);
}

.nav-external .icon {
    width: 14px;
    height: 14px;
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    border-top: 3px solid var(--color-primary);
    color: var(--color-accent);
    font-size: calc(0.875rem * var(--text-scale));
}

.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);
}

/* Narrower screens: the main navigation is a panel below the header while
   the menu button is open (CSS only, :has()); groups open within it. */
@media (max-width: 1100px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline: 0;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        padding: 8px 16px 16px;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        box-shadow: var(--shadow);
        color: var(--color-text);
    }

    .site-header:has(.menu-toggle[open]) .main-nav {
        display: block;
    }

    .site-header:has(.menu-toggle[open]) {
        box-shadow: none;
    }

    .site-header-on-hero:has(.menu-toggle[open]) {
        background: var(--color-primary-dark);
    }

    .main-nav-list {
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav-link,
    .site-header-on-hero .main-nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .site-header-on-hero .main-nav-link:hover {
        background: rgb(0 0 0 / 5%);
    }

    .main-nav-group summary .icon:last-child {
        margin-left: auto;
    }

    .main-nav-group ul {
        position: static;
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0 0 6px 16px;
        border: 0;
        box-shadow: none;
    }

    .main-nav-group .main-nav-subgroup > summary .icon:last-child {
        transform: none;
    }

    .main-nav-group .main-nav-subgroup[open] > summary .icon:last-child {
        transform: rotate(180deg);
    }
}

@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: calc(0.875rem * var(--text-scale));
}

.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: calc(1.75rem * var(--heading-scale));
    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;
}

/* A photo with its photographer (Helpers::photo()): "© Name" at the bottom
   left on a dark bar, smaller on the small photos of person cards. */
.photo {
    position: relative;
    display: block;
}

.photo > img {
    display: block;
}

.photo-credit {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 100%;
    padding: 2px 8px;
    overflow: hidden;
    color: var(--color-surface);
    background: var(--color-overlay);
    border-radius: 0 var(--radius-small) 0 var(--radius);
    font-size: calc(0.75rem * var(--text-scale));
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Cards: the photo's bottom corners are square. */
.card-photo-frame .photo-credit,
.person-photo-frame .photo-credit {
    border-bottom-left-radius: 0;
}

.person-photo-frame .photo-credit {
    padding: 1px 6px;
    font-size: calc(0.625rem * var(--text-scale));
}

.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: calc(0.875rem * var(--text-scale));
}

/* 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: calc(0.875rem * var(--text-scale));
}

.timeline-event h3 {
    margin: 2px 0 4px;
    font-size: calc(1.125rem * var(--heading-scale));
}

.timeline-teams {
    margin: 0;
}

.timeline-teams a {
    color: var(--color-accent);
}

/* Success: a star instead of the dot, title in the club color */
.timeline-event.is-success::before {
    content: none;
}

.timeline-star {
    position: absolute;
    top: 1px;
    left: -32px;
    display: flex;
    color: var(--color-primary);
}

.timeline-star .icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.timeline-event.is-success h3 {
    color: var(--color-primary);
}

/* Photo beside the text in its own proportions, above it on narrow screens */
.timeline-event.has-photo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
}

.timeline-photo-frame {
    overflow: hidden;
    border-radius: var(--radius);
}

.timeline-photo {
    width: auto;
    max-width: 320px;
    max-height: 320px;
}

@media (max-width: 640px) {
    .timeline-event.has-photo {
        grid-template-columns: minmax(0, 1fr);
    }

    .timeline-photo-frame {
        order: -1;
    }

    .timeline-photo {
        width: 100%;
        max-width: none;
        max-height: none;
    }
}

/* Logo in a tile (Helpers::logoTile()): fixed aspect ratio 3:2, the logo
   fitted with the same margin on every side, the background color as SVG
   rect behind it (--color-surface without one). The width comes from
   --logo-tile-width (default 100% of the parent). */
.logo-tile {
    position: relative;
    display: block;
    flex: none;
    width: var(--logo-tile-width, 100%);
    max-width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.logo-tile-color,
.logo-tile img {
    position: absolute;
    display: block;
}

.logo-tile-color {
    inset: 0;
    width: 100%;
    height: 100%;
}

.logo-tile img {
    inset: 12%;
    width: 76%;
    height: 76%;
    object-fit: contain;
}

/* Sponsor logos, grouped by tier (templates/sponsor-list.php; start page and
   sponsors page). Every sponsor is a tile of the same size within its tier,
   the rows (also the last) are centered. The higher the tier, the bigger its
   tiles: .logo-wall-size-1 (first tier) to -4 (fourth and all further
   tiers, Sponsors::LOGO_SIZES). The name (if shown) stands centered below
   the tile and wraps within it. The classes avoid the word "sponsor":
   ad blockers hide such elements (EasyList ##.sponsor-link hid all logos). */
.logo-wall-tier {
    margin: 24px 0 12px;
    font-size: calc(1rem * var(--text-scale));
    color: var(--color-accent);
}

.logo-wall {
    --logo-tile-width: 160px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.logo-wall-size-1 {
    --logo-tile-width: 240px;
}

.logo-wall-size-2 {
    --logo-tile-width: 200px;
}

.logo-wall-size-4 {
    --logo-tile-width: 120px;
}

.logo-wall li {
    width: var(--logo-tile-width);
    max-width: 100%;
}

.logo-wall-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    text-align: center;
    text-decoration: none;
}

.logo-wall-link .logo-tile {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.logo-wall-link:hover .logo-tile,
.logo-wall-link:focus-visible .logo-tile {
    transform: translateY(-3px);
    box-shadow: var(--shadow-raised);
}

.logo-wall-name {
    font-size: calc(1rem * var(--text-scale));
    overflow-wrap: anywhere;
}

.logo-wall-link:hover .logo-wall-name {
    color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {
    .logo-wall-link .logo-tile {
        transition: none;
    }

    .logo-wall-link:hover .logo-tile,
    .logo-wall-link:focus-visible .logo-tile {
        transform: none;
    }
}

/* Phones: the first tier one tile per row, all others two */
@media (max-width: 720px) {
    .logo-wall {
        gap: 20px 16px;
    }

    .logo-wall li {
        width: calc(50% - 8px);
    }

    .logo-wall-size-1 li {
        width: 100%;
    }

    .logo-wall .logo-tile {
        --logo-tile-width: 100%;
    }
}

/* 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;
}

/* .card with the photo on top and name, role or position in the white
   .card-body below; a player's number sits at the top left of the photo,
   mirroring the photographer's credit at the bottom left. */
.person-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.person-card .card-body {
    flex: 1;
    gap: 2px;
    padding: 12px;
}

.person-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: var(--color-surface);
}

.person-photo.photo-placeholder {
    padding: 24px;
    object-fit: contain;
    background: var(--color-bg);
}

.person-number {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 10px;
    color: var(--color-surface);
    background: var(--color-primary);
    border-bottom-right-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    line-height: 1.4;
}

.person-card .card-body span {
    color: var(--color-accent);
    font-size: calc(0.9375rem * var(--text-scale));
}

/* Contact button of a board member: full width of the card body, the
   label wraps onto a second line in the narrowest cards. */
.person-contact {
    gap: 4px;
    margin-top: 8px;
    padding: 6px;
    font-size: calc(0.875rem * var(--text-scale));
}

.person-contact .icon {
    flex-shrink: 0;
}

/* 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: calc(0.875rem * var(--text-scale));
}

/* "ab 01.11.2026" / "bis 31.10.2026" of a session with a period */
.training-period {
    grid-column: 1 / -1;
    color: var(--color-primary);
    font-size: calc(0.875rem * var(--text-scale));
}

/* Calendar (templates/calendar.php, calendar-entry.php; home, /calendar):
   a grid of the days on wide screens, a list of the days with entries on
   narrow ones. Each kind of entry has its color (--calendar-*). With JS an
   entry of the grid opens in the card .calendar-panel (initCalendarPanel()):
   beside the grid, which gets narrower, below it on medium screens. */
.calendar-kind-training   { --calendar-color: var(--calendar-training); }
.calendar-kind-game       { --calendar-color: var(--calendar-game); }
.calendar-kind-tournament { --calendar-color: var(--calendar-tournament); }
.calendar-kind-event      { --calendar-color: var(--calendar-event); }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    color: var(--color-accent);
    font-size: calc(0.875rem * var(--text-scale));
}

.calendar-legend li::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 2px;
    background: var(--calendar-color);
}

.calendar-body {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.calendar-panel-open .calendar-body {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-content: start;
    gap: 4px;
}

.calendar-weekday {
    padding: 0 6px;
    color: var(--color-accent);
    font-size: calc(0.8125rem * var(--text-scale));
    text-transform: uppercase;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 96px;
    padding: 6px;
    background: var(--color-surface);
    border-radius: var(--radius-small);
}

.calendar-day-today {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.calendar-day-past,
.calendar-day-outside {
    opacity: 0.55;
}

.calendar-date {
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    font-size: calc(0.875rem * var(--text-scale));
}

.calendar-entries {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.calendar-entry {
    padding-left: 6px;
    border-left: 3px solid var(--calendar-color);
    font-size: calc(0.8125rem * var(--text-scale));
    line-height: 1.3;
}

.calendar-entry > summary {
    cursor: pointer;
    list-style: none;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.calendar-entry > summary::-webkit-details-marker {
    display: none;
}

.calendar-time {
    color: var(--color-accent);
}

.calendar-entry-cancelled .calendar-time,
.calendar-entry-cancelled .calendar-title {
    text-decoration: line-through;
}

.calendar-details {
    color: var(--color-accent);
}

.calendar-details p {
    margin: 2px 0;
    overflow-wrap: anywhere;
}

/* Description of an event (formatted, .rich-text): a little closer than on
   the pages, lists only slightly indented. */
.calendar-details .calendar-description > :is(p, ul, ol) + :is(p, ul, ol) {
    margin-top: 4px;
}

.calendar-description :is(ul, ol) {
    padding-left: 20px;
}

.calendar-route {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.calendar-route .icon {
    flex-shrink: 0;
}

.calendar-cancelled {
    color: var(--color-primary);
}

.calendar-games {
    margin: 2px 0;
    padding: 0;
    list-style: none;
}

.calendar-entry-selected {
    margin-left: -3px;
    padding: 2px 4px 2px 9px;
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
    background: var(--color-bg);
    outline: 1px solid var(--calendar-color);
}

/* Spans the height of the grid; longer content makes it taller. */
.calendar-panel {
    min-width: 0;
    padding: 16px 20px 20px;
    border-top: 4px solid var(--calendar-color);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.calendar-panel-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-panel-kind {
    flex: 1;
    margin: 0;
    color: var(--color-accent);
    font-size: calc(0.875rem * var(--text-scale));
}

.calendar-panel-kind::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 2px;
    background: var(--calendar-color);
}

.calendar-panel-button {
    padding: 6px;
}

.calendar-panel-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.calendar-panel .calendar-title {
    margin: 12px 0 4px;
    font-size: calc(1.25rem * var(--heading-scale));
    overflow-wrap: anywhere;
    hyphens: auto;
}

.calendar-panel .calendar-title:focus {
    outline: none;
}

.calendar-panel-when {
    margin: 0 0 12px;
    font-weight: 500;
}

.calendar-panel .calendar-details p {
    margin: 0 0 8px;
}

.calendar-list,
.calendar-list-empty {
    display: none;
}

.calendar-month-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 24px 0 12px;
}

.calendar-month {
    min-width: 12ch;
    margin: 0;
    text-align: center;
}

@media (max-width: 1000px) {
    .calendar-panel-open .calendar-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .calendar-grid,
    .calendar-panel {
        display: none;
    }

    .calendar-list {
        display: grid;
        gap: 16px;
        margin: 0 0 20px;
        padding: 0;
        list-style: none;
    }

    .calendar-list-empty {
        display: block;
    }

    .calendar-list h3 {
        margin: 0 0 8px;
        font-size: calc(1rem * var(--heading-scale));
    }

    .calendar-list .calendar-entry {
        padding: 8px 12px;
        background: var(--color-surface);
        border-radius: 0 8px 8px 0;
        font-size: calc(0.9375rem * var(--text-scale));
    }

    .calendar-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        margin: 0;
    }
}

/* Gamedays and tournaments: templates/gameday.php, tournament.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: calc(0.9375rem * var(--text-scale));
}

.gameday-past {
    opacity: 0.6;
}

/* Tournaments with the color of tournaments in the calendar at the edge;
   cancelled ones (schedule page) struck through. */
.gameday-tournament {
    border-left: 4px solid var(--calendar-tournament);
}

.gameday-cancelled > span > strong {
    text-decoration: line-through;
}

@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 and tournaments (templates/gameday.php) and games from LeagueSphere */
.gameday-list {
    display: grid;
    gap: 24px;
}

.gameday-date h3 {
    margin-bottom: 8px;
    font-size: calc(1.125rem * var(--heading-scale));
}

.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
   only the sections. */
.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-nav {
    grid-column: 2;
    grid-row: 1;
}

.section-nav ul {
    position: sticky;
    top: calc(var(--header-offset) + 16px);
    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: calc(1.125rem * var(--text-scale));
    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);
}

@media (max-width: 900px) {
    .section-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-nav {
        display: none;
    }
}

/* 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(5.5rem, 8rem) 104px 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: calc(0.9375rem * var(--text-scale));
}

.game-when strong {
    color: var(--color-text);
}

.game-league {
    font-size: calc(0.8125rem * var(--text-scale));
    overflow-wrap: break-word;
}

/* Team logos are wide (lettering with a detail below), so the box is too. */
.game-team-logo {
    width: 104px;
    height: 48px;
    object-fit: contain;
}

.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: calc(0.75rem * var(--text-scale));
    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);
}

/* Headings of sortable tables (data-sortable, initSortTables() in
   common.js): a button with two small arrows (.sort-icon), pale while the
   column is not sorted, the one of the direction in the page colour once it
   is. The icon always takes its space, so sorting doesn't move the columns. */
.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
}

.sort-button:hover,
.sort-button:focus-visible,
.data-table th[aria-sort] .sort-button {
    color: var(--color-primary);
}

.sort-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.sort-icon::before,
.sort-icon::after {
    content: "";
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.35;
}

.sort-icon::before {
    border-bottom: 5px solid currentColor;
}

.sort-icon::after {
    border-top: 5px solid currentColor;
}

.sort-button:hover .sort-icon::before,
.sort-button:hover .sort-icon::after {
    opacity: 0.7;
}

.data-table th[aria-sort] .sort-icon::before,
.data-table th[aria-sort] .sort-icon::after {
    opacity: 0.2;
}

.data-table th[aria-sort="ascending"] .sort-icon::before,
.data-table th[aria-sort="descending"] .sort-icon::after {
    opacity: 1;
}

/* League table (templates/standings-table.php) */
.standings .standings-team {
    width: 100%;
    text-align: left;
}

/* Logo before the team name, without a column title */
.standings .standings-logo {
    padding-right: 0;
    line-height: 0;
}

.standings-logo .game-score-logo {
    vertical-align: middle;
}

.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: calc(1.125rem * var(--heading-scale));
}

.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: calc(0.875rem * var(--text-scale));
    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: calc(0.875rem * var(--text-scale));
}

/* Statistics of one game (templates/game-stats.php). Its headings keep
   their space even as the first heading of a section (after the team
   table, after the liveticker log); full team names as column titles wrap
   on phones instead of scrolling sideways. */
.subsection-title.game-stats-title {
    margin-top: 24px;
}

@media (max-width: 720px) {
    .game-stats thead th {
        min-width: 6rem;
        white-space: normal;
    }
}

/* Head of a game (templates/game-header.php): home, score, away. A team
   with club colors (ClubColors, /club-colors.css) has a bar below its name:
   primary color thick, secondary thin. */
.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-team-colors {
    width: 96px;
    height: 6px;
    border-bottom: 3px solid var(--club-secondary);
    border-radius: 3px;
    background: var(--club-color);
    box-shadow: 0 0 0 1px var(--color-border);
    box-sizing: content-box;
}

.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: calc(0.875rem * var(--text-scale));
}

.game-score-center strong {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: calc(2.5rem * var(--text-scale));
    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, with a stripe and the team name as a
   badge in the club's color (ClubColors), without one home in the primary
   and away in the accent color; events with name and headshot
   (templates/game-event.php) */
.game-log-half {
    margin: 24px 0 8px;
    font-size: calc(1.125rem * var(--text-scale));
}

.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(--club-color, var(--color-primary));
    border-radius: 8px;
}

.game-log-away {
    justify-self: end;
    border-left: 0;
    border-right: 3px solid var(--club-color, var(--color-accent));
}

.game-log-team {
    max-width: 100%;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--club-color, var(--color-primary));
    color: var(--club-on-color, var(--color-surface));
    font-size: calc(0.8125rem * var(--text-scale));
    font-weight: 600;
    overflow-wrap: break-word;
}

.game-log-team-away {
    background: var(--club-color, var(--color-accent));
}

/* Team and time of a log entry, mirrored for the away team */
.game-log-head {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    align-self: flex-start;
}

.game-log-away .game-log-head {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.live-ticks .game-log-team {
    justify-self: start;
}

/* Ticker entry of no team (e.g. game time) */
.game-log-team:empty {
    padding: 0;
    background: none;
}

.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,
.game-log-time {
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

.game-log-time {
    flex: none;
    font-size: calc(0.8125rem * var(--text-scale));
}

/* "Data: LeagueSphere" under every section with its data */
.source-note {
    margin: 12px 0 0;
    color: var(--color-accent);
    font-size: calc(0.8125rem * var(--text-scale));
}

/* 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, 5rem) 72px minmax(0, 1fr);
        grid-template-areas: "when logo opponent" "when logo result";
        row-gap: 4px;
        gap: 8px;
        padding: 10px 12px;
    }

    .game-when {
        grid-area: when;
        min-width: 0;
    }

    .game-team-logo {
        grid-area: logo;
        width: 72px;
        height: 34px;
    }

    .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: calc(1.75rem * var(--text-scale));
    }

    .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 h1 {
    font-size: calc(2rem * var(--heading-scale));
}

.legal h2 {
    margin-top: 1.75em;
    font-size: calc(1.25rem * var(--heading-scale));
}

/* "Stand: …" line at the end of a privacy policy. */
.legal-status {
    font-style: italic;
}

.legal-note {
    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;
}

/* Introduction above the content of a page or section (PageTexts, e.g. on
   the board page and above the teams of the home page). */
.intro-text {
    margin-bottom: 24px;
}

.intro-text > :first-child {
    margin-top: 0;
}

/* Running text (paragraphs and lists of longer texts) in justified alignment,
   with the browser's hyphenation in the language of <html lang> or of the
   element, so narrow screens get no large gaps. On a paragraph or on the
   element around several of them; headings, cards, tables, forms and the
   admin area stay left-aligned. Lines ending in a line break (.pre-line, <br>)
   and the last line stay left-aligned anyway. */
p.prose,
.prose :is(p, li) {
    text-align: justify;
    hyphens: auto;
}

/* Output of Helpers::richText() (formatted texts: descriptions of teams,
   events, timeline and merchandise): paragraphs and lists with a gap between
   them, none above the first and below the last, so the element around them
   decides its own spacing. */
.rich-text > :is(p, ul, ol) {
    margin: 0;
}

.rich-text > :is(p, ul, ol) + :is(p, ul, ol) {
    margin-top: 0.75em;
}

/* 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-info {
    border-color: var(--color-accent);
}

.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: calc(1.25rem * var(--heading-scale));
}

.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: calc(0.875rem * var(--text-scale));
}

.form-warning {
    color: var(--color-primary-dark);
}

.form-error-text {
    color: var(--color-primary);
    font-size: calc(0.875rem * var(--text-scale));
    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: calc(0.9375rem * var(--text-scale));
}

.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;
    }
}
