/* GoPong — sports scoreboard look: sharp corners, bevelled cuts, condensed italics. */

@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/Barlow-Condensed-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/Barlow-Condensed-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/Barlow-Condensed-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/Barlow-Condensed-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/Barlow-Condensed-800-italic.woff2") format("woff2"); font-weight: 800; font-style: italic; font-display: swap; }

:root {
  --paper: #f3f2ee;
  --panel: #fbfaf7;
  --sunk: #e9e7e1;
  --line: #dcdad3;
  --line-strong: #c4c2ba;
  --ink: #141414;
  --ink-2: #57564f;
  --ink-3: #8b8982;
  --red: #e2231e;
  --red-ink: #b8140f;
  --red-wash: rgba(226, 35, 30, 0.08);
  --up: #18874a;
  --down: #d2361f;
  --board: #161616;
  --board-2: #222222;
  --board-text: #ffffff;
  --board-dim: #9b9a94;
  --board-up: #4fd389;
  --board-down: #ff6a4d;
  --cut: 16px;
  --cut-sm: 8px;
  --head-h: 60px;
  --nav-h: 62px;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --logo-light: block;
  --logo-dark: none;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121212;
    --panel: #1a1a1a;
    --sunk: #202020;
    --line: #2a2a2a;
    --line-strong: #3a3a3a;
    --ink: #f2f1ec;
    --ink-2: #aaa9a2;
    --ink-3: #75746e;
    --red: #ff3d32;
    --red-ink: #ff6158;
    --red-wash: rgba(255, 61, 50, 0.1);
    --up: #46c77a;
    --down: #ff6a4d;
    --board: #1d1d1d;
    --board-2: #272727;
    --logo-light: none;
    --logo-dark: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"], :root[data-theme="amoled"] {
  --paper: #121212;
  --panel: #1a1a1a;
  --sunk: #202020;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --ink: #f2f1ec;
  --ink-2: #aaa9a2;
  --ink-3: #75746e;
  --red: #ff3d32;
  --red-ink: #ff6158;
  --red-wash: rgba(255, 61, 50, 0.1);
  --up: #46c77a;
  --down: #ff6a4d;
  --board: #1d1d1d;
  --board-2: #272727;
  --logo-light: none;
  --logo-dark: block;
  color-scheme: dark;
}
:root[data-theme="amoled"] { --paper: #000; --panel: #0c0c0c; --sunk: #141414; --line: #1f1f1f; --board: #111; --board-2: #1b1b1b; }

/* ---- Base ------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p a, .prose a, .link { color: var(--red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; text-wrap: balance; }
p { margin: 0 0 0.8em; text-wrap: pretty; }
small, .small { font-size: 0.85rem; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; stroke-width: 2; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 26px; height: 26px; flex: none; }
.cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }

/* Condensed italic: the GoPong voice for titles, numbers and labels */
.cond, .h-sec, .page-title, .big, .eyebrow, .nav-label, .chip, .vd, .score, .dt, .rank-no, .date-tile, .stat .v, .sim-out .v {
  font-family: var(--cond);
  font-style: italic;
}

/* ---- Shell ----------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(var(--head-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0 14px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; margin-right: auto; height: 100%; }
.brand img { height: 44px; width: auto; }
.brand .logo-light { display: var(--logo-light); }
.brand .logo-dark { display: var(--logo-dark); }
.top-nav { display: none; }
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { color: var(--red); }
.icon-btn .dot { position: absolute; top: 7px; right: 6px; min-width: 16px; height: 16px; padding: 0 3px; background: var(--red); color: #fff; font: 700 10px/16px var(--sans); text-align: center; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; margin-left: -8px; color: var(--ink); }

.main { width: 100%; max-width: 720px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 36px + env(safe-area-inset-bottom)); }

.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); }
.bottom-nav .nav-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.bottom-nav a[aria-current="page"] { color: var(--ink); }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px; background: var(--red); transform: translateX(-50%) skewX(-30deg); }

@media (min-width: 1000px) {
  .bottom-nav { display: none; }
  .topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1080px) / 2)); gap: 8px; }
  .brand { margin-right: 28px; }
  .brand img { height: 50px; }
  .top-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; }
  .top-nav a { position: relative; padding: 8px 12px; font: 600 italic 1.05rem var(--cond); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink-2); }
  .top-nav a:hover { color: var(--ink); }
  .top-nav a[aria-current="page"] { color: var(--ink); }
  .top-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--red); transform: skewX(-30deg); }
  .top-search { width: 260px; }
  .main { max-width: 1080px; padding: 28px 24px 72px; }
  .wide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: start; }
}
.top-search { display: none; }
@media (min-width: 1000px) { .top-search { display: block; } .top-search-btn { display: none; } }

.banner { display: flex; align-items: center; gap: 8px; padding: 7px 16px; font-size: 0.85rem; background: var(--board); color: var(--board-text); }
.banner a { color: var(--board-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.banner .icon { width: 15px; height: 15px; color: var(--red); }
.banner-warn { background: #fff4d6; color: #6b4b00; }
.banner-warn .icon { color: #6b4b00; }

/* ---- Titles ---------------------------------------------------------------------- */

.page-head { margin: 4px 0 18px; }
.page-title { font-size: 2.3rem; font-weight: 800; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.005em; overflow-wrap: anywhere; }
.page-sub { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 8px; color: var(--ink-2); font-size: 0.95rem; }
.page-sub a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.page-sub a:hover { color: var(--red); text-decoration-color: var(--red); }
.eyebrow { display: inline-block; font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--red); margin-bottom: 4px; }

