/* =============================================================================
   SoccerAnalytics.net — styles.css
   Aesthetic: "TACTICAL BOARD" — a tactician's chalkboard meets a continental
   football magazine. Chalkboard dark-green hero with chalk-rough underlined
   headings; faint pitch-marking geometry (halfway line + centre circle + arc)
   as a decorative motif; formation-dot bullets & dividers (player markers);
   figures framed like tactical diagrams; mono uppercase eyebrows; a chalk-draw
   underline on hover and a staggered load reveal.

   Type trio (≤3 families): Archivo (grotesque display + body), Fraunces (serif
   accent for leads / pull-quotes), IBM Plex Mono (data labels / eyebrows).
   Single stylesheet. All tokens are CSS custom properties. No frameworks.
   Sections:
     1. Tokens (:root) + dark theme
     2. Reset & base elements
     3. Layout primitives + pitch-line motif helpers
     4. Site header / nav / search / theme toggle
     5. Hero — chalkboard + pitch decoration
     6. Cards & grids
     7. Category badges / patches
     8. Article: breadcrumb, byline, TOC, body, figures, tables, code
     9. Stat callouts / pull-quotes
    10. Author bio, related, prev/next, ad slots
    11. Footer
    12. Forms (contact)
    13. Motion
    14. Utilities & a11y
   ========================================================================== */

/* 1. TOKENS ----------------------------------------------------------------- */
:root {
  /* Type families — Tactical-board trio (loaded via <link> in <head>). */
  --font-display: "Archivo", "Segoe UI", Helvetica, Arial, sans-serif; /* grotesque display */
  --font-body: "Archivo", "Segoe UI", Helvetica, Arial, sans-serif;    /* body too — continental grotesque */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;          /* serif accent: leads / quotes */
  --font-ui: "Archivo", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Fluid type scale (~1.25 minor third) */
  --step--1: clamp(0.82rem, 0.79rem + 0.12vw, 0.89rem);
  --step-0:  1.0625rem;
  --step-1:  clamp(1.2rem, 1.13rem + 0.34vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.33rem + 0.6vw, 1.8rem);
  --step-3:  clamp(1.75rem, 1.55rem + 1vw, 2.35rem);
  --step-4:  clamp(2.1rem, 1.78rem + 1.6vw, 3.1rem);
  --step-5:  clamp(2.6rem, 2.05rem + 2.7vw, 4.3rem);

  /* Spacing scale */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --measure: 42rem;        /* ~720px article measure */
  --wide: 74rem;           /* index / grid container */
  --radius: 3px;           /* tighter, more diagrammatic corners */
  --radius-lg: 8px;
  --hair: 1px;

  /* LIGHT THEME — "chalk on warm paper, pitch-green ink" */
  --paper: #f4f7f2;        /* chalk white page */
  --paper-2: #efead9;      /* warm paper — sunken panels / patches */
  --surface: #fbfdf9;      /* lifted cards */
  --ink: #14241c;          /* body text — near-black pitch green */
  --ink-soft: #3c4a40;
  --heading: #0c3a28;      /* deep pitch green */
  --brand: #0a5a3f;        /* pitch green — links, marks (KEEP) */
  --brand-strong: #073e2c;
  --board: #0c2b22;        /* chalkboard dark green — hero / feature / footer */
  --accent: #b6d94c;       /* referee-yellow / lime — the chalk highlight */
  --accent-ink: #21300a;   /* readable text on lime */
  --chalk: #f4f7f2;        /* chalk white for on-board text */
  --muted: #5a6b60;        /* meta text */
  --line: #cde0d2;         /* pitch-marking line */
  --line-strong: rgba(12, 58, 40, 0.22);
  --line-soft: rgba(12, 58, 40, 0.08);
  --shadow: 0 1px 2px rgba(12, 40, 28, 0.05), 0 12px 32px -14px rgba(12, 40, 28, 0.22);
  --shadow-sm: 0 1px 2px rgba(12, 40, 28, 0.06);
  --selection: rgba(182, 217, 76, 0.45);

  /* chalk line colour used in SVG/gradient pitch motifs (light) */
  --chalk-line: 12, 58, 40;       /* rgb of --heading, used at low opacity */
  --board-chalk: 244, 247, 242;   /* chalk on board */

  --header-bg: rgba(244, 247, 242, 0.85);
  --code-bg: #0c2b22;
  --code-ink: #e7ede7;

  color-scheme: light;
}

