/* ==========================================================================
   The Cricket Space: design system (ds.css)
   Loaded last on every page with <body class="... ds">. It refines the older
   stylesheets (cricket-feel.css, record-lens.css, page styles) into one language:
   near-black pitch greens, chalk text, gold for data, ball-red for wickets and
   live moments. Manrope for words, Big Shoulders Display for numbers and the logo.
   ========================================================================== */

/* ---------- Tokens ----------
   Editorial theme: white pages, near-black ink, one sunshine-yellow accent (light is the
   default; dark comes from the header toggle). Colours that need transparency are RGB
   triples (--ds-*-rgb), so rgba(var(--ds-ink-rgb), .08) flips with the theme. "accent" is a
   deep gold that stays readable as text on white; --ds-yellow is the bright fill colour. */
:root {
  --ds-bg-rgb: 255, 255, 255;
  --ds-surface-rgb: 255, 255, 255;
  --ds-ink-rgb: 17, 17, 17;
  --ds-accent-rgb: 17, 17, 17;
  --ds-red-rgb: 220, 38, 38;
  --ds-green-rgb: 21, 128, 61;
  --ds-blue-rgb: 37, 99, 235;
  --ds-bg: #ffffff;
  --ds-bg-2: #f6f6f4;
  --ds-surface: #ffffff;
  --ds-surface-2: #f6f6f4;
  --ds-surface-3: #efefec;
  --ds-surface-solid: #ffffff;
  --ds-line: #e8e8e6;
  --ds-line-2: #d9d9d6;
  --ds-text: #111111;
  --ds-muted: #6b6b6b;
  --ds-subtle: #6f6f69;
  --ds-gold: rgb(var(--ds-accent-rgb));
  --ds-gold-soft: #fff6cc;
  --ds-accent: rgb(var(--ds-accent-rgb));
  --ds-yellow: #ffd21f;
  --ds-yellow-soft: #fff6cc;
  --ds-grad-yellow: linear-gradient(135deg, #ffe45c 0%, #ffd21f 45%, #ffb020 100%);
  --ds-red: rgb(var(--ds-red-rgb));
  --ds-green: rgb(var(--ds-green-rgb));
  --ds-blue: rgb(var(--ds-blue-rgb));
  --ds-chalk: #111111;
  --ds-on-chalk: #ffffff;
  --ds-glass-blur: none;
  --ds-radius-s: 10px;
  --ds-radius: 14px;
  --ds-radius-l: 20px;
  --ds-shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 24px -12px rgba(17, 17, 17, .12);
  --ds-shadow-lg: 0 24px 60px -28px rgba(17, 17, 17, .28);
  --ds-ring: 0 0 0 3px rgba(255, 196, 0, .45);
  --ds-ease: cubic-bezier(.2, .7, .2, 1);
  --ds-fast: 160ms;
  --ds-mid: 240ms;
  --ds-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ds-num: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page-gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ds-bg-rgb: 13, 13, 13;
  --ds-surface-rgb: 22, 22, 22;
  --ds-ink-rgb: 244, 244, 242;
  --ds-accent-rgb: 255, 210, 31;
  --ds-red-rgb: 248, 113, 113;
  --ds-green-rgb: 74, 222, 128;
  --ds-blue-rgb: 96, 165, 250;
  --ds-bg: #0d0d0d; --ds-bg-2: #141414; --ds-surface: #161616; --ds-surface-2: #1d1d1d; --ds-surface-3: #252525; --ds-surface-solid: #161616;
  --ds-line: #262626; --ds-line-2: #333331;
  --ds-text: #f4f4f2; --ds-muted: #a3a3a0; --ds-subtle: #77776f;
  --ds-gold-soft: #2b2508; --ds-yellow-soft: #2b2508;
  --ds-chalk: #f4f4f2; --ds-on-chalk: #111111;
  --ds-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  --ds-shadow-lg: 0 30px 60px -28px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
html:has(body.ds) { background: var(--ds-bg); overflow-x: clip; }

/* Map the older variables onto the tokens so every page shares one palette. */
body.ds {
  --bg: var(--ds-bg); --panel: var(--ds-surface); --panel2: var(--ds-surface-2);
  --chalk: var(--ds-text); --ink: var(--ds-text); --text: var(--ds-text);
  --muted: var(--ds-muted); --mute: var(--ds-muted); --dim: var(--ds-muted);
  --line: var(--ds-line-2); --gold: var(--ds-gold); --gold2: rgb(var(--ds-accent-rgb));
  --red: var(--ds-red); --red2: rgb(var(--ds-red-rgb)); --orange: var(--ds-red); --green: var(--ds-green);
  background: var(--ds-bg);
  color: var(--ds-text);
  font: 400 16px/1.6 var(--ds-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.ds #ipl-lens { --ink: var(--ds-text); --dim: var(--ds-muted); --line: var(--ds-line-2); --orange: var(--ds-gold); --bg: var(--ds-bg); }
body.ds ::selection { background: rgba(var(--ds-accent-rgb), .35); color: rgb(var(--ds-ink-rgb)); }
body.ds a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
body.ds p { color: var(--ds-muted); }
body.ds :focus-visible { outline: 2px solid var(--ds-gold); outline-offset: 3px; border-radius: 6px; }

/* ---------- Layout ---------- */
body.ds .wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--page-gutter); }
body.ds main.wrap.page, body.ds main.tool-page { max-width: 1200px; }

/* ---------- Typography ---------- */
body.ds h1, body.ds h2, body.ds h3, body.ds h4 { font-family: var(--ds-font); color: var(--ds-text); letter-spacing: -.02em; text-transform: none; }
body.ds h2 { font-weight: 750; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; }
body.ds h3 { font-weight: 700; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.25; }
/* Section-page title: big but calm. Words in Manrope; the gold second line stays as the signature. */
body.ds .tool-heading, body.ds #ipl-lens h1.tool-heading, body.ds .archive-page h1 {
  font: 800 clamp(40px, 6.4vw, 76px)/.98 var(--ds-font); letter-spacing: -.045em; text-transform: none; margin: 8px 0 18px; max-width: 16ch;
}
body.ds .tool-heading span { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--ds-gold); }
body.ds .tool-heading br { display: none; }
body.ds .tool-heading span::before { content: " "; }
body.ds .label, body.ds #ipl-lens .label, body.ds .eyebrow, body.ds .bento-eye {
  font: 650 12px/1.3 var(--ds-font); letter-spacing: .08em; text-transform: uppercase; color: var(--ds-subtle);
}
body.ds .tool-coverage, body.ds .tool-count, body.ds .battle-status { color: var(--ds-muted); font-size: 14px; }
/* Numbers keep the scoreboard face, the site's signature. */
body.ds .tile b, body.ds .bento-num, body.ds .mx-card h3 b, body.ds #ipl-lens .metrics strong, body.ds .num-face { font-family: var(--ds-num); letter-spacing: .01em; }

