/* ============================================================
   TOURNO DESIGN SYSTEM — "Matchday"
   Pitch-side scoreboard app for junior football tournaments.
   Mobile-first. No framework dependencies.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
    /* Pitch greens (chrome) */
    --t-pitch-950: #071E15;
    --t-pitch-900: #0C2F22;
    --t-pitch-800: #123D2C;
    --t-pitch-700: #1A5039;

    /* Action green */
    --t-grass-700: #187A43;
    --t-grass-600: #1F8A4C;
    --t-grass-100: #DFF2E7;

    /* Bib volt — LIVE signals only */
    --t-volt: #D6F930;
    --t-volt-ink: #2A3505;

    /* Surfaces & ink */
    --t-chalk: #F4F6F2;
    --t-white: #FFFFFF;
    --t-ink: #17251E;
    --t-ink-60: #5C6B62;
    --t-ink-40: #8A968E;
    --t-line: #E0E6E0;

    /* Signals */
    --t-red: #CF4444;
    --t-red-bg: #FBEAEA;
    --t-amber: #D98E1F;
    --t-amber-bg: #FBF1DE;
    --t-info-bg: #E8F0F7;
    --t-info: #2F6396;

    /* Type */
    --t-font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --t-font-body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;

    /* Shape */
    --t-radius: 12px;
    --t-radius-sm: 8px;
    --t-shadow: 0 1px 2px rgba(12, 47, 34, .06), 0 4px 16px rgba(12, 47, 34, .07);
    --t-shadow-up: 0 -2px 12px rgba(7, 30, 21, .18);

    /* Layout */
    --t-appbar-h: 56px;
    --t-tabbar-h: 60px;
    --t-container: 1080px;
}

/* ---------- Reset (lite) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--t-font-body);
    font-size: 16px;
    line-height: 1.45;
    color: var(--t-ink);
    background: var(--t-chalk);
}
img, svg { vertical-align: middle; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, p, ul, ol, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
a { color: var(--t-grass-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
table { border-collapse: collapse; }
input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--t-grass-600);
    outline-offset: 2px;
}
.t-dark :focus-visible,
.t-appbar :focus-visible,
.t-tabbar :focus-visible,
.t-sheet :focus-visible {
    outline-color: var(--t-volt);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- Typography ---------- */
.t-display, .t-h1, .t-h2, .t-h3 {
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .015em;
    line-height: 1.08;
}
.t-h1 { font-size: 34px; }
.t-h2 { font-size: 26px; }
.t-h3 { font-size: 20px; }
@media (min-width: 768px) {
    .t-h1 { font-size: 44px; }
    .t-h2 { font-size: 30px; }
}
.t-eyebrow {
    font-family: var(--t-font-display);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--t-ink-60);
}
.t-num {
    font-family: var(--t-font-display);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
/* Inherits colour, only reveals as a link on hover */
.t-hoverlink { color: inherit; text-decoration: none; }
.t-hoverlink:hover, .t-hoverlink:focus { text-decoration: underline; }
.t-muted { color: var(--t-ink-60); }
.t-small { font-size: 14px; }

/* ---------- Layout ---------- */
.t-container {
    max-width: var(--t-container);
    margin: 0 auto;
    padding: 0 16px;
}
.t-main {
    min-height: 60vh;
    padding-bottom: 40px;
}
body.has-tabbar .t-main {
    /* room for the fixed bottom tab bar on mobile */
    padding-bottom: calc(var(--t-tabbar-h) + env(safe-area-inset-bottom, 0px) + 32px);
}
@media (min-width: 900px) {
    body.has-tabbar .t-main { padding-bottom: 40px; }
}
.t-section { margin: 24px 0; }
.t-stack > * + * { margin-top: 12px; }

/* ============================================================
   APP BAR
   ============================================================ */
.t-appbar {
    position: sticky;
    top: 0;
    /* above the tab bar (450) so open dropdowns are never covered;
       below the menu sheet (600) and modals (700) */
    z-index: 500;
    background: var(--t-pitch-900);
    color: #fff;
    height: var(--t-appbar-h);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.t-appbar__inner {
    max-width: var(--t-container);
    margin: 0 auto;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}
.t-appbar__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.t-appbar__logo img { height: 36px; width: auto; }
.t-appbar__spacer { flex: 1; }
.t-appbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 8px 10px;
    min-height: 44px;
    border-radius: var(--t-radius-sm);
    font-weight: 500;
    font-size: 15px;
}
.t-appbar__btn:hover { background: rgba(255, 255, 255, .08); }
.t-appbar__btn .flag { border-radius: 2px; display: block; }
.t-appbar__btn svg { display: block; }

/* dropdown */
.t-drop { position: relative; }
.t-drop__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: var(--t-white);
    color: var(--t-ink);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow), 0 12px 32px rgba(12, 47, 34, .18);
    padding: 6px;
    display: none;
    z-index: 500;
}
.t-drop.is-open .t-drop__menu { display: block; }
.t-drop__menu a,
.t-drop__menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    background: none;
    border-radius: var(--t-radius-sm);
    color: var(--t-ink);
    font-size: 15px;
    text-decoration: none;
}
.t-drop__menu a:hover, .t-drop__menu button:hover { background: var(--t-chalk); text-decoration: none; }
.t-drop__menu .t-drop__divider { height: 1px; background: var(--t-line); margin: 6px 4px; }
.t-drop__menu .is-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--t-radius-sm);
    background: var(--t-grass-100);
    color: var(--t-ink);
    font-weight: 600;
    pointer-events: none;
}
.t-drop__menu .is-current::after {
    content: "\2713";
    margin-left: auto;
    color: var(--t-grass-700);
    font-weight: 700;
}