[data-theme="dark"] {
  /* DARK THEME — "the lit chalkboard at full size" */
  --paper: #0a221b;        /* chalkboard green page */
  --paper-2: #0c2b22;      /* board panels */
  --surface: #0f342a;      /* lifted cards */
  --ink: #e7efe6;
  --ink-soft: #b7c8bc;
  --heading: #f4f7f2;
  --brand: #b6d94c;        /* lime as the link/mark colour reads best on board */
  --brand-strong: #cdec6e;
  --board: #061b15;        /* deepest board for hero/footer */
  --accent: #b6d94c;
  --accent-ink: #21300a;
  --chalk: #f4f7f2;
  --muted: #8fa597;
  --line: rgba(205, 224, 210, 0.16);
  --line-strong: rgba(205, 224, 210, 0.28);
  --line-soft: rgba(205, 224, 210, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px -16px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --selection: rgba(182, 217, 76, 0.3);

  --chalk-line: 205, 224, 210;
  --board-chalk: 244, 247, 242;

  --header-bg: rgba(8, 32, 25, 0.82);
  --code-bg: #061b15;
  --code-ink: #dce8da;

  color-scheme: dark;
}

/* 2. RESET & BASE ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--paper);
  /* faint pitch-marking whisper: a centre line cadence drawn very low-opacity */
  background-image:
    repeating-linear-gradient(90deg, transparent 0 159px, var(--line-soft) 159px 160px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--selection); color: var(--heading); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); font-weight: 900; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); margin-top: 2.2em; }
h3 { font-size: var(--step-2); margin-top: 1.6em; }
h4 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; }

p { text-wrap: pretty; }

a {
  color: var(--brand);
  text-decoration-color: color-mix(in srgb, var(--brand) 38%, transparent);
  text-underline-offset: 0.16em;
  text-decoration-thickness: from-font;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--brand-strong); text-decoration-color: var(--accent); }

strong { font-weight: 700; color: var(--heading); }
img { max-width: 100%; height: auto; display: block; }
small { font-size: var(--step--1); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* 3. LAYOUT PRIMITIVES ------------------------------------------------------ */
.container { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.measure { max-width: var(--measure); margin-inline: auto; }
main { display: block; }
.section { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-l); }

/* Mono uppercase eyebrow with a chalk dash + formation dot */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.kicker::before {
  content: "";
  width: 1.8em; height: 0;
  border-top: 2px solid var(--accent);
}

/* eyebrow rule between sections — a pitch line with a centre formation-dot */
.rule {
  border: 0; height: 1px; background: var(--line);
  margin-block: var(--space-l);
  position: relative;
}
.rule::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: var(--accent);
}

/* PITCH-MARKING MOTIF — reusable decorative SVG layer (halfway line, centre
   circle + spot, penalty box + arc). Placed in heroes/sections; pointer-none. */
.pitch-deco { position: absolute; inset: 0; z-index: 1; pointer-events: none; background-repeat: no-repeat; }

/* 4. SITE HEADER ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: var(--hair) solid var(--line);
}
.site-header__bar {
  display: flex; align-items: center; gap: var(--space-m);
  min-height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: var(--heading);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.55rem;
  white-space: nowrap;
}
.brand:hover { color: var(--heading); }
/* brand mark = a tiny tactics board: centre circle + halfway line + spot */
.brand__mark {
  width: 28px; height: 28px; flex: none;
  border: 2px solid var(--brand);
  border-radius: 5px;
  position: relative;
  background:
    radial-gradient(circle at center, transparent 5.5px, var(--brand) 5.5px 6.5px, transparent 6.5px),
    linear-gradient(var(--accent), var(--accent)) center/2px 100% no-repeat;
}
.brand__mark::after { /* centre spot */
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.brand em { font-style: normal; color: var(--brand); }

.site-nav { margin-left: auto; }
.site-nav__list {
  list-style: none; display: flex; align-items: center;
  gap: clamp(0.5rem, 1.6vw, 1.4rem); padding: 0;
}
.site-nav__list a {
  font-family: var(--font-ui);
  font-size: 0.9rem; font-weight: 600; letter-spacing: -0.005em;
  color: var(--ink); text-decoration: none;
  padding: 0.4rem 0.1rem; position: relative; white-space: nowrap;
}
/* chalk-draw underline grows from the left on hover */
.site-nav__list a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0.1rem;
  height: 2px; background: var(--accent); transition: right 0.24s cubic-bezier(0.22,0.61,0.36,1);
}
.site-nav__list a:hover, .site-nav__list a[aria-current="page"] { color: var(--heading); }
.site-nav__list a:hover::after, .site-nav__list a[aria-current="page"]::after { right: 0; }

.header-tools { display: flex; align-items: center; gap: 0.5rem; }

/* Search */
.search { position: relative; }
.search__form { display: flex; align-items: center; }
.search__input {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em;
  width: clamp(8rem, 14vw, 12rem);
  padding: 0.45rem 0.7rem 0.45rem 2rem;
  color: var(--ink);
  background:
    var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b60' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E")
    0.5rem center / 0.95rem no-repeat;
  border: var(--hair) solid var(--line);
  border-radius: var(--radius);
  transition: width 0.2s ease, border-color 0.15s ease;
}
.search__input:focus { border-color: var(--brand); }
.search__results {
  position: absolute; top: calc(100% + 0.5rem); right: 0;
  width: min(22rem, 80vw); max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: var(--hair) solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 0.35rem; z-index: 120;
}
.search__results:empty, .search__results[hidden] { display: none; }
.search__result {
  display: block; padding: 0.6rem 0.7rem; border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.search__result:hover, .search__result[aria-selected="true"] { background: var(--paper-2); color: var(--heading); }
.search__result b { font-family: var(--font-display); font-weight: 700; display: block; color: var(--heading); }
.search__result span { font-size: var(--step--1); color: var(--muted); }
.search__empty { padding: 0.7rem; color: var(--muted); font-size: 0.9rem; }

/* Icon buttons (theme toggle, hamburger) — squared like board tools */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  background: transparent; color: var(--ink);
  border: var(--hair) solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--paper-2); border-color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-toggle { display: none; }
