:root {
  --bg: #0B0C0E;
  --surface: #16181C;
  --surface-2: #1E2127;
  --surface-3: #2A2D33;
  --line: rgba(255,255,255,.07);
  --text: #F4F2EE;
  --text-2: #C4C7CD;
  --text-3: #9A9FA8;
  --text-4: #868B94;
  --live: #C8F04A;
  --gold: #F2C14E;
  --danger: #FF6B5E;
  /* Kit theme — overwritten from the selected kit */
  --shirt: #DB0007;
  --shorts: #FFFFFF;
  --trim: #FFFFFF;
  --ink: #FFFFFF;
  --ui: #E8202A;
  --ink-soft: color-mix(in srgb, var(--ink) 82%, transparent);
  --f-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-serif: 'Newsreader', Georgia, serif;
  --f-sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #050506; color: var(--text); font-family: var(--f-sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- Stage: phone on desktop, full-bleed on phones ---------- */
.stage { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 48px; padding: 32px 24px;
  background: radial-gradient(1200px 600px at 30% 0%, color-mix(in srgb, var(--shirt) 18%, transparent), transparent 60%), #050506; }
.device { padding: 12px; border-radius: 64px; background: linear-gradient(145deg, #2a2c31, #111215); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 40px 120px rgba(0,0,0,.7); flex: none; }
.phone { position: relative; width: 390px; height: 844px; border-radius: 52px; overflow: hidden; background: var(--bg); transition: background .3s; isolation: isolate; }
.phone::before { content: ''; position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 122px; height: 35px; border-radius: 20px; background: #000; z-index: 30; pointer-events: none; }
.screen { position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--shirt) 55%, var(--bg)) 0, color-mix(in srgb, var(--shirt) 22%, var(--bg)) 240px, var(--bg) 460px) local, var(--bg); transition: background-color .3s; overflow-y: auto; overflow-x: hidden; padding-bottom: 104px; scrollbar-width: none; outline: none; }
.screen::-webkit-scrollbar { display: none; }

@media (max-width: 520px) {
  .stage { padding: 0; display: block; background: var(--bg); }
  .device { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .phone { width: 100vw; height: 100dvh; border-radius: 0; }
  .phone::before { display: none; }
  .devpanel { display: none !important; }
}

/* ---------- Type helpers ---------- */
.cond { font-family: var(--f-cond); }
.serif { font-family: var(--f-serif); }
.label { font-family: var(--f-cond); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.meta { font-size: 13px; color: var(--text-3); }
.meta b { color: var(--text); font-weight: 600; }
.halftone { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.22) 1.1px, transparent 1.6px); background-size: 7px 7px; pointer-events: none; }
.trimband { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--trim); }
.card { background: var(--surface); border-radius: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 34px rgba(0,0,0,.38); }
.stack { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; padding: 28px 20px 12px; }
.section-h h2, .section-h h3 { margin: 0; }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Header ---------- */
.apphead { padding: 62px 20px 14px; display: flex; align-items: center; justify-content: space-between; }
.apphead .club { display: flex; align-items: center; gap: 10px; }
.apphead .club img { width: 34px; height: 34px; object-fit: contain; }
.apphead .club .slogan { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); line-height: 1; margin-bottom: 4px; white-space: nowrap; }
.apphead .club .name { font-family: var(--f-cond); font-weight: 800; font-size: 30px; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: color-mix(in srgb, var(--surface-2) 80%, transparent); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--text); }
.iconbtn:hover { background: var(--surface-3); }
.pagehead { padding: 62px 20px 0; display: flex; align-items: flex-end; justify-content: space-between; }
.pagehead h1 { margin: 0; font-family: var(--f-serif); font-weight: 600; font-size: 34px; line-height: 1; }

/* ---------- Tab bar ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 88px; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 8px 4px 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border-top: 2px solid color-mix(in srgb, var(--shirt) 60%, transparent); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-4); font-size: 11px; font-weight: 500; min-height: 44px; }
.tabbar a[aria-current="page"] { color: var(--text); font-weight: 600; }
.tabbar a[aria-current="page"] svg { color: var(--ui); }
.tabbar.hidden { display: none; }

/* ---------- Segmented control ---------- */
.seg { margin: 16px 16px 0; padding: 4px; border-radius: 14px; background: var(--surface); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.seg button { height: 40px; border: 0; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-3); }
.seg button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }

/* ---------- Next-match strip ---------- */
.strip { margin: 4px 16px 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); }
.strip .crests { display: flex; align-items: center; gap: 6px; }
.strip .crests img { width: 26px; height: 26px; object-fit: contain; }
.countdown { display: flex; gap: 4px; }
.countdown div { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 6px 7px; min-width: 34px; }
.countdown b { display: block; font-family: var(--f-cond); font-weight: 800; font-size: 21px; line-height: 1; }
.countdown span { font-size: 9.5px; color: var(--text-3); letter-spacing: .04em; }

