/* AI Football Predictor: "matchday programme" design.
   One idea carried everywhere: a printed football programme / newspaper sports
   page. Cream paper, black ink, one programme red, condensed caps for anything
   you'd see on a scoreboard, a serif for anything you'd read, and rules
   (lines) instead of boxes. No rounded cards, no shadows, no gradients.

   Probability colours follow the ink: home = ink, draw = paper shade,
   away = red. The same three appear in every bar, chart and key. */

:root {
  --paper: #f3eee3;
  --paper-2: #e9e2d2;
  --paper-3: #ddd4c0;
  --ink: #1b1914;
  --ink-2: #47423a;
  --muted: #7b7466;
  --hair: #cbc1ab;
  --red: #c4321c;
  --red-ink: #ffffff;
  --home: var(--ink);
  --draw: #b8ad95;
  --away: var(--red);
  --win: var(--ink);
  --loss: var(--red);
  --heat: 27, 25, 20;
  --cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f;
    --paper-2: #1e1b16;
    --paper-3: #2a261f;
    --ink: #efe8d8;
    --ink-2: #cfc6b2;
    --muted: #958c79;
    --hair: #3a352c;
    --red: #ff6b4f;
    --red-ink: #15130f;
    --draw: #6d6656;
    --heat: 239, 232, 216;
  }
}
:root[data-theme="dark"] {
  --paper: #15130f; --paper-2: #1e1b16; --paper-3: #2a261f; --ink: #efe8d8; --ink-2: #cfc6b2;
  --muted: #958c79; --hair: #3a352c; --red: #ff6b4f; --red-ink: #15130f; --draw: #6d6656; --heat: 239, 232, 216;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--serif); font-optical-sizing: auto;
  font-variant-numeric: tabular-nums lining-nums;
}
a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
img { display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- type ---------- */
.cond, h1, h2, h3, .kicker, th, .nav, .score, .num, .btn, .stamp {
  font-family: var(--cond); font-variant-numeric: tabular-nums;
}
h1 { font-weight: 800; font-size: clamp(2rem, 6vw, 3.4rem); line-height: .98; text-transform: uppercase;
     letter-spacing: -.005em; margin: .2em 0 .25em; }
h2 { font-weight: 700; font-size: 1.55rem; line-height: 1.05; text-transform: uppercase; margin: 0; }
h3 { font-weight: 700; font-size: 1.15rem; text-transform: uppercase; margin: 1.2rem 0 .4rem; }
.kicker { display: block; font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
          color: var(--red); }
.standfirst { font-size: 1.15rem; line-height: 1.5; color: var(--ink-2); max-width: 60ch; margin: 0 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.prose { max-width: 66ch; }
.prose p, .prose li { font-size: 1.05rem; }
.prose li { margin: .35rem 0; }
.note { font-size: .9rem; color: var(--muted); max-width: 72ch; }

/* ---------- masthead ---------- */
.masthead { padding-top: 10px; }
.masthead__edition { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--cond);
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  padding-bottom: 6px; }
.masthead__edition span:last-child { text-align: right; }
.wordmark { display: block; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 10px 0 8px; text-decoration: none; }
.wordmark b { display: block; font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.1rem, 7.4vw, 4.6rem); line-height: .9; letter-spacing: -.01em; }
.wordmark b i { font-style: normal; color: var(--red); }
.wordmark:hover { color: inherit; }
.nav { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 3px double var(--ink); }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 9px 14px 8px; font-weight: 700; font-size: 1rem; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; border-right: 1px solid var(--hair); }
.nav a:first-child { padding-left: 0; }
.nav a:last-child { border-right: 0; }
.nav a[aria-current] { color: var(--red); }

/* ---------- sections ---------- */
.section { margin: 2.6rem 0 0; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  border-top: 3px solid var(--ink); padding-top: 8px; margin-bottom: .9rem; }
.section__head a { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  font-size: .9rem; white-space: nowrap; text-decoration: none; }
.section__head a:hover { color: var(--red); }
.crumbs { font-family: var(--cond); font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 1.1rem 0 0; }
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 .4em; }
.cols { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr) 320px; } .cols--even { grid-template-columns: 1fr 1fr; } }

/* ---------- crest / badge ---------- */
.crest { width: var(--s, 28px); height: var(--s, 28px); object-fit: contain; flex: none; }
.badge { width: var(--s, 28px); height: var(--s, 28px); flex: none; display: inline-grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 50%; font-family: var(--cond); font-weight: 800;
  font-size: calc(var(--s, 28px) * .34); letter-spacing: .02em; }

/* ---------- fixture list ---------- */
.day { margin-bottom: 1.4rem; }
.day__head { font-family: var(--cond); font-weight: 800; font-size: 1.05rem; letter-spacing: .07em;
  text-transform: uppercase; border-bottom: 1.5px solid var(--ink); padding-bottom: 4px; scroll-margin-top: 12px; }