.nav-toggle__bars { position: relative; width: 18px; height: 13px; }
.nav-toggle__bars span,
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; border-radius: 2px; transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 5.5px; }
.nav-toggle__bars::after { bottom: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-5.5px) rotate(-45deg); }

/* 5. HERO — CHALKBOARD ------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(3.2rem, 7vw, 6rem);
  margin-bottom: var(--space-s);
  background: var(--board);
  color: var(--chalk);
  border-bottom: 2px solid var(--accent);
}
/* chalkboard texture: faint chalk smudge + a subtle vignette */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 15% -10%, rgba(var(--board-chalk), 0.06), transparent 60%),
    radial-gradient(80% 70% at 100% 120%, rgba(0,0,0,0.28), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.9;
}
.hero__inner { position: relative; z-index: 2; max-width: 52rem; }
.hero .kicker { color: var(--accent); }
.hero .kicker::before { border-color: var(--accent); }
.hero h1 {
  margin-block: 0.35em 0.35em;
  font-size: var(--step-5);
  color: var(--chalk);
  position: relative; display: inline;
}
/* chalk-rough underline drawn beneath the hero headline */
.hero h1 .chalk-underline,
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 100% 3px;
  padding-bottom: 0.06em;
}
.hero__lede {
  font-family: var(--font-serif);
  font-size: var(--step-1); font-weight: 400;
  color: color-mix(in srgb, var(--chalk) 84%, transparent);
  max-width: 40rem;
}
.hero__cta { margin-top: var(--space-m); display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* pitch markings on the hero: centre circle + halfway line + penalty box/arc,
   drawn in chalk-white at low opacity from the right edge */
.pitch-deco--hero {
  opacity: 0.5; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560' viewBox='0 0 560 560' fill='none' stroke='%23f4f7f2' stroke-opacity='0.5' stroke-width='2'%3E%3Ccircle cx='560' cy='280' r='100'/%3E%3Ccircle cx='560' cy='280' r='4' fill='%23f4f7f2' fill-opacity='0.5' stroke='none'/%3E%3Cpath d='M560 0v560M560 90H360v380h200M560 175H432v210h128'/%3E%3Cpath d='M432 220a86 86 0 0 1 0 120'/%3E%3C/svg%3E");
  background-position: right -50px center; background-size: auto 120%;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.92rem;
  letter-spacing: -0.005em; text-decoration: none;
  padding: 0.7rem 1.3rem; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { color: var(--accent-ink); transform: translateY(-1px); box-shadow: 0 6px 18px -6px rgba(0,0,0,0.45); }
.btn--ghost { background: transparent; color: var(--chalk); border-color: color-mix(in srgb, var(--chalk) 45%, transparent); }
.btn--ghost:hover { background: color-mix(in srgb, var(--chalk) 10%, transparent); color: var(--chalk); border-color: var(--accent); }
/* on a light surface (non-hero) the ghost button needs ink-coloured text */
.section .btn--ghost, .prose .btn--ghost { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.section .btn--ghost:hover, .prose .btn--ghost:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { color: var(--accent-ink); }

/* 6. CARDS & GRIDS ---------------------------------------------------------- */
.grid { display: grid; gap: var(--space-m); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.grid--feature { grid-template-columns: 1.5fr 1fr; gap: var(--space-l); align-items: stretch; }
@media (max-width: 760px) { .grid--feature { grid-template-columns: 1fr; } }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: var(--space-m); flex-wrap: wrap;
  position: relative; padding-top: 0.9rem;
}
/* a pitch line above each section head, with a formation dot at the start */
.section-head::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--line);
}
.section-head::after {
  content: ""; position: absolute; top: -2.5px; left: 0;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.section-head h2 { margin-top: 0; font-size: var(--step-3); }
.section-head__link { font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: var(--hair) solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card__media { aspect-ratio: 16 / 9; background: var(--paper-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card__title { font-size: var(--step-1); margin: 0; line-height: 1.16; letter-spacing: -0.02em; }
.card__title a { color: var(--heading); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card__title a:hover { color: var(--brand); }
.card .badge, .feature .kicker, .feature .card__meta { position: relative; z-index: 2; }
.card__desc { color: var(--ink-soft); font-size: 0.96rem; margin: 0; }
.card__meta {
  margin-top: auto; display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted);
  letter-spacing: 0.01em;
}
.card__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* Featured card — a grid-breaking chalkboard moment with pitch markings */
.feature {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 22rem; padding: var(--space-l);
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--board); color: var(--chalk);
  border: var(--hair) solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.feature::before { /* chalk pitch lines: centre circle arc + halfway line */
  content: ""; position: absolute; inset: 0; opacity: 0.55; pointer-events: none;
  background:
    radial-gradient(circle at 0% 50%, transparent 96px, rgba(var(--board-chalk),0.28) 96px 98px, transparent 99px),
    linear-gradient(rgba(var(--board-chalk),0.24), rgba(var(--board-chalk),0.24)) left 150px top 0 / 2px 100% no-repeat;
}
.feature__cat { color: var(--accent); }
.feature__cat::before { border-color: var(--accent); }
.feature h2 { color: var(--chalk); position: relative; margin: 0.4em 0 0.3em; font-size: var(--step-4); }
.feature h2 a { color: var(--chalk); text-decoration: none; }
.feature h2 a:hover { color: var(--accent); }
.feature h2 a::after { content: ""; position: absolute; inset: 0; }
.feature p { position: relative; color: color-mix(in srgb, var(--chalk) 86%, transparent); max-width: 34rem; }
.feature .card__meta { color: color-mix(in srgb, var(--chalk) 78%, transparent); position: relative; }
.feature .card__meta .dot { background: var(--accent); }

/* 7. CATEGORY BADGES — competition patches ---------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  padding: 0.34em 0.7em 0.32em; border-radius: var(--radius);
  color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
  white-space: nowrap; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.badge::before { /* formation dot marker */
  content: ""; width: 0.5em; height: 0.5em; border-radius: 50%;
  background: var(--accent); flex: none;
}
.badge:hover { background: var(--brand); color: var(--chalk); border-color: var(--brand); }
[data-theme="dark"] .badge { color: var(--brand-strong); }
[data-theme="dark"] .badge:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge--solid { background: var(--brand); color: var(--chalk); border-color: var(--brand); }
[data-theme="dark"] .badge--solid { background: var(--accent); color: var(--accent-ink); }

/* category patch grid on home — a tactics board of beats */
.cat-grid { display: grid; gap: 1px; background: var(--line); border: var(--hair) solid var(--line); border-radius: var(--radius-lg); overflow: hidden; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-patch {
  background: var(--surface); padding: 1.4rem 1.3rem; text-decoration: none;
  display: flex; flex-direction: column; gap: 0.4rem; min-height: 9.5rem;
  position: relative; transition: background 0.18s ease;
}
.cat-patch:hover { background: var(--paper-2); }
/* formation-dot marker bottom-right of each patch, lights up on hover */
.cat-patch::after {
  content: ""; position: absolute; top: 1.4rem; right: 1.3rem;
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--line-strong); transition: background 0.18s ease, border-color 0.18s ease;
}
.cat-patch:hover::after { background: var(--accent); border-color: var(--accent); }
.cat-patch__n { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; color: var(--muted); }
.cat-patch h3 { margin: 0; font-size: var(--step-1); color: var(--heading); letter-spacing: -0.02em; }
.cat-patch p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.cat-patch__count { margin-top: auto; font-family: var(--font-mono); font-size: var(--step--1); color: var(--brand); font-weight: 500; letter-spacing: 0.02em; }
[data-theme="dark"] .cat-patch__count { color: var(--brand-strong); }

/* 8. ARTICLE ---------------------------------------------------------------- */
.article-wrap { padding-block: var(--space-l) var(--space-xl); }
.breadcrumb { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); margin-bottom: var(--space-m); letter-spacing: 0.01em; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4em; padding: 0; }
.breadcrumb li { display: flex; align-items: center; gap: 0.4em; }
.breadcrumb li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }

.article-header { max-width: var(--measure); margin-inline: auto; margin-bottom: var(--space-l); }
.article-header h1 { font-size: var(--step-5); margin-block: 0.25em 0.3em; }
.article-header .dek { font-size: var(--step-1); color: var(--ink-soft); font-family: var(--font-serif); font-weight: 400; font-style: italic; }

.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); letter-spacing: 0.01em;
  margin-top: var(--space-m); padding-top: var(--space-s); border-top: var(--hair) solid var(--line);
}
.byline strong { color: var(--ink); font-weight: 600; font-family: var(--font-ui); }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* Article body layout — measure column with a TOC rail on wide screens */
.article-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-l); }
@media (min-width: 1080px) {
  .article-layout { grid-template-columns: minmax(0, var(--measure)) 15rem; justify-content: center; align-items: start; }
  .article-layout > .prose { grid-column: 1; }
  .article-layout > .toc { grid-column: 2; }
}