/* ---------- Hero story ---------- */
.hero { margin: 20px 16px 0; overflow: hidden; display: block; }
.hero .art { height: 250px; position: relative; overflow: hidden; background: var(--shirt); }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.6)); }
.hero .tags { position: absolute; left: 16px; top: 16px; display: flex; gap: 6px; z-index: 2; }
.pill { font-family: var(--f-cond); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 5px 9px 4px; border-radius: 7px; }
.pill.light { background: #fff; color: #0B0C0E; }
.pill.dark { background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(6px); }
.pill.kit { background: var(--shirt); color: var(--ink); }
.hero .body { padding: 18px; }
.hero h2 { margin: 0; font-family: var(--f-serif); font-weight: 600; font-size: 25px; line-height: 1.16; }
.hero p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.sources { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.dots { display: flex; }
.dots span { width: 24px; height: 24px; border-radius: 12px; background: var(--surface-3); color: var(--text); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.dots span + span { margin-left: -7px; }
.dots span.first { background: var(--text); color: var(--bg); }

/* ---------- Story cards ---------- */
.story { display: block; overflow: hidden; }
.story .img { height: 170px; position: relative; background: var(--surface-2); overflow: hidden; }
.story .img img { width: 100%; height: 100%; object-fit: cover; }
.story .img .pill { position: absolute; left: 14px; top: 14px; }
.story .body { padding: 16px; }
.story h3 { margin: 6px 0 0; font-family: var(--f-serif); font-weight: 600; font-size: 19px; line-height: 1.22; }
.story p { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.story .meta { margin-top: 10px; }
.kind { font-family: var(--f-cond); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.kind.transfer { color: var(--gold); }
.kind.injury { color: #FF8A7E; }
.kind.match_report { color: var(--live); }
.rows { padding: 4px 16px; }
.row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t div:last-child { font-size: 15.5px; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.row .thumb { width: 72px; height: 72px; flex: none; border-radius: 12px; object-fit: cover; background: var(--surface-3); }
.quote { padding: 18px; position: relative; overflow: hidden; display: block; }
.quote::before { content: '“'; position: absolute; right: 14px; top: -24px; font-family: var(--f-serif); font-size: 150px; line-height: 1; color: var(--ui); opacity: .45; }
.quote h3 { margin: 10px 0 0; font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: 21px; line-height: 1.3; position: relative; }
.story:hover h3, .row:hover .t div:last-child, .hero:hover h2, .quote:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Data cards ---------- */
.snap { display: flex; overflow: hidden; }
.snap .big { width: 124px; flex: none; background: var(--shirt); color: var(--ink); position: relative; display: grid; place-items: center; padding: 14px 0 18px; text-align: center; }
.snap .big b { font-family: var(--f-cond); font-weight: 800; font-size: 84px; line-height: .95; position: relative; }
.snap .big sup { font-size: 28px; vertical-align: top; line-height: 1.8; }
.snap .big small { position: relative; display: block; font-size: 12px; color: var(--ink-soft); }
.snap .info { padding: 16px; flex: 1; min-width: 0; }
.chips { display: flex; gap: 5px; }
.chip { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-cond); font-weight: 800; font-size: 16px; }
.chip.W { background: var(--live); color: #0B0C0E; }
.chip.D { background: #3A3E46; color: var(--text); }
.chip.L { background: var(--danger); color: #0B0C0E; }

/* ---------- Matchday modules ---------- */
.mday { margin: 16px 16px 0; border-radius: 24px; overflow: hidden; position: relative; background: var(--shirt); color: var(--ink); display: block; box-shadow: 0 18px 40px rgba(0,0,0,.4); }
.mday .in { position: relative; padding: 16px 18px 22px; }
.mday .top { display: flex; justify-content: space-between; align-items: center; }
.mday .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 12px; text-align: center; }
.mday .teams img { width: 48px; height: 48px; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.mday .teams .n { font-family: var(--f-cond); font-weight: 700; font-size: 16px; text-transform: uppercase; margin-top: 6px; }
.mday .score { font-family: var(--f-cond); font-weight: 800; font-size: 60px; line-height: 1; letter-spacing: -.01em; padding: 0 8px; }
.mday .last { margin-top: 12px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.livepill { background: var(--live); color: #0B0C0E; display: inline-flex; align-items: center; gap: 6px; }
.livepill i { width: 7px; height: 7px; border-radius: 4px; background: #0B0C0E; animation: pulse 1.2s infinite; }
/* Full time: a solid neutral pill, no dot, so a finished game never looks like a stalled live one. */
.ftpill { background: #E7E8EB; color: #15171C; }
.board .fetched { position: relative; text-align: center; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Match screen ---------- */
.board { position: relative; padding: 58px 20px 22px; background: var(--shirt); color: var(--ink); overflow: hidden; }
.board .nav { position: relative; display: flex; align-items: center; justify-content: space-between; }
.board .round { width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.22); display: grid; place-items: center; color: var(--ink); cursor: pointer; }
.board .teams { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 20px; text-align: center; }
.board .teams img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }
.board .teams .n { font-family: var(--f-cond); font-weight: 700; font-size: 17px; text-transform: uppercase; margin-top: 8px; }
.board .score { font-family: var(--f-cond); font-weight: 800; font-size: 84px; line-height: 1; display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.board .score span { font-size: 44px; opacity: .55; }
.board .scorers { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.board .scorers > div:first-child { text-align: right; }
.timeline { position: relative; margin-top: 16px; height: 34px; }
.timeline .bar { position: absolute; left: 0; right: 0; top: 16px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 25%, transparent); }
.timeline .prog { position: absolute; left: 0; top: 16px; height: 3px; border-radius: 2px; background: var(--ink); transition: width .5s; }
.timeline .ht { position: absolute; left: 50%; top: 11px; width: 1px; height: 13px; background: color-mix(in srgb, var(--ink) 45%, transparent); }
.timeline .ev { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; text-align: center; }
.timeline .ev.away { top: 21px; }
.timeline .ev i { display: block; width: 9px; height: 9px; border-radius: 5px; background: var(--ink); margin: 0 auto; box-shadow: 0 0 0 2px color-mix(in srgb, var(--shirt) 70%, black); }
.timeline .ev.card i { width: 7px; height: 10px; border-radius: 2px; background: var(--gold); }
.timeline .ev.card.red i { background: var(--danger); }
.timeline .ends { position: absolute; top: 24px; font-size: 10px; color: var(--ink-soft); }
.events { list-style: none; margin: 0; padding: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.events li { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 18px; padding: 14px; }
.events li.goal.ours { box-shadow: inset 3px 0 0 var(--ui); }
.events .min { width: 44px; flex: none; font-family: var(--f-cond); font-weight: 800; font-size: 21px; color: var(--text-3); }
.events li.goal .min { color: var(--text); }
.events .what { flex: 1; min-width: 0; }
.events .what b { display: block; font-size: 15px; font-weight: 600; }
.events .what span { font-size: 13px; color: var(--text-3); }
.events .sc { font-family: var(--f-cond); font-weight: 800; font-size: 19px; color: var(--text-3); }
.statbox { margin: 14px 16px 0; background: var(--surface); border-radius: 20px; padding: 4px 16px; }
.stat { padding: 12px 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
.stat .v { display: flex; justify-content: space-between; align-items: baseline; }
.stat .v b { font-family: var(--f-cond); font-weight: 800; font-size: 20px; }
.stat .v span { font-size: 13px; color: var(--text-3); }
.stat .bars { display: flex; gap: 4px; margin-top: 6px; height: 6px; }
.stat .bars i { border-radius: 3px; display: block; }
.pitch { margin: 14px 16px 0; height: 470px; border-radius: 20px; position: relative; overflow: hidden; background: #1A5A35; }
.pitch::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255,255,255,.045) 0 42px, transparent 42px 84px); }
.pitch svg.lines { position: absolute; inset: 0; }
.pitch .pl { position: absolute; width: 76px; margin-left: -38px; margin-top: -16px; text-align: center; }
.pitch .pl .nm { display: block; font-size: 10.5px; font-weight: 600; margin-top: 3px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitch .fm { position: absolute; left: 14px; font-size: 11px; color: rgba(255,255,255,.85); }

/* ---------- Fixtures ---------- */
.feature { margin: 16px 16px 0; border-radius: 24px; overflow: hidden; position: relative; background: var(--shirt); color: var(--ink); box-shadow: 0 18px 40px rgba(0,0,0,.4); }
.feature .in { position: relative; padding: 18px 18px 22px; }
.feature .cd { display: flex; gap: 6px; margin-top: 16px; }
.feature .cd div { flex: 1; background: rgba(0,0,0,.24); border-radius: 12px; padding: 8px 0; text-align: center; }
.feature .cd b { display: block; font-family: var(--f-cond); font-weight: 800; font-size: 24px; line-height: 1; }
.feature .cd span { font-size: 10px; color: var(--ink-soft); }
.btn { height: 48px; border: 0; border-radius: 14px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; width: 100%; }
.btn.white { background: #fff; color: #0B0C0E; margin-top: 12px; }
.btn.kit { background: var(--shirt); color: var(--ink); height: 56px; border-radius: 18px; font-size: 17px; }
.list { list-style: none; margin: 0 16px; padding: 4px 14px; background: var(--surface); border-radius: 20px; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .fx { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; }
.list .date { width: 44px; text-align: center; flex: none; }
.list .date b { display: block; font-family: var(--f-cond); font-weight: 800; font-size: 24px; line-height: 1; }
.list .opp { width: 30px; height: 30px; object-fit: contain; flex: none; }
.list .what { flex: 1; min-width: 0; }
.list .what b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .what span { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.list .what span img { width: 14px; height: 14px; object-fit: contain; }
.list .right { font-family: var(--f-cond); font-weight: 800; font-size: 20px; color: var(--text-2); }

/* ---------- Season ---------- */
.pos { margin: 18px 16px 0; display: flex; overflow: hidden; }
.pos .big { width: 138px; flex: none; background: var(--shirt); color: var(--ink); position: relative; padding: 16px 0 20px; text-align: center; }
.pos .big b { position: relative; display: block; font-family: var(--f-cond); font-weight: 800; font-size: 96px; line-height: .95; }
.pos .big b sup { font-size: 34px; vertical-align: top; line-height: 1.6; }
.pos .grid { flex: 1; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; align-content: center; }
.pos .grid b { display: block; font-family: var(--f-cond); font-weight: 800; font-size: 30px; line-height: 1; }
.pos .grid span { font-size: 12px; color: var(--text-3); }
.table { margin: 12px 16px 0; padding: 6px 16px 6px; }
.trow { display: grid; grid-template-columns: 26px 1fr 30px 40px 38px; align-items: center; padding: 9px 8px; margin: 0 -8px; border-radius: 12px; font-size: 14.5px; }
.trow.head { font-family: var(--f-cond); font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.trow.me { background: var(--surface-3); font-weight: 700; box-shadow: inset 3px 0 0 var(--ui); }
.trow .r { font-family: var(--f-cond); font-weight: 800; font-size: 17px; color: var(--text-3); }
.trow.me .r { color: var(--text); }
.trow .c { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trow .c img { width: 18px; height: 18px; object-fit: contain; }
.trow .c span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .n { text-align: right; color: var(--text-2); }
.trow .p { text-align: right; font-family: var(--f-cond); font-weight: 800; font-size: 18px; }
.trow.gap { padding: 2px 8px; color: var(--text-4); font-size: 12px; }
.people { margin: 12px 16px 0; padding: 14px 16px; }
.person { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; }
.person img { width: 36px; height: 36px; border-radius: 18px; object-fit: cover; background: var(--surface-3); }
.person .bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.person .bar i { display: block; height: 100%; border-radius: 3px; background: #6B707A; }
.person:first-of-type .bar i { background: var(--ui); }

/* ---------- Settings ---------- */
.clubcard { margin: 18px 16px 0; border-radius: 24px; overflow: hidden; position: relative; background: var(--shirt); color: var(--ink); padding: 16px 16px 22px; display: flex; align-items: center; gap: 14px; }
.clubcard img { position: relative; width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.pillbtn { position: relative; height: 40px; padding: 0 14px; border-radius: 20px; background: rgba(0,0,0,.24); display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink); border: 0; cursor: pointer; }
.kits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kitbtn { position: relative; height: 118px; padding: 10px 0 8px; border-radius: 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: space-between; background: transparent; border: 2px solid transparent; font-size: 13px; font-weight: 600; }
.kitbtn[aria-checked="true"] { background: var(--surface-3); border-color: var(--ui); }
.kitbtn .tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 10px; background: var(--text); display: none; place-items: center; }
.kitbtn[aria-checked="true"] .tick { display: grid; }
.swatches { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.swatches i { width: 22px; height: 22px; border-radius: 11px; box-shadow: 0 0 0 2px var(--surface-2), inset 0 0 0 1px rgba(255,255,255,.2); display: block; }
.swatches i + i { margin-left: -6px; }
.setlist { margin: 0 16px; padding: 0 16px; }
.setrow { display: flex; align-items: center; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow .t { flex: 1; min-width: 0; }
.setrow .t b { display: block; font-size: 15px; font-weight: 600; }
.setrow .t span { font-size: 12px; color: var(--text-3); }
.setrow.off .t, .setrow.off .tile { opacity: .5; }
.switch { width: 52px; height: 32px; border: 0; border-radius: 16px; padding: 3px; cursor: pointer; background: #3A3E46; display: flex; justify-content: flex-start; transition: background .2s; flex: none; }
.switch::after { content: ''; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.switch[aria-checked="true"] { background: var(--ui); justify-content: flex-end; }
.tile { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.tier { font-family: var(--f-cond); font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); margin-left: 6px; }
.tier.S { color: var(--live); } .tier.C { color: var(--gold); } .tier.E { color: var(--text-3); }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 14px; padding: 3px; }
.stepper button { width: 36px; height: 36px; border: 0; border-radius: 11px; background: transparent; font-size: 20px; cursor: pointer; }
.stepper button:hover { background: var(--surface-3); }

/* ---------- Onboarding ---------- */
.onb { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 36px; position: relative; }
.onb .glow { position: absolute; left: -80px; right: -80px; top: -140px; height: 420px; background: radial-gradient(closest-side, color-mix(in srgb, var(--shirt) 45%, transparent), transparent); pointer-events: none; transition: background .3s; }
.onb h1 { margin: 26px 0 0; font-family: var(--f-serif); font-weight: 600; font-size: 40px; line-height: 1.04; }
.onb h1 span { color: var(--text-3); }
.steps { display: flex; gap: 6px; }
.steps i { width: 28px; height: 4px; border-radius: 2px; background: #33363D; }
.steps i.on { background: var(--text); }
.clubgrid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 26px 20px 0; }
.clubbtn { position: relative; overflow: hidden; height: 132px; padding: 16px; border-radius: 22px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; text-align: left; background: var(--surface); border: 2px solid rgba(255,255,255,.06); }
.clubbtn img { width: 46px; height: 46px; object-fit: contain; margin-bottom: auto; }
.clubbtn b { font-family: var(--f-cond); font-weight: 800; font-size: 21px; line-height: 1; text-transform: uppercase; }
.clubbtn[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 26%, var(--surface)); box-shadow: 0 16px 40px color-mix(in srgb, var(--c) 30%, transparent); }

/* ---------- Push banner ---------- */
.banner-host { position: absolute; left: 8px; right: 8px; top: 54px; z-index: 40; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.banner { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 22px; background: rgba(40,42,48,.82); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: drop .45s cubic-bezier(.2,.9,.3,1.2) both; }
.banner.out { animation: rise .35s ease both; }
button.banner { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.banner:active { transform: scale(.98); }
.banner .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--shirt); color: var(--ink); display: grid; place-items: center; flex: none; font-family: var(--f-cond); font-weight: 800; font-size: 13px; }
.banner b { display: block; font-size: 14px; }
.banner span { font-size: 13px; color: var(--text-2); }
.banner small { margin-left: auto; align-self: flex-start; font-size: 12px; color: var(--text-3); }
@keyframes drop { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { to { transform: translateY(-120%); opacity: 0; } }

/* ---------- Loading / empty ---------- */
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 22px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { margin: 16px; padding: 20px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------- Dev panel ---------- */
.devpanel { width: 300px; flex: none; align-self: center; display: flex; flex-direction: column; gap: 14px; font-size: 13px; color: var(--text-2); }
.devpanel h2 { margin: 0; font-family: var(--f-cond); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.devpanel .box { background: #101114; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.devpanel .rp { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.devpanel .rp img { width: 20px; height: 20px; object-fit: contain; }
.devpanel .rp span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.devpanel button.small { white-space: nowrap; border: 1px solid rgba(255,255,255,.14); background: #1A1C21; border-radius: 9px; height: 30px; padding: 0 10px; cursor: pointer; font-size: 12px; font-weight: 600; }
.devpanel button.small:hover { background: #24272E; }
.devpanel button.small.on { background: var(--ui); color: var(--ink); border-color: transparent; }
.devpanel input[type=range] { width: 100%; accent-color: var(--ui); }
.devpanel .speeds { display: flex; gap: 6px; }
.devpanel .note { font-size: 12px; color: var(--text-4); line-height: 1.45; }
@media (max-width: 860px) { .devpanel { display: none; } }


/* Source badges: official club news / subscriber-only */
.badge { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.badge.pay { background: rgba(242,193,78,.14); color: var(--gold); }
.badge.official { background: color-mix(in srgb, var(--ui) 22%, transparent); color: var(--text); }
.lockmini { display: inline-flex; vertical-align: -1px; color: var(--gold); }
.lockmini.off { color: var(--ui); }
.setrow .t span:not(.tier) { display: block; }

/* ---------- Stats ---------- */
.tiles { margin: 16px 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile2 { background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.tile2 b { display: block; font-family: var(--f-cond); font-weight: 800; font-size: 40px; line-height: 1; }
.tile2 span { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; }
.tile2 small { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.statcard { margin: 12px 16px 0; padding: 14px 16px 16px; }
.statcard .sh { display: flex; justify-content: space-between; align-items: baseline; }
.statcard .sh h2 { margin: 0; font-size: 13px; }
.statcard .note { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.legend { display: flex; gap: 14px; margin: 10px 0 4px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.chart { display: block; margin-top: 4px; overflow: visible; }
.chart .cv { font-family: var(--f-cond); font-weight: 700; font-size: 14px; fill: var(--text); }
.chart .ct { font-size: 10.5px; fill: var(--text-3); }
.chart g:hover path { filter: brightness(1.2); }
.hrow { display: grid; grid-template-columns: 1fr 56px 56px 48px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hrow:last-child { border-bottom: 0; }
.hrow b { text-align: right; font-family: var(--f-cond); font-weight: 700; font-size: 18px; }
.hrow b:last-child { color: var(--text); }
.hrow b:not(:last-child) { color: var(--text-2); }
.hrow.head { font-family: var(--f-cond); font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding-top: 12px; }
.hrow.head span:not(:first-child) { text-align: right; }
.recs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.recs span { display: block; font-size: 12px; color: var(--text-3); }
.recs b { display: block; font-family: var(--f-cond); font-weight: 800; font-size: 24px; line-height: 1.1; margin-top: 2px; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.fm-chips span { background: var(--surface-3); border-radius: 999px; padding: 5px 10px; font-family: var(--f-cond); font-weight: 700; font-size: 15px; }
.fm-chips em { font-style: normal; color: var(--text-3); font-weight: 500; }
.minibars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; height: 70px; margin-top: 12px; }
.minibars div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.minibars i { width: 14px; border-radius: 3px 3px 1px 1px; background: var(--gold); display: block; }
.minibars span { font-size: 10.5px; color: var(--text-3); }
.metrics { display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 2px; scrollbar-width: none; }
.metrics::-webkit-scrollbar { display: none; }
.metrics button { flex: none; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.metrics button[aria-selected="true"] { background: var(--shirt); color: var(--ink); border-color: transparent; }
.lead { display: grid; grid-template-columns: 22px 38px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lead:last-child { border-bottom: 0; }
.lead .r { font-family: var(--f-cond); font-weight: 800; font-size: 16px; color: var(--text-3); text-align: center; }
.lead img { width: 38px; height: 38px; border-radius: 19px; object-fit: cover; background: var(--surface-3); }
.lead .who { min-width: 0; }
.lead .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .who span { display: block; font-size: 11.5px; color: var(--text-3); }
.lead .bar { height: 5px; border-radius: 3px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.lead .bar i { display: block; height: 100%; border-radius: 3px; background: var(--ui); }
.lead .v { font-family: var(--f-cond); font-weight: 800; font-size: 22px; min-width: 36px; text-align: right; }

/* ---------- Season: competitions ---------- */
.metrics.comps button { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px 0 8px; }
.metrics.comps img { width: 20px; height: 20px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
.trow.z-q { box-shadow: inset 3px 0 0 var(--live); }
.trow.z-p { box-shadow: inset 3px 0 0 var(--gold); }
.trow.z-p2 { box-shadow: inset 3px 0 0 #7FB6FF; }
.trow.z-r { box-shadow: inset 3px 0 0 var(--danger); }
.trow.me { box-shadow: inset 3px 0 0 var(--ui); }
.zones { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0 2px; font-size: 11.5px; color: var(--text-3); }
.zones span { display: inline-flex; align-items: center; gap: 6px; }
.zones i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.zones i.z-q { background: var(--live); } .zones i.z-p { background: var(--gold); } .zones i.z-p2 { background: #7FB6FF; } .zones i.z-r { background: var(--danger); }
.morebtn { width: 100%; margin-top: 8px; height: 40px; border: 0; border-radius: 12px; background: var(--surface-3); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.road { margin: 14px 16px 0; position: relative; display: flex; flex-direction: column; gap: 8px; }
.road .step { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 12px 14px; }
.road .step > i { width: 12px; height: 12px; border-radius: 6px; flex: none; background: #3A3E46; box-shadow: 0 0 0 3px var(--surface-3); }
.road .step.W > i { background: var(--live); } .road .step.L > i { background: var(--danger); } .road .step.D > i { background: var(--text-3); }
.road .step.next > i { background: var(--ui); animation: pulse 1.4s infinite; }
.road .step div { flex: 1; min-width: 0; }
.road .step b { display: block; font-size: 15px; margin-top: 2px; }
.road .step em { font-style: normal; color: var(--text-3); font-weight: 500; }
.road .sc { font-family: var(--f-cond); font-weight: 800; font-size: 20px; }

.countdown.onkit { margin-top: 6px; justify-content: center; }
.countdown.onkit div { background: rgba(0,0,0,.24); min-width: 30px; padding: 4px 5px; }
.countdown.onkit span { color: var(--ink-soft); }
.seg.lu { margin-top: 12px; }
.seg.lu button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.lu img { width: 20px; height: 20px; object-fit: contain; flex: none; }

/* Live ticker: quieter than goals/cards/subs so key events still stand out. */
.events li.tick { background: transparent; padding: 4px 14px; border-radius: 0; gap: 12px; }
.events li.tick .min { font-size: 15px; }
.events li.tick i { width: 24px; flex: none; text-align: center; font-style: normal; color: var(--text-3); font-size: 15px; }
.events li.tick .what { font-size: 14px; color: var(--text-2); }
.events li.tick .what span { font-size: 12px; color: var(--text-3); }
.events li.tick.ours i { color: var(--ui); }
.events li.tick.shot_on .what { color: var(--text); font-weight: 600; }
.events li.tick.summary { background: var(--surface); border-radius: 14px; padding: 10px 14px; margin: 4px 0; }
.events li.tick.summary .what { font-size: 13px; color: var(--text-2); }

/* Latest moments on the live match card. */
.mday .mtick { list-style: none; margin: 14px 0 0; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 6px; }
.mday .mtick li { display: flex; gap: 10px; font-size: 13px; line-height: 1.3; color: var(--ink-soft); text-align: left; }
.mday .mtick li:first-child { color: var(--ink); }
.mday .mtick li.key { color: var(--ink); font-weight: 700; }
.mday .mtick b { font-family: var(--f-cond); font-weight: 800; font-size: 14px; width: 34px; flex: none; }
.mday .mtick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Story screen & in-app browser (slide-up layers) ---------- */
.screen { transition: transform .42s cubic-bezier(.32,.72,0,1), border-radius .42s, filter .42s, background-color .3s; transform-origin: 50% 0; }
.phone.sheeted .screen { transform: translateY(14px) scale(.93); border-radius: 22px; filter: brightness(.55); overflow: hidden; }
.phone.sheeted .tabbar { opacity: 0; pointer-events: none; transition: opacity .3s; }
.sheet { position: absolute; inset: 0; z-index: 50; }
.sh-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .4s; }
.sheet.open .sh-scrim { opacity: 1; }
.sh-panel { position: absolute; left: 0; right: 0; bottom: 0; top: 50px; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); transform: translateY(100%); transition: transform .42s cubic-bezier(.32,.72,0,1); will-change: transform; }
.sheet.open .sh-panel { transform: none; }
.sh-panel.dragging { transition: none; }
.sh-grab { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); z-index: 3; }
.sh-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 16px 14px 0; pointer-events: none; }
.sh-bar > * { pointer-events: auto; }
.sh-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none;
  background: rgba(11,12,14,.55); color: #fff; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
.sh-btn:active { transform: scale(.92); }
.sh-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 40px; }
.sh-scroll::-webkit-scrollbar { display: none; }

/* Story screen */
.st-hero { aspect-ratio: 16/10; background: var(--surface); overflow: hidden; position: relative; }
.st-hero img { width: 100%; height: 100%; object-fit: cover; }
.st-hero::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, var(--bg)); }
.story .sh-scroll > .st-body:first-child { padding-top: 70px; }
.st-body { padding: 4px 20px 0; position: relative; }
.st-kicker { display: flex; align-items: center; gap: 8px; }
.st-kicker .kind { font-family: var(--f-cond); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ui); }
.st-body h1 { margin: 10px 0 14px; font-family: var(--f-serif); font-weight: 600; font-size: 30px; line-height: 1.12; letter-spacing: -.005em; }
.st-meta { display: flex; gap: 6px; font-size: 14px; color: var(--text-3); }
.st-meta b { color: var(--text); font-weight: 600; }
.st-sum { margin: 18px 0 0; font-family: var(--f-serif); font-size: 19px; line-height: 1.6; color: var(--text-2); }
.st-skel { padding-top: 10px; }
.st-skel i { display: block; height: 15px; margin: 12px 0; border-radius: 8px; background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 40%, var(--surface) 80%) 0 0 / 300% 100%; animation: stskel 1.3s infinite linear; }
@keyframes stskel { to { background-position: -150% 0; } }
.st-actions { display: flex; gap: 10px; margin-top: 26px; }
.st-actions .btn.kit { flex: 1; height: 54px; font-size: 16px; box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 10px 24px rgba(0,0,0,.35); }
.st-actions .btn.kit svg { width: 13px; height: 13px; }
.st-share { width: auto; flex: none; padding: 0 18px; height: 54px; border-radius: 18px; background: var(--surface-2); color: var(--text); }
.st-note { margin: 12px 2px 0; font-size: 13px; color: var(--text-3); }
.st-others { margin-top: 30px; }
.st-others .label { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.st-other { width: 100%; display: flex; text-decoration: none; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.st-other .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-family: var(--f-cond); font-weight: 700; font-size: 12px; }
.st-other b { flex: 1; font-weight: 600; font-size: 15px; }

@media (max-width: 520px) {
  .sh-panel { top: calc(env(safe-area-inset-top) + 12px); }
  .phone.sheeted .screen { transform: translateY(calc(env(safe-area-inset-top) + 4px)) scale(.93); }
}
@media (prefers-reduced-motion: reduce) { .sh-panel, .sh-scrim, .screen { transition-duration: .01s !important; } }

/* Back to where you came from, above page titles */
.pageback { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 10px -6px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.pageback svg { width: 18px; height: 18px; }
.pageback:active { transform: scale(.96); }
.pagehead > div { display: flex; flex-direction: column; align-items: flex-start; }

/* Feed header (club, date, refresh, alerts) stays pinned while the feed scrolls. */
.apphead { position: sticky; top: 0; z-index: 15; transition: background-color .25s, box-shadow .25s; }

/* One Team logo (inline SVG from scripts/brand.mjs): "One Team" in the primary ink, "NEWS" in the secondary. */
.logo { display: block; flex: none; }
.logo-p { fill: var(--text); }
.logo-s { fill: var(--text-2); }
.apphead .logo-header { margin-bottom: 8px; }
.sharedhead .logo-header { margin-bottom: 10px; }
/* Splash: the large lockup, centred, until the first screen renders. */
.splash { min-height: 100%; display: grid; place-items: center; padding-bottom: 60px; }

/* Shared links (/s, /m): visitors without a club see the One Team wordmark on top and a follow bar below. */
.sharedhead { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sharedstory { padding-bottom: 24px; }
.sharedstory .st-hero { margin: 0 16px; border-radius: 14px; overflow: hidden; }
.followbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, color-mix(in srgb, var(--shirt) 45%, var(--bg)) 88%, transparent); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 -1px 0 rgba(255,255,255,.06), 0 -8px 24px rgba(0,0,0,.25); }
.followbar .fb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.followbar .fb-txt b { font-size: 14px; }
.followbar .fb-txt span { font-size: 12px; color: var(--text-2); }
.followbar .btn { flex: none; width: auto; height: 40px; padding: 0 18px; }
/* Narrow phones: drop the avatar and tighten so each line of copy stays on one line. */
@media (max-width: 380px) { .followbar { gap: 10px; } .followbar .avatar { display: none; } .followbar .btn { padding: 0 16px; } }
@media (max-width: 340px) { .followbar .fb-txt b { font-size: 13px; } .followbar .fb-txt span { font-size: 11.5px; } .followbar .btn { padding: 0 14px; } }
/* Room under the content for the follow bar. */
.screen.notabs { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.mday { position: relative; }
.mday-share { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 17px; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.22); color: var(--ink); cursor: pointer; }
.mday-share:active { transform: scale(.92); }
.apphead.stuck { background: color-mix(in srgb, color-mix(in srgb, var(--shirt) 45%, var(--bg)) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.25); }

/* On a real phone, reserve room for the notch and home bar only where the device has them
   (env() is 0 in a normal browser tab, where the browser's own bars already take that space). */
@media (max-width: 520px) {
  .apphead { padding-top: calc(env(safe-area-inset-top) + 16px); }
  .pagehead { padding-top: calc(env(safe-area-inset-top) + 18px); }
  .board { padding-top: calc(env(safe-area-inset-top) + 14px); }
  .banner-host { top: calc(env(safe-area-inset-top) + 8px); }
  .tabbar { height: calc(60px + env(safe-area-inset-bottom)); padding: 7px 4px env(safe-area-inset-bottom); align-items: center; }
  .tabbar a { gap: 3px; }
  .screen { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .onb { --onb-top: calc(env(safe-area-inset-top) + 32px); }
}

/* Text-only cards: the lead article had no image of its own (we never borrow another outlet's). */
.hero.textonly .tags { position: static; padding: 18px 20px 0; }
.hero.textonly .body h2 { font-size: 28px; }
.st-other img { width: 46px; height: 34px; border-radius: 7px; object-fit: cover; flex: none; background: var(--surface-3); }

/* ---------- One Team Avatar System (stands in for club crests) ---------- */
:root {
  --sans: var(--f-sans);
  --color-arsenal: #e5131a;
  --color-chelsea: #1e3a8a;
  --color-liverpool: #a4142a;
  --color-man-city: #36749f; /* 5.05:1 with white, verified at 4.5:1 target */
  --color-man-united: #b8102e;
  --color-tottenham: #0b1733;
  --color-neutral-team: #6c7482;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #fff;
  font-weight: 700;
  font-family: var(--sans);
}
.avatar--xs { width: 20px; height: 20px; font-size: 9px; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--md { width: 48px; height: 48px; font-size: 17px; }
.avatar--lg { width: 96px; height: 96px; font-size: 34px; }

.avatar--arsenal     { background: var(--color-arsenal); }
.avatar--chelsea     { background: var(--color-chelsea); }
.avatar--liverpool   { background: var(--color-liverpool); }
.avatar--man-city    { background: var(--color-man-city); }
.avatar--man-united  { background: var(--color-man-united); }
.avatar--tottenham   { background: var(--color-tottenham); }
.avatar--neutral     { background: var(--color-neutral-team); }

/* Fit avatars into layouts that were built around crest images. */
.avatar { flex: none; line-height: 1; letter-spacing: .02em; }
.avatar--licensed { object-fit: contain; border-radius: 0; background: none; }
.mday .teams .avatar, .board .teams .avatar { margin: 0 auto; }
.clubbtn .avatar { margin-bottom: auto; }
.clubcard .avatar { position: relative; }
/* Rule: an avatar on a background tinted with its own team's colour gets a 1.5px white ring. */
.avatar--on-team-bg { box-shadow: 0 0 0 1.5px #fff; }

/* Player Avatar: on the pitch (md, surname below) and in list rows (sm, name beside). */
.pitch .pl .avatar { margin: 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pitch .pl .avatar--neutral { box-shadow: 0 0 0 1.5px rgba(255,255,255,.5), 0 2px 8px rgba(0,0,0,.35); }
.person .avatar, .lead .avatar { margin: 0 auto; }
.avatar--photo { border-radius: 9999px; object-fit: cover; }

/* Attribution (Task 5): outlet name above the headline at >= 80% of the headline size.
   Headlines: hero 25px (text-only 28px), story 19px, quote 21px, row 15.5px. */
.outlet { font-weight: 700; color: var(--text); line-height: 1.2; }
.hero .outlet { font-size: 20px; margin-bottom: 6px; }
.hero.textonly .outlet { font-size: 22.4px; }
.story .outlet { font-size: 15.2px; margin-top: 6px; }
.story .img + .body .outlet { margin-top: 0; }
.quote .outlet { font-size: 16.8px; margin-top: 10px; }
.quote .outlet + h3 { margin-top: 4px; }
.rowhead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.rowhead .outlet { font-size: 12.4px; }
.rowhead .lockmini { align-self: center; }
.st-outlet { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ui) 60%, transparent); text-underline-offset: 3px; }

/* ======================================================================================
   Modern design pass (Task 4.5). Tokens first; components below only consume them.
   .ds2 sits on #phone, so every screen uses these tokens.
   ====================================================================================== */
.ds2 {
  /* Type */
  --font-ui: -apple-system, "SF Pro Text", Inter, system-ui, sans-serif;
  --font-hero: 'Newsreader', Georgia, serif;   /* the one serif touch: the top story's headline */
  --headline-weight: 600;
  --headline-tracking: -0.01em;          /* applied to headlines 17px and up */
  --card-headline-hero: 22px;
  --card-headline: 18px;
  --card-headline-compact: 15px;
  --card-outlet: 17.6px;                  /* 80% of the hero headline (22); 98% of card headlines (18) */
  --card-outlet-compact: 13px;            /* >= 13px floor; 87% of compact headline (15) */
  /* Cards */
  --card-radius: 14px;
  --card-border: 0.5px solid rgba(255,255,255,.12);
  --card-pad: 14px;
  --card-shadow: none;
  --card-shadow-raised: 0 1px 2px rgba(0,0,0,.30), 0 8px 24px rgba(0,0,0,.28);   /* hero + live only */
  /* Buttons */
  --btn-height: 44px;
  --btn-radius: 10px;
  --btn-weight: 500;
  /* Primary button = the kit's own shirt/ink pair, so text always contrasts (e.g. Spurs home: white button, navy text). */
  --btn-primary-bg: var(--shirt);
  --btn-primary-ink: var(--ink);
  /* Live indicator */
  --live-dot: 8px;
  --live-cycle: 1.5s;
}
/* Font tokens: the serif and sans faces both resolve to the UI stack; the condensed face stays for labels. */
.ds2 { --f-serif: var(--font-ui); --f-sans: var(--font-ui); }
.ds2 .screen, .ds2 .sheet, .ds2 .banner-host, .ds2 #followbar { font-family: var(--font-ui); }
/* Tabular numerals on numeric UI only (Inter's tnum also widens hyphens in running text). */
.ds2 .countdown, .ds2 .score, .ds2 .mday .score, .ds2 .mtick b, .ds2 .trow, .ds2 .min, .ds2 .chips, .ds2 .snap .big b { font-variant-numeric: tabular-nums; }

/* Cards: hairline, 14px radius, no default shadow; hero and live cards get the raised double shadow. */
.ds2 .card { border-radius: var(--card-radius); border: var(--card-border); box-shadow: var(--card-shadow); }
.ds2 .hero, .ds2 .mday { border-radius: var(--card-radius); box-shadow: var(--card-shadow-raised); }
.ds2 .mday { border: var(--card-border); }
.ds2 .strip { border-radius: var(--card-radius); border: var(--card-border); padding: var(--card-pad); }
.ds2 .hero .body, .ds2 .story .body, .ds2 .quote, .ds2 .mday .in { padding: var(--card-pad); }
.ds2 .rows { padding: 0 var(--card-pad); }
.ds2 .row { padding: var(--card-pad) 0; border-bottom-width: 0.5px; }
.ds2 .stack { gap: 10px; }

/* Headlines: UI font, weight 600, tightened tracking at 17px+. */
.ds2 .hero h2, .ds2 .hero.textonly .body h2 { font-family: var(--font-hero); font-weight: var(--headline-weight); font-size: var(--card-headline-hero); line-height: 1.22; letter-spacing: var(--headline-tracking); }
.ds2 .story h3, .ds2 .quote h3 { font-family: var(--font-ui); font-weight: var(--headline-weight); font-size: var(--card-headline); line-height: 1.25; letter-spacing: var(--headline-tracking); }
.ds2 .quote h3 { font-style: normal; }
.ds2 .row .t div:last-child { font-size: var(--card-headline-compact); font-weight: var(--headline-weight); line-height: 1.3; }
.ds2 .hero p, .ds2 .story p { font-size: 14px; line-height: 1.45; }

/* Attribution: two outlet tokens only (full cards / compact rows). */
.ds2 .hero .outlet, .ds2 .hero.textonly .outlet, .ds2 .story .outlet, .ds2 .quote .outlet { font-size: var(--card-outlet); font-weight: 600; margin-bottom: 4px; }
.ds2 .rowhead .outlet { font-size: var(--card-outlet-compact); font-weight: 600; }
.ds2 .story .outlet { margin-top: 4px; }
.ds2 .story .img + .body .outlet { margin-top: 0; }

/* Buttons: 44px, 10px radius, weight 500; primary solid / secondary outlined / tertiary ghost. */
.ds2 .btn { height: var(--btn-height); border-radius: var(--btn-radius); font-weight: var(--btn-weight); font-size: 15px; }
.ds2 .btn.kit, .ds2 .btn.primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); height: var(--btn-height); border-radius: var(--btn-radius); font-size: 15px; box-shadow: none; }
.ds2 .btn.white { background: #fff; color: #0B0C0E; }
.ds2 .btn.secondary, .ds2 .st-share { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.22); height: var(--btn-height); border-radius: var(--btn-radius); font-weight: var(--btn-weight); }
.ds2 .btn.tertiary { background: transparent; color: var(--text-2); border: 0; }
.ds2 .st-actions .btn.kit { height: var(--btn-height); font-size: 15px; box-shadow: none; }

/* Live indicator: 8px dot with an outward ring, 1.5s cycle. */
.ds2 .livepill i { position: relative; width: var(--live-dot); height: var(--live-dot); border-radius: 50%; background: currentColor; animation: none; flex: none; }
.ds2 .livepill i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid currentColor; animation: live-ring var(--live-cycle) ease-out infinite; }
@keyframes live-ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ds2 .livepill i::after { animation: none; } }

/* ---- Rollout to every screen: components consume the same tokens ---- */
/* Card-like surfaces: 14px radius, hairline, no shadow, 14px padding. */
.ds2 .events li, .ds2 .statbox, .ds2 .list, .ds2 .tile2, .ds2 .road .step, .ds2 .kitbtn, .ds2 .clubbtn, .ds2 .clubcard {
  border-radius: var(--card-radius); border: var(--card-border); box-shadow: var(--card-shadow);
}
.ds2 .events li.tick { border: 0; border-radius: 0; }
.ds2 .events li.tick.summary { border: var(--card-border); border-radius: var(--card-radius); }
.ds2 .statbox { padding: 4px var(--card-pad); }
.ds2 .tile2, .ds2 .road .step { padding: var(--card-pad); }
.ds2 .list { padding: 4px var(--card-pad); }
.ds2 .clubcard { padding: var(--card-pad); }
.ds2 .pitch { border-radius: var(--card-radius); }
.ds2 .clubbtn[aria-pressed="true"] { box-shadow: none; border: 1.5px solid var(--c); }
/* Hero cards on other screens (Fixtures "Next" feature) get the raised double shadow. */
.ds2 .feature { border-radius: var(--card-radius); border: var(--card-border); box-shadow: var(--card-shadow-raised); }
/* Page and onboarding titles: UI font, 600, tightened tracking. */
.ds2 .pagehead h1, .ds2 .onb h1, .ds2 .st-body h1 { font-family: var(--font-ui); font-weight: var(--headline-weight); letter-spacing: var(--headline-tracking); }
.ds2 .pagehead h1 { font-size: 32px; }
.ds2 .onb h1 { font-size: 36px; }
/* Buttons everywhere: 44px / 10px / 500. */
.ds2 .pillbtn { height: var(--btn-height); border-radius: var(--btn-radius); font-weight: var(--btn-weight); padding: 0 16px; }
.ds2 .onb .btn.kit { height: var(--btn-height); border-radius: var(--btn-radius); font-size: 16px; font-weight: var(--btn-weight); }
/* Numbers that line up: scores, countdowns, tables, stat values, minutes. */
.ds2 .board .score, .ds2 .list .right, .ds2 .statbox, .ds2 .lead .v, .ds2 .tile2 b, .ds2 .feature .countdown, .ds2 .road .step b { font-variant-numeric: tabular-nums; }

/* Quick wins from docs/unused-api-fields.md */
.mday .ref { margin-top: 4px; font-size: 12px; color: var(--ink-soft); text-align: center; }
.score .ht { display: block; font-family: var(--font-ui, var(--f-sans)); font-weight: 600; font-size: 12px; letter-spacing: .02em; line-height: 1; margin-top: 6px; opacity: .8; font-variant-numeric: tabular-nums; }
.board .score { flex-wrap: wrap; justify-content: center; }
.board .score .ht { flex-basis: 100%; text-align: center; font-size: 13px; opacity: .85; margin-top: 2px; }
.trow { grid-template-columns: 26px 1fr 26px 28px 28px 36px 34px; }
.trow .gfa { color: var(--text-3); }
.lead .who .inj { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; vertical-align: 1px; color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }

/* Line-up event markers (ended matches) + legible surnames over pitch lines. */
.ds2 { --event-goal: #1f7a3d; --event-yellow: #d4a017; --event-red: #c2102a; --event-sub: #5a6370; --event-var: #4a3d85; }
.pitch .pl .nm { display: inline-block; max-width: 76px; margin-top: 3px; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.42); text-shadow: none; vertical-align: top; }
.pitch .pl { display: flex; flex-direction: column; align-items: center; }
.pitch .evs { display: flex; justify-content: center; gap: 3px; margin: 2px auto 0; padding: 1px 4px; width: max-content; max-width: 96px; border-radius: 5px; background: rgba(0,0,0,.55); }
.evs .ev { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; line-height: 12px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.evs .ev svg { flex: none; }
.evs .ev i { width: 6px; height: 8px; border-radius: 1px; flex: none; }
.evs .ev.yellow i { background: var(--event-yellow); }
.evs .ev.red i, .evs .ev.second i { background: var(--event-red); }
.evs .ev.second { color: #ffb3bd; }
.evs .ev.goal svg circle { fill: #fff; }
.evs .ev.goal { color: #9be3b0; }
.evs .ev.og { color: #ffb3bd; }
.evs .ev.miss { color: rgba(255,255,255,.6); }
.evs .ev.assist { padding: 0 3px; border-radius: 3px; border: 1px solid var(--event-goal); color: #9be3b0; font-size: 9px; line-height: 10px; }
.evs .ev b { display: inline-grid; place-items: center; width: 10px; height: 10px; border-radius: 2px; font-size: 9px; line-height: 1; background: var(--event-sub); color: #fff; }
.evs .ev.on b { background: var(--event-goal); }
.evs .ev.more { color: rgba(255,255,255,.75); }
.evs.bench { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.evs.bench .ev { color: var(--text-2); font-size: 11.5px; line-height: 14px; }
.evs.bench .ev.goal { color: #6fcf8f; }
.evs.bench .ev.goal svg circle { fill: var(--text); }
.person.unused { opacity: .5; }

/* Full surnames on the pitch (no truncation); light outline so kit-coloured circles read on grass. */
.pitch .pl .nm { max-width: none; overflow: visible; text-overflow: clip; }
.pitch .pl .avatar--kit { box-shadow: 0 0 0 1.5px rgba(255,255,255,.55), 0 2px 8px rgba(0,0,0,.35); }
.evs .ev .ball { font-size: 10.5px; line-height: 1; }
.evs.bench .ev .ball { font-size: 11px; }

/* Stadium line under the competition on the match header. */
.board .nav .venue { font-size: 12px; color: var(--ink-soft); margin-top: -2px; text-align: center; }

/* Match timeline: team codes left, home above / away below the line, minute scale underneath. */
.timeline { display: flex; gap: 8px; height: 62px; margin-top: 14px; }
.timeline .tl-teams { flex: none; width: 30px; display: flex; flex-direction: column; justify-content: space-between; padding: 1px 0 21px; font-family: var(--f-cond); font-weight: 700; font-size: 11px; letter-spacing: .06em; color: var(--ink-soft); }
.timeline .tl-track { position: relative; flex: 1; }
.timeline .bar, .timeline .prog { top: 20px; }
.timeline .tick { position: absolute; top: 17px; width: 1px; height: 9px; background: color-mix(in srgb, var(--ink) 35%, transparent); }
.timeline .tick.half { top: 13px; height: 17px; background: color-mix(in srgb, var(--ink) 55%, transparent); }
.timeline .tick b { position: absolute; top: 31px; left: 50%; transform: translateX(-50%); font-family: var(--f-cond); font-weight: 600; font-size: 10px; letter-spacing: .04em; color: var(--ink-soft); white-space: nowrap; }
.timeline .tick:first-of-type b { transform: none; left: 0; }
.timeline .tick:nth-last-of-type(1) b, .timeline .tick[style*="97.8"] b { transform: translateX(-100%); left: 1px; }
.timeline .ev { position: absolute; top: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 1px; line-height: 1; }
.timeline .ev.away { top: 25px; }
.timeline .ev .ball { font-size: 13px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.timeline .ev em { font-style: normal; font-size: 8px; font-weight: 700; color: var(--ink); }
.timeline .ev.card { top: 3px; }
.timeline .ev.card.away { top: 27px; }
.timeline .ev.card i { display: block; width: 8px; height: 11px; border-radius: 2px; margin: 0; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--shirt) 60%, black); background: var(--event-yellow, #d4a017); }
.timeline .ev.card.red i { background: var(--event-red, #c2102a); }
.timeline .tick.half b { top: 35px; }
.timeline .ev.card i { box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }

/* Timeline marks are tappable; a little pop-up shows minute + player. */
.timeline button.ev { border: 0; padding: 0; margin: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.timeline button.ev::before { content: ""; position: absolute; inset: -9px -5px; }
.timeline button.ev:active { transform: translateX(-50%) scale(1.25); }
.tl-pop { position: absolute; z-index: 60; text-align: left; width: max-content; pointer-events: none; animation: tlpop .16s cubic-bezier(.2,.9,.3,1.2); }
.tl-pop.above { transform-origin: var(--arrow) 100%; }
.tl-pop.below { transform-origin: var(--arrow) 0; }
.board .scorers > div { display: flex; flex-direction: column; align-items: flex-start; }
.board .scorers > div:first-child { align-items: flex-end; }
.board .scorers .scorer { border: 0; padding: 0; margin: 0; background: none; font: inherit; color: inherit; line-height: inherit; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; }
.board .scorers .scorer:active { color: var(--ink); }
.tl-pop-in { display: flex; align-items: center; gap: 9px; padding: 7px 11px 7px 9px; border-radius: 11px; background: rgba(14,14,18,.94); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 .5px rgba(255,255,255,.12); white-space: nowrap; }
.tl-pop-in b { font-family: var(--f-cond); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; padding-right: 9px; border-right: 1px solid rgba(255,255,255,.18); }
.tl-pop-in span { display: flex; flex-direction: column; line-height: 1.15; }
.tl-pop-in strong { font-size: 13px; font-weight: 600; }
.tl-pop-in small { font-size: 11px; color: rgba(255,255,255,.65); }
.tl-pop::after { content: ""; position: absolute; left: var(--arrow); width: 10px; height: 10px; margin-left: -5px; background: rgba(14,14,18,.94); transform: rotate(45deg); border-radius: 2px; }
.tl-pop.above::after { bottom: -4px; }
.tl-pop.below::after { top: -4px; }
@keyframes tlpop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.tl-pop-in small { white-space: normal; }
.tl-pop-in { white-space: normal; }
.tl-pop-in strong, .tl-pop-in b { white-space: nowrap; }
button.chip { border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s; }
button.chip:active { transform: scale(.9); }
/* Add-to-calendar on each "Coming up" row. */
.fx .calrow { flex: none; width: 36px; height: 36px; margin: -4px -6px -4px 4px; display: grid; place-items: center; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fx .calrow svg { width: 18px; height: 18px; }
.fx .calrow:active { transform: scale(.9); background: color-mix(in srgb, var(--text) 16%, transparent); }
.snap .big small { padding: 0 6px; font-size: 11px; line-height: 1.35; }
/* Add to Calendar in an upcoming match's header: ink-on-kit so it reads on every shirt colour. */
.board .calmatch { position: relative; display: flex; align-items: center; gap: 8px; margin: 14px auto 0; height: 40px; padding: 0 18px; border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--ink) 14%, transparent); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.board .calmatch:active { transform: scale(.96); background: color-mix(in srgb, var(--ink) 24%, transparent); }
