:root {
    /* "Midnight" scheme */
    --bg: #0b0f1c;
    --ink: #eef0f7;
    --text: var(--ink);
    --muted: #8d95ad;
    --brand: #ff7a59;
    --brand-soft: rgba(255,122,89,.45);
    --pulse: var(--brand-soft);
    --panel: rgba(255,255,255,.035);
    --panel-2: rgba(255,255,255,.06);
    --line: rgba(255,255,255,.08);
    --glow1: rgba(255,122,89,.16);
    --glow2: rgba(96,110,255,.18);
    --win: #2fbf71;
    --draw: #d9a93a;
    --loss: #e5534b;
    --accent: var(--brand);
    --display: 'Big Shoulders Display', sans-serif;
    --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    position: relative;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Figtree, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }

.shell, .page, .footer { position: relative; z-index: 1; }
.shell { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 16px; }
.topbar-line { height: 1px; background: var(--line); transform-origin: left; }
/* Logo: PS shield + "PERFECT SEASON" over a rule and "FOOTBALL CLUB". */
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-emblem { width: 34px; height: 40px; flex: none; transition: transform .25s var(--ease); }
.brand:hover .brand-emblem { transform: translateY(-2px) rotate(-3deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--display); font-weight: 900; font-size: 24px; letter-spacing: .8px; color: var(--text); }
.brand-text small { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: 3.2px; color: var(--brand); }
.brand-text small::before { content: ""; width: 18px; height: 2px; border-radius: 1px; background: var(--brand); }
.topbar nav { display: flex; gap: 20px; color: var(--muted); font-size: 14px; }
.topbar nav a { transition: color .2s; }
.topbar nav a:hover { color: var(--brand); }
.topbar nav > * { white-space: nowrap; }
@media (max-width: 600px) {
    .topbar { flex-wrap: wrap; row-gap: 10px; padding: 14px 0; }
    .topbar nav { gap: 16px; font-size: 13px; flex-wrap: wrap; row-gap: 6px; }
}

.page { max-width: 1100px; margin: 0 auto; padding: 16px 32px 48px; }
@media (max-width: 600px) { .page { padding: 16px 16px 48px; } }
.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 48px; padding: 28px 16px 40px; border-top: 1px solid var(--line); }

.back { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.back:hover { color: var(--brand); }

.hero { text-align: center; margin: 16px 0 28px; }
.hero h1 { font-family: var(--display); font-weight: 900; font-size: clamp(38px, 7vw, 64px); letter-spacing: .5px; margin: 0; line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { color: var(--muted); margin: 12px auto 0; max-width: 540px; font-size: 16px; text-wrap: pretty; }

.section-title { font-size: 13px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); margin: 36px 0 12px; }
.muted { color: var(--muted); }

/* ---------- cards ---------- */
.mode-card, .league-card, .club-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 18px;
    transition: transform .25s var(--ease), background .25s, box-shadow .25s, border-color .25s;
}
.mode-card:hover, .club-card:hover { transform: translateY(-3px); background: var(--panel-2); box-shadow: 0 14px 34px -14px var(--accent); }
.mode-card { margin-bottom: 12px; border-left: 3px solid var(--accent); }
.mode-europe { --accent: var(--brand); }
.mode-europe:hover { box-shadow: 0 14px 34px -14px var(--brand-soft); }
.mode-daily { --accent: #ffc56b; }
.mode-text { flex: 1; min-width: 0; }
.mode-arrow { color: var(--accent); font-size: 20px; transition: transform .25s var(--ease); }
.mode-card:hover .mode-arrow { transform: translateX(4px); }
.mode-card strong, .club-card strong { display: block; font-size: 16px; }
.mode-card small, .club-card small, .league-card small { color: var(--muted); font-size: 13px; }
.mode-badge {
    display: grid; place-items: center; width: 44px; height: 44px; flex: none;
    border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px;
}

.league-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.league-card {
    position: relative; overflow: hidden; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 22px 20px 20px; transition: transform .3s var(--ease), box-shadow .3s, background .3s;
}
.league-card:hover { transform: translateY(-6px); background: var(--panel-2); box-shadow: 0 18px 40px -16px var(--accent); }
.league-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); transform-origin: left; }
.league-card strong { font-size: 19px; }
.nowrap { white-space: nowrap; }
.league-flag { padding: 5px 10px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 1px; }

.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

.crest {
    display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
    background: var(--c); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px;
    text-shadow: 0 1px 2px rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.25);
}
.crest.sm { display: inline-grid; width: 30px; height: 30px; font-size: 9px; vertical-align: middle; }

