/* The Saturday Table: the newcomer's first screen (decision 2026-11-14, contract
 * Addendum 2). One rendered still, a hero stadium in front and four behind it;
 * five floodlight layers blended over it; one full label on the hero, a numbered
 * marker on each of the others, and the same numbers on the list under the image.
 * The frame keeps the image's own shape (4:5 on phones, 16:9 from 768px) so the
 * anchors in table.json, given as fractions of the image, stay true.
 * The frame is dark in both site themes: it is a photograph, not a surface. */

.sat-table__frame {
    position: relative;
    isolation: isolate; /* the light layers blend with the still and nothing else */
    aspect-ratio: 1080 / 1350;
    /* Phones: edge to edge, out of the page's own side padding. */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    background: #05070a;
    color: #f4f6f8;
}

.sat-table__base,
.sat-table__light {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none; /* taps fall through to the label and markers */
}

.sat-table__base img,
.sat-table__light img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Each layer is only that stadium's floodlights on black; screen adds it to the
   still. --light is the seat's opacity from the service, used as given. */
.sat-table__light {
    mix-blend-mode: screen;
    opacity: var(--light, 0);
    transition: opacity 0.45s ease;
}

/* A soft shade behind the heading, so it reads over the far stadiums' glow. */
.sat-table__frame::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 22%;
    background: linear-gradient(rgba(3, 5, 8, 0.78), rgba(3, 5, 8, 0));
    pointer-events: none;
}

.sat-table__head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem 0;
    pointer-events: none;
}