.fx { display: grid; grid-template-columns: 44px minmax(0, 1fr) 76px minmax(0, 1fr) 160px;
  align-items: center; gap: 0 12px; padding: 12px 0; border-bottom: 1px solid var(--hair);
  text-decoration: none; color: inherit; }
.fx:hover { background: var(--paper-2); color: inherit; }
.fx__time { font-family: var(--cond); font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.fx__team { display: flex; align-items: center; gap: 9px; font-family: var(--cond); font-weight: 700;
  font-size: 1.16rem; text-transform: uppercase; letter-spacing: .01em; min-width: 0; }
.fx__team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx__team--home { justify-content: flex-end; text-align: right; }
.fx__probs { font-family: var(--cond); }
.fx__foot { grid-column: 2 / 5; display: flex; justify-content: center; gap: .8rem; align-items: center;
  font-family: var(--cond); font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-top: 4px; }
.fx__foot:empty { display: none; }
@media (max-width: 760px) {
  .fx { grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); row-gap: 8px; padding: 12px 4px; }
  .fx__time { grid-column: 1 / -1; font-size: .85rem; }
  .fx__team { font-size: 1.08rem; gap: 7px; }
  .fx__probs { grid-column: 1 / -1; }
  .fx__foot { grid-column: 1 / -1; margin: 0; }
}

/* scoreboard numerals: predicted = outlined, final = solid ink */
.score { display: flex; justify-content: center; gap: 3px; font-weight: 800; font-size: 1.45rem; line-height: 1; }
.score i { font-style: normal; min-width: 1.45em; padding: .2em 0 .16em; text-align: center; border: 1.5px solid var(--ink); }
.score--final i { background: var(--ink); color: var(--paper); }
.score--lg { font-size: clamp(2.6rem, 9vw, 4.4rem); gap: 6px; }
.score--lg i { border-width: 2.5px; }

/* probability bar: home ink / draw paper-shade / away red */
.pbar { display: flex; height: 9px; background: var(--draw); }
.pbar span { display: block; }
.pbar .h { background: var(--home); }
.pbar .d { background: var(--draw); }
.pbar .a { background: var(--away); }
.pnums { display: flex; justify-content: space-between; font-weight: 700; font-size: .95rem; margin-top: 4px; }
.pnums b:nth-child(2) { color: var(--muted); }
.pnums b:last-child { color: var(--red); }
.pbar--lg { height: 14px; }

/* verdict stamps */
.stamp { display: inline-block; font-weight: 800; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  border: 1.5px solid currentColor; padding: 1px 6px 0; transform: rotate(-2deg); }
.stamp--hit { color: var(--ink); }
.stamp--exact { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.stamp--miss { color: var(--red); }

/* ---------- calendar ---------- */
.cal { width: 100%; border-collapse: collapse; font-family: var(--cond); table-layout: fixed; }
.cal caption { text-align: left; font-weight: 800; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .05em;
  padding-bottom: 6px; }
.cal th { font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; text-align: center;
  background: none; border-bottom: 1.5px solid var(--ink); }
.cal td { text-align: center; padding: 0; height: 38px; border-bottom: 1px solid var(--hair); font-weight: 600; }
.cal td.out { color: var(--hair); }
.cal td a { display: grid; place-items: center; height: 100%; text-decoration: none; background: var(--ink);
  color: var(--paper); font-weight: 800; position: relative; }
.cal td a:hover { background: var(--red); color: var(--red-ink); }
.cal td.today { outline: 2px solid var(--red); outline-offset: -2px; }
.cal td a small { position: absolute; right: 3px; top: 1px; font-size: .6rem; opacity: .7; }
.cal__nav { display: flex; justify-content: space-between; font-family: var(--cond); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; margin-top: 8px; }
.cal__nav a { text-decoration: none; }

/* ---------- round list (season / month) ---------- */
.rounds { list-style: none; margin: 0; padding: 0; }
.rounds li { border-bottom: 1px solid var(--hair); }
.rounds a { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 10px 0; text-decoration: none;
  font-family: var(--cond); font-weight: 700; font-size: 1.15rem; text-transform: uppercase; }
.rounds a:hover { color: var(--red); }
.rounds small { font-weight: 600; font-size: .85rem; color: var(--muted); letter-spacing: .05em; align-self: center; }
.rounds .is-current a { color: var(--red); }

/* ---------- tables ---------- */
.tbl { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: .98rem; }
table.data th { font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  text-align: right; padding: 6px 8px; border-bottom: 1.5px solid var(--ink); color: var(--ink-2); white-space: nowrap; }
table.data td { text-align: right; padding: 8px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data .l { text-align: left; }
table.data .team { display: flex; align-items: center; gap: 9px; font-family: var(--cond); font-weight: 700;
  font-size: 1.08rem; text-transform: uppercase; text-decoration: none; }
table.data .team:hover { color: var(--red); }
table.data td.num, table.data td .num { font-family: var(--cond); font-weight: 700; font-size: 1.05rem; }
table.data tr.cut td { border-bottom: 2px solid var(--ink); }
table.data tr.is-current td { background: var(--paper-2); }
.meter { display: inline-block; height: 8px; background: var(--ink); vertical-align: middle; margin-right: 6px; }

/* ---------- match cover ---------- */
.cover { border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 22px 0 18px; margin-top: .8rem; }
.cover__teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.cover__side { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; text-decoration: none; }
.cover__side b { font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(1.25rem, 4vw, 2.1rem); line-height: 1; }
.cover__side small { font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-size: .8rem; }
.cover__meta { text-align: center; font-family: var(--cond); font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; font-size: .9rem; color: var(--ink-2); margin-top: 14px; }
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.big3 div { padding: 0 4px; }
.big3 div + div { border-left: 1px solid var(--hair); padding-left: 14px; }
.big3 b { display: block; font-family: var(--cond); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1; }
.big3 span { font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; font-size: .82rem; color: var(--muted); }
.big3 div:nth-child(2) b { color: var(--muted); }
.big3 div:nth-child(3) b { color: var(--red); }

/* fact strip: figures separated by rules (replaces stat tiles) */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-bottom: 1px solid var(--hair); }
.facts div { padding: 12px 14px 12px 0; }
.facts div + div { border-left: 1px solid var(--hair); padding-left: 14px; }
.facts b { display: block; font-family: var(--cond); font-weight: 800; font-size: 1.7rem; line-height: 1.05; }
.facts span { font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; font-size: .78rem; color: var(--muted); }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr 1fr; } .facts div:nth-child(odd) { border-left: 0; padding-left: 0; } }