/* ============================================================
   FULL-SCREEN MENU SHEET
   ============================================================ */
.t-sheet {
    position: fixed;
    inset: 0;
    z-index: 600;
    background:
        linear-gradient(rgba(7, 30, 21, .55), rgba(7, 30, 21, .78)),
        var(--t-pitch-950) url(../images/overlay_menu_background.jpg) center / cover no-repeat;
    color: #fff;
    display: none;
    flex-direction: column;
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
}
.t-sheet.is-open { display: flex; }
.t-sheet__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--t-appbar-h);
}
.t-sheet__close {
    background: rgba(255, 255, 255, .08);
    border: 0;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.t-sheet__nav { margin-top: 6vh; }
.t-sheet__nav a {
    display: block;
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    font-size: 36px;
    line-height: 1.25;
    color: #fff;
    padding: 8px 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.t-sheet__nav a:hover { color: var(--t-volt); }
.t-sheet__meta { margin-top: auto; padding-top: 32px; }
.t-sheet__langs { display: flex; gap: 8px; margin-top: 12px; }
.t-sheet__langs a, .t-sheet__langs span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    border-radius: var(--t-radius-sm);
    background: rgba(255, 255, 255, .07);
    color: #fff;
    font-size: 15px;
    text-decoration: none;
}
.t-sheet__langs .is-current {
    background: var(--t-volt);
    color: var(--t-volt-ink);
    font-weight: 600;
}

/* ============================================================
   TOURNAMENT TAB BAR  (bottom on mobile, top tabs on desktop)
   ============================================================ */
.t-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 450;
    background: var(--t-pitch-900);
    box-shadow: var(--t-shadow-up);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.t-tabbar__inner {
    display: flex;
    max-width: var(--t-container);
    margin: 0 auto;
}
.t-tabbar a, .t-tabbar button {
    flex: 1;
    min-width: 0; /* allow tabs to shrink to fit (e.g. 6 tabs incl. Present) instead of overflowing */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: var(--t-tabbar-h);
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .62);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none;
    padding: 6px 2px;
}
.t-tabbar a:hover, .t-tabbar button:hover { text-decoration: none; color: #fff; }
.t-tabbar svg { display: block; }
.t-tabbar .is-active { color: #fff; }
.t-tabbar .is-active::after {
    content: "";
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--t-volt);
    margin-top: 1px;
}
@media (min-width: 900px) {
    .t-tabbar {
        position: sticky;
        top: var(--t-appbar-h);
        bottom: auto;
        box-shadow: 0 2px 8px rgba(12, 47, 34, .12);
    }
    .t-tabbar__inner { justify-content: flex-start; padding: 0 16px; }
    .t-tabbar a, .t-tabbar button {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 8px;
        min-height: 48px;
        padding: 0 18px;
        font-size: 14px;
    }
    .t-tabbar .is-active::after { display: none; }
    .t-tabbar .is-active { box-shadow: inset 0 -3px 0 var(--t-volt); }
}

/* ============================================================
   TOURNAMENT HERO
   ============================================================ */
.t-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 85% -20%, var(--t-pitch-700) 0%, var(--t-pitch-900) 55%, var(--t-pitch-950) 100%);
    color: #fff;
    padding: 24px 0 20px;
}
/* club-crest watermark variant: page sets --hero-crest: url(...) */
.t-hero--crest {
    background:
        linear-gradient(100deg, rgba(12, 47, 34, .9) 35%, rgba(12, 47, 34, .55)),
        var(--hero-crest) right -30px center / 230px auto no-repeat,
        radial-gradient(120% 140% at 85% -20%, var(--t-pitch-700) 0%, var(--t-pitch-900) 55%, var(--t-pitch-950) 100%);
    /* multiply hides white JPG backgrounds against the pitch gradient */
    background-blend-mode: normal, multiply, normal;
}
@media (min-width: 768px) {
    .t-hero--crest {
        background:
            linear-gradient(100deg, rgba(12, 47, 34, .9) 45%, rgba(12, 47, 34, .45)),
            var(--hero-crest) right 40px center / 340px auto no-repeat,
            radial-gradient(120% 140% at 85% -20%, var(--t-pitch-700) 0%, var(--t-pitch-900) 55%, var(--t-pitch-950) 100%);
        background-blend-mode: normal, multiply, normal;
    }
}