/* ---------- Header ---------- */
body.ds .site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(var(--ds-bg-rgb), .72);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ds-line);
}
body.ds .site-nav .bar { height: 64px; gap: 20px; max-width: 1200px; }
body.ds .site-nav .logo.d { flex: 0 0 auto; font: 900 22px/1 var(--ds-num); letter-spacing: .03em; color: var(--ds-text); text-decoration: none; white-space: nowrap; }
body.ds .site-nav .logo.d span { color: var(--ds-gold); }
html body.ds .site-nav #site-links { display: flex; align-items: center; gap: 2px; margin-left: auto; font: 600 14px var(--ds-font); color: var(--ds-muted); position: static; flex-direction: row; padding: 0; background: none; border: 0; box-shadow: none; }
html body.ds .site-nav #site-links a { padding: 8px 12px; border-radius: 999px; text-decoration: none; transition: color var(--ds-fast), background var(--ds-fast); }
html body.ds .site-nav #site-links a[aria-current="page"] { color: var(--ds-text); background: rgba(var(--ds-ink-rgb), .08); }
html body.ds .site-nav #site-links .links-cta { display: none; }
body.ds .site-nav .bar > .btn, body.ds .site-nav .nav-cta {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; margin: 0;
  background: var(--ds-chalk); color: rgb(var(--ds-bg-rgb)); font: 700 14px var(--ds-font); letter-spacing: -.01em; text-decoration: none; border: 0;
  transition: transform var(--ds-fast) var(--ds-ease), background var(--ds-fast);
}
html body.ds .site-nav .bar > .nav-toggle { display: none; }
body.ds .site-nav .mobile-contact { display: none; }

@media (max-width: 960px) {
  body.ds .site-nav .bar { gap: 10px; }
  html body.ds .site-nav .bar > .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto; height: 38px; padding: 0 14px;
    border: 1px solid var(--ds-line-2); border-radius: 999px; background: rgba(var(--ds-ink-rgb), .04); color: var(--ds-text); font: 650 14px var(--ds-font); cursor: pointer;
  }
  body.ds .site-nav .bar > .btn { display: none; }
  /* Full-height sheet under the bar */
  /* The header's backdrop-filter makes it the containing block, so the sheet is sized from it. */
  html body.ds .site-nav #site-links {
    position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - 64px); height: calc(100dvh - 64px); display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 18px var(--page-gutter) 32px; margin: 0; background: rgba(var(--ds-bg-rgb), .98); border: 0; border-radius: 0; box-shadow: none;
    font: 700 24px/1.2 var(--ds-font); letter-spacing: -.02em; color: var(--ds-text);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity var(--ds-mid) var(--ds-ease), transform var(--ds-mid) var(--ds-ease), visibility 0s linear var(--ds-mid);
    overflow-y: auto;
  }
  html body.ds .site-nav #site-links.open { display: flex; grid-template-columns: none; opacity: 1; visibility: visible; transform: none; transition: opacity var(--ds-mid) var(--ds-ease), transform var(--ds-mid) var(--ds-ease); }
  html body.ds .site-nav #site-links a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--ds-line); background: none; }
  html body.ds .site-nav #site-links a[aria-current="page"] { color: var(--ds-gold); background: none; }
  html body.ds .site-nav #site-links .links-cta { display: inline-flex; justify-content: center; margin-top: 20px; padding: 14px; border: 0; border-radius: 999px; background: var(--ds-chalk); color: rgb(var(--ds-bg-rgb)); font-size: 16px; }
  body.ds.menu-open { overflow: hidden; }
}

/* ---------- Buttons ---------- */
body.ds .ds-btn, body.ds .btn:not(.d), body.ds .ap-cta, body.ds .bento-send, body.ds #pv-share, body.ds #pv-card {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  font: 700 15px var(--ds-font); letter-spacing: -.01em; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  background: var(--ds-chalk); color: rgb(var(--ds-bg-rgb)); box-shadow: none;
  transition: transform var(--ds-fast) var(--ds-ease), background var(--ds-fast), border-color var(--ds-fast), color var(--ds-fast);
}
body.ds .ds-btn:active { transform: translateY(0) scale(.98); }
body.ds .ds-btn.ghost, body.ds #pv-card { background: rgba(var(--ds-ink-rgb), .04); color: var(--ds-text); border-color: var(--ds-line-2); }
body.ds button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Pills, segmented controls, tool links ---------- */
body.ds .tool-pills { gap: 6px; margin-bottom: 16px; }
body.ds .tool-pills button, body.ds #ipl-lens .tool-pills button {
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ds-line-2); background: rgba(var(--ds-ink-rgb), .03);
  color: var(--ds-muted); font: 650 14px var(--ds-font); box-shadow: none; transition: color var(--ds-fast), background-color var(--ds-fast), border-color var(--ds-fast);
}
body.ds .tool-pills :is(.active, [aria-pressed="true"]), body.ds #ipl-lens .tool-pills :is(.active, [aria-pressed="true"]) {
  background: var(--ds-chalk); color: rgb(var(--ds-bg-rgb)); border-color: var(--ds-chalk); box-shadow: none;
}
body.ds .tool-links { padding: 4px; gap: 2px; border-color: var(--ds-line); background: rgba(var(--ds-ink-rgb), .025); margin-bottom: 28px; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
body.ds .tool-links::-webkit-scrollbar { display: none; }
body.ds .tool-links a { white-space: nowrap; padding: 8px 14px; font: 650 13px var(--ds-font); color: var(--ds-muted); transition: color var(--ds-fast), background var(--ds-fast); }
body.ds .tool-links [aria-current] { background: rgba(var(--ds-ink-rgb), .1); color: var(--ds-text); }

/* ---------- Inputs & filters ---------- */
body.ds .tool-filter, body.ds .battle-filters { padding: 14px; gap: 10px; border-radius: var(--ds-radius-l); border: 1px solid var(--ds-line); background: var(--ds-bg-2); backdrop-filter: none; }
body.ds .tool-filter label, body.ds #ipl-lens label { font: 600 12.5px var(--ds-font); color: var(--ds-muted); letter-spacing: 0; }
body.ds :is(.tool-filter, .tool-picker, .tool-compare, #ipl-lens, .pv-controls, .mx-controls) :is(input, select) {
  height: 44px; border-radius: var(--ds-radius-s); border: 1px solid var(--ds-line-2); background-color: var(--ds-surface); color: var(--ds-text);
  font: 600 14.5px var(--ds-font); padding-inline: 14px; transition: border-color var(--ds-fast), background-color var(--ds-fast);
}
body.ds :is(.tool-filter, .tool-picker, .tool-compare, #ipl-lens) select { padding-right: 36px; }
body.ds :is(.tool-filter, .tool-picker, .tool-compare, #ipl-lens) :is(input, select):hover { border-color: rgba(var(--ds-ink-rgb), .26); }
body.ds :is(.tool-filter, .tool-picker, .tool-compare, #ipl-lens) :is(input, select):focus { outline: none; border-color: var(--ds-gold); box-shadow: var(--ds-ring); }
body.ds .tool-filter button, body.ds #battle-reset, body.ds #battle-swap, body.ds #battle-clear {
  height: 44px; border-radius: 999px; border: 1px solid var(--ds-line-2); background: transparent; color: var(--ds-text); font: 650 14px var(--ds-font); padding: 0 16px;
}
body.ds textarea { border-radius: var(--ds-radius); border: 1px solid var(--ds-line-2); background: var(--ds-surface); color: var(--ds-text); font: 500 15px/1.5 var(--ds-font); }
body.ds textarea:focus { outline: none; border-color: var(--ds-gold); box-shadow: var(--ds-ring); }

/* ---------- Cards & panels ---------- */
body.ds .tool-panel, body.ds #ipl-lens .panel {
  background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-l); box-shadow: var(--ds-shadow); padding: clamp(16px, 2.4vw, 28px);
}
body.ds .tool-panel::before { display: none; }
body.ds .tool-panel h2, body.ds #ipl-lens .panel h2 { font: 750 clamp(22px, 2.6vw, 30px)/1.15 var(--ds-font); letter-spacing: -.02em; margin: 4px 0 18px; }
body.ds .tool-panel .eyebrow, body.ds #ipl-lens .eyebrow { color: var(--ds-gold); letter-spacing: .1em; font-weight: 700; }
body.ds .tile, body.ds .battle, body.ds .mx-card, body.ds .chart, body.ds .phase-profile, body.ds #ipl-lens .battle-result .phase-profile {
  background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-l); box-shadow: var(--ds-shadow);
}
body.ds .tile { padding: 18px 20px; transition: border-color var(--ds-mid), transform var(--ds-mid) var(--ds-ease); }
body.ds .tile b { color: var(--ds-text); font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); }
body.ds .tile span { color: var(--ds-muted); font-size: 13px; }
body.ds .phase-chip, body.ds #ipl-lens .battle-result .phase-chip { border-radius: 999px; font: 650 12.5px var(--ds-font); padding: 4px 12px; background: var(--ds-gold-soft); border-color: transparent; }
body.ds #ipl-lens .battle-result .phase-chip-none, body.ds #ipl-lens .battle-result .phase-chip.form-even, body.ds #ipl-lens .battle-result .phase-chip.form-none { background: rgba(var(--ds-ink-rgb), .05); }
body.ds #ipl-lens .battle-result .phase-chip.form-up { background: rgba(var(--ds-green-rgb), .12); }
body.ds #ipl-lens .battle-result .phase-chip.form-down { background: rgba(var(--ds-red-rgb), .12); }
body.ds .battle-coverage-warning { border-left-color: var(--ds-gold); border-radius: 0 var(--ds-radius-s) var(--ds-radius-s) 0; background: var(--ds-gold-soft); font-size: 13.5px; }