/* score grid */
.heat { border-collapse: collapse; font-family: var(--cond); font-weight: 700; }
.heat th { font-size: .8rem; color: var(--muted); padding: 4px 8px; }
.heat td { width: 3.2rem; height: 2.4rem; text-align: center; background: rgba(var(--heat), var(--a)); border: 1px solid var(--paper); }
.heat td.dark { color: var(--paper); }
.heat td.top { outline: 2.5px solid var(--red); outline-offset: -2.5px; }

/* form squares */
.form { display: inline-flex; gap: 3px; vertical-align: middle; }
.form b { width: 1.45rem; height: 1.45rem; display: inline-grid; place-items: center; font-family: var(--cond);
  font-size: .78rem; font-weight: 800; }
.form .W { background: var(--win); color: var(--paper); }
.form .D { border: 1.5px solid var(--ink-2); color: var(--ink-2); }
.form .L { background: var(--loss); color: var(--red-ink); }

/* finishing-position chart */
.posbars { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; align-items: end; height: 120px; }
.posbars span { background: var(--ink); min-height: 1px; }
.posbars span.mode { background: var(--red); }
.posaxis { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; font-family: var(--cond); font-size: .72rem;
  color: var(--muted); text-align: center; border-top: 1.5px solid var(--ink); padding-top: 3px; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 1.8rem 0 0; font-family: var(--cond);
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pager a { text-decoration: none; }
.pager a:hover { color: var(--red); }

.ad-slot { margin: 2rem 0; min-height: 90px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 4rem; border-top: 4px solid var(--ink); padding: 14px 0 3rem; font-size: .88rem; color: var(--ink-2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-family: var(--cond); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .8rem; font-size: .95rem; }
.site-footer nav a { text-decoration: none; }
.site-footer p { max-width: 80ch; }

/* Night edition: dark crests (Spurs' navy, Fulham/Newcastle black) would vanish on
   dark paper, so they get a thin cream outline that follows the crest's own shape
   (drop-shadows with zero blur), rather than sitting in a disc. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .crest { filter: drop-shadow(0 0 .6px var(--ink)) drop-shadow(0 0 .6px var(--ink)); }
}
:root[data-theme="dark"] .crest { filter: drop-shadow(0 0 .6px var(--ink)) drop-shadow(0 0 .6px var(--ink)); }
/* phones: crest stacked over the name, so the name gets the full column width */
@media (max-width: 760px) {
  .fx { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 8px 8px; }
  .fx__team, .fx__team--home { flex-direction: column; justify-content: center; text-align: center; gap: 5px; font-size: 1rem; }
  .fx__team--home .crest, .fx__team--home .badge { order: -1; }
  .fx__team span { white-space: nowrap; }
  .score { font-size: 1.3rem; }
}

/* Q&A: questions in readable sentence case (the same text is the FAQPage markup) */
.faq h3 { font-family: var(--serif); text-transform: none; font-weight: 600; font-size: 1.1rem; margin: 1.1rem 0 .25rem; }
.faq p { margin: 0 0 .6rem; max-width: 70ch; color: var(--ink-2); }
.analysis .prose p { font-size: 1.08rem; }
