/* ------------------------------------------------------------------
   Lineup Legends: one stylesheet for every page.

   Every page is built to fit the screen without scrolling: the page is
   exactly one screen tall (.app) and the pitches shrink or grow to use
   whatever height is left. Sizes inside a pitch use container units
   (cqw / cqh), so shirts and names scale with the pitch.
   ------------------------------------------------------------------ */

:root {
    --bg: #08130e;
    --bg-2: #0c1a14;
    --surface: #12241b;
    --surface-2: #193025;
    --line: rgba(255, 255, 255, 0.09);
    --text: #eef5f0;
    --muted: #93a99c;
    --brand: #c8f53c;
    --brand-ink: #0a1410;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --p0: #fbbf24;
    --p1: #22d3ee;
    --radius: 14px;
    --display: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
    --body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --gutter: clamp(10px, 2vw, 24px);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    background:
        radial-gradient(1200px 600px at 50% -200px, rgba(200, 245, 60, 0.08), transparent 70%),
        linear-gradient(var(--bg-2), var(--bg));
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

/* One screen tall, never more */
.app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 14px);
    padding: clamp(8px, 1.6vh, 18px) var(--gutter) clamp(8px, 1.6vh, 18px);
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    max-width: 1500px;
    margin: 0 auto;
}

.display {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 0.95;
}

.muted {
    color: var(--muted);
}

/* ---------- top bar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 0;
}

.brand img {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.brand .display {
    font-size: 26px;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.chip.brand-chip {
    background: var(--brand);
    color: var(--brand-ink);
    border-color: transparent;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--brand);
    color: var(--brand-ink);
    border-color: transparent;
}

.btn-primary:hover {
    background: #d5ff55;
    border-color: transparent;
}

.btn-ghost {
    background: transparent;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 14px;
}

.btn-lg {
    padding: 14px 22px;
    font-size: 17px;
}

.btn .label-short {
    display: none;
}

/* ---------- cards ---------- */

.card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* ---------- title page ---------- */

.home {
    justify-content: center;
    max-width: 760px;
}

.home-hero {
    text-align: center;
}

.home-logo {
    width: clamp(48px, 9vh, 92px);
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(200, 245, 60, 0.25));
}

.home-title {
    font-size: clamp(44px, 9vh, 92px);
    margin: clamp(2px, 0.8vh, 8px) 0 0;
}

.home-title span {
    color: var(--brand);
}

.home-tagline {
    color: var(--muted);
    font-size: clamp(14px, 2vh, 18px);
    margin: clamp(4px, 1vh, 10px) 0 0;
}

.daily-hero {
    position: relative;
    display: block;
    text-decoration: none;
    padding: clamp(14px, 2.6vh, 26px) clamp(16px, 3vw, 30px);
    border-radius: 18px;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 40px, transparent 40px 80px),
        linear-gradient(135deg, #1f4a2e, #14301f 60%, #10261a);
    border: 1px solid rgba(200, 245, 60, 0.35);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s;
}

.daily-hero:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
}

.daily-hero .kicker {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
}

.daily-hero .daily-title {
    font-size: clamp(36px, 7vh, 64px);
    margin: 4px 0 2px;
}

.daily-hero .daily-sub {
    color: var(--muted);
    font-size: 15px;
}

.daily-hero .daily-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: clamp(8px, 1.8vh, 16px);
    flex-wrap: wrap;
}

.countdown {
    font-variant-numeric: tabular-nums;
    color: var(--text);
    font-weight: 700;
}

.daily-played {
    display: none;
    color: var(--good);
    font-weight: 700;
}

.home-links {
    text-align: center;
    font-size: 14px;
}

.home-links a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 1.4vw, 14px);
}

.mode-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: clamp(10px, 2vh, 18px) 14px;
    text-decoration: none;
    text-align: left;
    transition: transform 0.15s, border-color 0.15s;
}

.mode-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(200, 245, 60, 0.5);
}

.mode-tile .icon {
    font-size: clamp(20px, 3.2vh, 28px);
}

.mode-tile .name {
    font-size: clamp(22px, 3.4vh, 30px);
}

.mode-tile .desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
}

.site-footer a {
    color: var(--muted);
}

/* ---------- game screens ---------- */

.match-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    flex-shrink: 0;
}

.fixture {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.5vw, 18px);
    font-size: clamp(22px, 4vh, 38px);
    max-width: 100%;
}