.prose { max-width: var(--measure); margin-inline: auto; font-size: 1.1rem; line-height: 1.72; }
.prose > p, .prose > ul, .prose > ol, .prose > figure, .prose > .callout, .prose > .table-wrap, .prose > pre, .prose > blockquote, .prose > h2, .prose > h3 { margin-bottom: 1.15em; }
.prose > p + p { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin-bottom: 0.4em; }
/* formation-dot bullets — small player-marker circles */
.prose ul { list-style: none; padding-left: 1.6em; }
.prose ul > li { position: relative; }
.prose ul > li::before {
  content: ""; position: absolute; left: -1.3em; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); border: 1.5px solid var(--accent);
  box-sizing: border-box;
}
.prose ol > li::marker { color: var(--brand); font-family: var(--font-mono); font-weight: 600; }
/* h2 marked like a tactical annotation: chalk dash + number tick */
.prose h2 { scroll-margin-top: 84px; position: relative; padding-top: 0.5em; }
.prose h2::before { content: ""; position: absolute; top: 0; left: 0; width: 2.4rem; border-top: 3px solid var(--accent); }
.prose h3 { scroll-margin-top: 84px; }
.prose a { font-weight: 600; }
.prose .lead, .prose > p.lead {
  font-size: 1.3rem; line-height: 1.5; color: var(--ink);
  font-family: var(--font-serif); font-weight: 400;
}
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 0.2em 0 0.2em 1.2em;
  font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--heading);
}