/* chalk centre-circle motif */
.t-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -110px;
    width: 300px;
    height: 300px;
    border: 2px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    pointer-events: none;
}
.t-hero::before {
    content: "";
    position: absolute;
    right: 55px;
    top: 35px;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, .09);
    border-radius: 50%;
    pointer-events: none;
}
.t-hero__inner { position: relative; z-index: 1; }
.t-hero__crest {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin-bottom: 10px;
}
.t-hero__crest img { max-height: 100%; width: auto; }
.t-hero__title {
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .015em;
    font-size: 30px;
    line-height: 1.05;
}
@media (min-width: 768px) { .t-hero__title { font-size: 42px; } }
.t-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
}
.t-hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.t-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* stat strip */
.t-statbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 18px;
}
.t-statbar__item {
    background: rgba(255, 255, 255, .07);
    border-radius: var(--t-radius-sm);
    padding: 8px 6px;
    text-align: center;
}
.t-statbar__num {
    font-family: var(--t-font-display);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 26px;
    line-height: 1;
    color: #fff;
}
.t-statbar__item.is-live .t-statbar__num { color: var(--t-volt); }
.t-statbar__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
    margin-top: 3px;
}

/* ============================================================
   BUTTONS / CHIPS / BADGES
   ============================================================ */
.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 20px;
    min-height: 44px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.t-btn:hover { text-decoration: none; }
