:root {
  --stamp-display: block; --pill-display: none;   /* html.no-stamps flips these: plain pills instead of stamps */
  --bg: #0E1712; --card: #16211A; --card2: #1C2A21; --line: #263528; --line-hi: #3A4F3C;
  --text: #ECF2EA; --muted: #8FA396; --faint: #6B8277; --accent: #39FF88; --bad: #E1614F;
  --track: #223026; --on-accent: #0A120D;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 56px; }
.wrap.wide { max-width: 1120px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; }

/* ---- top bar (shared by every page) ---- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(14,23,18,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-hi); }
.topbar .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 26px; letter-spacing: .06em; text-transform: uppercase; }
.brand b { color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 4px; }
.nav a { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; border-radius: 4px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); border-radius: 0; padding-bottom: 6px; }
.badge-f { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); border-radius: 100px; padding: 3px 11px; white-space: nowrap; }
.res { display: inline-block; font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 11.5px; border-radius: 3px; padding: 2px 8px; }
.res.WIN { color: var(--on-accent); background: var(--accent); } .res.LOSS { color: #fff; background: #5F706A; } .res.PUSH { color: var(--text); background: var(--line-hi); }
.empty, .err { color: var(--muted); padding: 18px 0; font-size: 14px; }
.err { background: rgba(225,97,79,.12); border: 1px solid var(--bad); padding: 14px; border-radius: 4px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- logos: image shown directly on the page background (no circle, ring or fill); initials as plain text if missing ---- */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; vertical-align: middle; }
.av.sm { width: 24px; height: 24px; }
.av img { width: 100%; height: 100%; object-fit: contain; }
.av .ini { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); }
.av.fallback .ini { display: flex; }

/* ---- game page ---- */
.back { display: inline-block; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--muted); padding: 6px 0 12px; }
.hero { background: var(--card); border: 1.5px solid var(--line-hi); border-radius: 4px; padding: 14px 16px 16px; margin-bottom: 12px; }
.hero.featured { border-color: var(--accent); background: linear-gradient(180deg, rgba(57,255,136,.10), rgba(57,255,136,.025)); }
.hero .meta { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.hero .vs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 19px; color: var(--muted); }
.hero .vs .at { color: var(--faint); font-size: 14px; }
.hero .bigpick { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; min-width: 0; }
.hero .bigpick .nm { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: clamp(30px, 9vw, 42px); line-height: 1.05; overflow-wrap: anywhere; }
.hero .bigpick .ln { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: clamp(20px, 6vw, 26px); color: var(--accent); }
.hero .line2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }
.matchstrip { margin-top: 12px; border-top: 1px solid var(--line-hi); padding-top: 10px; }
.matchstrip .sl { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.matchstrip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.matchstrip li { font-size: 13.5px; color: var(--text); padding-left: 18px; position: relative; }
.matchstrip li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.models { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
.mod { background: var(--card); border: 1.5px solid var(--line-hi); border-radius: 4px; padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mlabel { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--faint); }
.pick { display: flex; align-items: center; gap: 8px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 22px; min-width: 0; }
.pick .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .ln { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 14px; color: var(--muted); }
.proj { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--muted); }
.edge { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--faint); }
.saved { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.saved b { color: var(--accent); font-weight: 600; }
.nopick { color: var(--faint); font-style: italic; font-size: 13px; padding: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; white-space: nowrap; }
.chip .k { color: var(--muted); } .chip .v { font-weight: 600; } .chip .n { color: var(--faint); }
.chip.small { border-style: dashed; opacity: .75; }

.pane { background: var(--card); border: 1.5px solid var(--line-hi); border-radius: 4px; padding: 14px 16px 18px; margin-bottom: 12px; min-width: 0; }
.pane h2 { margin: 0 0 8px; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--faint); font-weight: 600; }
.pane .empty { padding: 0; }
.edge-row { border-top: 1px solid var(--line); }
.edge-row:first-of-type { border-top: 0; }
.edge-row > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr minmax(88px, auto); align-items: center; gap: 4px 10px; padding: 11px 0; }
.edge-row > summary::-webkit-details-marker { display: none; }
.edge-name { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 15px; line-height: 1.15; }
.edge-chart { grid-column: 1 / -1; grid-row: 2; position: relative; height: 20px; }
.edge-track { position: absolute; top: 50%; left: 0; right: 0; height: 4px; margin-top: -2px; background: var(--track); border-radius: 2px; }
.edge-center { position: absolute; top: 2px; bottom: 2px; left: 50%; width: 1px; background: var(--line-hi); }
.edge-bar { position: absolute; top: 50%; height: 10px; margin-top: -5px; border-radius: 2px; }
.edge-bar.home { background: var(--accent); } .edge-bar.away { background: var(--muted); }
.edge-verdict { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; text-align: right; color: var(--muted); }
.edge-verdict b.home { color: var(--accent); } .edge-verdict b.away { color: var(--text); } .edge-verdict .x { color: var(--faint); margin-left: 5px; }
.edge-detail { font-size: 13px; color: var(--muted); padding: 0 0 12px; }
.edge-detail p { margin: 0 0 6px; }
.edge-legend { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.sec { margin-bottom: 18px; }
.sec-label { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--faint); margin-bottom: 7px; }
.wp-names { display: flex; justify-content: space-between; gap: 8px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.wp-names .home { color: var(--accent); } .wp-names .away { color: var(--text); }
.wp-bar { display: flex; height: 26px; border-radius: 5px; overflow: hidden; background: var(--track); }
.wp-seg { display: flex; align-items: center; justify-content: center; font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 12px; color: var(--on-accent); min-width: 0; }
.wp-seg.home { background: var(--accent); } .wp-seg.away { background: var(--muted); }
.rg-labels { display: flex; justify-content: space-between; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.rg-labels .away { color: var(--muted); } .rg-labels .home { color: var(--accent); }
.rg-track { position: relative; height: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; margin-bottom: 8px; }
.rg-band { position: absolute; top: 3px; bottom: 3px; background: rgba(57,255,136,.18); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); border-radius: 3px; }
.rg-center { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.rg-marks { position: relative; height: 15px; margin-bottom: 8px; }
.rg-mark { position: absolute; top: 0; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; white-space: nowrap; color: var(--muted); }
.rg-mark.hi { transform: translateX(-100%); } .rg-mark.center { transform: translateX(-50%); color: var(--accent); font-weight: 600; }
.rg-score { display: flex; justify-content: space-between; gap: 8px; font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.rg-score .fav { color: var(--accent); }
.rg-caption { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.drv summary { cursor: pointer; list-style: none; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--faint); padding: 9px 0; border-top: 1px solid var(--line); }
.drv summary::-webkit-details-marker { display: none; }
.drv-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding-top: 8px; }
.drv-name { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.drv-name.home { color: var(--accent); }
.drv-row { margin-bottom: 9px; }
.drv-row .l { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.drv-row .v { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 14px; }
.drv-row.final .v { font-size: 17px; color: var(--accent); }

@media (min-width: 640px) {
  .models { grid-template-columns: 1fr 1fr; }
  .drv-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---- result stamps (swap back to plain pills by adding class "no-stamps" to <html>) ---- */
html.no-stamps { --stamp-display: none; --pill-display: inline-block; }
.res.pill { display: var(--pill-display); }
.stamp { display: var(--stamp-display); position: absolute; z-index: 5; pointer-events: none; height: auto; width: auto; max-width: none; }