/* TOC rail — like a team-sheet */
.toc { position: sticky; top: 84px; font-family: var(--font-ui); }
.toc__title { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.7rem; }
.toc__list { list-style: none; padding: 0; border-left: var(--hair) solid var(--line); display: flex; flex-direction: column; }
.toc__list a { display: block; padding: 0.32rem 0 0.32rem 0.9rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.85rem; line-height: 1.35; }
.toc__list a:hover { color: var(--brand); }
.toc__list a.is-active { color: var(--heading); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 1079px) {
  .toc { position: static; margin: 0 auto var(--space-l); max-width: var(--measure); padding: 1rem 1.2rem; border: var(--hair) solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2); }
  .toc__list { border-left: 0; }
  .toc__list a { padding-left: 0; border-left: 0; }
  .toc__list a.is-active { border-left: 0; }
}

/* Figures — framed like TACTICAL DIAGRAMS: thin ruled frame + mono caption */
figure { margin: 0; }
.prose figure { margin-block: 1.9em; }
figure img {
  width: 100%; border-radius: var(--radius);
  border: var(--hair) solid var(--line-strong);
  background: var(--surface);
  padding: 0.5rem;
}
/* corner ticks on the diagram frame, drawn around the figure */
.prose figure { position: relative; padding: 0.2rem; }
.prose figure::before, .prose figure::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border-color: var(--accent); border-style: solid; opacity: 0.85;
}
.prose figure::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.prose figure::after { bottom: 2.2rem; right: -2px; border-width: 0 2px 2px 0; }
figure.full-bleed { /* grid-breaking full-bleed pass map */
  width: min(100% + 8rem, 100vw); max-width: var(--wide);
  margin-inline: calc(50% - 50vw); margin-inline: auto;
  position: relative; left: 50%; transform: translateX(-50%);
}
@media (min-width: 1080px) { figure.full-bleed { width: 62rem; } }
figcaption {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  margin-top: 0.7rem; line-height: 1.5; padding-left: 0.9rem; letter-spacing: 0.01em;
  border-left: 2px solid var(--accent);
}
figcaption .source { display: block; color: var(--muted); opacity: 0.85; font-size: 0.72rem; margin-top: 0.2rem; }

/* Tables — read like a data sheet */
.table-wrap { overflow-x: auto; border: var(--hair) solid var(--line-strong); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; text-align: left; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); padding: 0.7rem 0.9rem; line-height: 1.45; }
thead th { background: var(--board); color: var(--chalk); text-align: left; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
[data-theme="dark"] thead th { background: var(--surface); color: var(--heading); }
th, td { padding: 0.6rem 0.9rem; border-bottom: var(--hair) solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-2) 50%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
td.num, th.num { text-align: right; font-feature-settings: "tnum"; }
tbody td:first-child { font-weight: 600; color: var(--ink); font-family: var(--font-ui); }

/* Code (tutorials) */
code { font-family: var(--font-mono); font-size: 0.86em; background: color-mix(in srgb, var(--brand) 10%, transparent); padding: 0.1em 0.38em; border-radius: 3px; color: var(--brand-strong); }
[data-theme="dark"] code { color: var(--brand-strong); }
pre {
  font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6;
  background: var(--code-bg); color: var(--code-ink);
  padding: 1.1rem 1.2rem; border-radius: var(--radius-lg); overflow-x: auto;
  border: var(--hair) solid rgba(182,217,76,0.16);
  position: relative;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
pre::before {
  content: attr(data-lang); position: absolute; top: 0; right: 0;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); padding: 0.25em 0.7em; border-bottom-left-radius: var(--radius);
}

/* 9. STAT CALLOUTS / PULL-QUOTES -------------------------------------------- */
.callout {
  background: var(--paper-2); border: var(--hair) solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; font-size: 1rem;
}
[data-theme="dark"] .callout { background: var(--surface); }
.callout__label { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); margin-bottom: 0.35rem; }
[data-theme="dark"] .callout__label { color: var(--brand-strong); }

/* scoreline-style stat: big tabular figures on the chalkboard */
.statline {
  display: flex; flex-wrap: wrap; gap: 1.4rem 2.2rem; align-items: flex-end;
  padding: 1.5rem 1.6rem; margin-block: 1.8em;
  background: var(--board); color: var(--chalk); border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.statline::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border: 2px solid rgba(var(--board-chalk),0.18); border-radius: 50%; }
.statline__item { position: relative; }
.statline__num { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--chalk); }
.statline__num em { font-style: normal; color: var(--accent); }
.statline__label { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in srgb, var(--chalk) 80%, transparent); margin-top: 0.5rem; max-width: 14rem; }