/* ---------- Tables ---------- */
body.ds .tool-table, body.ds #ipl-lens .table-wrap { border: 1px solid var(--ds-line); border-radius: var(--ds-radius); background: var(--ds-bg-2); }
body.ds .tool-table th, body.ds #ipl-lens th {
  background: var(--ds-surface-2); color: var(--ds-subtle); font: 650 11.5px var(--ds-font); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--ds-line);
}
body.ds .tool-table td, body.ds #ipl-lens td { border-bottom: 1px solid var(--ds-line); font: 500 14px/1.4 var(--ds-font); color: var(--ds-text); font-variant-numeric: tabular-nums; }
body.ds .tool-table tbody tr:last-child td, body.ds #ipl-lens tbody tr:last-child td { border-bottom: 0; }
body.ds .tool-table tbody tr, body.ds #ipl-lens tbody tr { transition: background var(--ds-fast); }
body.ds .tool-table td:nth-child(2) { color: inherit; }
body.ds #ipl-lens .battle-result tr.selected { background: var(--ds-gold-soft); }

/* ---------- Footer ---------- */
body.ds .site-footer { border-top: 1px solid var(--ds-line); margin-top: clamp(48px, 8vw, 96px); padding: 48px 0 32px; background: var(--ds-bg); }
body.ds .site-footer .wrap { display: block; }
body.ds .footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; }
body.ds .footer-brand .logo.d { font: 900 22px/1 var(--ds-num); letter-spacing: .03em; color: var(--ds-text); text-decoration: none; text-transform: uppercase; }
body.ds .footer-brand .logo.d span { color: var(--ds-gold); }
body.ds .footer-brand p { margin: 12px 0 0; max-width: 34ch; font-size: 14px; }
body.ds .footer-col h2 { font: 650 12px var(--ds-font); letter-spacing: .08em; text-transform: uppercase; color: var(--ds-subtle); margin: 4px 0 12px; }
body.ds .footer-col a { display: block; padding: 5px 0; color: var(--ds-muted); font-size: 14.5px; text-decoration: none; transition: color var(--ds-fast); }
body.ds .footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ds-line); color: var(--ds-subtle); font-size: 13px; }
body.ds .footer-base a { color: var(--ds-muted); text-decoration: none; }
@media (max-width: 760px) {
  body.ds .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ds .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Motion ---------- */
@keyframes ds-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.ds .ds-reveal { animation: ds-rise .35s var(--ds-ease) both; }
body.ds .ds-reveal-2 { animation: ds-rise .35s .08s var(--ds-ease) both; }
body.ds .ds-reveal-3 { animation: ds-rise .35s .16s var(--ds-ease) both; }
@media (prefers-reduced-motion: reduce) {
  body.ds *, body.ds *::before, body.ds *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- States ---------- */
body.ds .ds-loading { color: var(--ds-muted); }
body.ds .finder-empty, body.ds .hint { color: var(--ds-muted); }

/* ==========================================================================
   Homepage
   ========================================================================== */
body.ds.home-page .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding: clamp(40px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
body.ds .hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 6px 12px 6px 10px; border: 1px solid var(--ds-line-2); border-radius: 999px; font: 650 12.5px var(--ds-font); color: var(--ds-muted); letter-spacing: .02em; }
body.ds .hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ds-red); box-shadow: 0 0 0 4px rgba(var(--ds-red-rgb), .18); }
body.ds .hero-title, body.ds.home-page .hero h1.hero-title {
  font: 800 clamp(48px, 8.4vw, 112px)/.95 var(--ds-font); letter-spacing: -.055em; margin: 0 0 22px; color: var(--ds-text); max-width: 11ch;
}
body.ds .hero-title em { font-style: normal; color: var(--ds-gold); display: block; }
body.ds.home-page .hero .sub { font: 450 clamp(17px, 1.7vw, 20px)/1.55 var(--ds-font); color: var(--ds-muted); max-width: 42ch; margin: 0 0 30px; }
body.ds .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
body.ds .hero-actions .ds-btn { min-height: 50px; padding: 0 24px; font-size: 16px; }
body.ds.home-page .hero-social a { min-height: 40px; padding: 0 14px; border: 1px solid var(--ds-line); border-radius: 999px; font: 600 14px var(--ds-font); color: var(--ds-muted); text-decoration: none; transition: color var(--ds-fast), border-color var(--ds-fast); }
body.ds .hero-wheel { width: 100%; max-width: 520px; justify-self: end; filter: drop-shadow(0 40px 60px rgba(var(--ds-bg-rgb), .45)); }
body.ds.home-page .strip { background: var(--ds-bg-2); border-block: 1px solid var(--ds-line); }
body.ds.home-page .strip b { font: 800 18px var(--ds-num); letter-spacing: .04em; }
body.ds.home-page .strip em { font: 500 14px var(--ds-font); color: var(--ds-subtle); }

