/* Box to Box — matchday programme meets TV listings.
   Light: newsprint paper + ink. Dark: floodlit pitch at night. */

:root {
  --paper: #F1ECE2;
  --paper-2: #E8E1D3;
  --paper-3: #DDD4C2;
  --ink: #15130F;
  --ink-2: #5B554A;
  --ink-3: #8A8374;
  --rule: #CFC5B3;
  --accent: #1F5C3A;      /* pitch green */
  --accent-ink: #F1ECE2;
  --live: #D9401F;        /* vermilion */
  --win: #1F7A47;
  --draw: #A7832A;
  --loss: #B4322A;
  --shadow: 0 1px 0 rgba(21, 19, 15, .06);

  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: 'Archivo', system-ui, sans-serif;
  --gutter: 16px;
  --maxw: 860px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1210;
    --paper-2: #161B17;
    --paper-3: #1F2620;
    --ink: #ECE6D8;
    --ink-2: #A39D8F;
    --ink-3: #6F6A60;
    --rule: #28302A;
    --accent: #8FD8A8;
    --accent-ink: #0F1210;
    --live: #FF6B4A;
    --win: #5CC287;
    --draw: #D9B65A;
    --loss: #F0675C;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1210; --paper-2: #161B17; --paper-3: #1F2620;
  --ink: #ECE6D8; --ink-2: #A39D8F; --ink-3: #6F6A60; --rule: #28302A;
  --accent: #8FD8A8; --accent-ink: #0F1210; --live: #FF6B4A;
  --win: #5CC287; --draw: #D9B65A; --loss: #F0675C; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.4 var(--body);
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.masthead {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 3px solid var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 21px; fill: none; stroke: var(--ink); stroke-width: 2.2; transform: translateY(2px); }
.brand-mark circle { fill: var(--live); stroke: none; }
.brand-word {
  font: 900 30px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .01em;
}
.brand-word i {
  font-style: normal;
  font-weight: 600;
  font-size: .55em;
  vertical-align: .38em;
  margin: 0 .22em;
  color: var(--ink-2);
}
.brand-tag {
  margin: 0;
  font: 700 13px/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
@media (max-width: 420px) { .brand-tag { display: none; } }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; outline: none; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

/* ---------- Day strip ---------- */
.days {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.days-scroll {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 0 var(--gutter);
}
.days-scroll::-webkit-scrollbar { display: none; }
.day {
  flex: 1 0 64px;
  scroll-snap-align: center;
  text-align: center;
  text-decoration: none;
  padding: 10px 4px 9px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-2);
}
.day b { display: block; font: 800 22px/1 var(--display); color: var(--ink); }
.day span { display: block; font: 700 11px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 3px; }
.day[aria-current="page"] { border-color: var(--live); color: var(--ink); }
.day[aria-current="page"] b { color: var(--live); }
.day:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px var(--gutter) 4px;
}
.chip {
  border: 1.5px solid var(--ink);
  background: transparent;
  border-radius: 2px;
  padding: 5px 10px 4px;
  font: 700 13px/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip:not([aria-pressed="true"]):hover { background: var(--paper-2); }

/* ---------- Day heading + groups ---------- */
.dayhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 18px var(--gutter) 2px;
}
.dayhead h1 {
  margin: 0;
  font: 800 34px/1 var(--display);
  text-transform: uppercase;
}
.dayhead small { color: var(--ink-2); font-size: 13px; }

.group { margin-top: 18px; }
.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--gutter) 6px;
  border-bottom: 1.5px solid var(--ink);
  margin: 0 var(--gutter);
  padding-left: 0; padding-right: 0;
}
.group-head h2 {
  margin: 0;
  font: 800 19px/1 var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.group-head .count { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.comp-tag {
  font: 800 11px/1 var(--display);
  letter-spacing: .08em;
  padding: 3px 4px 2px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Fixture row ---------- */
.fx {
  display: grid;
  grid-template-columns: 58px 1fr minmax(150px, 210px);
  grid-template-areas: "time teams tv";
  align-items: center;
  column-gap: 14px;
  margin: 0 var(--gutter);
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
}
.fx:hover { background: linear-gradient(90deg, transparent, var(--paper-2) 8%, var(--paper-2) 92%, transparent); }
.fx-time { grid-area: time; font: 800 22px/1 var(--display); }
.fx-time.is-live { color: var(--live); }
.fx-time.is-post { color: var(--ink-3); font-size: 18px; letter-spacing: .06em; }
.fx-time small { display: block; font: 600 11px/1.3 var(--body); color: var(--ink-3); letter-spacing: 0; margin-top: 3px; }
.fx-time.is-live small { color: var(--live); }
.fx-teams { grid-area: teams; min-width: 0; display: grid; gap: 5px; }
.fx-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fx-team .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fx-team.won .nm { font-weight: 700; }
.fx-team .sc { font: 800 20px/1 var(--display); min-width: 18px; text-align: right; }
.fx.is-post .fx-team:not(.won) .sc, .fx.is-post .fx-team:not(.won) .nm { color: var(--ink-2); }
.crest { width: 20px; height: 20px; object-fit: contain; flex: none; }
.crest-blank { width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--paper-3); }
.fx-tv { grid-area: tv; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }

@media (max-width: 600px) {
  .fx {
    grid-template-columns: 52px 1fr;
    grid-template-areas: "time teams" ". tv";
    row-gap: 8px;
  }
  .fx-tv { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- TV channel tag ---------- */
.ch {
  --c: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 3px 8px 3px 0;
  font: 700 12.5px/1.15 var(--body);
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
  white-space: nowrap;
}
.ch::before { content: ""; align-self: stretch; width: 5px; background: var(--c); flex: none; }
.ch span { overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="dark"] .ch::before { box-shadow: inset 0 0 0 1px rgba(236, 230, 216, .28); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ch::before { box-shadow: inset 0 0 0 1px rgba(236, 230, 216, .28); } }
.ch.more { padding-left: 8px; color: var(--ink-2); font-weight: 600; }
.ch.more::before { display: none; }
.no-tv { font-size: 12.5px; color: var(--ink-3); }
.no-tv b { color: var(--ink-2); font-weight: 600; }

/* ---------- Live pulse ---------- */
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- Empty / loading ---------- */
.empty { padding: 40px var(--gutter); text-align: center; color: var(--ink-2); }
.empty h2 { font: 800 26px/1.1 var(--display); text-transform: uppercase; color: var(--ink); margin: 0 0 6px; }
.skel { margin: 18px var(--gutter); }
.skel div { height: 46px; border-bottom: 1px solid var(--rule); background: linear-gradient(90deg, transparent 0, var(--paper-2) 40%, transparent 80%) 0 0 / 200% 100%; animation: sk 1.3s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.notice { margin: 10px var(--gutter) 0; padding: 8px 10px; background: var(--paper-2); font-size: 13px; color: var(--ink-2); border-left: 3px solid var(--draw); }

/* ---------- Match page ---------- */
.back {
  display: inline-block;
  margin: 14px var(--gutter) 0;
  font: 700 13px/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
}
.back:hover { color: var(--ink); }
.hero { padding: 14px var(--gutter) 18px; border-bottom: 1.5px solid var(--ink); margin: 0 var(--gutter); padding-left: 0; padding-right: 0; }
.hero-comp { text-align: center; font: 700 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.hero-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 16px; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; min-width: 0; }
.hero-team img, .hero-team .crest-blank { width: 64px; height: 64px; }
.hero-team .nm { font: 800 20px/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.hero-team:hover .nm { text-decoration: underline; text-underline-offset: 3px; }
.hero-score { text-align: center; }
.hero-score .big { font: 900 54px/0.9 var(--display); white-space: nowrap; }
.hero-score .big.ko { font-size: 44px; }
.hero-score .st { margin-top: 6px; font: 700 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.hero-score .st.live { color: var(--live); }
.hero-meta { text-align: center; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
@media (max-width: 420px) {
  .hero-team img, .hero-team .crest-blank { width: 48px; height: 48px; }
  .hero-team .nm { font-size: 16px; }
  .hero-score .big { font-size: 42px; }
  .hero-score .big.ko { font-size: 34px; }
}

.watch {
  margin: 16px var(--gutter) 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: start;
}
.watch h3 { margin: 4px 0 0; font: 800 15px/1.1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.watch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-list .ch { font-size: 14px; padding: 6px 10px 6px 0; }
.watch-list .ch::before { width: 6px; }

/* Share (match page) */
.share { margin: 12px var(--gutter) 0; display: flex; align-items: center; gap: 10px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 2px;
  padding: 6px 10px 5px 8px;
  font: 800 13px/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.share-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-btn:active { background: var(--ink); color: var(--paper); }
.share-msg { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.tabs {
  display: flex;
  gap: 2px;
  margin: 22px var(--gutter) 0;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 8px 10px 7px;
  font: 800 15px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.tab:hover { color: var(--ink); }
.panel { padding: 14px var(--gutter) 10px; }
.panel-note { color: var(--ink-2); font-size: 14px; padding: 18px 0; }

/* Lineups */
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .lineups { grid-template-columns: 1fr; } }
.lu h4 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline; font: 800 17px/1 var(--display); text-transform: uppercase; border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; }
.lu h4 small { font: 700 14px/1 var(--display); color: var(--ink-2); letter-spacing: .06em; }
.lu ol { list-style: none; margin: 0; padding: 0; }
.lu li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.lu li .n { font: 800 16px/1 var(--display); color: var(--ink-2); text-align: right; }
.lu li .p { font: 700 11px/1 var(--display); letter-spacing: .1em; color: var(--ink-3); }
.lu .subs-h { margin: 12px 0 2px; font: 700 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.marks { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; vertical-align: -1px; }
.m-goal { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.m-yc, .m-rc { width: 7px; height: 10px; border-radius: 1px; background: #E8B923; }
.m-rc { background: var(--loss); }
.m-off, .m-on { font: 800 11px/1 var(--display); }
.m-off { color: var(--loss); }
.m-on { color: var(--win); }

/* Pitch */
.pitch {
  position: relative;
  margin: 0 0 18px;
  aspect-ratio: 68 / 105;
  max-height: 560px;
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 9.09%, color-mix(in srgb, var(--accent) 7%, transparent) 9.09% 18.18%),
    var(--paper-2);
}
.pitch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--ink); opacity: .5; }
.pitch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; transform: translate(-50%, -50%); opacity: .5; }
.pitch .box { position: absolute; left: 26%; right: 26%; height: 11%; border: 2px solid var(--ink); opacity: .5; }
.pitch .box.top { top: -2px; border-top: 0; }
.pitch .box.bot { bottom: -2px; border-bottom: 0; }
.pl { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; width: 22%; z-index: 1; }
.pl .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--display); color: #fff; border: 2px solid var(--ink); }
.pl .lbl { font: 600 10.5px/1.1 var(--body); text-align: center; background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 1px 3px; border-radius: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Timeline */
.tl { position: relative; list-style: none; margin: 0; padding: 0; }
.tl::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: var(--rule); transform: translateX(-50%); }
.tl li { display: grid; grid-template-columns: 1fr 48px 1fr; align-items: center; padding: 6px 0; font-size: 14px; }
.tl .min { grid-column: 2; justify-self: center; font: 800 14px/1 var(--display); background: var(--paper); border: 1.5px solid var(--ink); padding: 4px 5px 3px; border-radius: 2px; z-index: 1; min-width: 38px; text-align: center; }
.tl .ev { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tl .home { grid-column: 1; grid-row: 1; justify-content: flex-end; text-align: right; padding-right: 8px; }
.tl .away { grid-column: 3; grid-row: 1; padding-left: 8px; }
.tl .ev small { display: block; color: var(--ink-3); font-size: 12px; }
.tl .goal .who { font-weight: 700; }

/* Stats */
.stat { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.stat-top { display: flex; justify-content: space-between; font-size: 14px; }
.stat-top b { font: 800 18px/1 var(--display); }
.stat-top span { font: 700 12px/1.4 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.bar { display: flex; height: 6px; gap: 3px; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--ink); }
.bar i + i { background: var(--ink-3); }

/* Lists: form / h2h / team fixtures */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  text-decoration: none;
}
a.row:hover { background: var(--paper-2); }
.row .d { font: 700 13px/1.15 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.row .d small { display: block; font: 500 11px/1.2 var(--body); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.row .t { min-width: 0; display: flex; align-items: center; gap: 8px; }
.row .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t .ha { font: 800 11px/1 var(--display); color: var(--ink-3); width: 12px; flex: none; }
.row .r { display: flex; align-items: center; gap: 8px; font: 800 18px/1 var(--display); white-space: nowrap; }
.row .t .tn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.row .t .tn > span:first-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t .ch { font-size: 11.5px; }
.res { width: 22px; height: 22px; display: inline-grid; place-items: center; font: 800 13px/1 var(--display); color: #fff; border-radius: 2px; }
.res.W { background: var(--win); }
.res.D { background: var(--draw); }
.res.L { background: var(--loss); }
.formblock + .formblock { margin-top: 18px; }
.formblock h4, .subhead { margin: 0 0 4px; font: 800 17px/1 var(--display); text-transform: uppercase; border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.formstrip { display: inline-flex; gap: 3px; margin-left: auto; }
.formstrip .res { width: 18px; height: 18px; font-size: 11px; }
.h2h-sum { display: flex; justify-content: space-around; text-align: center; padding: 6px 0 14px; }
.h2h-sum b { display: block; font: 900 34px/1 var(--display); }
.h2h-sum span { font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); text-align: right; padding: 6px 4px; border-bottom: 1.5px solid var(--ink); }
.tbl th:nth-child(2) { text-align: left; }
.tbl td { padding: 6px 4px; border-bottom: 1px solid var(--rule); text-align: right; }
.tbl td:first-child { color: var(--ink-3); font: 700 14px/1 var(--display); width: 26px; }
.tbl td:nth-child(2) { text-align: left; }
.tbl td:nth-child(2) div, .tbl td:nth-child(2) a { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.tbl td:nth-child(2) span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td:nth-child(2) a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.tbl td:last-child { font-weight: 700; }
.tbl tr.hl td { background: var(--paper-2); font-weight: 700; }
.tbl tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--live); }
.tbl tr.mine td:nth-child(2) span::after { content: " ★"; color: var(--live); }
/* Qualification / relegation zones: a coloured edge on the position number */
.tbl tr[class*="z-"] td:first-child { box-shadow: inset 4px 0 0 var(--zone); padding-left: 9px; }
.z-top { --zone: var(--win); }
.z-second { --zone: var(--draw); }
.z-third { --zone: var(--ink-3); }
.z-down { --zone: var(--loss); }
.z-other { --zone: var(--accent); }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 1px; background: var(--zone); }
@media (max-width: 420px) { .tbl .hide-sm { display: none; } }
@media (max-width: 600px) { .tbl .hide-md { display: none; } }
.more-link { display: inline-block; margin-top: 12px; font: 700 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.more-link:hover { color: var(--ink); }

/* Team / competition hero */
.team-hero { display: flex; align-items: center; gap: 14px; padding: 16px 0 14px; margin: 0 var(--gutter); border-bottom: 3px solid var(--ink); }
.team-hero img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.team-hero h1 { margin: 0; font: 900 38px/0.95 var(--display); text-transform: uppercase; min-width: 0; overflow-wrap: anywhere; }
.team-hero > .follow { margin-left: auto; }
.season { margin: 4px 0 0; font: 700 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 420px) { .team-hero h1 { font-size: 30px; } }

/* Top navigation */
.topnav {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: 10px 10px 8px;
  font: 800 14px/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-3);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.topnav a:first-child { padding-left: 0; }
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.topnav a span { color: var(--live); }

/* Follow button */
.follow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  border: 1.5px solid var(--ink);
  background: transparent;
  border-radius: 2px;
  padding: 6px 10px 5px 8px;
  font: 800 13px/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.follow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.follow[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.follow[aria-pressed="true"] svg { fill: var(--live); stroke: var(--live); }
.follow.compact { border: 0; padding: 6px; }
.follow.compact svg { width: 22px; height: 22px; color: var(--ink-3); }
.follow.compact[aria-pressed="true"] { background: none; }
.follow.compact:hover svg { color: var(--ink); }

/* Day view extras */
a.group-head { text-decoration: none; }
a.group-head:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.group-head .go { margin-left: 4px; color: var(--ink-2); }
.comp-tag.star { background: var(--live); color: #fff; }
.fx-team.is-mine .nm::after { content: " ★"; color: var(--live); font-size: .85em; }
.fx-comp { position: absolute; left: 0; bottom: 9px; font: 800 10px/1 var(--display); letter-spacing: .08em; color: var(--ink-3); }

/* Competitions hub */
.comp-grid { list-style: none; margin: 14px var(--gutter) 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.comp-card { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.comp-card img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.comp-card b { display: block; font: 800 22px/1 var(--display); text-transform: uppercase; }
.comp-card small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.comp-card .go { margin-left: auto; font: 800 20px/1 var(--display); color: var(--ink-3); }
.comp-card:hover b { text-decoration: underline; text-underline-offset: 3px; }
.datehead { margin: 18px 0 0; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); font: 800 18px/1 var(--display); text-transform: uppercase; }
.datehead:first-child { margin-top: 4px; }
.datehead small { font: 600 13px/1 var(--body); text-transform: none; color: var(--ink-2); margin-left: 6px; }
.panel .fx { margin: 0; }

/* Scorers */
.leaders { list-style: none; margin: 0; padding: 0; }
.leaders li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.leaders .rk { font: 800 16px/1 var(--display); color: var(--ink-3); text-align: right; }
.leaders .who { min-width: 0; }
.leaders .who b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .who a, .leaders .who > span { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; min-width: 0; }
.leaders .who a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .who a:hover span { text-decoration: underline; }
.leaders .who .crest { width: 14px; height: 14px; }
.leaders .val { font: 900 26px/1 var(--display); }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news a { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.news img { width: 120px; height: 68px; object-fit: cover; border-radius: 2px; background: var(--paper-2); }
.news b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.news small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.news a:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 420px) { .news a { grid-template-columns: 88px 1fr; } .news img { width: 88px; height: 50px; } }

/* My teams */
.my-list { list-style: none; margin: 10px var(--gutter) 0; padding: 0; }
.my-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.my-team { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.my-team .crest, .my-team .crest-blank { width: 30px; height: 30px; }
.my-team b { font: 800 19px/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.my-team .res { flex: none; }
.my-team:hover b { text-decoration: underline; text-underline-offset: 3px; }
.my-next { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; text-decoration: none; font-size: 14px; }
.my-next small, .my-list li > small { color: var(--ink-3); font-size: 12px; }
.my-next > span { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-next .ch { font-size: 11.5px; }
.my-next:hover > span { text-decoration: underline; }
@media (max-width: 520px) {
  .my-list li { grid-template-columns: 1fr auto; grid-template-areas: "team star" "next next"; row-gap: 8px; }
  .my-team { grid-area: team; }
  .my-list li > .follow { grid-area: star; }
  .my-next, .my-list li > small { grid-area: next; padding-left: 40px; }
}
.my-head { flex-wrap: wrap; }
.my-head small { margin-right: auto; }
.edit-teams {
  align-self: center;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: inherit;
  border-radius: 2px;
  padding: 6px 10px 5px;
  font: 800 13px/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.edit-teams[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
#my-picker[hidden] { display: none; }
#my-picker { margin-top: 8px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px; margin: 0 var(--gutter); }
.pick { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; min-width: 0; }
.pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad { padding-left: var(--gutter); padding-right: var(--gutter); }


/* ---------- Team page: socials, squad, club facts ---------- */
.news a.noimg { grid-template-columns: 1fr; }
.soc-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.hero-soc { margin: 12px var(--gutter) 0; }
.soc {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--ink); border-radius: 2px;
  padding: 5px 9px 4px; font: 700 13px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.soc::after { content: '↗'; font-size: 11px; color: var(--ink-3); }
.soc:hover { background: var(--ink); color: var(--paper); }
.soc-row.big .soc { padding: 8px 12px 7px; font-size: 14px; }
.squad { list-style: none; margin: 0 0 16px; padding: 0; }
.squad li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.squad .no { font: 800 18px/1 var(--display); color: var(--ink-3); text-align: right; }
.squad .pn b { display: block; font-weight: 600; font-size: 15px; }
.squad .pn small { display: flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.squad .pn img { width: 16px; height: 16px; object-fit: contain; }
.squad .socs { display: flex; gap: 4px; }
.squad .soc { padding: 4px 6px 3px; font-size: 11px; border-width: 1px; }
.squad .soc::after { content: none; }
.intro { font-size: 15px; line-height: 1.55; margin: 4px 0 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 16px; margin: 0 0 18px; }
.facts div { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; }

/* ---------- Floating bottom bar (phones) ---------- */
.bottomnav { display: none; }
@media (max-width: 700px) {
  .topnav { display: none; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .bottomnav {
    position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; gap: 2px; padding: 5px;
    width: min(calc(100% - 24px), 420px);
    background: color-mix(in srgb, var(--paper) 78%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  }
  .bottomnav a {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px 5px; border-radius: 13px;
    color: var(--ink-3); text-decoration: none;
    font: 700 10px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }
  .bottomnav a[hidden] { display: none; }
  .bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .bottomnav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bottomnav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
  .bottomnav a[aria-current="page"] svg { stroke-width: 2; }
  .bottomnav a[data-section="my"][aria-current="page"] svg { fill: var(--live); stroke: var(--live); }
  .bottomnav .bn-next img { width: 22px; height: 22px; object-fit: contain; }
}
@media (max-width: 700px) { .bottomnav .bn-next.is-live span { color: var(--live); } }