.t-btn--primary { background: var(--t-grass-600); color: #fff; }
.t-btn--primary:hover { background: var(--t-grass-700); }
.t-btn--dark { background: var(--t-pitch-900); color: #fff; }
.t-btn--dark:hover { background: var(--t-pitch-800); }
.t-btn--ghost { background: rgba(255, 255, 255, .12); color: #fff; }
.t-btn--ghost:hover { background: rgba(255, 255, 255, .2); }
.t-btn--outline {
    background: transparent;
    color: var(--t-grass-700);
    box-shadow: inset 0 0 0 2px var(--t-grass-600);
}
.t-btn--outline:hover { background: var(--t-grass-100); }
.t-btn--danger { background: var(--t-red); color: #fff; }
.t-btn--block { display: flex; width: 100%; }
.t-btn--lg { min-height: 52px; font-size: 17px; padding: 12px 26px; }
.t-btn--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.t-btn[disabled] { opacity: .55; pointer-events: none; }

/* filter chips */
.t-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
    margin: 0 -2px;
}
.t-chips::-webkit-scrollbar { display: none; }
/* desktop: no horizontal scroll — wrap so every chip is visible at once */
@media (min-width: 768px) {
    .t-chips { flex-wrap: wrap; overflow-x: visible; }
}
.t-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--t-line);
    background: var(--t-white);
    color: var(--t-ink);
    border-radius: 999px;
    padding: 7px 16px;
    min-height: 38px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.t-chip:hover { border-color: var(--t-grass-600); text-decoration: none; }
.t-chip.is-active {
    background: var(--t-pitch-900);
    border-color: var(--t-pitch-900);
    color: #fff;
}
.t-chip__sub { font-weight: 400; color: var(--t-ink-60); font-size: 12.5px; }
.t-chip.is-active .t-chip__sub { color: rgba(255, 255, 255, .65); }

/* badges */
.t-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.t-badge--live { background: var(--t-volt); color: var(--t-volt-ink); }
.t-badge--done { background: var(--t-line); color: var(--t-ink-60); }
.t-badge--time { background: var(--t-grass-100); color: var(--t-grass-700); }
.t-badge--warn { background: var(--t-amber-bg); color: var(--t-amber); }
.t-badge--closed { background: var(--t-red-bg); color: var(--t-red); }
.t-badge--open { background: var(--t-grass-600); color: #fff; }
.t-badge--pens { background: var(--t-grass-700); color: #fff; }
.t-scoreboard__pens { text-align: center; margin-top: 6px; font-weight: 700; font-size: 15px; color: var(--t-grass-700); }
/* read-only penalty shootout sequence */
.t-pen-seq { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.t-pen-seq__row { display: flex; align-items: center; gap: 8px; }
.t-pen-seq__name { font-size: 12px; font-weight: 700; color: var(--t-ink-60); min-width: 84px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-pen-seq__dots { display: flex; gap: 4px; }
.t-pen-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--t-line); background: var(--t-white); box-sizing: border-box; }
.t-pen-dot.is-goal { background: var(--t-grass-600); border-color: var(--t-grass-600); }
.t-pen-dot.is-miss { background: var(--t-red, #CF4444); border-color: var(--t-red, #CF4444); }

/* live pulse dot */
.t-livedot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: t-pulse 1.6s ease-in-out infinite;
}
@keyframes t-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

/* ============================================================
   CARDS
   ============================================================ */
.t-card {
    background: var(--t-white);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
    overflow: hidden;
}
.t-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--t-line);
}
.t-card__title {
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 18px;
    letter-spacing: .02em;
}
.t-lock { display: inline-flex; align-items: center; color: var(--t-ink-40); flex-shrink: 0; }
.t-lock svg { height: 18px; width: auto; }

/* standings position-change animation (FLIP) — classes applied by tourno-ds.js */
.t-standings tr.t-row-up, .t-standings tr.t-row-down { position: relative; z-index: 1; }
.t-standings tr.t-row-up { animation: t-row-up-flash 1.8s ease; }
.t-standings tr.t-row-down { animation: t-row-down-flash 1.8s ease; }
@keyframes t-row-up-flash { 0%, 55% { background: var(--t-grass-100); } 100% { background: transparent; } }
@keyframes t-row-down-flash { 0%, 55% { background: var(--t-red-bg); } 100% { background: transparent; } }

/* goal celebration on panel refresh — classes applied by tourno-ds.js */
.t-match__pts.t-goal-pop { animation: t-goal-pop 3s cubic-bezier(.22,.9,.35,1); }
@keyframes t-goal-pop {
    0% { transform: scale(1); }
    10% { transform: scale(1.45); background: var(--t-grass-600); color: #fff; }
    26% { transform: scale(1); }
    72% { background: var(--t-grass-600); color: #fff; }
    100% { transform: scale(1); }
}
.t-match__team.t-goal-team { animation: t-goal-team 3s ease; }
@keyframes t-goal-team { 0%, 72% { color: var(--t-grass-700); } }
.t-badge--pens.t-pens-pop { animation: t-pens-pop .9s ease; }
@keyframes t-pens-pop { 30% { transform: scale(1.25); } }

.t-card__body { padding: 16px; }
.t-card--pad { padding: 16px; }

a.t-card { color: inherit; display: block; }
a.t-card.t-flex { display: flex; }
a.t-card:hover { text-decoration: none; box-shadow: 0 2px 4px rgba(12,47,34,.09), 0 8px 24px rgba(12,47,34,.12); }

/* ============================================================
   MATCH CARD  — the core unit of the redesign
   Markup contract:
   .t-match[data-status=upcoming|live|done]
     .t-match__when   (kick-off time, pitch, day)
     .t-match__teams  (two .t-match__team rows)
     .t-match__score  (two .t-match__pts)
   ============================================================ */
.t-matchlist { display: flex; flex-direction: column; gap: 8px; }
.t-match {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 12px;
    background: var(--t-white);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    border-left: 4px solid transparent;
}
a.t-match:hover { text-decoration: none; box-shadow: 0 2px 4px rgba(12,47,34,.09), 0 8px 24px rgba(12,47,34,.12); }
.t-match.is-live { border-left-color: var(--t-volt); }
.t-match.is-done { border-left-color: var(--t-line); }

.t-match__when {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    border-right: 1px solid var(--t-line);
    padding-right: 10px;
    align-self: stretch;
    justify-content: center;
}
.t-match__time {
    font-family: var(--t-font-display);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 19px;
    line-height: 1;
}
.t-match__sub {
    font-size: 11.5px;
    color: var(--t-ink-60);
    line-height: 1.25;
}

.t-match__teams { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.t-match__team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 500;
    font-size: 15.5px;
}
.t-match__team .crest { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.t-match__team .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.t-match__team .hint { font-size: 12px; color: var(--t-ink-60); font-weight: 400; }
/* green "arrived" dot shown to organisers when a team has registered arrival */
.t-arrived { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--t-grass-600); flex-shrink: 0; }

/* moderator game card — used by moderate_games and the dependent-games modal */
.mod-game { border-left: 4px solid var(--t-line); }
.mod-game.clickable_game { cursor: pointer; }
.mod-game.is-live { border-left-color: var(--t-volt); }
.mod-game.is-done { border-left-color: var(--t-grass-600); }
.mod-game.is-cancelled { border-left-color: var(--t-ink-40); opacity: .7; }
.mod-game__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mod-game__status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.mod-game__meta-line { font-size: 12.5px; color: var(--t-ink-60); }
.mod-game__name { font-family: var(--t-font-display); font-weight: 700; text-transform: uppercase; font-size: 17px; letter-spacing: .01em; }
.mod-game__board { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
.mod-game__teams { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mod-game__team { font-weight: 500; font-size: 15.5px; }
.mod-game__team img { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.mod-game__score { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mod-game__pts { font-family: var(--t-font-display); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 22px; line-height: 26px; min-width: 30px; text-align: center; border-radius: 6px; padding: 0 6px; background: var(--t-chalk); }
.mod-game.is-live .mod-game__pts { background: var(--t-volt); color: var(--t-volt-ink); }
.mod-game__details { border-top: 1px dashed var(--t-line); margin-top: 10px; padding-top: 8px; font-size: 13px; color: var(--t-ink-60); line-height: 1.6; }
.mod-game__details strong { color: var(--t-ink); }
.t-match__team.is-winner { font-weight: 700; }
.t-match__team.is-loser { color: var(--t-ink-60); }
.t-match__team .star { flex-shrink: 0; }

.t-match__score {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    padding-left: 6px;
}
.t-match__pts {
    font-family: var(--t-font-display);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 21px;
    line-height: 22px;
    min-width: 26px;
    text-align: center;
    border-radius: 6px;
    padding: 0 4px;
    background: var(--t-chalk);
}
.t-match.is-live .t-match__pts { background: var(--t-volt); color: var(--t-volt-ink); }
.t-match__pts.is-empty { background: transparent; color: var(--t-ink-40); }

.t-match__foot {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--t-ink-60);
    border-top: 1px dashed var(--t-line);
    padding-top: 8px;
    margin-top: 2px;
}

/* group label row inside match lists */
.t-matchlist__day {
    font-family: var(--t-font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 13px;
    color: var(--t-ink-60);
    padding: 10px 2px 2px;
}

/* ============================================================
   NEXT-UP CARD (signature): pinned team's next game
   ============================================================ */
.t-nextup {
    position: relative;
    overflow: hidden;
    background: radial-gradient(130% 160% at 90% -30%, var(--t-pitch-700) 0%, var(--t-pitch-900) 60%, var(--t-pitch-950) 100%);
    color: #fff;
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
    padding: 16px;
}
.t-nextup::after {
    content: "";
    position: absolute;
    left: -70px;
    bottom: -120px;
    width: 240px;
    height: 240px;
    border: 2px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    pointer-events: none;
}
.t-nextup__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--t-font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .65);
}
.t-nextup__match {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.t-nextup__teams {
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 22px;
    line-height: 1.15;
}
.t-nextup__vs { color: rgba(255,255,255,.5); font-size: 16px; padding: 0 2px; }
.t-nextup__count {
    font-family: var(--t-font-display);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 30px;
    line-height: 1;
    color: var(--t-volt);
    white-space: nowrap;
}
.t-nextup__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, .78);
}
.t-nextup__meta span { display: inline-flex; align-items: center; gap: 6px; }
.t-nextup a { color: inherit; }

/* hint shown when no team pinned yet */
.t-nextup--hint {
    background: var(--t-white);
    color: var(--t-ink-60);
    border: 1.5px dashed var(--t-line);
    box-shadow: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.t-nextup--hint::after { display: none; }
.t-nextup--hint .star-demo { color: var(--t-amber); flex-shrink: 0; }

/* star (pin team) button */
.t-star {
    background: none;
    border: 0;
    padding: 6px;
    margin: -6px;
    color: var(--t-ink-40);
    display: inline-flex;
    border-radius: 50%;
}
.t-star:hover { color: var(--t-amber); }
.t-star.is-pinned { color: var(--t-amber); }
.t-star svg { display: block; }

/* ============================================================
   STANDINGS TABLE
   ============================================================ */
.t-standings { width: 100%; font-size: 14.5px; }
.t-standings th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t-ink-60);
    text-align: center;
    padding: 8px 6px;
    border-bottom: 1px solid var(--t-line);
    white-space: nowrap;
}
.t-standings th:nth-child(2) { text-align: left; }
.t-standings td {
    padding: 9px 6px;
    text-align: center;
    border-bottom: 1px solid var(--t-line);
    font-variant-numeric: tabular-nums;
}
.t-standings tr:last-child td { border-bottom: 0; }
.t-standings td.team {
    text-align: left;
    max-width: 0;
    width: 60%;
}
.t-standings td.team .cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.t-standings td.team .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: inherit;
}
.t-standings td.team a { color: inherit; }
.t-standings td.team .crest { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.t-standings .pos {
    font-family: var(--t-font-display);
    font-weight: 700;
    color: var(--t-ink-60);
    width: 28px;
}
.t-standings .pts { font-weight: 700; }
.t-standings tr.is-mine td { background: #FFFBEB; }
.t-standings .mini-score { margin-left: 6px; }
tr.t-rowlink { cursor: pointer; }
tr.t-rowlink:hover td { background: var(--t-chalk); }

/* ============================================================
   FORMS
   ============================================================ */
.t-field { margin-bottom: 16px; }
.t-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}
.t-field .req { color: var(--t-red); }
.t-input, .t-select, .t-textarea {
    width: 100%;
    background: var(--t-white);
    border: 1.5px solid var(--t-line);
    border-radius: var(--t-radius-sm);
    padding: 11px 12px;
    font-size: 16px; /* prevents iOS zoom */
    min-height: 46px;
}
.t-input:focus, .t-select:focus, .t-textarea:focus {
    border-color: var(--t-grass-600);
    outline: none;
    box-shadow: 0 0 0 3px var(--t-grass-100);
}
.t-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235C6B62' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
.t-field__help { font-size: 13px; color: var(--t-ink-60); margin-top: 4px; }
.t-field__error { font-size: 13px; color: var(--t-red); margin-top: 4px; font-weight: 500; }
.t-check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.t-check input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--t-grass-600);
    flex-shrink: 0;
}

/* ============================================================
   ALERTS / CALLOUTS
   ============================================================ */
.t-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: var(--t-radius-sm);
    padding: 12px 14px;
    font-size: 14.5px;
}
.t-alert svg { flex-shrink: 0; margin-top: 1px; }
.t-alert--info { background: var(--t-info-bg); color: var(--t-info); }
.t-alert--success { background: var(--t-grass-100); color: var(--t-grass-700); }
.t-alert--warn { background: var(--t-amber-bg); color: var(--t-amber); }
.t-alert--danger { background: var(--t-red-bg); color: var(--t-red); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.t-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--t-ink-60);
}
.t-empty svg { margin-bottom: 10px; opacity: .5; }
.t-empty__title {
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 20px;
    color: var(--t-ink);
    margin-bottom: 4px;
}

/* ============================================================
   MODAL (vanilla)
   ============================================================ */
.t-modal {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(7, 30, 21, .55);
    padding: 0;
}
.t-modal.is-open { display: flex; }
.t-modal__box {
    background: var(--t-white);
    border-radius: var(--t-radius) var(--t-radius) 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) {
    .t-modal { align-items: center; padding: 24px; }
    .t-modal__box { border-radius: var(--t-radius); padding: 24px; }
}
body.t-modal-lock { overflow: hidden; }

/* ============================================================
   FOOTER
   ============================================================ */
.t-footer {
    background: var(--t-pitch-950);
    color: rgba(255, 255, 255, .75);
    margin-top: 48px;
    padding: 32px 0 24px;
    font-size: 14.5px;
}
body.has-tabbar .t-footer {
    padding-bottom: calc(24px + var(--t-tabbar-h) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 900px) {
    body.has-tabbar .t-footer { padding-bottom: 24px; }
}
.t-footer a { color: #fff; }
.t-footer__grid {
    display: grid;
    gap: 24px;
}
@media (min-width: 640px) {
    .t-footer__grid { grid-template-columns: 1fr 1fr; }
}
.t-footer__heading {
    font-family: var(--t-font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 15px;
    color: #fff;
    margin-bottom: 10px;
}
.t-footer__links li { margin-bottom: 8px; }
.t-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 24px;
    padding-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, .5);
}

/* ============================================================
   MISC / UTILITIES
   ============================================================ */
.t-center { text-align: center; }
.t-right { text-align: right; }
.t-flex { display: flex; align-items: center; gap: 8px; }
.t-flex--between { justify-content: space-between; }
.t-wrap { flex-wrap: wrap; }
.t-grid {
    display: grid;
    gap: 12px;
}
@media (min-width: 640px) { .t-grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .t-grid--3 { grid-template-columns: 1fr 1fr 1fr; } }
.t-mt-0 { margin-top: 0 !important; }
.t-mt-8 { margin-top: 8px; }
.t-mt-16 { margin-top: 16px; }
.t-mt-24 { margin-top: 24px; }
.t-mb-8 { margin-bottom: 8px; }
.t-mb-16 { margin-bottom: 16px; }
.t-hide-mobile { display: none !important; }
@media (min-width: 768px) {
    .t-hide-mobile { display: revert !important; }
    .t-hide-desktop { display: none !important; }
}
/* legacy JS hooks (invitation/application flows toggle these) */
.hidden { display: none !important; }
.validate_error {
    border-color: var(--t-red) !important;
    box-shadow: 0 0 0 3px var(--t-red-bg) !important;
}
.component_delete_error_space {
    font-size: 13px;
    color: var(--t-red);
    margin-top: 4px;
    font-weight: 500;
}

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

/* crest fallback */
.crest--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--t-chalk);
    border-radius: 4px;
    color: var(--t-ink-40);
}

/* page headers on plain pages */
.t-pagehead {
    background: var(--t-pitch-900);
    color: #fff;
    padding: 24px 0;
}
.t-pagehead .t-h1, .t-pagehead .t-h2 { color: #fff; }
.t-pagehead p { color: rgba(255, 255, 255, .75); margin-top: 6px; }

@media print {
    .t-appbar, .t-tabbar, .t-footer, .t-sheet, #tourno-chatbot { display: none !important; }
    body { background: #fff; }
}