/* Bento → calm card grid */
body.ds .bento-bento { gap: 14px; }
body.ds .bento-card {
  background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-l); box-shadow: var(--ds-shadow);
  padding: clamp(20px, 2.4vw, 28px); text-decoration: none; color: var(--ds-text);
  transition: transform var(--ds-mid) var(--ds-ease), border-color var(--ds-mid), background var(--ds-mid);
}
body.ds .bento-card h2 { font: 750 clamp(20px, 2vw, 24px)/1.2 var(--ds-font); letter-spacing: -.025em; margin: 10px 0 8px; }
body.ds .bento-card p { font-size: 15px; line-height: 1.55; color: var(--ds-muted); }
body.ds .bento-big { font: 800 clamp(28px, 3.6vw, 44px)/1.05 var(--ds-font) !important; letter-spacing: -.04em; }
body.ds .bento-link { font: 650 14px var(--ds-font); color: var(--ds-text); display: inline-flex; gap: 6px; margin-top: auto; }
body.ds .bento-link em { font-style: normal; transition: transform var(--ds-fast) var(--ds-ease); }
body.ds .bento-eye.bento-red { color: var(--ds-red); }
body.ds .bento-cta { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-l); }
body.ds .bento-cta h2 { font: 800 clamp(28px, 3.6vw, 44px)/1.05 var(--ds-font); letter-spacing: -.04em; }

@media (max-width: 860px) {
  body.ds.home-page .hero { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  body.ds .hero-wheel { justify-self: center; max-width: 360px; order: -1; margin-bottom: -8px; }
}
@media (max-width: 480px) {
  body.ds .hero-actions .ds-btn { flex: 1 1 100%; }
  body.ds .hero-wheel { max-width: 240px; }
}

/* Some older page styles target bare nav/footer elements; keep the shared footer immune. */
body.ds .site-footer, body.ds footer.site-footer { display: block; padding: 48px 0 32px; font-size: 14px; color: var(--ds-muted); }
body.ds .site-footer nav.footer-col { display: block; gap: 0; font-size: 14.5px; }

/* ==========================================================================
   Overrides for page styles that load after this file (inline <style> in the body).
   `html body.ds` adds one step of specificity so the shared language wins.
   ========================================================================== */
/* The header now carries site navigation, so the per-page tool-link bars are redundant. */
html body.ds .tool-links { display: none; }

/* Homepage article label: readable red on a soft red chip. */
html body.ds .bento-eye.bento-red { background: rgba(var(--ds-red-rgb), .14); color: rgb(var(--ds-red-rgb)); border-color: transparent; }

/* Record Book "Show more" and other plain buttons inside tool pages. */
html body.ds #more { min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ds-line-2); background: rgba(var(--ds-ink-rgb), .04); color: var(--ds-text); font: 650 14px var(--ds-font); margin-top: 18px; }

/* Player Battle */
html body.ds #ipl-lens .panel th, html body.ds #ipl-lens .battle-result th, html body.ds #ipl-lens th { background: var(--ds-surface-2); color: var(--ds-subtle); }
html body.ds #ipl-lens .panel, html body.ds #ipl-lens .tool-panel { background: var(--ds-surface); border: 1px solid var(--ds-line); }
html body.ds #ipl-lens button:not(.similar-name):not(.phase-chip):not([data-competition]):not([data-view]):not(.battle-suggestions button) {
  background: transparent; border: 1px solid var(--ds-line-2); border-radius: 999px; color: var(--ds-text); font: 650 14px var(--ds-font); min-height: 40px; padding: 0 16px;
}
html body.ds #ipl-lens .tool-pills button[data-competition], html body.ds #ipl-lens .tool-pills button[data-view] { border-radius: 999px; }
html body.ds #ipl-lens .tool-picker { background: var(--ds-surface-2); border: 1px solid var(--ds-line); box-shadow: none; border-radius: var(--ds-radius); }
html body.ds #ipl-lens .tool-picker::before, html body.ds #ipl-lens .tool-picker::after { display: none; }
html body.ds #ipl-lens input, html body.ds #ipl-lens select { background-color: var(--ds-surface); border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius-s); color: var(--ds-text); }
html body.ds #ipl-lens input:focus, html body.ds #ipl-lens select:focus { border-color: var(--ds-gold); box-shadow: var(--ds-ring); outline: none; }
html body.ds #ipl-lens .battle-suggestions { background: var(--ds-surface-2); border: 1px solid var(--ds-line-2); border-radius: var(--ds-radius); box-shadow: 0 20px 40px -20px rgb(var(--ds-bg-rgb)); }
html body.ds #ipl-lens .battle-suggestions button { background: none; border: 0; border-radius: var(--ds-radius-s); color: var(--ds-text); }
html body.ds #ipl-lens .battle-suggestions button:hover, html body.ds #ipl-lens .battle-suggestions button:focus { background: rgba(var(--ds-ink-rgb), .06); }
html body.ds #ipl-lens h1, html body.ds .v2 #ipl-lens h1 { font: 800 clamp(40px, 6.4vw, 76px)/.98 var(--ds-font); letter-spacing: -.045em; text-transform: none; margin: 6px 0 22px; }
html body.ds #ipl-lens h1 span { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--ds-gold); }
html body.ds #ipl-lens .battle-result .phase-profile { background: var(--ds-surface); border-color: var(--ds-line); }
html body.ds #ipl-lens .battle-result .form-spark rect { fill: var(--ds-gold); }
html body.ds #ipl-lens .battle-result .phase-bar { background: rgba(var(--ds-ink-rgb), .07); }
html body.ds #ipl-lens .battle-result .phase-bar-fill { background: var(--ds-gold); }
html body.ds #ipl-lens .panel-head .eyebrow { color: var(--ds-gold); }
html body.ds #ipl-lens .tool-picker input, html body.ds #ipl-lens .battle-picker input { background: var(--ds-surface); }
html body.ds #ipl-lens .filters-toggle { display: none; }
@media (max-width: 760px) {
  html body.ds #ipl-lens .filters-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; }
  html body.ds #ipl-lens .filters-toggle::after { content: "▾"; font-size: 12px; color: var(--ds-muted); transition: transform var(--ds-fast); }
  html body.ds #ipl-lens.filters-open .filters-toggle::after { transform: rotate(180deg); }
  html body.ds #ipl-lens .battle-filters:not([hidden]) { display: none; }
  html body.ds #ipl-lens.filters-open .battle-filters:not([hidden]) { display: grid; animation: ds-rise .25s var(--ds-ease) both; }
  html body.ds #ipl-lens #filters-count { color: var(--ds-gold); }
}