/* inline data highlight — chalk marker swipe */
mark, .mark { background: linear-gradient(transparent 60%, var(--accent) 60% 92%, transparent 92%); color: inherit; padding: 0 0.05em; }

/* AD SLOT placeholder (structurally ready, no ad code) */
.ad-slot { margin-block: 2.2em; min-height: 280px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--paper-2); }
@media (max-width: 600px) { .ad-slot { min-height: 250px; } }
.ad-slot[data-filled] { border: 0; background: none; min-height: 0; }
/* Until a real AdSense unit is pasted in, an ad-slot has no children: hide it
   entirely so no empty dashed placeholder box is shown to visitors or AdSense
   review. A slot with a live <ins class="adsbygoogle"> inside still displays. */
.ad-slot:empty { display: none; }

/* 10. AUTHOR BIO / RELATED / PREV-NEXT -------------------------------------- */
.author-bio {
  max-width: var(--measure); margin: var(--space-xl) auto 0;
  display: flex; gap: 1.2rem; align-items: flex-start;
  padding: 1.5rem; background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--radius-lg);
  position: relative;
}
.author-bio::before { /* a chalk accent tab */
  content: ""; position: absolute; left: -1px; top: 1.5rem; bottom: 1.5rem; width: 3px; background: var(--accent); border-radius: 3px;
}
.author-bio__avatar { width: 64px; height: 64px; flex: none; border-radius: var(--radius); background: var(--board); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; overflow: hidden; }
.author-bio__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-bio h3 { margin: 0 0 0.3rem; font-size: var(--step-1); font-family: var(--font-ui); font-weight: 700; }
.author-bio p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }

.related { max-width: var(--wide); margin-inline: auto; }
.prevnext {
  max-width: var(--measure); margin: var(--space-l) auto 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 560px) { .prevnext { grid-template-columns: 1fr; } }