/* ---------- home page motion ---------- */
/* Fixed to the viewport, painted behind the page content. */
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.glow { position: absolute; border-radius: 50%; }
.glow-1 { width: 55vw; height: 55vw; left: -15vw; top: -20vw; background: radial-gradient(circle, var(--glow1), transparent 65%); animation: drift1 18s ease-in-out infinite; }
.glow-2 { width: 60vw; height: 60vw; right: -20vw; bottom: -30vw; background: radial-gradient(circle, var(--glow2), transparent 65%); animation: drift2 22s ease-in-out infinite; }
.ring { position: absolute; left: 50%; top: 230px; width: 520px; height: 520px; border-radius: 50%; border: 1px dashed var(--line); transform: translate(-50%, -50%); animation: spin 90s linear infinite, fadeIn 2s ease both; }

.home .topbar { animation: fadeDown .7s var(--ease) both; }
.home .topbar-line { animation: lineGrow 1s .2s var(--ease) both; }
.home .footer { animation: fadeIn 1s 1.8s both; }
.hero-home { margin: 24px 0 28px; }
.hero-home h1 { font-size: clamp(48px, 7vw, 72px); }
.hero-home h1, .hero-anim h1 { display: flex; flex-wrap: wrap; justify-content: center; column-gap: .25em; overflow: hidden; padding-bottom: .05em; }
.word { display: inline-block; animation: wordUp .8s var(--d, 0s) cubic-bezier(.2,.9,.2,1) both; }
.shimmer {
    background: linear-gradient(100deg, var(--brand) 40%, #fff6ee 50%, var(--brand) 60%);
    background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shimmer 5s 1.4s ease-in-out infinite;
}
.anim-rise { animation: rise .8s var(--d, 0s) var(--ease) both; }
.anim-fade { animation: fadeIn .8s var(--d, 0s) both; }
.anim-rise .league-bar { animation: barGrow .7s calc(var(--d, 0s) + .3s) var(--ease) both; }
.pulse { animation: pulse 2.4s 1.6s ease-out infinite; }
.mode-card:not(.mode-europe) .pulse { --pulse: color-mix(in srgb, var(--accent) 45%, transparent); }

@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wordUp { from { opacity: 0; transform: translateY(60%) skewY(6deg); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0%, 55% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.15); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-7vw, -5vh) scale(.95); } }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--pulse); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lineGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .shimmer { color: var(--brand); background: none; }
}

/* ---------- game ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
#setup { max-width: 620px; margin: 0 auto; }
.rules { padding-left: 20px; margin: 0 0 12px; }
.rules li { margin-bottom: 10px; color: var(--muted); }
.rules strong { color: var(--text); }
.label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 600; }
.chip { transition: transform .2s var(--ease), border-color .2s, background .2s; }
.chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-primary, .btn-secondary { border-radius: 12px; padding: 12px 18px; font-weight: 700; border: 1px solid var(--line); }
.btn-primary { background: var(--brand); color: #1c0d07; border-color: var(--brand); width: 100%; margin-top: 22px; font-size: 16px; }
.btn-primary, .btn-secondary { transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px var(--brand-soft); }
.btn-secondary:not(:disabled):hover { transform: translateY(-2px); background: rgba(255,255,255,.1); }
.btn-secondary { background: var(--panel-2); }
.btn-secondary:disabled { opacity: .45; }

.draft { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .draft { grid-template-columns: 1fr; } }
.draft .label:first-child { margin-top: 0; }

.pitch {
    display: flex; flex-direction: column; gap: 10px; padding: 14px 8px; border-radius: 12px;
    background: repeating-linear-gradient(0deg, #14532d 0 40px, #166534 40px 80px);
    border: 2px solid rgba(255,255,255,.2);
}
.pitch-row { display: flex; justify-content: center; gap: 6px; }
.slot {
    flex: 1 1 0; max-width: 92px; min-width: 0; text-align: center; padding: 6px 4px; border-radius: 10px;
    background: rgba(0,0,0,.3); border: 1px dashed rgba(255,255,255,.35); font-size: 12px;
}
.slot b { display: block; font-size: 12px; color: var(--muted); }
/* Names: given names small on one line, the surname bold underneath — so the part
   that identifies a player always shows, even on narrow cards. */
.slot span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.filled { container-type: inline-size; }
.slot .nm { display: block; white-space: normal; line-height: 1.15; font-weight: 700; }
/* A long surname shrinks a little towards fitting on one line (about 0.55em per bold character), but never
   below 9px; past that it breaks at a syllable (soft hyphens from core.js). */