.section { margin-top: 34px; }
.section:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.h-sec { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
.h-sec::before { content: ""; width: 14px; height: 5px; background: var(--red); transform: skewX(-25deg); flex: none; }
.sec-link { font: 600 italic 1rem var(--cond); text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.sec-link:hover { color: var(--red); }

/* ---- Scoreboard (live points, weekend totals, match score) ------------------------ */

.board {
  position: relative;
  background: var(--board);
  color: var(--board-text);
  padding: 18px 20px 16px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  overflow: hidden;
}
.board::after {
  content: "";
  position: absolute;
  top: 0;
  right: 30px;
  width: 64px;
  height: 100%;
  background: repeating-linear-gradient(115deg, transparent 0 10px, rgba(255, 255, 255, 0.04) 10px 20px);
  pointer-events: none;
}
.board-label { display: flex; align-items: center; gap: 8px; font: 600 italic 1rem var(--cond); text-transform: uppercase; letter-spacing: 0.04em; color: var(--board-dim); }
.board-label a { color: var(--board-text); text-decoration: underline; text-underline-offset: 3px; }
.big { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 6px; font-size: 4.6rem; font-weight: 800; line-height: 0.9; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.big small { font-size: 1.3rem; font-weight: 700; color: var(--board-dim); }
.board .dt { font-size: 1.9rem; }
.board .dt.up { color: var(--board-up); }
.board .dt.down { color: var(--board-down); }
.board .dt.flat { color: var(--board-dim); }
.board-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--board-dim); font-size: 0.92rem; }
.board-foot b { color: var(--board-text); font-weight: 600; }
.board-meter { position: relative; height: 4px; margin: 14px 0 8px; background: var(--board-2); }
.board-meter span { position: absolute; inset: 0 auto 0 0; background: var(--red); }
.board-note { font-size: 0.8rem; color: var(--board-dim); }
.board-note a { color: var(--board-dim); text-decoration: underline; text-underline-offset: 2px; }
a.board { display: block; }
a.board:hover .big { color: #fff; }
.live-dot { width: 8px; height: 8px; background: var(--red); transform: skewX(-15deg); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } html { scroll-behavior: auto; } }

/* ---- Rows ------------------------------------------------------------------------ */

.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rows > li, .rows > .r { border-bottom: 1px solid var(--line); }
.r { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 4px; }
a.r, .r-link { transition: background 0.15s; }
a.r:hover, .r-link:hover { background: var(--red-wash); }
.r .grow { flex: 1; min-width: 0; }
.r .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r .s { margin-top: 1px; font-size: 0.86rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r .e { flex: none; text-align: right; }
.r .pts { font: 700 italic 1.25rem var(--cond); font-variant-numeric: tabular-nums; }
.rank-no { flex: none; width: 28px; font-size: 1.25rem; font-weight: 700; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.rows-head { padding: 14px 4px 6px; font: 600 italic 0.95rem var(--cond); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); border-bottom: 1px solid var(--line); }

/* Victory / defeat marker: a slanted block */
.vd { flex: none; display: inline-grid; place-items: center; width: 26px; height: 28px; color: #fff; font-size: 1rem; font-weight: 700; clip-path: polygon(28% 0, 100% 0, 72% 100%, 0 100%); }
.vd.w { background: var(--up); }
.vd.l { background: var(--down); }

/* Points delta: plain coloured text, sign included */
.dt { font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt.up { color: var(--up); }
.dt.down { color: var(--down); }
.dt.flat { color: var(--ink-3); }
.text-up { color: var(--up); }
.text-down { color: var(--down); }

details.m > summary { list-style: none; cursor: pointer; }
details.m > summary::-webkit-details-marker { display: none; }
details.m[open] > summary { background: var(--red-wash); }
.why { padding: 4px 4px 14px 42px; font-size: 0.88rem; color: var(--ink-2); }
.why b { color: var(--ink); font-weight: 600; }

.tag { display: inline-block; padding: 1px 6px; font: 600 italic 0.8rem var(--cond); text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-2); background: var(--sunk); }
.tag-red { background: var(--red); color: #fff; }
.tag-up { background: var(--up); color: #fff; }

/* ---- Chips: one tap filters, applied immediately --------------------------------- */

.chipbar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -2px; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chipbar + .chipbar { margin-top: 6px; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 16px;
  background: var(--sunk);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: background 0.15s, color 0.15s;
}
.chip:hover { background: var(--line); }
.chip[aria-current="true"], .chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--paper); }
.chip .icon { width: 16px; height: 16px; }
.chip-sep { flex: none; width: 1px; margin: 6px 4px; background: var(--line-strong); }

/* ---- Buttons --------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  background: var(--sunk);
  color: var(--ink);
  font: 600 1rem var(--sans);
  cursor: pointer;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-ink); color: #fff; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink); opacity: 0.88; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn[aria-pressed="true"] .icon { fill: currentColor; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.text-btn { border: 0; background: none; padding: 0; color: var(--ink-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-btn:hover { color: var(--red); }

/* ---- Forms ----------------------------------------------------------------------- */

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.label { font: 600 italic 0.95rem var(--cond); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font: 500 16px var(--sans);
  border-radius: 0;
  appearance: none;
}
.input:focus { outline: none; border-bottom-color: var(--red); }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b8982' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.input-big { font: 700 italic 2.2rem var(--cond); min-height: 64px; font-variant-numeric: tabular-nums; }
.search-box { position: relative; }
.search-box > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-left: 44px; }
.search-xl .input { min-height: 58px; font-size: 1.1rem; background: var(--panel); border-bottom-width: 3px; border-bottom-color: var(--ink); }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--panel); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18); border-top: 2px solid var(--red); }
.suggestions:empty { display: none; }
.suggestions .r { padding: 8px 14px; min-height: 52px; border-bottom: 1px solid var(--line); }
.suggestions .r[aria-selected="true"] { background: var(--red-wash); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); pointer-events: none; transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; transition: transform 0.2s; }
.switch input:checked + span { background: var(--red); }
.switch input:checked + span::after { transform: translateX(20px); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }

/* ---- Panels ---------------------------------------------------------------------- */

.panel { background: var(--panel); padding: 16px; clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.panel + .panel { margin-top: 10px; }
.note { padding: 12px 14px; border-left: 3px solid var(--red); background: var(--panel); font-size: 0.92rem; color: var(--ink-2); }
.note b, .note strong { color: var(--ink); }
.empty { padding: 26px 4px; color: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty b { display: block; font: 700 italic 1.3rem var(--cond); text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }

/* ---- Team matches ---------------------------------------------------------------- */

.match-line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.match-line .team { font-weight: 600; font-size: 0.95rem; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.match-line .team.right { text-align: right; }
.match-line .team.ours { color: var(--red); }
.match-line .sub { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: 0.84rem; color: var(--ink-3); margin-top: -4px; }
a.match-line:hover { background: var(--red-wash); }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; padding: 4px 12px; background: var(--ink); color: var(--paper); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.score.w { background: var(--up); color: #fff; }
.score.l { background: var(--down); color: #fff; }
.score.pending { background: var(--sunk); color: var(--ink-2); font-size: 1rem; font-weight: 600; }

.duel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; }
.duel .team { font: 700 italic clamp(1rem, 4.2vw, 1.4rem)/1.05 var(--cond); text-transform: uppercase; overflow-wrap: break-word; hyphens: auto; }
.duel .team.right { text-align: right; }
.duel .score { font-size: clamp(2rem, 9vw, 2.8rem); min-width: 96px; background: var(--red); color: #fff; }

.game { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.game .p { overflow-wrap: anywhere; color: var(--ink-2); }
.game .p.right { text-align: right; }
.game .p.won { color: var(--ink); font-weight: 600; }
.game .p .dt { font-size: 1rem; margin-left: 4px; }
.game .sets { grid-column: 1 / -1; text-align: center; font-size: 0.78rem; color: var(--ink-3); margin-top: -6px; font-variant-numeric: tabular-nums; }

/* ---- Tables ---------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; padding: 8px 6px; font: 600 italic 0.9rem var(--cond); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table td { padding: 11px 6px; border-bottom: 1px solid var(--line); }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table .strong { font: 700 italic 1.15rem var(--cond); }
.table tr.me td { background: var(--red-wash); }
.table tr.me td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.table td.team { font-weight: 600; min-width: 150px; }

/* ---- Chart ----------------------------------------------------------------------- */

.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); }
.chart .axis-label { fill: var(--ink-3); font: 500 12px var(--sans); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.chart .line-virtual { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-dasharray: 6 5; }
.chart .area { fill: var(--sunk); }
.chart .pt { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.chart .pt-virtual { fill: var(--red); }
.chart .value-label { fill: var(--ink); font: 700 italic 15px var(--cond); }

/* ---- Tournaments ----------------------------------------------------------------- */

.date-tile { flex: none; width: 50px; text-align: center; line-height: 0.95; }
.date-tile .d { display: block; font-size: 1.85rem; font-weight: 800; }
.date-tile .m { display: block; font-size: 0.9rem; font-weight: 600; text-transform: uppercase; color: var(--red); }
.map { height: 400px; background: var(--sunk); margin-bottom: 8px; }
.slot { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.slot .time { font: 700 italic 1.2rem var(--cond); }
.slot.off { opacity: 0.45; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 14px 0; }
.facts > div { background: var(--paper); padding: 10px 12px; }
.facts .k { font: 600 italic 0.85rem var(--cond); text-transform: uppercase; color: var(--ink-3); letter-spacing: 0.03em; }
.facts .v { font-weight: 600; margin-top: 2px; }

/* ---- Simulator ------------------------------------------------------------------- */

.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim-out { padding: 14px 16px; color: #fff; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.sim-out.w { background: var(--up); }
.sim-out.l { background: var(--down); }
.sim-out .k { font: 600 italic 1rem var(--cond); text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.sim-out .v { font-size: 3.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.opp-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto 36px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.opp-row .input { min-height: 42px; }
.opp-row [data-out] { font: 700 italic 1.05rem var(--cond); white-space: nowrap; }
.scenario { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.scenario .k { font: 600 italic 1.1rem var(--cond); text-transform: uppercase; }

/* ---- Stats ----------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.stat { padding: 10px 4px; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 12px; }
.stat .v { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.82rem; color: var(--ink-2); margin-top: 2px; }

/* ---- Misc ------------------------------------------------------------------------ */

.toast-stack { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; pointer-events: none; }
@media (min-width: 1000px) { .toast-stack { left: auto; right: 24px; bottom: 24px; width: 380px; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--board); color: var(--board-text); font-size: 0.93rem; border-left: 4px solid var(--red); animation: toast-in 0.25s ease; }
.toast .icon { color: var(--board-up); }
.toast.error .icon { color: var(--board-down); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* The cut corner and the ball live in layers behind the content, so the search suggestions can overflow the block */
.welcome { position: relative; isolation: isolate; padding: 26px 20px 22px; color: var(--board-text); }
.welcome:focus-within { z-index: 20; }
.welcome::after { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--board); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%); }
.welcome::before { content: ""; position: absolute; z-index: -1; right: -40px; top: -40px; width: 160px; height: 160px; background: radial-gradient(circle at 38% 38%, #ff6e60, #e2231e 55%, #8f0f0a); border-radius: 50%; clip-path: inset(40px 40px 0 0); }
.welcome h1 { position: relative; font: 800 italic 2.7rem/0.92 var(--cond); text-transform: uppercase; max-width: 15ch; }
.welcome p { position: relative; color: var(--board-dim); margin: 10px 0 18px; max-width: 34ch; }
.welcome .search-box { position: relative; }
.welcome .input { background: var(--board-2); color: var(--board-text); border-bottom-color: var(--red); }

.prose { color: var(--ink-2); max-width: 68ch; }
.prose h2 { font: 700 italic 1.4rem var(--cond); text-transform: uppercase; color: var(--ink); margin: 28px 0 8px; }
.prose ul { padding-left: 18px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }

.footer { margin-top: 48px; padding-top: 16px; border-top: 2px solid var(--ink); font-size: 0.82rem; color: var(--ink-3); }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--red); }

.code { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; background: var(--sunk); padding: 1px 5px; overflow-wrap: anywhere; }
pre.code { display: block; padding: 12px; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; font-size: 0.93rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.bar { display: flex; height: 6px; background: var(--sunk); }
.bar .w { background: var(--up); }
.bar .l { background: var(--down); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 22px; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; gap: 10px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---- Print: CGU art. 3, printed federal data carries "FFTT [year]" ---------------- */

.print-only { display: none; }
@media print {
  .topbar, .bottom-nav, .banner, .btn, .chip, .chipbar, .icon-btn, .toast-stack, .no-print { display: none !important; }
  .main { max-width: none; padding: 0; }
  .board, .welcome { background: #fff !important; color: #000 !important; border: 2px solid #000; clip-path: none; }
  .welcome::before, .welcome::after { display: none; }
  .print-only { display: block; font-size: 0.8rem; border-bottom: 1px solid #000; padding-bottom: 6px; margin-bottom: 12px; }
}

/* ---- Progresser: lessons, sessions, video analysis -------------------------------- */

.thumb { flex: none; display: grid; place-items: center; width: 54px; height: 54px; background: var(--board); color: var(--board-text); font: 800 italic 1.3rem var(--cond); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.thumb .icon { color: var(--red); width: 22px; height: 22px; }
.thumb.red { background: var(--red); }
.thumb.red .icon { color: #fff; }

.frame { position: relative; aspect-ratio: 16 / 9; background: var(--board); clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); }
.frame iframe, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.poster { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--board-dim); background: repeating-linear-gradient(115deg, transparent 0 14px, rgba(255, 255, 255, 0.03) 14px 28px); text-align: center; padding: 16px; }
.poster .play { display: grid; place-items: center; width: 64px; height: 64px; background: var(--red); color: #fff; clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.poster .play .icon { width: 26px; height: 26px; fill: currentColor; }
.poster b { font: 700 italic 1.2rem var(--cond); text-transform: uppercase; color: var(--board-text); }

.keys { margin: 0; padding: 0; list-style: none; counter-reset: key; }
.keys li { counter-increment: key; display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.keys li::before { content: counter(key); font: 800 italic 1.9rem/1 var(--cond); color: var(--red); }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { padding: 8px 0 8px 20px; position: relative; border-bottom: 1px solid var(--line); }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 16px; width: 10px; height: 4px; background: var(--down); transform: skewX(-25deg); }
.plain-list.good li::before { background: var(--up); }

label.chip { position: relative; }
label.chip input { position: absolute; opacity: 0; pointer-events: none; }
label.chip:has(input:checked) { background: var(--ink); color: var(--paper); }
label.chip:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-size: 0.93rem; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--red); }
.drop { display: grid; place-items: center; gap: 6px; min-height: 120px; padding: 16px; background: var(--panel); border: 2px dashed var(--line-strong); color: var(--ink-2); text-align: center; cursor: pointer; }
.drop:hover { border-color: var(--red); color: var(--ink); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop b { color: var(--ink); }
.form-block { margin-top: 22px; }
.err { padding: 10px 14px; background: var(--down); color: #fff; font-weight: 600; margin-bottom: 14px; }

.moment { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.moment .time { font: 700 italic 1.15rem var(--cond); font-variant-numeric: tabular-nums; }
a.moment:hover { background: var(--red-wash); }
.stroke-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 52px; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.stroke-row .bar { height: 8px; }

.timer-face { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timer-face .clock { font: 800 italic 3.6rem/1 var(--cond); font-variant-numeric: tabular-nums; }
.block-line { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.block-line .time { font: 700 italic 1.2rem var(--cond); }
.block-line.is-now { background: var(--red-wash); box-shadow: inset 4px 0 0 var(--red); }
.block-line.is-done { opacity: 0.45; }
.board + .wide > div > .section:first-child { margin-top: 28px; }

/* ---- Community: threads, composer, blog ------------------------------------------- */

.lead { font-size: 1.12rem; color: var(--ink); max-width: 62ch; }
.thread { border-top: 1px solid var(--line); }
.msg { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.msg.is-new { animation: msg-in 0.5s ease-out; }
.msg:target { background: var(--red-wash); }
.msg header { display: flex; align-items: baseline; gap: 10px; }
.msg header b { font: 700 italic 1.02rem var(--cond); text-transform: uppercase; letter-spacing: 0.02em; }
.msg time { font-size: 0.8rem; color: var(--ink-3); }
.msg blockquote { margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--line-strong); font-size: 0.86rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg blockquote b { color: var(--ink-2); }
.msg-body { margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
.msg-body p { margin: 0 0 6px; }
.msg-body a { color: var(--red); }
.msg footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 4px; font-size: 0.84rem; }
.msg footer form { margin: 0; }
.msg .text-btn { text-decoration: none; color: var(--ink-3); font-weight: 600; }
.msg .text-btn:hover, .msg .text-btn.on { color: var(--red); }
.report summary { list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report[open] { flex-basis: 100%; }
@keyframes msg-in { from { background: var(--red-wash); } to { background: transparent; } }

.composer { position: sticky; bottom: calc(var(--nav-h, 64px) + env(safe-area-inset-bottom)); z-index: 5; margin: 0 -16px; padding: 12px 16px; background: var(--paper); border-top: 2px solid var(--ink); }
.composer textarea { flex: 1; min-height: 46px; max-height: 180px; resize: none; }
.composer .btn { min-width: 52px; padding-inline: 12px; }
.reply-chip { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding: 4px 10px; border-left: 3px solid var(--red); background: var(--panel); font-size: 0.86rem; color: var(--ink-2); }
.err-inline { color: var(--down); min-height: 0; }
.err-inline:not(:empty) { margin-top: 6px; }
@media (min-width: 1000px) { .composer { bottom: 0; margin: 0 -24px; padding-inline: 24px; } }

.article { max-width: 720px; }
.article-cover { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; margin-bottom: 18px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); }
.article-body { color: var(--ink); font-size: 1.04rem; line-height: 1.65; }
.article-body h3 { font: 700 italic 1.15rem var(--cond); text-transform: uppercase; margin: 22px 0 6px; }
.article-body a { color: var(--red); }
.article-body blockquote { margin: 16px 0; padding: 8px 14px; border-left: 3px solid var(--red); background: var(--panel); }
.article-body img { max-width: 100%; height: auto; }
.cover-board { display: block; width: calc(100% + 40px); margin: -18px -20px 14px; aspect-ratio: 16 / 8; object-fit: cover; }

/* ---- Search: groups, highlights, progress ------------------------------------------ */

mark { background: none; color: var(--red); font-weight: 700; }
.suggestions { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.suggestions .r > .icon:first-child { flex: none; }
.sg-head { padding: 10px 14px 4px; font: 600 italic 0.82rem var(--cond); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.sg-note { padding: 8px 14px; font-size: 0.84rem; color: var(--ink-2); background: var(--red-wash); }
.suggestions .sg-all { min-height: 44px; justify-content: space-between; font: 600 italic 0.95rem var(--cond); text-transform: uppercase; color: var(--red); border-bottom: 0; }
.fuzzy { padding: 10px 14px; border-left: 3px solid var(--red); background: var(--panel); color: var(--ink-2); }
.search-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; pointer-events: none; }
.is-searching .search-progress::after, .search-box.is-searching::after { content: ""; position: absolute; left: 0; bottom: 0; width: 30%; height: 3px; background: var(--red); animation: search-run 0.9s ease-in-out infinite; }
.search-box.is-searching::after { z-index: 2; }
.search-box:has(.search-progress).is-searching::after { content: none; }
@keyframes search-run { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .is-searching .search-progress::after, .search-box.is-searching::after { animation-duration: 2.4s; } }

/* ---- Mon classement: match rows typed by hand ------------------------------------- */

.mrows { border-top: 1px solid var(--line); }
.mrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 40px; grid-template-areas: "date comp del" "opp opp opp" "res delta delta"; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.mrow > input[type="date"] { grid-area: date; }
.mrow > select { grid-area: comp; }
.mrow > input[name$="[opponent]"] { grid-area: opp; }
.mrow > .vd-pick { grid-area: res; }
.mrow > input[name$="[delta]"] { grid-area: delta; }
.mrow > .opp { display: none; }
.mrow > .icon-btn { grid-area: del; }
.mrow .input { min-height: 42px; }
.show-opp .mrow { grid-template-areas: "date comp del" "opp opp opp" "res delta opp2"; grid-template-columns: 150px minmax(0, 1fr) 96px; }
.show-opp .mrow > .opp { display: block; grid-area: opp2; }
.vd-pick { display: flex; gap: 6px; }
.vd-pick label { position: relative; cursor: pointer; }
.vd-pick input { position: absolute; opacity: 0; pointer-events: none; }
.vd-pick .vd { opacity: 0.28; transition: opacity 0.15s; }
.vd-pick input:checked + .vd { opacity: 1; }
.vd-pick input:focus-visible + .vd { outline: 2px solid var(--red); outline-offset: 2px; }
@media (min-width: 760px) {
  .mrow { grid-template-columns: 150px minmax(0, 1.3fr) minmax(0, 1fr) auto 96px 40px; grid-template-areas: "date comp opp res delta del"; }
  .show-opp .mrow { grid-template-columns: 150px minmax(0, 1.2fr) minmax(0, 1fr) auto 84px 84px 40px; grid-template-areas: "date comp opp res delta opp2 del"; }
}