.prevnext a {
  display: flex; flex-direction: column; gap: 0.3rem; text-decoration: none;
  padding: 1rem 1.2rem; border: var(--hair) solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prevnext a:hover { border-color: var(--brand); background: var(--paper-2); }
.prevnext__dir { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.prevnext__title { font-family: var(--font-display); font-weight: 700; color: var(--heading); line-height: 1.2; letter-spacing: -0.02em; }
.prevnext .next { text-align: right; }

/* 11. FOOTER ---------------------------------------------------------------- */
.site-footer { margin-top: var(--space-2xl); background: var(--board); color: color-mix(in srgb, var(--chalk) 86%, transparent); position: relative; overflow: hidden; border-top: 2px solid var(--accent); }
.site-footer::before { /* pitch markings: centre circle + halfway line rising from the base */
  content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background:
    radial-gradient(circle at 50% 130%, transparent 200px, rgba(var(--board-chalk),0.2) 201px 203px, transparent 204px),
    linear-gradient(rgba(var(--board-chalk),0.16), rgba(var(--board-chalk),0.16)) center top/ 2px 80px no-repeat;
}
.site-footer__inner { position: relative; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-l); padding-block: var(--space-xl) var(--space-l); }
@media (max-width: 760px) { .site-footer__inner { grid-template-columns: 1fr; gap: var(--space-m); } }
.site-footer h4 { color: var(--chalk); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.9rem; }
.site-footer a { color: color-mix(in srgb, var(--chalk) 82%, transparent); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; font-family: var(--font-ui); font-size: 0.9rem; }
.site-footer__brand { font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; letter-spacing: -0.03em; color: var(--chalk); }
.site-footer__tag { max-width: 26rem; font-size: 0.95rem; margin-top: 0.5rem; color: color-mix(in srgb, var(--chalk) 78%, transparent); }
.site-footer__bottom { position: relative; border-top: var(--hair) solid rgba(var(--board-chalk),0.18); padding-block: 1.3rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; justify-content: space-between; font-family: var(--font-mono); font-size: 0.76rem; color: color-mix(in srgb, var(--chalk) 66%, transparent); }

/* 12. FORMS (contact) ------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-family: var(--font-ui); font-weight: 600; font-size: 0.86rem; color: var(--heading); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: 0.7rem 0.9rem; background: var(--surface);
  border: var(--hair) solid var(--line); border-radius: var(--radius);
}
.field input:focus, .field textarea:focus { border-color: var(--brand); outline-offset: 1px; }
.field textarea { min-height: 9rem; resize: vertical; }

/* 13. MOTION ---------------------------------------------------------------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal > * { animation: fade-up 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.reveal > *:nth-child(2) { animation-delay: 0.07s; }
.reveal > *:nth-child(3) { animation-delay: 0.14s; }
.reveal > *:nth-child(4) { animation-delay: 0.21s; }
.reveal > *:nth-child(5) { animation-delay: 0.28s; }
.reveal > *:nth-child(6) { animation-delay: 0.35s; }
.reveal > *:nth-child(7) { animation-delay: 0.42s; }
.reveal > *:nth-child(n+8) { animation-delay: 0.49s; }
.fade-in { animation: fade-up 0.7s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* 14. UTILITIES & A11Y ------------------------------------------------------ */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem;
  border-radius: var(--radius); font-family: var(--font-ui); font-weight: 700;
  transition: top 0.18s ease; text-decoration: none;
}
.skip-link:focus { top: 0.5rem; color: var(--accent-ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: var(--space-s); }
.lede { font-size: var(--step-1); color: var(--ink-soft); }
[hidden] { display: none !important; }

/* No-JS graceful degradation: hide JS-only controls, expose nav links */
.no-js .nav-toggle, .no-js .theme-toggle, .no-js .search { display: none; }

/* Responsive header / mobile nav ------------------------------------------- */
@media (max-width: 1024px) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    position: fixed; inset: 64px 0 auto 0; margin: 0;
    background: var(--paper); border-bottom: var(--hair) solid var(--line);
    box-shadow: var(--shadow); padding: 0.5rem 0 1rem;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s;
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .site-nav[data-open="true"] { transform: none; opacity: 1; visibility: visible; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding-inline: clamp(1rem, 4vw, 2.5rem); }
  .site-nav__list li { border-bottom: var(--hair) solid var(--line-soft); }
  .site-nav__list a { display: block; padding: 0.85rem 0; font-size: 1rem; }
  .site-nav__list a::after { display: none; }
  /* Without JS the menu must still be reachable */
  .no-js .site-nav { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border: 0; background: transparent; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 480px) {
  .search__input { width: 2.2rem; padding-right: 0; }
  .search__input:focus { width: 11rem; padding-right: 0.7rem; }
  .brand { font-size: 1.1rem; }
  .site-header__bar { gap: 0.5rem; }
}

/* =============================================================================
   15. INTERACTIVE TOOLS — calculators + World Cup 2026 simulator
   A "tactical board" instrument set. Each tool is a framed panel (diagram
   corner-ticks + mono labels) that hydrates from /js/tools.js. Works in both
   themes; degrades to a labelled "needs JavaScript" note when JS is off.
   ========================================================================== */

/* Tool hub: grid of instrument cards */
.tool-grid { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin-block: var(--space-l); }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.3rem 1.3rem 1.4rem; text-decoration: none;
  background: var(--surface); border: var(--hair) solid var(--line);
  border-radius: var(--radius-lg); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.tool-card__n { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; color: var(--muted); }
.tool-card h3 { margin: 0; font-size: var(--step-1); color: var(--heading); letter-spacing: -0.02em; }
.tool-card h3 a { text-decoration: none; color: var(--heading); }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tool-card h3 a:hover { color: var(--brand); }
.tool-card p { font-size: 0.93rem; color: var(--ink-soft); margin: 0; }
.tool-card__go { margin-top: auto; font-family: var(--font-mono); font-size: var(--step--1); color: var(--brand); font-weight: 500; letter-spacing: 0.02em; }
[data-theme="dark"] .tool-card__go { color: var(--brand-strong); }

/* The instrument panel */
.tool {
  position: relative; margin-block: 2em; padding: 1.4rem 1.4rem 1.5rem;
  background: var(--surface); border: var(--hair) solid var(--line-strong);
  border-radius: var(--radius-lg);
}
.tool::before, .tool::after {
  content: ""; position: absolute; width: 13px; height: 13px; pointer-events: none;
  border-color: var(--accent); border-style: solid; opacity: 0.85;
}
.tool::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.tool::after { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }
.tool__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.tool__title { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); color: var(--heading); letter-spacing: -0.02em; margin: 0; }
.tool__eyebrow { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); }
[data-theme="dark"] .tool__eyebrow { color: var(--brand-strong); }
.tool__intro { font-size: 0.95rem; color: var(--ink-soft); margin: 0.1rem 0 1.1rem; }
.tool__nojs { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); padding: 0.8rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper-2); }

/* Input rows */
.tool__inputs { display: grid; gap: 1rem 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); align-items: end; }
.tool-field { display: flex; flex-direction: column; gap: 0.35rem; }
.tool-field > label { font-family: var(--font-ui); font-weight: 600; font-size: 0.84rem; color: var(--heading); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tool-field input[type="number"], .tool-field input[type="text"] {
  font-family: var(--font-mono); font-size: 1rem; color: var(--ink);
  padding: 0.6rem 0.7rem; background: var(--paper); width: 100%;
  border: var(--hair) solid var(--line); border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}
.tool-field input:focus { border-color: var(--brand); outline-offset: 1px; }
.tool-field input[type="range"] { width: 100%; accent-color: var(--brand); }
.tool-field__val { font-family: var(--font-mono); font-size: 0.82rem; color: var(--brand); font-weight: 600; }
[data-theme="dark"] .tool-field__val { color: var(--brand-strong); }
.tool-field__hint { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); letter-spacing: 0.01em; }
.tool-field select {
  font-family: var(--font-ui); font-size: 0.9rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); width: 100%; cursor: pointer;
}
.tool-field select:focus { border-color: var(--brand); outline-offset: 1px; }
/* shot-map explorer */
.shotmap__pitch { max-width: 600px; margin: 1.2rem auto 0.4rem; }
.shotmap__svg { width: 100%; height: auto; display: block; }
.shotmap__summary { margin-top: 1rem; }
.shotmap__legend { font-size: 0.82rem; color: var(--muted); text-align: center; margin: 0.4rem auto 0; max-width: 44ch; }
.sm-dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; vertical-align: middle; margin: 0 0.1rem; }
.sm-dot.sm-shot { background: #3a6ea5; opacity: 0.55; }
.sm-dot.sm-goal { background: #e0a500; border: 1px solid #7a5a00; }
.tool__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.1rem; align-items: center; }
.tool__btn {
  font-family: var(--font-ui); font-weight: 700; font-size: 0.9rem; cursor: pointer;
  padding: 0.6rem 1.2rem; border-radius: var(--radius);
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.tool__btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -6px rgba(0,0,0,0.4); }
.tool__btn--ghost { background: transparent; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.tool__btn--ghost:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.tool__status { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.02em; }

/* Output: scoreline-style chalkboard result strip */
.tool__out { margin-top: 1.3rem; }
.tool__out[hidden] { display: none; }
.tool-result {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end;
  padding: 1.3rem 1.4rem; background: var(--board); color: var(--chalk);
  border-radius: var(--radius-lg); position: relative; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.tool-result::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border: 2px solid rgba(var(--board-chalk),0.16); border-radius: 50%; pointer-events: none; }
.tool-result__item { position: relative; min-width: 5.5rem; }
.tool-result__num { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--chalk); }
.tool-result__num em { font-style: normal; color: var(--accent); }
.tool-result__label { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--chalk) 80%, transparent); margin-top: 0.45rem; }