.slot .nm em { display: block; font-style: normal; overflow-wrap: break-word; font-size: max(9px, min(1em, calc(100cqi / (var(--len) * 0.55)))); hyphens: manual; }
.slot .nm i { display: block; font-style: normal; font-weight: 500; font-size: .85em; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.filled { background: rgba(11,15,28,.88); border: 1px solid var(--brand); }
.slot.filled b { color: var(--brand); font-size: 15px; }
.slot.filled span { font-weight: 600; }
.slot.filled .nm { font-weight: 700; }

.era-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.era-head .label { margin-top: 0; }
.era-title { font-family: var(--display); font-weight: 900; font-size: 24px; letter-spacing: .5px; }
.era-title em { font-style: normal; color: var(--brand); }

.player-list { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.player {
    display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
.player { transition: transform .2s var(--ease), border-color .2s, background .2s; }
.player:not(:disabled):hover { border-color: var(--brand); transform: translateX(3px); background: rgba(255,255,255,.08); }
.player:disabled { opacity: .4; }
.pos { flex: none; width: 38px; text-align: center; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 0; }
.pos-G { background: #b45309; } .pos-D { background: #1d4ed8; } .pos-M { background: #15803d; } .pos-F { background: #b91c1c; }
.pname { flex: 1; min-width: 0; font-weight: 600; }
.pname small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.stats { display: flex; gap: 6px; flex: none; text-align: right; }
.player .rating {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,122,89,.12); border: 1px solid var(--brand-soft); color: var(--brand);
    font-family: var(--display); font-weight: 900; font-size: 22px;
}
@media (max-width: 420px) { .player .rating { width: 36px; height: 36px; font-size: 18px; } }
.stats span { width: 50px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.stats em { display: block; font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 1px; color: var(--muted); }
@media (max-width: 420px) { .stats { gap: 8px; } .stats span { width: 46px; font-size: 14px; } }
#final-pitch { margin-bottom: 8px; }
.credit { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

.season-head { text-align: center; }
.record { font-family: var(--display); font-weight: 900; font-size: clamp(48px, 12vw, 84px); line-height: 1; }
.verdict { text-align: center; font-weight: 700; font-size: 18px; margin: 12px 0; min-height: 1.4em; }
.verdict.perfect { color: var(--brand); font-size: 28px; font-family: var(--display); font-weight: 900; letter-spacing: .5px; }
.verdict.good { color: var(--win); }
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 16px 0; }
.fixture { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; border-left: 4px solid; animation: pop .2s ease-out; }
.fixture .gw { color: var(--muted); width: 20px; }
.fixture .teams { flex: 1; }
.fixture .badge { font-weight: 700; }
.res-W { border-color: var(--win); } .res-W .badge { color: var(--win); }
.res-D { border-color: var(--draw); } .res-D .badge { color: var(--draw); }
.res-L { border-color: var(--loss); } .res-L .badge { color: var(--loss); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
.actions { display: flex; gap: 10px; }
.actions .btn-primary { margin-top: 0; }
.actions > * { flex: 1; }

/* ---------- draft motion ---------- */
.era-in { animation: slideIn .45s var(--ease) both; }
.row-in { animation: rowIn .4s calc(min(var(--i, 0), 14) * 30ms) var(--ease) both; }
.slot.pop { animation: slotPop .5s cubic-bezier(.3,1.6,.5,1) both; box-shadow: 0 0 0 3px var(--brand-soft); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes slotPop { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: none; } }

/* ---------- season stats ---------- */
.awards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 4px; }
.awards:empty { display: none; }
@media (max-width: 600px) { .awards { grid-template-columns: 1fr; } }
.award { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; animation: rise .5s var(--ease) both; }
.award:nth-child(2) { animation-delay: .08s; } .award:nth-child(3) { animation-delay: .16s; }
.award:first-child { border-color: var(--brand); box-shadow: 0 10px 28px -16px var(--brand-soft); }
.award em { display: block; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.award strong { display: block; font-size: 17px; margin-top: 4px; }
.award span { color: var(--brand); font-weight: 700; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.season-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.season-table th { text-align: right; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.season-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); font-weight: 700; font-variant-numeric: tabular-nums; }
.season-table th:first-child, .season-table td:first-child { text-align: left; }
.season-table td:first-child { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.season-table td.rtg { color: var(--brand); }
.season-table tbody tr:hover { background: var(--panel-2); }
.match-rating { display: inline-block; min-width: 36px; padding: 2px 6px; border-radius: 6px; text-align: center; color: #0b0f1c; font-weight: 800; }
.mr-elite { background: #3b82f6; color: #fff; }
.mr-good { background: #2fbf71; }
.mr-ok { background: #f5b942; }
.mr-poor { background: #e5534b; color: #fff; }

/* ---------- logos ---------- */
/* Crests sit on a light tile so dark logos (Juventus, Bundesliga) stay visible on the dark theme. */
.crest-img { flex: none; width: 42px; height: 42px; object-fit: contain; padding: 4px; border-radius: 10px; background: #f4f5f9; }
.crest-img.sm { width: 30px; height: 30px; padding: 3px; border-radius: 8px; vertical-align: middle; }
.crest-img.xs, .crest.xs { width: 20px; height: 20px; padding: 2px; border-radius: 5px; flex: none; }
.crest.xs { font-size: 6px; border-width: 1px; border-radius: 50%; padding: 0; }
.league-logo { height: 46px; width: auto; max-width: 140px; object-fit: contain; padding: 6px 10px; border-radius: 10px; background: #f4f5f9; }
.logo-badge { background: #f4f5f9; padding: 5px; }
.logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.credit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.credit-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; background: var(--panel-2); }
.credit-row strong { display: block; }
.credit-row small { color: var(--muted); font-size: 12px; word-break: break-word; }
.credits a { color: var(--brand); }
.credits .section-title:first-child { margin-top: 0; }
.footer a { color: var(--muted); text-decoration: underline; }
/* Generated badges are drawn with their own border, so they skip the light tile. */
.crest-img[src^="/badge/"] { background: none; padding: 0; border-radius: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.eras-note { font-size: 13px; margin: 8px 0 0; }

/* ---------- 1 vs 1 ---------- */
.mode-versus { --accent: #8b5cf6; }
.mode-versus .mode-badge { font-size: 13px; }
.vs-names { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.vs-names label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); flex: 1 1 200px; }
.vs-names input { font: inherit; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.vs-names input:focus { outline: none; border-color: var(--brand); }
/* Pick list on top with the two pitches side by side; three columns only when there's room. */
.vs-draft { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.vs-pick { grid-column: 1 / -1; order: -1; }
@media (min-width: 1280px) {
    .vs-draft { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); }
    .vs-pick { grid-column: auto; order: 0; }
}
@media (max-width: 640px) { .vs-draft { grid-template-columns: 1fr; } }
.vs-team { border-top: 3px solid var(--side); transition: box-shadow .3s, border-color .3s; }
.vs-team.active { box-shadow: 0 0 0 1px var(--side), 0 16px 36px -18px var(--side); }
.vs-team-head { display: flex; flex-direction: column; margin-bottom: 10px; }
.vs-team-head strong { font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: .5px; }
.vs-team .pitch { padding: 10px 3px; gap: 6px; }
.vs-team .pitch-row { gap: 4px; }
.vs-team .slot { padding: 4px 3px; font-size: 11px; }
.vs-turn { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; border-left: 4px solid var(--side); background: var(--panel-2); }
.vs-turn span { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.vs-turn strong { font-size: 18px; color: var(--side); }
.vs-turn small { color: var(--muted); }
.player.owned-0 { border-left: 3px solid var(--brand); }
.player.owned-1 { border-left: 3px solid #3b82f6; }
.vs-scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; }
.vs-side { display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--side); padding-top: 8px; }
.vs-side strong { font-family: var(--display); font-weight: 900; font-size: clamp(20px, 4vw, 30px); }
.vs-score .record { font-size: clamp(56px, 12vw, 96px); }
.vs-pens { margin: 10px auto 0; max-width: 420px; }
.vs-pens .label { text-align: center; margin: 0 0 8px; }
.vs-pen-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.vs-pen-row strong { flex: 1; color: var(--side); font-size: 14px; }
.pen { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; animation: slotPop .35s both; }
.pen.in { background: var(--win); color: #06140c; }
.pen.out { background: var(--loss); color: #fff; }
.vs-events { display: flex; flex-direction: column; gap: 6px; max-width: 520px; margin: 8px auto 16px; }
.vs-event { display: flex; gap: 10px; align-items: baseline; padding: 6px 12px; border-radius: 8px; background: var(--panel-2); border-left: 3px solid var(--side); animation: rowIn .35s var(--ease) both; }
.vs-event.side-1 { flex-direction: row-reverse; text-align: right; border-left: 0; border-right: 3px solid var(--side); }
.vs-event b { color: var(--muted); font-variant-numeric: tabular-nums; }
.vs-event small { color: var(--muted); }
.vs-lineups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 12px 0 16px; }
#motm .award { max-width: 360px; margin: 0 auto; text-align: center; }
#motm { grid-template-columns: 1fr; }
.vs-online { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line); }
.vs-online p { margin: 0 0 10px; font-size: 13px; }
.vs-join { display: flex; gap: 8px; }
.vs-join input { width: 130px; font: inherit; font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: 4px; text-transform: uppercase;
    color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.vs-join input:focus { outline: none; border-color: var(--brand); }
.vs-error { color: var(--loss); font-size: 13px; min-height: 1em; margin: 8px 0 0 !important; }
.vs-lobby { max-width: 560px; margin: 0 auto; text-align: center; }
.vs-code { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 14vw, 88px); letter-spacing: 10px; color: var(--brand); line-height: 1.1; }
.vs-link { font-size: 13px; word-break: break-all; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.vs-waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.vs-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: pulse 1.6s ease-out infinite; }
.vs-net-banner { position: sticky; top: 8px; z-index: 5; margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: #3a2412; border: 1px solid var(--draw); color: #ffd9a8; text-align: center; font-weight: 600; }
.vs-viz { margin: 14px 0 6px; }
.pitch-viz { display: block; width: 100%; border-radius: 12px; border: 2px solid rgba(255,255,255,.15); box-shadow: 0 18px 40px -22px rgba(0,0,0,.8); }
.vs-speed { justify-content: center; margin-top: 10px; }
.vs-speed .chip { padding: 5px 12px; font-size: 13px; }

/* ---------- watch a fixture ---------- */
.fixture .fx-watch { flex: none; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border-radius: 50%;
    border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 10px; transition: background .2s, color .2s, transform .2s; }
.fixture .fx-watch:hover { background: var(--brand); color: #1c0d07; transform: scale(1.1); }
.watch { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5,8,16,.72); backdrop-filter: blur(3px); animation: fadeIn .2s both; }
.watch-box { width: min(960px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; animation: rise .3s var(--ease) both; }
.watch-head { display: flex; align-items: center; justify-content: space-between; }
.watch-head .label { margin: 0; }
.watch-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); font-size: 20px; line-height: 1; }
.watch-close:hover { border-color: var(--brand); color: var(--brand); }
.watch-scoreboard { margin: 6px 0 12px; }
.watch-scoreboard .record { font-size: clamp(44px, 9vw, 72px); }
body.modal-open { overflow: hidden; }

/* share sheet: the result image with Share / Save / Copy */
.share-modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgba(5,8,16,.78); backdrop-filter: blur(3px); animation: fadeIn .2s both; }
.share-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(460px, 100%); max-height: calc(100vh - 32px); animation: rise .3s var(--ease) both; }
.share-img { display: block; width: auto; max-width: 100%; max-height: calc(100vh - 150px); aspect-ratio: 1080 / 1350; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.share-close { position: absolute; top: -8px; right: -8px; z-index: 1; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.share-note { margin: 0; font-size: 14px; }
.share-note:empty { display: none; }


/* ---------- accounts ---------- */
.auth { max-width: 420px; margin: 0 auto; }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.field input { font: inherit; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field input:focus { outline: none; border-color: var(--brand); }
.field small { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field-error { color: #f87171; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.field-error:empty { display: none; }
.auth-errors { color: #f87171; font-size: 14px; }
.auth-errors ul { margin: 0; padding-left: 18px; }
.auth-errors.validation-summary-valid { display: none; }
.auth .btn-primary { margin-top: 6px; }
.auth-alt { text-align: center; margin: 18px 0 0; }
.auth-alt a, .vs-account a { color: var(--brand); }
.nav-account { display: inline-flex; align-items: center; gap: 10px; }
.nav-account form { display: inline; margin: 0; }
.nav-account button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; opacity: .8; }
.nav-account button:hover { opacity: 1; }
.nav-user { color: var(--brand); font-weight: 700; }
.vs-account { margin: 0 0 12px; }
.vs-verified { color: #4ade80; font-size: .85em; }
.vs-names input[readonly] { opacity: .75; cursor: default; }

/* ---------- online record ---------- */
.record-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.record-tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; animation: rise .5s var(--ease) both; }
.record-tile em { display: block; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.record-tile strong { display: block; font-family: var(--display); font-weight: 900; font-size: 32px; line-height: 1.1; margin-top: 4px; }
.record-tile strong small { font-size: .6em; color: var(--muted); }
.record-tile.win strong { color: var(--win); }
.record-tile.loss strong { color: var(--loss); }
@media (max-width: 600px) { .record-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .record-tile:first-child { grid-column: span 2; } }
.record-table td, .record-table th { vertical-align: middle; text-align: left; }
.record-table td:first-child { display: table-cell; font-weight: 500; white-space: nowrap; }
.record-table th:last-child, .record-table td:last-child { text-align: right; width: 1%; }
.result-chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 800; font-size: 12px; color: #0b0f1c; }
.result-chip.w { background: var(--win); }
.result-chip.l { background: var(--loss); }
.vs-record { color: var(--text); font-weight: 600; }
a.link { color: var(--brand); }
a.nav-user:hover { text-decoration: underline; }

/* ---------- leaderboard ---------- */
.board td:first-child { display: table-cell; width: 1%; }
.board .board-name { text-align: left; font-weight: 600; }
.board th:nth-child(2) { text-align: left; }
.board td.w { color: var(--win); }
.board td.l { color: var(--loss); }
.board tr.me { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.board tr.me .board-name { color: var(--brand); }
.board-rank { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--panel-2); font-weight: 800; font-size: 13px; }
.board-rank.medal-1 { background: #e3b341; color: #1c1405; }
.board-rank.medal-2 { background: #c0c7d6; color: #13161d; }
.board-rank.medal-3 { background: #c7824a; color: #1c0f05; }
.board-gap td { text-align: center !important; color: var(--muted); padding: 2px; }
.board-foot { margin: 14px 0 0; font-size: 13px; }
.board-empty { margin: 0; text-align: center; }
@media (max-width: 480px) { .board th, .board td { padding: 7px 5px; } .board th:nth-child(7), .board td:nth-child(7) { display: none; } }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.board-head .section-title { margin: 0; }
.board-days { display: flex; gap: 16px; font-size: 14px; }
.board-sub { margin: 6px 0 14px; font-size: 14px; }
#versus { margin-top: 18px; }
.board-daily td:nth-child(3) { font-variant-numeric: tabular-nums; }

/* ---------- quick match ---------- */
.vs-quick { display: flex; align-items: center; gap: 16px; padding: 12px 14px; margin: 0 0 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 10%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.vs-quick > div { flex: 1; min-width: 0; }
.vs-quick strong { display: block; font-size: 15px; }
.vs-online .vs-quick p { margin: 2px 0 0; }
.vs-quick .btn-primary { width: auto; margin: 0; flex: none; }
@media (max-width: 520px) { .vs-quick { flex-direction: column; align-items: stretch; } }
.vs-or { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.vs-or::before, .vs-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vs-search { padding-top: 26px; }
.vs-search-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.vs-search #search-lonely { margin: 12px 0 0; }
.vs-search .actions { justify-content: center; }
.vs-radar { position: relative; width: 84px; height: 84px; margin: 0 auto 10px; }
.vs-radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; animation: radar 2.4s ease-out infinite; }
.vs-radar span:nth-child(2) { animation-delay: .8s; }
.vs-radar span:nth-child(3) { animation-delay: 1.6s; }
.vs-radar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 18px var(--brand-soft); }
@keyframes radar { from { transform: scale(.15); opacity: .9; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vs-radar span { animation: none; opacity: .35; } .vs-radar span:nth-child(2) { transform: scale(.66); } .vs-radar span:nth-child(3) { transform: scale(.33); } }

/* ---------- account data / privacy / errors ---------- */
.your-data { margin-top: 16px; }
.your-data .section-title { margin-top: 0; }
.your-data p { margin: 0 0 14px; }
.your-data .actions { flex-wrap: wrap; }
a.btn-secondary { display: inline-block; text-align: center; }
.btn-secondary.danger { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, transparent); }
.btn-secondary.danger:hover { background: color-mix(in srgb, var(--loss) 14%, transparent); }
.btn-danger { border-radius: 12px; padding: 12px 18px; font-weight: 700; width: 100%; margin-top: 6px; font-size: 16px; background: var(--loss); color: #fff; border: 1px solid var(--loss); }
.btn-danger:hover { filter: brightness(1.08); }
.delete-list { margin: 0 0 14px; padding-left: 20px; font-size: 14px; }
.delete-list li + li { margin-top: 6px; }
.center { text-align: center; }
.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { font-size: 18px; margin: 28px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose a { color: var(--brand); }
.error-code { font-family: var(--display); font-weight: 900; font-size: clamp(80px, 18vw, 160px); line-height: 1; color: var(--brand); opacity: .9; }
.error-ref { font-size: 12px; margin-top: 18px; }

/* ---------- penalty takers ---------- */
.vs-order .section-title { margin-top: 0; }
.vs-order > p { margin: 0 0 14px; font-size: 14px; }
.po-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.po-list .label { color: var(--side); margin-top: 0; }
.pen-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.po-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid transparent; }
.po-item.po-first { border-color: color-mix(in srgb, var(--side) 35%, transparent); }
.po-item .pname { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.po-item .pname small { color: var(--muted); font-weight: 500; font-size: 12px; }
.po-item .rtg { color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.po-num { width: 22px; text-align: center; font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--side); }
.po-move { display: flex; gap: 4px; }
.po-move button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; }
.po-move button:hover:not(:disabled) { border-color: var(--side); color: var(--side); }
.po-move button:disabled { opacity: .3; }
.po-cut { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.po-cut::before, .po-cut::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vs-order .actions { margin-top: 16px; }
.vs-order-status:empty, .vs-order-timer:empty { display: none; }
.vs-order-status { margin: 14px 0 0; }
.vs-order-timer { margin: 10px 0 0; font-size: 12px; text-align: center; }
.vs-order-score { font-family: var(--display); font-weight: 900; font-size: clamp(22px, 5vw, 30px); margin: 0 0 6px; }

/* ---------- online pick clock ---------- */
.pick-clock { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pick-clock b { flex: none; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); min-width: 118px; }
.pick-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.pick-bar i { display: block; height: 100%; background: var(--side); border-radius: 3px; transition: width .25s linear; }
.pick-clock.urgent b { color: var(--loss); }
.pick-clock.urgent .pick-bar i { background: var(--loss); animation: pickPulse 1s ease-in-out infinite; }
@keyframes pickPulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pick-clock.urgent .pick-bar i { animation: none; } .pick-bar i { transition: none; } }

/* ---------- online match settings (league, then eras) ---------- */
.vs-settings .section-title { margin-top: 0; }
.vs-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.vs-step { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--side); opacity: .7; }
.vs-step.now { opacity: 1; box-shadow: 0 0 0 1px var(--side); }
.vs-step em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.vs-step strong { font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1.1; }
.vs-step span { font-size: 13px; color: var(--side); font-weight: 600; }
#settings-choose .chips small { opacity: .6; font-size: 11px; margin-left: 2px; }
#settings-choose .btn-primary { margin-top: 14px; }
.vs-settings-status:empty { display: none; }
.vs-vetoes .chip:disabled { cursor: default; transform: none; opacity: .75; }
.vs-vetoes .chip.veto-pick { background: var(--loss); border-color: var(--loss); text-decoration: line-through; }
.vs-vetoes .chip.vetoed { opacity: .45; text-decoration: line-through; border-color: var(--side); color: var(--muted); }
.vs-veto-note { color: var(--draw); }
.vs-settings-status { margin: 12px 0 0; }
#settings-clock { margin-top: 14px; }
@media (max-width: 480px) { .vs-step strong { font-size: 18px; } }

/* ---------- one-off account notices ---------- */
.site-notice { max-width: 720px; margin: 0 auto 18px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); font-size: 14px; animation: rise .5s var(--ease) both; }
.email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.email-row strong { font-size: 15px; }
.email-ok { color: var(--win); font-weight: 700; font-size: 13px; }
.email-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.email-form .field { margin: 0; }
.email-form .btn-secondary { height: 42px; }
@media (max-width: 640px) { .email-form { grid-template-columns: 1fr; } }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
.link-button:hover { color: var(--loss); }
.auth-forgot { margin: -6px 0 0; text-align: right; font-size: 13px; }
.auth-forgot a { color: var(--muted); }
.auth-forgot a:hover { color: var(--brand); }

/* ---------- online: create or join a game with a friend ---------- */
.vs-friend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs-friend-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.vs-friend-card strong { font-size: 15px; }
.vs-online .vs-friend-card p { margin: 0; flex: 1; }
.vs-friend-card .btn-primary { width: 100%; margin: 0; }
.vs-friend-card .vs-join { margin: 0; }
.vs-friend-card .vs-join input { flex: 1; min-width: 0; width: auto; }
@media (max-width: 560px) { .vs-friend { grid-template-columns: 1fr; } }

/* ---------- owner's stats page ---------- */
.admin-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .admin-tiles { grid-template-columns: 1fr 1fr 1fr; } .admin-tiles .record-tile:first-child { grid-column: auto; } }
.admin-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 8px; border-radius: 10px; background: var(--panel-2); }
.admin-day { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.admin-day .bar { flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.bar.seasons, .key.seasons { background: var(--brand); }
.bar.online, .key.online { background: #3b82f6; }
.admin-legend { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 12px; }
.admin-legend .key { width: 10px; height: 10px; border-radius: 2px; margin-left: 6px; }
.admin-table td:first-child { display: table-cell; text-align: left; font-weight: 500; }

/* ---------- daily challenge ---------- */
.daily-rank { margin: -4px auto 18px; line-height: 2; max-width: 640px; text-align: center; color: var(--muted); font-size: 15px; }
.daily-rank .board-rank { min-width: 38px; height: 32px; margin-right: 4px; font-size: 16px; vertical-align: middle; }
/* A guest's finished daily: where it would rank, and the button to claim it */
.claim-card { margin: 4px auto 0; padding: 18px 20px; border-radius: 16px; background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
    box-shadow: 0 18px 40px -24px var(--brand-soft); line-height: 1.5; }
.claim-head { display: block; color: var(--text); font-size: 20px; line-height: 1.6; }
.claim-card p { margin: 6px 0 0; }
.claim-card .claim-btn { display: inline-block; width: auto; min-width: 220px; margin-top: 14px; text-decoration: none; }
.claim-card .claim-alt { font-size: 13px; }
.board tr.ghost { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, transparent) 0 10px, color-mix(in srgb, var(--brand) 8%, transparent) 10px 20px); }
.board tr.ghost .board-rank { background: transparent; border: 1.5px dashed var(--brand); color: var(--brand); }
.board tr.ghost .board-name { color: var(--brand); }
.claim-chip { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--brand); color: #1c0d07; font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.claim-chip:hover { filter: brightness(1.1); }
.daily-played { margin: 4px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }

/* ---------- chemistry and captain ---------- */
.slot.filled { position: relative; }
button.slot { font: inherit; color: inherit; cursor: pointer; }
button.slot:hover { border-color: #ffc56b; }
.slot .chem { display: flex; justify-content: center; gap: 3px; margin-top: 3px; }
.slot .chem i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.18); }
.slot .chem.c1 i:nth-child(-n+1), .slot .chem.c2 i:nth-child(-n+2), .slot .chem.c3 i { background: var(--win); }
.slot.captain { border-color: #ffc56b; box-shadow: 0 0 0 1px #ffc56b inset; }
.slot .armband {
    position: absolute; top: -7px; right: -5px; display: grid; place-items: center; width: 18px; height: 18px;
    border-radius: 50%; background: #ffc56b; color: #1c1405; font-size: 10px; font-weight: 900; line-height: 1;
}
.team-rating { margin: 12px 0 4px; font-size: 14px; }
.team-rating strong { font-family: var(--display); font-size: 20px; }
.chem-hint { margin: 0; font-size: 12px; }
.player .links { flex: none; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--win); background: color-mix(in srgb, var(--win) 14%, transparent); }
.captain-panel .btn-primary { margin-top: 14px; width: 100%; }
.captain-panel .player.chosen { border-color: #ffc56b; background: color-mix(in srgb, #ffc56b 12%, transparent); }
.captain-panel .cap-rating { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; color: #ffc56b; }
.armband-inline { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 5px; border-radius: 50%; background: #ffc56b; color: #1c1405; font-size: 9px; font-weight: 900; vertical-align: 1px; }

/* Flag emoji. Windows has none, so flags come from a small flags-only font (Twemoji Country Flags,
   CC BY 4.0), used only for flag characters; other systems fall back to their own emoji. */
@font-face {
    font-family: "Twemoji Country Flags";
    src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.10/dist/TwemojiCountryFlags.woff2") format("woff2");
    unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
    font-display: swap;
}
.flag { font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-style: normal; }
/* The player's country, in the top-left corner of a pitch card. */
.slot .card-flag { position: absolute; top: 4px; left: 5px; font-size: 12px; line-height: 1; }
.vs-team .slot .card-flag { top: 3px; left: 3px; font-size: 10px; }

/* 1v1: players online now, next to the Online chip and on the search screen */
.online-count { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.18); font-size: 12px; font-weight: 700; color: var(--win); }
.online-count::before, .online-dot { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--win); box-shadow: 0 0 0 0 rgba(47,191,113,.6); animation: onlinePulse 2s ease-out infinite; }
.chip.active .online-count { color: #fff; border-left-color: rgba(255,255,255,.4); }
.chip.active .online-count::before { background: #fff; }
.vs-search-count { margin: 4px 0 0; color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.vs-search-count[hidden] { display: none; }
@keyframes onlinePulse { 0% { box-shadow: 0 0 0 0 rgba(47,191,113,.6); } 70% { box-shadow: 0 0 0 7px rgba(47,191,113,0); } 100% { box-shadow: 0 0 0 0 rgba(47,191,113,0); } }

/* ---------- daily: streaks, yesterday, history, "not played yet" ---------- */
.nav-new { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--brand); vertical-align: 2px; box-shadow: 0 0 0 0 var(--brand-soft); animation: pulse 1.8s ease-out infinite; }
.daily-next { display: block; margin-top: 3px; font-weight: 600; }
.daily-next.is-new { color: var(--brand) !important; }
.daily-streak { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, #ffc56b 10%, transparent); border: 1px solid color-mix(in srgb, #ffc56b 30%, transparent); font-size: 14px; }
.daily-streak[hidden] { display: none; }
#season .daily-streak { max-width: 640px; margin: -6px auto 18px; text-align: center; }
.daily-yesterday { margin-top: 18px; }
.yday-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.yday-head .section-title { margin: 0; }
.yday-top { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 6px; }
.yday-top li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); }
.yday-top li strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.dh-tiles .record-tile:first-child { grid-column: auto; }
.dh-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 36px)); gap: 6px; margin: 10px 0; }
.dh-calendar b { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; }
.dh-day { display: inline-block; aspect-ratio: 1; min-width: 14px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); }
.dh-calendar .dh-day { width: 100%; }
.dh-day.win { background: var(--win); border-color: var(--win); }
.dh-day.mid { background: var(--draw); border-color: var(--draw); }
.dh-day.low { background: var(--loss); border-color: var(--loss); }
.dh-day.played { background: var(--brand); border-color: var(--brand); }
.dh-day.out { opacity: .25; }
.dh-day.today { outline: 2px solid #fff; outline-offset: 1px; }
.dh-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.dh-legend .dh-day { width: 14px; height: 14px; }
.dh-note { margin: 14px 0 0; font-size: 14px; }

/* Club pages: who's in the draw, decade by decade (also what search engines read) */
.pool-legends { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.pool-legends .label { margin: 0 0 6px; }
.pool-legends > p { margin: 0 0 10px; font-size: 14px; }
.pool-legends dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.pool-legends dt { font-family: var(--display); font-weight: 900; color: var(--accent); }
.pool-legends dd { margin: 0; color: var(--text); }
.pool-names { font-size: 14px; line-height: 1.7; color: var(--text); }