.fixture .team {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixture .team.home {
    text-align: right;
}

.scoreline {
    flex-shrink: 0;
    padding: 2px 12px 0;
    border-radius: 8px;
    background: var(--brand);
    color: var(--brand-ink);
}

.meta {
    color: var(--muted);
    font-size: 13px;
}

.guess-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.guess-form {
    display: flex;
    gap: 8px;
    width: min(560px, 100%);
}

.guess-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid var(--line);
    background: #f8fbf6;
    color: #0a1410;
    font-size: 17px;
    outline: none;
}

.guess-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(200, 245, 60, 0.2);
}

.result-line {
    min-height: 22px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.result-line.good { color: var(--good); }
.result-line.bad { color: var(--bad); }
.result-line.warn { color: var(--warn); }

.result-line.pop {
    animation: pop 0.35s ease;
}

@keyframes pop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* A compact bar that replaces the guess box once a game is over */
.done-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 700;
}

/* ---------- pitches ---------- */

.team-tabs {
    display: none;
    gap: 6px;
    flex-shrink: 0;
}

.team-tab {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.team-tab .tname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-tab.active {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--brand);
}

.kit-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--kit);
    border: 2px solid rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.pitches {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 32px);
    container-type: size;
}

.board {
    --head: 30px;
    height: 100%;
    width: min(calc(50cqw - 16px), calc((100cqh - var(--head)) * 0.88));
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.board-head {
    height: calc(var(--head) - 6px);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    min-width: 0;
}

.board-head .bname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-head .formation {
    white-space: nowrap;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

.board-head .count {
    margin-left: auto;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.board-head .count.full {
    color: var(--good);
}

.pitch {
    position: relative;
    flex: 1;
    min-height: 0;
    container-type: size;
    border-radius: 14px;
    background:
        repeating-linear-gradient(180deg, #1f8a46 0 10%, #1b7d3f 10% 20%);
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.25), 0 12px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.pitch .line {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.pitch .halfway {
    left: 0;
    right: 0;
    top: 50%;
    border-width: 2px 0 0 0;
}

.pitch .circle {
    width: 28cqw;
    height: 28cqw;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pitch .box-top,
.pitch .box-bottom {
    width: 50cqw;
    height: 13cqh;
    left: 50%;
    transform: translateX(-50%);
}

.pitch .box-top {
    top: -2px;
}

.pitch .box-bottom {
    bottom: -2px;
}

.pitch-body {
    position: absolute;
    inset: 2.5cqh 2cqw;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 1;
}

.row {
    display: flex;
    justify-content: center;
    gap: 4.6cqw;
}

.shirt {
    --s: min(14.5cqw, 16cqh);
    position: relative;
    width: var(--s);
    height: calc(var(--s) * 0.96);
    border-radius: calc(var(--s) * 0.1) calc(var(--s) * 0.1) calc(var(--s) * 0.15) calc(var(--s) * 0.15);
    background: var(--kit, #ccc);
    color: var(--kit-ink, #000);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 800;
    box-shadow: 0 calc(var(--s) * 0.06) calc(var(--s) * 0.14) rgba(0, 0, 0, 0.35);
}

.shirt::before,
.shirt::after {
    content: "";
    position: absolute;
    width: calc(var(--s) * 0.26);
    height: calc(var(--s) * 0.26);
    top: calc(var(--s) * 0.08);
    background: var(--kit, #ccc);
    border-radius: calc(var(--s) * 0.08);
}

.shirt::before {
    left: calc(var(--s) * -0.16);
    transform: rotate(25deg);
}

.shirt::after {
    right: calc(var(--s) * -0.16);
    transform: rotate(-25deg);
}

/* soft shading over the kit colour */
.shirt .shade {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(255,255,255,0.22), rgba(255,255,255,0) 45%, rgba(0,0,0,0.18));
    z-index: 1;
}

.shirt-neck {
    position: absolute;
    width: calc(var(--s) * 0.24);
    height: calc(var(--s) * 0.1);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 50% 50%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 2;
}

.shirt .q {
    position: relative;
    z-index: 2;
    font-size: calc(var(--s) * 0.36);
    opacity: 0.75;
}

.player-name {
    position: relative;
    z-index: 2;
    font-size: calc(var(--s) * 0.17);
    line-height: 1.05;
    letter-spacing: -0.02em;
    padding: 0 calc(var(--s) * 0.04);
    margin-top: calc(var(--s) * 0.08);
    overflow-wrap: anywhere;
    max-height: 2.2em;
    overflow: hidden;
}

.shirt.missed {
    opacity: 0.5;
    filter: grayscale(0.7);
}

.shirt.just-found {
    animation: flip 0.8s ease;
}

.shirt.just-found::selection {
    background: none;
}

@keyframes flip {
    0% { transform: rotateY(0deg) scale(1); }
    45% { transform: rotateY(90deg) scale(1.12); }
    100% { transform: rotateY(0deg) scale(1); }
}

.shirt.just-found .shade {
    animation: glint 1.2s ease 0.4s;
}

@keyframes glint {
    0% { box-shadow: 0 0 0 0 rgba(200, 245, 60, 0.9); }
    100% { box-shadow: 0 0 0 calc(var(--s) * 0.25) rgba(200, 245, 60, 0); }
}

.shirt.by-p0 { outline: calc(var(--s) * 0.04 + 1px) solid var(--p0); outline-offset: 2px; }
.shirt.by-p1 { outline: calc(var(--s) * 0.04 + 1px) solid var(--p1); outline-offset: 2px; }

/* ---------- head to head ---------- */

.duel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(8px, 2vw, 24px);
    width: min(820px, 100%);
    margin: 0 auto;
    flex-shrink: 0;
}

.player-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 2px solid transparent;
    opacity: 0.55;
    min-width: 0;
    transition: opacity 0.2s, border-color 0.2s;
}

.player-card.p1 {
    flex-direction: row-reverse;
    text-align: right;
}

.player-card.active {
    opacity: 1;
}

.player-card.p0.active { border-color: var(--p0); box-shadow: 0 0 24px rgba(251, 191, 36, 0.2); }
.player-card.p1.active { border-color: var(--p1); box-shadow: 0 0 24px rgba(34, 211, 238, 0.2); }

.player-card .pname {
    font-size: clamp(20px, 3vh, 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p0 .pname, .turn.p0 { color: var(--p0); }
.p1 .pname, .turn.p1 { color: var(--p1); }

.player-card .lives {
    font-size: 15px;
    letter-spacing: 2px;
    white-space: nowrap;
}

.player-card .score {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.clock {
    text-align: center;
}

.clock .turn {
    font-size: clamp(18px, 2.6vh, 24px);
    white-space: nowrap;
}

.timer {
    font-family: var(--display);
    font-size: clamp(30px, 5vh, 46px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer.low {
    color: var(--bad);
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    50% { opacity: 0.55; }
}

/* ---------- end-of-game card ---------- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 10, 7, 0.72);
    backdrop-filter: blur(4px);
    animation: fade 0.25s ease;
}

.overlay[hidden] {
    display: none;
}

@keyframes fade {
    from { opacity: 0; }
}

.end-card {
    position: relative;
    width: min(440px, 100%);
    max-height: 100%;
    overflow: auto;
    padding: clamp(18px, 3vh, 28px);
    text-align: center;
    border-color: rgba(200, 245, 60, 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: rise 0.35s cubic-bezier(.2,1.4,.4,1);
}

@keyframes rise {
    from { transform: translateY(24px) scale(0.96); opacity: 0; }
}

.end-card .kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand);
}

.end-card h2 {
    font-size: clamp(34px, 6vh, 48px);
    margin: 6px 0 4px;
}

.big-score {
    font-family: var(--display);
    font-size: clamp(64px, 13vh, 104px);
    line-height: 0.9;
    color: var(--brand);
}

.big-score small {
    font-size: 0.45em;
    color: var(--muted);
}

.end-card .sub {
    color: var(--muted);
    margin: 4px 0 12px;
}

.share-grid {
    margin: 10px auto 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: 1px;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: inherit;
}

.end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.close-x {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
}

.copy-status {
    min-height: 20px;
    margin-top: 8px;
    color: var(--good);
    font-size: 14px;
}

.duel-result {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 16px;
}

.duel-result > div {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.duel-result .pname {
    font-family: var(--display);
    font-size: 24px;
}

.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    overflow: hidden;
}

.confetti i {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    animation: fall linear forwards;
}

@keyframes fall {
    to { transform: translateY(110vh) rotate(720deg); }
}

/* ---------- simple pages (history, setup, about) ---------- */

.panel {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: clamp(14px, 2.4vh, 26px) clamp(14px, 3vw, 28px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.6vh, 16px);
    min-height: 0;
}

.panel.fill {
    flex: 1;
}

.panel h1 {
    font-size: clamp(34px, 6vh, 56px);
    margin: 0;
    text-align: center;
}

.panel .lead {
    text-align: center;
    color: var(--muted);
    margin: 0;
    line-height: 1.45;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-shrink: 0;
}

.stat {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}

.stat-value {
    font-family: var(--display);
    font-size: clamp(26px, 4.4vh, 38px);
    color: var(--brand);
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
}

.scroll-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-2) transparent;
}

.day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.day-info {
    min-width: 0;
}

.day-title {
    font-weight: 700;
}

.today-tag {
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.day-detail {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-score {
    font-family: var(--display);
    font-size: 26px;
    white-space: nowrap;
    margin-left: auto;
}

.day-score.full {
    color: var(--brand);
}

.names-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.names-row .vs {
    font-family: var(--display);
    font-size: 26px;
    color: var(--muted);
}

.names-row input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid var(--line);
    background: #f8fbf6;
    color: #0a1410;
    font-size: 17px;
    outline: none;
}

.names-row input:focus {
    border-color: var(--brand);
}

.names-row .p0-input { border-left: 6px solid var(--p0); }
.names-row .p1-input { border-left: 6px solid var(--p1); }

.rules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

.rules div {
    padding: 8px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.rules strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    margin-bottom: 2px;
}

.mode-pick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mode-pick .btn {
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
    white-space: normal;
}

.mode-pick .btn .display {
    font-size: 24px;
}

.mode-pick .btn small {
    font-weight: 500;
    font-size: 12px;
    opacity: 0.8;
}

.error {
    color: var(--bad);
    text-align: center;
    font-weight: 700;
}

.prose {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    line-height: 1.6;
    color: #d3e0d8;
    font-size: 15px;
}

.prose h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 26px;
    color: var(--text);
    margin: 14px 0 4px;
}

.prose p,
.prose ul {
    margin: 0 0 10px;
}

.center {
    text-align: center;
}

/* ---------- smaller screens ---------- */

@media (max-width: 760px) {

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .mode-tile {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 12px;
        align-items: center;
    }

    .mode-tile .icon {
        grid-row: span 2;
    }

    .btn .label-long {
        display: none;
    }

    .btn .label-short {
        display: inline;
    }
}

/* Phones: one pitch at a time, with tabs to switch team */
@media (max-width: 640px) {

    .brand .display {
        display: none;
    }

    .team-tabs {
        display: flex;
    }

    .board {
        width: min(100cqw, calc((100cqh - var(--head)) * 0.8));
    }

    .board:not(.active) {
        display: none;
    }

    .board-head {
        display: none;
    }

    .board {
        --head: 0px;
    }

    .duel {
        grid-template-columns: 1fr 1fr;
    }

    .duel .clock {
        grid-column: 1 / -1;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .player-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 6px 10px;
    }

    .player-card.p1 {
        flex-direction: column;
        align-items: flex-end;
    }

    .stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .stat-label {
        font-size: 11px;
    }

    .rules {
        grid-template-columns: 1fr;
    }

    .rules div {
        text-align: left;
    }

    .rules strong {
        display: inline;
        margin-right: 6px;
    }

    .names-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .names-row .vs {
        display: none;
    }

    .guess-input {
        font-size: 16px;
    }
}

/* Short screens (landscape phones, small laptops) */
@media (max-height: 560px) {

    .meta,
    .mode-tile .desc,
    .home-tagline {
        display: none;
    }

    .brand img {
        width: 28px;
        height: 28px;
    }

    .btn {
        padding: 7px 12px;
        font-size: 14px;
    }

    .guess-input {
        padding: 8px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* The main action on the end card gets its own row */
.end-actions .btn-lg {
    flex-basis: 100%;
}

/* Nothing in a page squashes except the parts built to (pitches, panels) */
.app > * {
    flex-shrink: 0;
}

.app > .pitches,
.app > .panel.fill {
    flex-shrink: 1;
}

.topbar .chip {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {

    /* Phones: use the full width for the one pitch on show */
    .board {
        width: 100cqw;
    }

    .fixture {
        font-size: 22px;
        align-items: center;
    }

    .fixture .team {
        white-space: normal;
        overflow: visible;
        line-height: 1;
    }

    .fixture .team.away {
        text-align: left;
    }

    /* Mode tiles become three small squares */
    .mode-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .mode-tile {
        display: flex;
        align-items: center;
        text-align: center;
        padding: 10px 6px;
    }

    .mode-tile .desc {
        display: none;
    }

    .mode-tile .name {
        font-size: 20px;
    }

    .daily-hero .daily-row .btn {
        flex: 1;
    }

    .site-footer {
        font-size: 11px;
    }
}

@media (max-width: 640px) and (max-height: 700px) {
    .home-tagline {
        display: none;
    }
}