/* Probability bar (win / draw / loss split) */
.prob-bar { display: flex; height: 1.5rem; border-radius: var(--radius); overflow: hidden; margin-top: 1.1rem; border: var(--hair) solid var(--line); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; }
.prob-bar > span { display: grid; place-items: center; color: var(--accent-ink); white-space: nowrap; overflow: hidden; min-width: 0; transition: flex-basis 0.4s ease; }
.prob-bar__win { background: var(--brand); color: var(--chalk); }
.prob-bar__draw { background: color-mix(in srgb, var(--accent) 70%, var(--paper-2)); color: var(--accent-ink); }
.prob-bar__loss { background: color-mix(in srgb, var(--muted) 55%, var(--paper-2)); color: var(--chalk); }
[data-theme="dark"] .prob-bar__win { background: color-mix(in srgb, var(--brand) 75%, #000); }

/* Method / interpretation note blocks under a result */
.tool__method, .tool__interp { margin-top: 1.1rem; font-size: 0.93rem; }
.tool__method { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); background: var(--paper-2); border: var(--hair) solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); padding: 0.8rem 1rem; line-height: 1.55; overflow-x: auto; }
.tool__method b { color: var(--heading); }
.tool__interp { color: var(--ink-soft); border-left: 3px solid var(--accent); padding-left: 0.9rem; }
.tool__interp strong { color: var(--heading); }

/* Mini scoreline matrix (xG outcome tool) */
.score-grid { margin-top: 1.1rem; overflow-x: auto; }
.score-grid table { font-size: 0.74rem; }
.score-grid td.hot { background: color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 700; color: var(--heading); }
.score-grid td.warm { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.score-grid caption { caption-side: top; text-align: left; padding-top: 0; }

/* Simulator: standings + bracket */
.sim-teams { display: grid; gap: 0.5rem; margin-block: 1rem; }
.sim-team-row { display: grid; grid-template-columns: 1.4rem 1fr 5.5rem 5.5rem; gap: 0.5rem; align-items: center; }
.sim-team-row input[type="text"] { font-family: var(--font-ui); }
.sim-team-row .sim-seed { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); text-align: center; }
.sim-odds-table { margin-top: 1.2rem; }
.sim-odds-table .bar-cell { position: relative; }
.sim-odds-table .bar-cell span { position: relative; z-index: 1; }
.sim-odds-table .bar-cell::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); background: color-mix(in srgb, var(--brand) 22%, transparent); }
.sim-bracket { display: flex; gap: 1.2rem; overflow-x: auto; margin-top: 1.3rem; padding-bottom: 0.6rem; }
.sim-round { display: flex; flex-direction: column; justify-content: space-around; gap: 0.5rem; min-width: 8.5rem; }
.sim-round__title { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.sim-slot { font-family: var(--font-mono); font-size: 0.74rem; padding: 0.4rem 0.55rem; border: var(--hair) solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-slot.champ { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-color: var(--accent); }
.sim-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 0.8rem; }

/* "Model only" honesty banner on the simulator */
.tool__disclaimer { font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.5; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 30%, var(--paper-2)); border: var(--hair) solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: var(--radius); padding: 0.7rem 0.9rem; margin-bottom: 1.1rem; }
[data-theme="dark"] .tool__disclaimer { color: var(--chalk); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* Inline "open the full tool" link shown under an embedded calculator */
.tool__more { font-family: var(--font-mono); font-size: 0.76rem; margin-top: 1rem; letter-spacing: 0.01em; }
@media (max-width: 560px) {
  .sim-team-row { grid-template-columns: 1.2rem 1fr; grid-auto-rows: auto; }
  .sim-team-row .sim-seed { grid-row: 1; }
}