.sat-table__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.sat-table__sub {
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #d3d9e1;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

/* ── Seat 1: the one full label, centred on its anchor and hanging down from it ── */
.sat-seat {
    --x: var(--px);
    --y: var(--py);
    --w: 80%;
    position: absolute;
    box-sizing: border-box; /* --w is the whole label, padding included */
    /* Centred on the anchor, but never past the frame's edge. */
    left: clamp(2%, calc(var(--x) * 100% - var(--w) / 2), calc(98% - var(--w)));
    /* Hangs from the anchor; lifted just enough that a two-line name still ends inside the frame. */
    top: min(calc(var(--y) * 100%), calc(100% - 96px));
    width: var(--w);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 44px;
    padding: 0.8125rem 0.625rem 0.4375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(5, 7, 10, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #f4f6f8 !important;
    text-align: center;
    text-decoration: none !important;
    line-height: 1.25;
    transition: opacity 0.45s ease, border-color 0.2s ease;
}

/* The hero's number, riding the label's top edge: the same "1" as the list's first row. */
.sat-seat__num {
    position: absolute;
    top: -12px;
    left: 50%;
    margin-left: -12px;
}

.sat-seat__num,
.sat-marker__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: rgba(5, 7, 10, 0.72);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.sat-seat__num {
    background: #05070a;
}

.sat-seat__teams {
    font-size: 0.875rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sat-seat__at {
    font-weight: 400;
    color: #c5ccd6;
}

.sat-seat__when {
    font-size: 0.8125rem;
    color: #d3d9e1;
}

.sat-seat__line {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #f3dfae; /* the floodlights' warm white */
}

/* ── Seats 2 to 5: a numbered marker centred on its anchor ──
   The circle draws at 28px; the link around it is the 44px tap target. */
.sat-marker {
    --x: var(--px);
    --y: var(--py);
    position: absolute;
    left: calc(var(--x) * 100% - 22px);
    top: calc(var(--y) * 100% - 22px);
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none !important;
    transition: opacity 0.45s ease;
}

.sat-marker__dot {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sat-seat:hover,
.sat-seat:focus-visible {
    border-color: rgba(255, 255, 255, 0.6);
}

.sat-marker:hover .sat-marker__dot,
.sat-marker:focus-visible .sat-marker__dot,
.sat-marker.is-on .sat-marker__dot {
    border-color: #fff;
    background: rgba(5, 7, 10, 0.92);
}

.sat-seat:focus-visible,
.sat-marker:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sat-marker:focus-visible {
    outline-offset: -6px;
}

.sat-seat.is-waiting,
.sat-marker.is-waiting {
    cursor: progress;
}

/* ── One stadium has the floor (its simulation is playing, or its row or marker
      is hovered or focused): that layer at full, the rest eased down ── */
.sat-table__frame.is-focus .sat-table__light {
    opacity: calc(var(--light, 0) * 0.3);
}

.sat-table__frame.is-focus .sat-table__light.is-on {
    opacity: 1;
}

.sat-table__frame.is-playing .sat-seat:not(.is-on),
.sat-table__frame.is-playing .sat-marker:not(.is-on) {
    opacity: 0.5;
}

/* ── Result panel: slides up from the bottom of the frame, or sits at the top
      when the hero itself is playing so it never covers that stadium ── */
.sat-sim {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    padding: 0.625rem 0.75rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: #0a0c11; /* opaque: the heading, markers or label sit under it */
    color: #f4f6f8;
    scroll-margin: 72px 0; /* clear of the nav above and the cookie strip below */
    animation: sat-sim-up 0.22s ease-out;
}

.sat-sim[hidden] {
    display: none;
}

.sat-sim[data-pos="top"] {
    top: 8px;
    bottom: auto;
    animation-name: sat-sim-down;
}

.sat-sim:focus {
    outline: none;
}

.sat-sim:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

@keyframes sat-sim-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes sat-sim-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: none; }
}

.sat-sim__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sat-sim__tag {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c5ccd6;
}

.sat-sim__close {
    width: 44px;
    /* 44 px each way: the minimum tap target */
    height: 44px;
    margin: -0.75rem -0.625rem -0.625rem 0;
    border: 0;
    background: none;
    color: #c5ccd6;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
}

.sat-sim__close:hover,
.sat-sim__close:focus-visible {
    color: #fff;
}

.sat-sim__split {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.3;
}

.sat-sim__side--home {
    text-align: right;
}

.sat-sim__side b {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #f3dfae;
}

.sat-sim__track {
    display: flex;
    justify-content: space-between;
    height: 6px;
    margin-top: 0.375rem;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.sat-sim__fill {
    display: block;
    width: 0;
    height: 100%;
}

.sat-sim__fill--away { background: #8b95a3; }
.sat-sim__fill--home { background: #f3dfae; }

.sat-sim__result {
    margin: 0.5rem 0 0;
    min-height: 2.7em; /* holds its two lines while the count runs, so nothing jumps */
    font-size: 0.875rem;
    line-height: 1.35;
}

.sat-sim__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.sat-sim__note {
    margin: 0;
    font-size: 0.75rem;
    color: #c5ccd6;
}

.sat-sim__open {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1rem;
    border-radius: 8px;
    background: #047857;
    color: #fff !important;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none !important;
}

.sat-sim__open:hover,
.sat-sim__open:focus-visible {
    background: #065f46;
}

.sat-sim__open:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ── No game inside three weeks: the still at rest, one line, two ways on ── */
.sat-table__links {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin: 0;
}

.sat-table__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(5, 7, 10, 0.72);
    color: #fff !important;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none !important;
}

.sat-table__links a:hover,
.sat-table__links a:focus-visible {
    border-color: #fff;
}

/* ── Under the image: the line about the light, then the five games by number ── */
.sat-key {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.sat-list {
    list-style: none;
    margin: 0 0 0.25rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.sat-list > li + li {
    border-top: 1px solid var(--border-color);
}

.sat-row {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr) auto;
    grid-template-areas:
        "num teams teams"
        "num when  state"
        "num line  state";
    align-items: center;
    gap: 0 0.5rem;
    padding: 0.4375rem 0.625rem;
    min-height: 44px;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    background-color: var(--bg-primary);
    line-height: 1.3;
}

.sat-row:hover,
.sat-row:focus-visible {
    background-color: var(--bg-secondary);
}

.sat-row__num {
    grid-area: num;
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.0625rem;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.sat-row__teams {
    grid-area: teams;
    font-size: 0.95rem;
    font-weight: 600;
    /* Names wrap rather than truncate ("Western Kentu..." read worse than two lines). */
    overflow-wrap: anywhere;
}

.sat-row__at {
    font-weight: 400;
    color: var(--text-secondary);
}

.sat-row__when {
    grid-area: when;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sat-row__line {
    grid-area: line;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.sat-row__state {
    grid-area: state;
    text-align: right;
}

/* ── The one line saying what the site is ── */
.landing-about {
    max-width: 880px;
    margin: 0 auto;
    padding: 0.75rem 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

/* ── Wide screens: the landscape still, as large as the first screen allows ── */
@media (min-width: 768px) {
    .sat-table {
        padding: 0.75rem 0.75rem 0;
    }

    .sat-table__frame {
        aspect-ratio: 1920 / 1080;
        /* As wide as the page, but short enough that the list starts on the first screen. */
        width: min(100%, 1600px, calc((100vh - 210px) * 16 / 9));
        min-width: min(100%, 720px);
        margin: 0 auto;
        border-radius: 12px;
    }

    .sat-table__head {
        padding: 1.125rem 1.5rem 0;
    }

    .sat-table__title {
        font-size: 1.5rem;
    }

    .sat-seat {
        --x: var(--lx);
        --y: var(--ly);
        --w: 29%;
        padding: 1rem 0.875rem 0.625rem;
        top: min(calc(var(--y) * 100%), calc(100% - 120px));
    }

    .sat-seat__teams { font-size: 1.0625rem; }
    .sat-seat__when,
    .sat-seat__line { font-size: 0.9375rem; }

    .sat-marker {
        --x: var(--lx);
        --y: var(--ly);
    }

    .sat-marker__dot {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* The floor in front of the hero, bottom left, is the one place a panel covers
       no stadium, marker or label, whichever seat is playing. */
    .sat-sim,
    .sat-sim[data-pos="top"] {
        left: 16px;
        right: auto;
        top: auto;
        bottom: 16px;
        width: min(340px, 30%);
        padding: 0.75rem 1rem 1rem;
        animation-name: sat-sim-up;
    }

    .sat-table__links {
        left: 1.5rem;
        bottom: 1.5rem;
    }

    .sat-row {
        grid-template-columns: 2rem minmax(0, 1fr) 11rem minmax(8rem, auto) 9rem;
        grid-template-areas: "num teams when line state";
        gap: 0 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .sat-row__num {
        align-self: center;
        margin-top: 0;
    }

    .sat-row__line {
        text-align: right;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sat-table__light,
    .sat-seat,
    .sat-marker,
    .sat-marker__dot {
        transition: none;
    }

    .sat-sim,
    .sat-sim[data-pos="top"] {
        animation: none;
    }
}

/* The lectures line under the about line: same quiet type, a link colour that reads in both themes. */
.landing-about--lectures {
    padding-top: 0;
}
.landing-about--lectures a {
    color: var(--accent-primary, var(--text-primary));
    text-decoration: underline;
    text-underline-offset: 3px;
}
.landing-about--lectures a:hover,
.landing-about--lectures a:focus-visible {
    color: var(--text-primary);
}