/* One heading voice everywhere: Manrope for titles (articles and detail pages too). */
html body.ds .article-main h1, html body.ds .v2 .article-main h1 { font: 800 clamp(36px, 5.6vw, 68px)/1.02 var(--ds-font); letter-spacing: -.045em; text-transform: none; }
html body.ds .detail-head .title { font: 800 clamp(32px, 4.8vw, 56px)/1.04 var(--ds-font); letter-spacing: -.04em; }
html body.ds .detail-head .title em { font: 700 .5em var(--ds-font); color: var(--ds-gold); vertical-align: .22em; margin: 0 .2em; letter-spacing: 0; }
html body.ds .mx-card h3, html body.ds .battle h3, html body.ds .chart h2 { font-family: var(--ds-font); letter-spacing: -.02em; }
@media (max-width: 960px) { html body.ds .site-nav #site-links { background: var(--ds-bg); } }
/* main's grouped dropdown (cricket-feel.css) sized the panel to its content; the shared menu is full-width. */
@media (max-width: 960px) {
  html body.ds .site-nav #site-links { width: auto; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; grid-template-columns: none; }
}
@media (max-width: 960px) { html body.ds .site-nav .bar > .nav-toggle { width: auto; height: 38px; padding: 0 14px; font: 650 14px var(--ds-font); display: inline-flex; align-items: center; justify-content: center; } }

/* Record Book milestones: names are links, not buttons (an old archive-page rule painted all buttons red). */
html body.ds .milestones .ms-list button { all: unset; cursor: pointer; font-weight: 700; color: var(--ds-text); }
html body.ds .milestones .ms-list button:hover, html body.ds .milestones .ms-list button:focus-visible { text-decoration: underline; text-underline-offset: 3px; color: rgb(var(--ds-accent-rgb)); }
html body.ds .milestones .ms-toggle button { background: rgba(var(--ds-ink-rgb), .05); color: var(--ds-muted); border: 1px solid var(--ds-line-2); }
html body.ds .milestones .ms-toggle button[aria-pressed="true"] { background: var(--ds-chalk); color: var(--ds-on-chalk); border-color: var(--ds-chalk); }
/* Article body text */
html body.ds .v2 .article-main .prose p, html body.ds.v2 .article-main .prose p { color: rgba(var(--ds-ink-rgb), .8); }
html body.ds.v2 .article-main .prose p:first-child { color: var(--ds-text); }

/* Player faces (player-faces.js): portrait or initials badge. */
html body.ds .tcs-face { flex: 0 0 auto; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; vertical-align: middle;
  background: linear-gradient(150deg, hsl(var(--h, 260) 65% 55%), hsl(calc(var(--h, 260) + 50) 65% 35%)); color: #fff; font: 800 13px/1 var(--ds-font); letter-spacing: 0; }
html body.ds .tcs-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 16%; display: block; }
html body.ds .tcs-face.row-face { width: 30px; height: 30px; font-size: 11.5px; margin-right: 10px; }
html body.ds #ipl-lens .duel-name { display: flex; align-items: center; gap: 14px; }
html body.ds #ipl-lens .duel-name > small, html body.ds #ipl-lens .duel-name > strong { min-width: 0; }
html body.ds #ipl-lens .duel-face { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; box-shadow: 0 14px 30px -14px rgba(var(--ds-accent-rgb), .8); }
html body.ds .fx-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
html body.ds .fx-who .tcs-face { width: 44px; height: 44px; }
html body.ds #ipl-lens .duel-name:last-child { flex-direction: row-reverse; }
html body.ds #ipl-lens .duel-text { display: grid; min-width: 0; }
html body.ds td.with-face { white-space: nowrap; }
/* Grid tool pages: the grid gap spaces blocks, so their own margins do not stack on top of it. */
html body.ds .fx { gap: 16px; }
html body.ds .fx > * { margin-block: 0; }

/* ==========================================================================
   Editorial layer (approved design, Nov 2026): restyles the shared components every
   page already uses. Black ink, white cards, yellow for fills and highlights.
   ========================================================================== */
html body.ds { background: var(--ds-bg) !important; color: var(--ds-text); font-family: var(--ds-font); }
body.ds::before { content: none; }
html body.ds::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; transform: translateZ(0);
  background-image: radial-gradient(1px 1px at 23px 41px, rgba(241, 237, 226, .55), transparent 60%), radial-gradient(1px 1px at 151px 97px, rgba(241, 237, 226, .35), transparent 60%),
    radial-gradient(1.5px 1.5px at 87px 173px, rgba(241, 237, 226, .45), transparent 60%), radial-gradient(1px 1px at 201px 13px, rgba(255, 124, 104, .45), transparent 60%),
    radial-gradient(1px 1px at 263px 211px, rgba(241, 237, 226, .3), transparent 60%), radial-gradient(1px 1px at 9px 250px, rgba(245, 197, 24, .4), transparent 60%); background-size: 280px 280px; }
html body.ds ::selection { background: var(--ds-yellow); color: #111; }
html body.ds :focus-visible { outline: 2px solid var(--ds-text); outline-offset: 3px; }

/* Header */
html body.ds .site-nav { background: color-mix(in srgb, var(--ds-bg) 90%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--ds-line); }
html body.ds .site-nav .bar { height: 68px; max-width: 1240px; }
html body.ds .logo.d { display: inline-block; font: 800 17px/1 var(--ds-font) !important; letter-spacing: -.03em !important; text-transform: none !important; color: var(--ds-text) !important; text-decoration: none; white-space: nowrap; }
html body.ds .logo.d small { display: block; font: inherit; font-size: 13px; margin-bottom: 1px; }
html body.ds .logo.d i, html body.ds .logo.d span { font-style: normal; color: var(--ds-yellow) !important; }
html body.ds .site-nav #site-links { font: 600 14px var(--ds-font); color: var(--ds-text); gap: 2px; }
html body.ds .site-nav #site-links a { position: relative; border-radius: 8px; color: var(--ds-text); }
html body.ds .site-nav #site-links a[aria-current="page"] { background: none; color: var(--ds-text); }
@media (min-width: 961px) { html body.ds .site-nav #site-links a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -15px; height: 3px; border-radius: 3px; background: var(--ds-yellow); } }
html body.ds .site-nav .bar > .btn, html body.ds .site-nav .nav-cta { background: var(--ds-chalk); color: var(--ds-on-chalk); }
html body.ds .site-nav .theme-toggle { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; margin: 0 0 0 6px; border-radius: 50%; border: 0; background: transparent; color: var(--ds-text); cursor: pointer; }
html body.ds .site-nav .theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html body.ds .site-nav .theme-toggle svg path:only-child { fill: currentColor; stroke: none; }
@media (max-width: 960px) {
  html body.ds .site-nav .theme-toggle { margin-left: auto; }
  html body.ds .site-nav .bar > .nav-toggle { margin-left: 0; border-color: var(--ds-line-2); background: transparent; }
  html body.ds .site-nav #site-links { background: var(--ds-bg); }
  html body.ds .site-nav #site-links a[aria-current="page"] { color: var(--ds-text); box-shadow: inset 4px 0 0 var(--ds-yellow); padding-left: 14px; }
}

/* Titles: solid ink with a yellow full stop */
html body.ds :is(.tool-heading, #ipl-lens h1, .archive-page h1, .detail-head .title, .pp-head h1, .pp-hero h1) { font-family: var(--ds-font) !important; font-weight: 800 !important; letter-spacing: -.04em !important; color: var(--ds-text); }
html body.ds :is(.tool-heading, #ipl-lens h1, .pp-head h1) span { background: none !important; -webkit-background-clip: initial !important; background-clip: initial !important; color: inherit !important; }
html body.ds :is(.tool-heading, #ipl-lens h1, .pp-head h1, .pp-hero h1)::after { content: "."; color: var(--ds-yellow); }
html body.ds .detail-head .title em { color: var(--ds-muted); }
html body.ds :is(.eyebrow, .label, .bento-eye, .pp-eyebrow, .detail-head .eyebrow) { color: var(--ds-text); letter-spacing: .14em; }
html body.ds .tool-panel .eyebrow, html body.ds #ipl-lens .eyebrow, html body.ds #ipl-lens .panel-head .eyebrow { color: var(--ds-text); }
html body.ds h2, html body.ds h3 { font-family: var(--ds-font); }

/* Buttons */
html body.ds :is(.ds-btn, .btn:not(.d), .ap-cta, .bento-send, #pv-share) { background: var(--ds-chalk); color: var(--ds-on-chalk); border: 1.5px solid var(--ds-chalk); font-family: var(--ds-font); }
html body.ds :is(.ds-btn, .btn:not(.d), .ap-cta, .bento-send, #pv-share):hover { background: var(--ds-chalk); transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(17, 17, 17, .45); }
html body.ds :is(.ds-btn.ghost, #pv-card) { background: transparent; color: var(--ds-text); border-color: var(--ds-line-2); }
html body.ds :is(.ds-btn.ghost, #pv-card):hover { border-color: var(--ds-text); background: transparent; }
html body.ds .ds-btn.yellow { background: var(--ds-grad-yellow); color: #111; border-color: transparent; box-shadow: 0 10px 24px -12px rgba(255, 166, 0, .8); }

/* Pills and segmented controls: black when active */
html body.ds :is(.tool-pills button, #ipl-lens .tool-pills button) { background: var(--ds-surface); border: 1px solid var(--ds-line); color: var(--ds-text); font-family: var(--ds-font); }
html body.ds :is(.tool-pills :is(.active, [aria-pressed="true"]), #ipl-lens .tool-pills :is(.active, [aria-pressed="true"])) { background: var(--ds-chalk); color: var(--ds-on-chalk); border-color: var(--ds-chalk); }
html body.ds :is(.phase-chip, #ipl-lens .battle-result .phase-chip) { background: var(--ds-yellow-soft); color: var(--ds-text); }

/* Cards, panels, tiles */
html body.ds :is(.tool-panel, .tile, .mx-card, .chart, .battle, .phase-profile, .bento-card, .bento-cta, #ipl-lens .panel, .tool-filter, .battle-filters, .fx-tile, .fx-player, .qz-card) {
  background: var(--ds-surface); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
html body.ds :is(.tile, .mx-card, .bento-card, .fx-player):hover { border-color: var(--ds-line-2); }
html body.ds :is(.tile b, .fx-tile b, .qz-score, .bento-num) { font-family: var(--ds-font) !important; font-weight: 800; letter-spacing: -.03em; color: var(--ds-text); }

/* Inputs */
html body.ds :is(.tool-filter, .tool-picker, .tool-compare, #ipl-lens, .pv-controls, .mx-controls) :is(input, select), html body.ds #ipl-lens :is(input, select) { background-color: var(--ds-surface); border: 1px solid var(--ds-line-2); color: var(--ds-text); font-family: var(--ds-font); }
html body.ds :is(input, select, textarea):focus { border-color: var(--ds-text) !important; box-shadow: var(--ds-ring) !important; }

/* Tables */
html body.ds :is(.tool-table, #ipl-lens .table-wrap, .pp-scroll) { background: var(--ds-surface); border: 1px solid var(--ds-line); }
html body.ds :is(.tool-table th, #ipl-lens th, .pp-table thead th) { background: var(--ds-bg-2); color: var(--ds-muted); font-family: var(--ds-font); }
html body.ds :is(.tool-table td, #ipl-lens td) { font-family: var(--ds-font); }

/* Footer */
html body.ds .site-footer { background: var(--ds-bg); border-top: 1px solid var(--ds-line); }
html body.ds .footer-col h2 { color: var(--ds-text); letter-spacing: .12em; }
html body.ds .footer-col a { color: var(--ds-muted); }

/* Header layout without the older stylesheets (pages like the homepage load only ds.css). */
html body.ds .site-nav { position: sticky; top: 0; z-index: 50; }
html body.ds .site-nav .bar { display: flex; align-items: center; justify-content: space-between; margin-inline: auto; padding-inline: var(--page-gutter); }
html body.ds .site-nav #site-links a { display: inline-flex; align-items: center; text-decoration: none; }
html body.ds .site-nav .bar > .btn { display: inline-flex; }
@media (max-width: 960px) { html body.ds .site-nav .bar > .btn { display: none; } html body.ds .site-nav #site-links a { display: flex; } }
html body.ds .site-footer .wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--page-gutter); }
html body.ds .site-footer a { text-decoration: none; }
html body.ds #ipl-lens #battle-swap { background: var(--ds-chalk); color: var(--ds-on-chalk); border-color: var(--ds-chalk); }
html body.ds #ipl-lens .duel-face { box-shadow: 0 12px 24px -14px rgba(17, 17, 17, .6); }
html body.ds main:is(.archive-page, .tool-page, .cricket-tools) { background: none; }

/* Wider pages so big screens do not show wide empty margins. */
html body.ds .wrap, html body.ds main.wrap.page, html body.ds main.tool-page, html body.ds .site-nav .bar, html body.ds .site-footer .wrap { max-width: 1440px; }
@media (min-width: 961px) { html body.ds .site-nav #site-links { overflow: visible; } }

/* ---- Audit fixes (Nov 2026) ---- */
/* Fills that used the accent colour stay yellow now that accent text is ink. */
html body.ds #ipl-lens .battle-result .phase-bar-fill { background: var(--ds-grad-yellow); }
html body.ds #ipl-lens .battle-result .form-spark rect { fill: var(--ds-yellow); }
html body.ds #ipl-lens .result-heading { color: var(--ds-text); }
html body.ds :is(.tool-heading, #ipl-lens h1) span::before { content: " "; }
@media (max-width: 520px) {
  html body.ds #ipl-lens .duel-face { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }
  html body.ds #ipl-lens .duel-name { gap: 8px; padding: 14px 10px; }
  html body.ds #ipl-lens .duel-names { grid-template-columns: minmax(0, 1fr); }
  html body.ds #ipl-lens .duel-name, html body.ds #ipl-lens .duel-name:last-child { flex-direction: row; text-align: left; }
  html body.ds #ipl-lens .duel-name + .duel-name { border-top: 1px solid var(--ds-line); }
  html body.ds #ipl-lens .duel-name strong { font-size: 22px; white-space: nowrap; }
}
/* Article: black and yellow instead of the old red */
html body.ds .share-actions button { background: var(--ds-chalk); color: var(--ds-on-chalk); border: 0; }
html body.ds .share-actions button#share { background: var(--ds-grad-yellow); color: #111; }
html body.ds .prose p:last-child { border-left-color: var(--ds-yellow) !important; }
html body.ds .article-main .label, html body.ds main .label { color: var(--ds-text); }
/* Retentions: ratings in ink (team colours were too faint as text) */
html body.ds :is(.rt-score, .rt-big b) { color: var(--ds-text) !important; }
html body.ds .rt-bar i::before { background: var(--ds-grad-yellow); }
html body.ds main [aria-pressed="true"]:has(.rt-score) { border-color: var(--ds-text); background: var(--ds-yellow-soft); }
html body.ds img[src*="logos/"] { filter: drop-shadow(0 0 .7px rgba(0, 0, 0, .7)) drop-shadow(0 0 .7px rgba(0, 0, 0, .7)); }

/* ==========================================================================
   THE CRICKET SPACE (Nov 2026): the site's single theme. Deep space with faint
   stars, panels like scoreboard plates floating in it, white paint for the main
   action, one yellow light for "current", red only for wickets. Barlow Condensed
   for headings and numbers, Barlow for text. Flat: no glowing buttons, no purple.
   Overrides every token above.
   ========================================================================== */
:root, :root[data-theme="light"], :root[data-theme="dark"] {
  --ds-bg-rgb: 5, 8, 13;
  --ds-surface-rgb: 11, 17, 24;
  --ds-ink-rgb: 241, 237, 226;
  --ds-accent-rgb: 245, 197, 24;
  --ds-red-rgb: 255, 124, 104;
  --ds-green-rgb: 241, 237, 226;
  --ds-blue-rgb: 154, 215, 245;
  --ds-bg: #05080d; --ds-bg-2: #0b1118; --ds-surface: #0b1118; --ds-surface-2: #111a24; --ds-surface-3: #17222e; --ds-surface-solid: #0b1118;
  --ds-line: #1c2733; --ds-line-2: #33414f;
  --ds-text: #f1ede2; --ds-muted: #b9c0c6; --ds-subtle: #95a0aa;
  --ds-yellow: #f5c518; --ds-yellow-soft: rgba(245, 197, 24, .14); --ds-gold-soft: rgba(245, 197, 24, .14);
  --ds-grad-yellow: #f5c518;
  --ds-cyan: #9ad7f5;
  --ds-chalk: #f1ede2; --ds-on-chalk: #0d130f;
  --ds-shadow: none;
  --ds-shadow-lg: none;
  --ds-ring: 0 0 0 3px rgba(245, 197, 24, .6);
  --ds-font: "Barlow", system-ui, sans-serif;
  --ds-num: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sb-plate: #0d130f; --sb-paint: #f1ede2; --sb-bulb: #f5c518; --sb-wicket: #ff7c68; --sb-seam: #1c2733;
  --ed-bg: #05080d; --ed-page: #05080d; --ed-surface: #0b1118; --ed-soft: #111a24;
  --ed-ink: #f1ede2; --ed-ink-2: #e3e0d5; --ed-muted: #b9c0c6; --ed-subtle: #95a0aa;
  --ed-line: #1c2733; --ed-line-2: #33414f;
  --ed-yellow: #f5c518; --ed-yellow-2: #f5c518; --ed-yellow-soft: rgba(245, 197, 24, .14); --ed-on-yellow: #0d130f;
  --ed-grad-yellow: #f5c518;
  --ed-green: #f1ede2; --ed-green-soft: rgba(241, 237, 226, .1); --ed-red: #ff7c68; --ed-red-soft: rgba(255, 124, 104, .14); --ed-blue: #9ad7f5;
  --ed-shadow: none; --ed-shadow-lg: none;
  --ed-font: "Barlow", system-ui, sans-serif;
  color-scheme: dark;
}
html { background: #05080d; }
html body.ds, html body.ed { background: transparent !important;
  /* The starfield is a fixed layer of its own (below), so scrolling never repaints the page background. */ color: var(--ds-text); font-family: var(--ds-font); font-size: 17px; }
html body.ds ::selection { background: #f5c518; color: #0d130f; }
html body.ds :focus-visible { outline: 3px solid #f5c518; outline-offset: 2px; }
html { scrollbar-color: #33414f #05080d; }
/* No theme switch: one board. */
html body.ds .site-nav .theme-toggle { display: none !important; }
/* Flat everywhere: nothing glows. */
html body.ds :is(h1, h2, h3, .tool-heading, .ed-display, .ed-title, .ed-h2)::after, html body.ds :is(.tile b, .pp-big dd, .ed-stat b) { text-shadow: none !important; }

/* Headings and numbers in the scoreboard face */
html body.ds :is(h1, h2, h3, .tool-heading, #ipl-lens h1, .pp-hero h1, .pp-head h1, .ed-display, .ed-title, .ed-h2, .logo.d) { font-family: var(--ds-num) !important; font-weight: 800 !important; letter-spacing: .005em !important; }
html body.ds :is(h1, .tool-heading, #ipl-lens h1, .pp-hero h1, .pp-head h1, .ed-title, .ed-display) { text-transform: uppercase; line-height: .95 !important; }
html body.ds :is(.tool-heading, #ipl-lens h1, .pp-head h1, .pp-hero h1, .ed-title, .ed-h2.dot, .ed-display, .pp-letter h2)::after { color: #f5c518; }
html body.ds :is(.tile b, .fx-tile b, .qz-score, .bento-num, .pp-big dd, .ed-stat b, .h-nums b, .rt-score, .rt-big b, .board b) { font-family: var(--ds-num) !important; font-weight: 800 !important; font-variant-numeric: tabular-nums; }
html body.ds :is(.pp-big div:nth-child(2) dd, .tile:first-child b) { color: #f5c518; }

/* Header: the name board */
html body.ds .site-nav { background: #05080d; border-bottom: 6px solid #1c2733; backdrop-filter: none; }
html body.ds .logo.d { font-size: 22px !important; text-transform: uppercase !important; letter-spacing: .03em !important; }
html body.ds .logo.d small { display: inline; font-size: inherit; margin: 0 .25em 0 0; }
html body.ds .logo.d i { color: #f5c518 !important; }
html body.ds .site-nav #site-links a { color: var(--ds-muted); font: 600 18px var(--ds-num); letter-spacing: .06em; text-transform: uppercase; }
html body.ds .site-nav #site-links a[aria-current="page"] { color: var(--ds-text); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 7px; }
html body.ds .site-nav #site-links a[aria-current="page"]::after { display: none; }

/* Buttons: flat painted boards. White for the main action, outlined for the rest. */
html body.ds :is(.ds-btn, .btn:not(.d), .ap-cta, .bento-send, #pv-share, .ed-btn, .site-nav .bar > .btn) { font-family: var(--ds-num) !important; font-weight: 800 !important; letter-spacing: .06em; text-transform: uppercase; border-radius: 3px !important; box-shadow: none !important; }
html body.ds :is(.ds-btn:not(.ghost), .ed-btn:not(.ghost), .ed-btn.yellow, .site-nav .bar > .btn, .pp-actions button, .pp-more button) { background: #f1ede2 !important; color: #0d130f !important; border-color: #f1ede2 !important; }
html body.ds :is(.ds-btn.ghost, .ed-btn.ghost, #pv-card, .pp-actions a, .pp-more a) { background: transparent !important; color: var(--ds-text) !important; border: 2px solid var(--ds-line-2) !important; }
html body.ds :is(.tool-pills :is(.active, [aria-pressed="true"]), #ipl-lens .tool-pills :is(.active, [aria-pressed="true"]), .ed-seg .on, .ed-tabs .on) { background: #f1ede2 !important; color: #0d130f !important; border-color: #f1ede2 !important; box-shadow: none !important; }
html body.ds :is(.ed-tag:not(.dark):not(.white), .ed-chip.on, .phase-chip) { background: #0d130f !important; color: #f5c518 !important; }

/* Panels: lower boards with dark seams */
html body.ds :is(.tool-panel, .tile, .mx-card, .chart, .battle, .phase-profile, .bento-card, .tool-filter, .battle-filters, .fx-tile, .fx-player, .qz-card, .pp-card, .pp-feat, .ed-card, .ed-stat, .t-card, .h-tool) { background: var(--ds-surface) !important; border: 3px solid #1c2733 !important; border-radius: 4px !important; box-shadow: none !important; }
html body.ds #ipl-lens .panel { background: var(--ds-surface) !important; border: 3px solid #1c2733 !important; border-radius: 4px !important; box-shadow: none !important; }
html body.ds :is(.tool-table, #ipl-lens .table-wrap, .pp-scroll, .ed-table-wrap) { background: var(--ds-bg-2) !important; border-color: #1c2733 !important; }
html body.ds :is(.tool-table th, #ipl-lens th, .pp-table thead th, .ed-table thead th) { background: #1c2733 !important; color: var(--ds-muted) !important; font-family: var(--ds-num) !important; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
html body.ds :is(input, select, textarea) { background-color: #070b10 !important; border: 2px solid var(--ds-line-2) !important; color: var(--ds-text) !important; border-radius: 3px !important; }
html body.ds a:is(.ed-more, .bento-link) { color: #f5c518; }

/* Stat groups read as one scoreboard strip with seams, not separate cards. */
html body.ds :is(.tiles, .fx-summary, .pp-big) { gap: 0 !important; background: #0b1118 !important; border: 6px solid #1c2733 !important; border-radius: 4px !important; overflow: hidden; }
html body.ds :is(.tiles > .tile, .fx-summary > .fx-tile, .pp-big > div) { background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; outline: 3px solid #1c2733; outline-offset: -1.5px; }
/* Line icons in the tool list */
html body.ds .ed-icon-chip .ic, html body.ds .ed-icon-chip svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body.ds :is(h1, .tool-heading, #ipl-lens h1) { text-transform: uppercase !important; }

/* Charts and bars */
html body.ds .pp-bar { fill: #33414f !important; } html body.ds .pp-bar.hi { fill: #f5c518 !important; }
html body.ds .pp-val { fill: var(--ds-text); }
html body.ds .pp-track i { background: #9ad7f5; } html body.ds .pp-track i.up { background: #f5c518; }
html body.ds .rt-bar i::before, html body.ds .ea-bar i { background: #f5c518 !important; }
html body.ds .pp-hero { background: #0b1118 !important; border: 6px solid #1c2733 !important; }
html body.ds .pp-chips span:nth-child(3) { background: #f5c518 !important; color: #0d130f !important; }
html body.ds .pp-big div:nth-child(2) dd { color: #f5c518; }

/* Footer */
html body.ds .site-footer { background: #0b1118; border-top: 6px solid #1c2733; }
/* ed.css declares its tokens on :root after this file loads, so its components read
   the scoreboard values from body instead. */
html body.ds.ed, html body.ds .ed-main, html body.ed {
  --ed-bg: #05080d; --ed-page: #05080d; --ed-surface: #0b1118; --ed-soft: #111a24;
  --ed-ink: #f1ede2; --ed-ink-2: #e3e0d5; --ed-muted: #b9c0c6; --ed-subtle: #95a0aa;
  --ed-line: #1c2733; --ed-line-2: #33414f;
  --ed-yellow: #f5c518; --ed-yellow-2: #f5c518; --ed-yellow-soft: rgba(245, 197, 24, .14); --ed-on-yellow: #0d130f;
  --ed-grad-yellow: #f5c518;
  --ed-green: #f1ede2; --ed-red: #ff7c68; --ed-blue: #9ad7f5;
  --ed-shadow: none; --ed-shadow-lg: none;
  --ed-font: "Barlow", system-ui, sans-serif;
}
html body.ds .ed-icon-chip { background: #0d130f; color: #f5c518; box-shadow: none; }
/* No tiny labels above headings: the heading carries itself. */
html body.ds #ipl-lens .tool-page > .label, html body.ds .section.tool-page > .label, html body.ds #ipl-lens .panel-head > .eyebrow, html body.ds .pp-head > .pp-eyebrow { display: none; }
html body.ds .detail-head .title { text-transform: uppercase; font-family: var(--ds-num) !important; }
html body.ds #battle-panel-label { display: none; }
html body.ds .pp-sources { max-width: 75ch; }
html body.ds .btn-ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Hover only on devices with a real pointer, so taps on phones never stick. Colour changes only. */
@media (hover: hover) and (pointer: fine) {
  html body.ds .site-nav #site-links a:hover { color: var(--ds-text); background: transparent; }
  html body.ds :is(.ds-btn:not(.ghost), .ed-btn:not(.ghost), .site-nav .bar > .btn, .ap-cta, .bento-send, #pv-share):hover { background: #ffffff !important; }
  html body.ds :is(.ds-btn.ghost, .ed-btn.ghost, #pv-card, .pp-actions a, .pp-more a):hover { border-color: #f1ede2 !important; }
  html body.ds :is(.tile, .fx-player, .pp-feat, .t-card, .h-tool, a.ed-card, a.bento-card):hover { border-color: #f5c518 !important; }
  html body.ds .tool-pills button:hover { color: var(--ds-text); border-color: #f1ede2; }
  html body.ds .tool-links a:hover, html body.ds .footer-col a:hover { color: #f5c518; }
  html body.ds :is(.tool-table, #ipl-lens) tbody tr:hover { background: rgba(241, 237, 226, .04); }
  html body.ds .pp-bar:hover { fill: #f5c518 !important; }
}
