/* ============================================================
   MATCHDAY — Cricket Intelligence Platform
   
   PALETTE
   ─────────────────────────────────────────────────────────────
   --deep    #62211D   crimson dark      (structure, authority)
   --rich    #7A2A24   crimson mid       (hover states)
   --ember   #A8907A   warm tan          (muted elements)
   --gold    #FEDF86   bright gold       (active, accent, data)
   --gold-d  #E8C660   gold darker      (hover on gold)
   --bg      #1C0E0C   near-black tinted (page background)
   --surface #251210   slightly lighter  (card background)
   --line    #3D2220   subtle divider
   --ink     #F5EFE6   warm white        (primary text)
   --ink2    #C4A898   muted text
   --ink3    #8A6A62   very muted
   
   FONTS
   ─────────────────────────────────────────────────────────────
   Site: Rubik 400–800
   ============================================================ */

:root {
  /* Header/footer charcoal — shared with light mode */
  --deep:    #202020;
  --rich:    #333333;

  /* Dark mode = neutral grey inversion of light mode */
  --bg:      #141414;
  --surface: #1E1E1E;
  --surface2:#2A2A2A;
  --line:    #303030;
  --line2:   #424242;
  --ink:     #F0EFEF;
  --ink2:    #B0AFAF;
  --ink3:    #666666;

  --ember:   #A8907A;
  --gold:    #FEDF86;
  --gold-d:  #E8C660;

  --t1:      #E8604A;
  --t2:      #4AAD68;
  --win:     #4AAD68;
  --loss:    #E8604A;
  --draw:    #A8907A;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Rubik', sans-serif; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Rubik', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  width: 100%;
  height: 58px;
  background: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--line2);
}

.header-inner {
  width: 100%;
  max-width: 1440px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-logo-img {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.header-logo-mark {
  height: 30px;
  padding: 0 7px;
  background: var(--gold);
  color: var(--deep);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.header-logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.header-nav-btn {
  text-decoration: none;
  color: rgba(254,223,134,0.65);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 7px 14px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.header-nav-btn:hover {
  color: #FEDF86;
  background: rgba(255,255,255,0.07);
}

.header-search {
  flex: 0 0 240px;
}

.header-search input {
  width: 100%;
  height: 34px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(254,223,134,0.15);
  border-radius: 4px;
  padding: 0 14px;
  font-size: 0.82rem;
  color: rgba(254,223,134,0.8);
  outline: none;
  transition: all 0.2s;
}

.header-search input::placeholder { color: rgba(254,223,134,0.3); }
.header-search input:focus {
  border-color: rgba(254,223,134,0.45);
  background: rgba(255,255,255,0.1);
  color: #FEDF86;
}

.header-cta {
  text-decoration: none;
  background: var(--gold);
  color: var(--deep);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 7px 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.header-cta:hover { background: var(--gold-d); }

/* ── PAGE WRAPPER ───────────────────────────────────────────── */
.page-wrapper {
  width: 100%;
  background: var(--bg);
  min-height: calc(100vh - 58px);
  padding: 28px 0 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-content {
  width: 100%;
  max-width: 1000px;
  display: flex;
  align-items: flex-start;
  padding: 0 16px;
}

.site-main { width: 95%; flex-shrink: 0; padding: 0 20px 0 0; }
.site-sidebar { width: 5%; flex-shrink: 0; }

.pl-squad-widget ~ .pl-squad-widget { margin-top: 12px; }
.sidebar-inner { width: 100%; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  background: var(--deep);
  padding: 40px 24px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line2);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-logo {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.footer-logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.footer-divider { width: 32px; height: 1px; background: var(--line2); }

.footer-nav { display: flex; gap: 28px; }
.footer-nav a {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink3);
  text-decoration: none;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--gold); }
.footer-sub { font-size: 0.78rem; color: var(--ink3); }
.footer-copy { font-size: 0.65rem; color: var(--ink3); opacity: 0.5; }

/* ── SECTION TITLES ─────────────────────────────────────────── */
.today-section, .upcoming-section { width: 100%; margin-bottom: 32px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 1px;
  flex-shrink: 0;
}

.no-matches {
  text-align: center;
  padding: 48px 0;
  color: var(--ink3);
  font-size: 0.9rem;
}

/* ── LEAGUE BLOCK ───────────────────────────────────────────── */
.league-block {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.league-header {
  background: var(--deep);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-country {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.league-sep { color: var(--line2); font-size: 0.65rem; }

.league-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── MATCH ROW ──────────────────────────────────────────────── */
a.match-row {
  display: grid;
  grid-template-columns: 48px 1fr 22% 1fr 48px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
  width: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
}

a.match-row:last-child { border-bottom: none; }

a.match-row:hover { background: var(--surface2); }

a.match-row.match-live {
  background: rgba(254,223,134,0.04);
}

a.match-row.match-live::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
}

a.match-row.match-finished { opacity: 0.38; }

/* ── FORM WRAPPERS ──────────────────────────────────────────── */
.form-home { display: flex; align-items: center; justify-content: center; padding-right: 6px; }
.form-away { display: flex; align-items: center; justify-content: center; padding-left: 6px; }

/* ── TEAM ───────────────────────────────────────────────────── */
.team { display: flex; align-items: center; min-width: 0; }
.team-home { justify-content: flex-start; }
.team-away { justify-content: flex-end; }

.team-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

/* ── FORM BOXES ─────────────────────────────────────────────── */
.form-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 26px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  color: #fff;
  letter-spacing: 0;
}

/* Dark mode — vivid, high contrast on dark surface */
.form-very-good { background: #1E8C34; }
.form-good      { background: #3DA85A; }
.form-mid       { background: #C47D10; }
.form-bad       { background: #C03A28; }
.form-very-bad  { background: #8B1A1A; }
.form-na        { background: var(--line2); color: rgba(196,168,152,0.95); font-size: 0.7rem; font-weight: 600; letter-spacing: 0; }

/* ── MATCH CENTER ───────────────────────────────────────────── */
.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.kickoff-time {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.kickoff-date {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.score-home, .score-away { color: var(--ink); min-width: 18px; text-align: center; }
.score-sep { color: var(--line2); font-weight: 400; }

.match-status {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: 2px;
  text-transform: uppercase;
}

.live-badge {
  background: rgba(254,223,134,0.15);
  color: var(--gold);
  border: 1px solid rgba(254,223,134,0.25);
  animation: pulse 2s ease-in-out infinite;
}

.fin-badge {
  background: var(--line);
  color: var(--ink3);
  border: 1px solid var(--line2);
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─────────────────────────────────────────────────────────────
   H2H PAGE LAYOUT
   ───────────────────────────────────────────────────────────── */
.h2h-layout {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 0 20px;
  box-sizing: border-box;
}

.h2h-left { flex: 1 1 0; min-width: 0; max-width: 1000px; }
.h2h-left-header { width: 100%; margin-bottom: 0; }
.h2h-left-header .h2h-hero { border-radius: 0; margin-bottom: 0; }
.h2h-left-body { width: 100%; }

.h2h-side {
  flex: 0 0 300px;
  width: 300px;
  min-height: 200px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  padding-top: 20px;
}

/* ─────────────────────────────────────────────────────────────
   H2H SECTION CARDS
   ───────────────────────────────────────────────────────────── */
.h2h-page { width: 100%; }

.h2h-section {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  padding: 0px 0px;
  margin-bottom: 0;
}

.h2h-section:last-child {
  /*border-radius: 0 0 6px 6px;*/
  /*padding-bottom: 24px;*/
  /*margin-bottom: 16px;*/
}

/* ct-section is border-top: none already, following sections stay flush */
.h2h-section + .h2h-section { border-top: none; }

.h2h-section--padded { padding: 20px 24px; }
.h2h-ct-section + .h2h-section { border-top: none; }

/* After the comparison table block, the next group of sections starts a new card */
.h2h-left-body > .h2h-section:first-child {
  border-top: 1px solid var(--line);
  /*margin-top: 16px;*/
  /*border-radius: 6px 6px 0 0;*/
}

.h2h-section-title {
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  /*margin-bottom: 16px;*/
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.h2h-section-title small {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.68rem;
  color: var(--ink3);
}

/* ─────────────────────────────────────────────────────────────
   H2H HERO (classic 3-column layout)
   ───────────────────────────────────────────────────────────── */
.h2h-hero {
  width: 100%;
  background: var(--surface2, rgba(255, 255, 255, 0.03));
  border-radius: 0;
  padding: 40px 36px 11px;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid var(--line);
}

.h2h-hero-classic {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px 48px;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
}

.h2h-hero-col--team {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.h2h-hero-col--team:first-child {
  align-items: flex-start;
  text-align: left;
}

.h2h-hero-col--team-right {
  align-items: flex-end;
  text-align: right;
}

.h2h-hero-team-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.h2h-hero-team-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.h2h-hero-team-title--right {
  text-align: right;
}

.h2h-hero-team-title .h2h-hero-team-name {
  font-weight: 700;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.h2h-hero-team-name a {
  color: inherit;
  text-decoration: none;
}

.h2h-hero-team-name a:hover {
  text-decoration: underline;
}

.h2h-hero-team-country {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink3);
  letter-spacing: 0.2px;
}

.h2h-hero-team-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.h2h-hero-team-body--right {
  flex-direction: row;
}

.h2h-hero-form-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.h2h-hero-form-block--right {
  flex-direction: row;
}

.h2h-hero-logo-wrap {
  flex-shrink: 0;
}

.h2h-hero-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px;
  display: block;
}

.h2h-hero-badge {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  background: var(--line);
  border: 1px solid var(--line2);
  color: var(--ink2);
}

.h2h-hero-form-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink3);
  line-height: 1.45;
  white-space: nowrap;
}

.h2h-hero-last10-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.h2h-hero-last10-line--right {
  justify-content: flex-end;
}

.h2h-last10 { display: contents; }

/* Team hero: keep last-10 dots in a horizontal row (not column flex children) */
.tm-hero .h2h-last10 {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.tm-hero-last10-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.h2h-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  font-size: 0.58rem;
  font-weight: 600;
}

.h2h-dot--win   { background: rgba(74,173,104,0.18); color: var(--win); }
.h2h-dot--loss  { background: rgba(232,96,74,0.12); color: var(--loss); }
.h2h-dot--draw  { background: var(--line); color: var(--ink3); }
.h2h-dot--empty { background: var(--line); color: var(--ink3); font-size: 0.75rem; }
.h2h-last10-empty { font-size: 0.7rem; color: var(--ink3); font-style: italic; }

.h2h-hero-col--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 0 24px;
  min-width: 230px;
  max-width: 320px;
}

.h2h-hero-meta-top {
  font-size: 0.8rem;
  color: var(--ink3);
  line-height: 1.6;
}

.h2h-hero-meta-sep {
  opacity: 0.65;
}

.h2h-hero-live {
  color: var(--ink2);
  font-weight: 600;
}

.h2h-hero-matchup {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  margin: 6px 0 8px;
  max-width: 300px;
}

.h2h-hero-matchup-vs {
  font-weight: 500;
  color: var(--ink3);
}

.h2h-hero-h2h-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -10px;
}

.h2h-hero-h2h-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink3);
}

.h2h-hero-record {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 1.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.05;
}

.h2h-hero-record-num {
  color: var(--ink2);
  font-weight: 500;
}

.h2h-hero-record-strong {
  color: var(--ink);
  font-weight: 700;
}

.h2h-hero-dash {
  color: var(--ink3);
  font-weight: 400;
}

.h2h-hero-stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-top: 1px;
}

.h2h-hero-stat-label {
  font-size: 0.72rem;
  color: var(--ink3);
}

.h2h-hero-stat-val {
  font-size: 0.8rem;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}

/* Upcoming match strip */
.h2h-upcoming {
  margin: -40px -36px 24px;
  padding: 20px 36px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
}

.h2h-upcoming-headline {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
  text-transform: none;
}

.h2h-upcoming-sep {
  color: var(--ink3);
  font-weight: 500;
  padding: 0 2px;
}

.h2h-upcoming-meta {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--ink3);
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.h2h-upcoming-live { color: var(--gold); margin-left: 8px; animation: pulse 2s ease-in-out infinite; }

.h2h-upcoming-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.h2h-upcoming-team { display: flex; align-items: center; gap: 8px; }
.h2h-upcoming-team--right { justify-content: flex-end; }

.h2h-upcoming-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.h2h-upcoming-score {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--gold);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.h2h-upcoming-time {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink3);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.h2h-form-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 18px;
  border-radius: 2px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.h2h-form-box.h2h-form-box--hero {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

/* Hero form + last-10: use global form-* / h2h-dot colors */
.h2h-hero .h2h-dot--win   { background: rgba(74,173,104,0.28); color: var(--win); }
.h2h-hero .h2h-dot--loss  { background: rgba(232,96,74,0.2); color: var(--loss); }
.h2h-hero .h2h-dot--draw  { background: var(--line); color: var(--ink3); }

/* ─────────────────────────────────────────────────────────────
   H2H STAT SECTIONS (split / career / batting / bowling / milestones)
   ───────────────────────────────────────────────────────────── */
.h2h-split-header { display: flex; justify-content: space-between; font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }

.h2h-split-row { display: grid; grid-template-columns: 30% 40% 30%; align-items: center; margin-bottom: 4px; }

.h2h-split-val {
  font-size: 1rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.h2h-split-val small { font-size: 0.62rem; opacity: 0.45; }
.h2h-split-val--right { text-align: right; }

.h2h-split-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink3);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.h2h-split-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 14px; }
.h2h-split-bar { height: 10px; background: var(--line); border-radius: 4px; overflow: hidden; }
.h2h-split-bar--right { display: flex; justify-content: flex-end; }
.h2h-split-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; display: block; }

.h2h-stat-names { display: flex; justify-content: space-between; font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.h2h-stat-table { display: flex; flex-direction: column; gap: 8px; }

.h2h-stat-row { display: grid; grid-template-columns: 15% 70% 15%; align-items: center; gap: 8px; }
.h2h-stat-val { font-size: 1rem; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h2h-stat-val small { font-size: 0.6rem; opacity: 0.45; }
.h2h-stat-val--right { text-align: right; }
.h2h-stat-winner { font-weight: 800; }

.h2h-stat-bars { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.h2h-stat-bar-wrap { height: 10px; background: var(--line); border-radius: 4px; overflow: hidden; }
.h2h-stat-bar-wrap--right { display: flex; justify-content: flex-end; }
.h2h-stat-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

.h2h-stat-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  white-space: nowrap;
}

/* Milestones */
.h2h-milestone-table { width: 100%; border-collapse: collapse; }
.h2h-milestone-table th {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink3);
}
.h2h-milestone-table th:first-child { text-align: left; }
.h2h-milestone-label {
  padding: 9px 12px 9px 0;
  color: var(--ink2);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
  width: 40%;
}
.h2h-milestone-val {
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────
   H2H COMPARISON TABLE  (Overall / Batting / Bowling tabs)
   ───────────────────────────────────────────────────────────── */
.h2h-ct-section {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  margin-bottom: 0;
  /*border-radius: 0;*/
}

/* ── Split selector: Overall / Home / Away ── */
.h2h-ct-subnav {
  display: flex;
  background: var(--deep);
  height: 38px;
  border-bottom: 1px solid var(--line2);
}

.h2h-ct-sub-btn {
  flex: 1;
  border: none;
  border-right: 1px solid var(--line2);
  background: transparent;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink3);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.h2h-ct-sub-btn:last-child { border-right: none; }
.h2h-ct-sub-btn:hover { color: var(--ink2); background: rgba(255,255,255,0.03); }
.h2h-ct-sub-btn.active {
  color: var(--gold);
  background: rgba(254,223,134,0.06);
}
.h2h-ct-sub-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

/* ── Main tabs: Overall / Batting / Bowling ── */
.h2h-ct-tabs {
  display: flex;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
}

.h2h-ct-tab {
  flex: 1;
  padding: 0 8px;
  height: 44px;
  border: none;
  background: none;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink3);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.h2h-ct-tab:hover { color: var(--ink2); }
.h2h-ct-tab.active { color: var(--ink); }
.h2h-ct-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

.h2h-ct-panel        { display: none; }
.h2h-ct-panel.active { display: block; }

/* ── Table ── */
.h2h-ct-table { width: 100%; border-collapse: collapse; }

/* Column header row — deep crimson band */
.h2h-ct-table thead tr { background: var(--deep); }

.h2h-ct-th-label {
  padding: 12px 20px;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(168,144,122,0.45);
  text-align: left;
  width: 42%;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.h2h-ct-th {
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #FEDF86;
  text-align: center;
  width: 29%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  letter-spacing: 0;
}

/* ── Body rows ── */
.h2h-ct-label {
  padding: 11px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink2);
  border-bottom: 1px solid var(--line);
  width: 42%;
  white-space: nowrap;
}

.h2h-ct-val {
  padding: 11px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  border-bottom: 1px solid var(--line);
  width: 29%;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  transition: background 0.12s, color 0.12s;
}

/* Winner — gold text, very subtle warm glow */
.h2h-ct-val.h2h-ct-win {
  color: var(--gold);
  background: rgba(254,223,134,0.07);
}

/* Sub text under value */
.h2h-ct-sub {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: inherit;
  opacity: 0.45;
  /*margin-top: 1px;*/
  letter-spacing: 0;
}

/* Alternating rows — barely visible tint */
.h2h-ct-table tbody tr:nth-child(odd) .h2h-ct-label,
.h2h-ct-table tbody tr:nth-child(odd) .h2h-ct-val:not(.h2h-ct-win) {
  background: rgba(255,255,255,0.014);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .h2h-side { flex: 0 0 200px; width: 200px; }
}

@media (max-width: 860px) {
  .h2h-layout { flex-direction: column; padding: 0 12px; }
  .h2h-left   { max-width: 100%; }
  .h2h-side   { display: none; }
}

@media (max-width: 1020px) {
  .page-content { padding: 0 12px; }
  .header-inner { padding: 0 16px; gap: 20px; }
}

@media (max-width: 800px) {
  .page-content  { flex-direction: column; }
  .site-main     { width: 100%; padding: 0; }
  .site-sidebar  { display: none; }
  .header-inner  { padding: 0 12px; gap: 10px; }
  .header-search { flex: 0 0 140px; }
  .header-search input { width: 100%; height: 30px; font-size: 0.75rem; }
  a.match-row    { grid-template-columns: 34px 1fr 22% 1fr 34px; padding: 10px 10px; }
  .team-name     { font-size: 0.88rem; }
  .kickoff-time  { font-size: 0.95rem; }
  /* name and record now use clamp() — no override needed */
  .h2h-dot { width: 18px; height: 18px; font-size: 0.55rem; }
  .h2h-stat-row { grid-template-columns: 18% 64% 18%; }
}

@media (max-width: 480px) {
  .header-nav   { display: none; }
  .team-name    { font-size: 0.8rem; }
  .form-box     { width: 34px; height: 22px; font-size: 0.8rem; }
  .h2h-hero { padding: 18px 16px 20px; }
}

@media (max-width: 720px) {
  .h2h-hero-classic {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: none;
  }
  .h2h-hero-col--team,
  .h2h-hero-col--team:first-child,
  .h2h-hero-col--team-right {
    max-width: none;
    justify-self: stretch;
  }
  .h2h-hero-col--center {
    order: -1;
    max-width: none;
  }
  .h2h-hero-matchup { max-width: none; }
  .h2h-hero-col--team-right {
    align-items: flex-start;
    text-align: left;
  }
  .h2h-hero-team-title--right { text-align: left; }
  .h2h-hero-team-body--right {
    flex-direction: row-reverse;
    justify-content: flex-end;
  }
  .h2h-hero-form-block--right {
    flex-direction: row-reverse;
  }
  .h2h-hero-last10-line--right {
    justify-content: flex-start;
  }
}

.site-main--full { width: 100%; padding: 0; }

/* ── VIEW TABS ─────────────────────────────────────────────── */
.view-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--line2);
    background: var(--surface);
}

.view-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 10px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    border-right: 1px solid var(--line2);
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.view-tab:last-child { border-right: none; }
.view-tab:hover { background: var(--surface2); color: var(--ink2); }

.view-tab.active {
    background: var(--deep);
    color: var(--gold);
}

.view-tab-icon { font-size: 0.9rem; opacity: 0.7; }

.view-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

/* Panels */
.view-panel { display: none; }
.view-panel.active { display: block; }

/* ── LIVE ZONE ─────────────────────────────────────────────── */
.live-zone {
    margin-bottom: 24px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(254,223,134,0.2);
    background: rgba(254,223,134,0.04);
}

.live-zone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(254,223,134,0.1);
    border-bottom: 1px solid rgba(254,223,134,0.15);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
}

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.live-count {
    margin-left: auto;
    background: var(--gold);
    color: var(--deep);
    font-size: 0.7rem;
    font-weight: 900;
    padding: 1px 7px;
    border-radius: 10px;
}

/* Live card */
.live-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(254,223,134,0.08);
    transition: background 0.12s;
}

.live-card:last-child { border-bottom: none; }
.live-card:hover { background: rgba(254,223,134,0.06); }

.live-card-league {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink3);
    margin-bottom: 10px;
}

.live-card-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.live-card-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.live-card-team--right {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.live-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-card-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.live-score-num {
    font-size: 1.8rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
    line-height: 1;
}

.live-score-sep {
    font-size: 1rem;
    color: var(--ink3);
    align-self: center;
    margin: 0 4px;
    line-height: 1;
}

/* Make score display inline */
.live-card-score { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.live-card-status {
    width: 100%;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.75;
    /*margin-top: 2px;*/
}

.live-score-vs {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--ink3);
    text-transform: uppercase;
}

/* ── DATE DIVIDER ──────────────────────────────────────────── */
.date-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 10px;
}

.date-divider::before,
.date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.date-divider:first-child { margin-top: 0; }

.date-divider-label {
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--ink3);
    white-space: nowrap;
    padding: 3px 10px;
    border: 1px solid var(--line2);
    border-radius: 2px;
    background: var(--surface);
}

/* ── LEAGUE COUNT BADGE ────────────────────────────────────── */
.league-count {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--ink3);
    opacity: 0.6;
    letter-spacing: 0;
}

/* ── SECTION HEADER ────────────────────────────────────────── */
.section-header {
    margin-bottom: 12px;
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  color: var(--ink2);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.12);
  color: var(--ink);
  border-color: rgba(255,255,255,0.2);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ============================================================
   LIGHT MODE  —  [data-theme="light"]
   Palette:
     deep     #202020   charcoal — header, footer, league headers, h2h hero
     bg       #ECEBEB   warm light grey (page background)
     surface  #F8F7F7   card surface
     surface2 #E4E3E3   hover / alternating rows
     line     #D2D0D0   divider
     line2    #BCBBBB   stronger border
     ink      #1A1A1A   near-black
     ink2     #484848   muted
     ink3     #808080   very muted
     gold     #FEDF86   kept — visible on charcoal #202020 surfaces
     accent1  #BFA190   warm clay
     accent2  #9EABCD   slate-blue
   ============================================================ */

[data-theme="light"] {
  --deep:    #202020;
  --rich:    #333333;
  --bg:      #ECEBEB;
  --surface: #F8F7F7;
  --surface2:#E4E3E3;
  --line:    #D2D0D0;
  --line2:   #BCBBBB;
  --ink:     #1A1A1A;
  --ink2:    #484848;
  --ink3:    #808080;
  --gold:    #FEDF86;
  --gold-d:  #E8C660;
  --accent1: #BFA190;
  --accent2: #9EABCD;
}

/* Body + wrapper */
[data-theme="light"] body          { background: var(--bg); color: var(--ink); }
[data-theme="light"] .page-wrapper { background: var(--bg); }

/* ── Header — charcoal #202020 via --deep, nav text gold ── */
[data-theme="light"] .site-header {
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

/* header-nav-btn and logo-text already use #FEDF86/ink2 from base CSS;
   --deep override ensures the header bg is charcoal — no extra rules needed */

[data-theme="light"] .theme-toggle {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  color: rgba(254,223,134,0.8);
}
[data-theme="light"] .theme-toggle:hover {
  background: rgba(255,255,255,0.18);
  color: #FEDF86;
}

/* ── League blocks — charcoal header via --deep ── */
[data-theme="light"] .league-block {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

/* league-header uses background: var(--deep) — now charcoal automatically */
/* league-name uses color: var(--gold) — stays gold on charcoal ✓ */

/* ── Match rows ── */
[data-theme="light"] a.match-row          { border-bottom-color: var(--line); }
[data-theme="light"] a.match-row:hover    { background: var(--surface2); }
[data-theme="light"] a.match-row.match-live {
  background: rgba(158,171,205,0.1);
}
[data-theme="light"] a.match-row.match-live::before { background: var(--accent2); }
[data-theme="light"] a.match-row.match-finished     { opacity: 0.45; }

/* ── Text ── */
[data-theme="light"] .team-name    { color: var(--ink); }
[data-theme="light"] .kickoff-time { color: var(--ink2); }
[data-theme="light"] .kickoff-date { color: var(--ink3); }
[data-theme="light"] .score-home,
[data-theme="light"] .score-away   { color: var(--ink); }
[data-theme="light"] .score-sep    { color: var(--line2); }

/* ── Badges ── */
[data-theme="light"] .live-badge {
  background: rgba(158,171,205,0.2);
  color: #2E4070;
  border-color: rgba(158,171,205,0.45);
}
[data-theme="light"] .fin-badge {
  background: var(--surface2);
  color: var(--ink3);
  border-color: var(--line);
}

/* ── Section titles ── */
[data-theme="light"] .section-title {
  color: var(--ink);
  border-bottom-color: var(--line);
}
[data-theme="light"] .section-title::before { background: var(--accent1); }

/* ── Form boxes — high contrast on light surfaces ── */
[data-theme="light"] .form-very-good { background: #1A7A2E; }
[data-theme="light"] .form-good      { background: #2E8F47; }
[data-theme="light"] .form-mid       { background: #A96910; }
[data-theme="light"] .form-bad       { background: #A82E1E; }
[data-theme="light"] .form-very-bad  { background: #6E1212; }
[data-theme="light"] .form-na {
  background: #C8C6C6;
  color: #484848;
  font-size: 0.72rem;
  letter-spacing: 0;
}

/* ── View tabs — active gets charcoal + gold text ── */
[data-theme="light"] .view-tabs    { background: var(--surface); border-color: var(--line); }
[data-theme="light"] .view-tab     { color: var(--ink3); border-right-color: var(--line); }
[data-theme="light"] .view-tab:hover { background: var(--surface2); color: var(--ink2); }
[data-theme="light"] .view-tab.active {
  background: var(--deep);   /* charcoal */
  color: var(--gold);        /* #FEDF86 */
}
[data-theme="light"] .view-tab-dot { background: var(--accent2); }

/* ── Live zone ── */
[data-theme="light"] .live-zone {
  border-color: rgba(158,171,205,0.3);
  background: rgba(158,171,205,0.07);
}
[data-theme="light"] .live-zone-header {
  background: rgba(158,171,205,0.16);
  border-bottom-color: rgba(158,171,205,0.22);
  color: #2E4070;
}
[data-theme="light"] .live-pulse               { background: var(--accent2); }
[data-theme="light"] .live-count               { background: var(--accent2); color: #fff; }
[data-theme="light"] .live-card                { border-bottom-color: rgba(158,171,205,0.12); }
[data-theme="light"] .live-card:hover          { background: rgba(158,171,205,0.08); }
[data-theme="light"] .live-card-league         { color: var(--ink3); }
[data-theme="light"] .live-card-name           { color: var(--ink); }
[data-theme="light"] .live-score-num           { color: #2E4070; }
[data-theme="light"] .live-card-status         { color: #2E4070; opacity: 0.85; }

/* ── Date dividers ── */
[data-theme="light"] .date-divider::before,
[data-theme="light"] .date-divider::after { background: var(--line); }
[data-theme="light"] .date-divider-label  {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink3);
}

/* ── Misc ── */
[data-theme="light"] .league-count { color: var(--ink3); }
[data-theme="light"] .no-matches   { color: var(--ink3); }

/* ── H2H sections — light card on pale bg ── */
[data-theme="light"] .h2h-section        { background: var(--surface); border-color: var(--line); }
[data-theme="light"] .h2h-section-title  { color: var(--ink2); border-bottom-color: var(--line); }

[data-theme="light"] .h2h-hero {
  background: var(--surface);
  border-bottom-color: var(--line);
}
[data-theme="light"] .h2h-hero-team-title,
[data-theme="light"] .h2h-hero-team-name,
[data-theme="light"] .h2h-hero-team-name a,
[data-theme="light"] .h2h-hero-matchup { color: var(--ink); }
[data-theme="light"] .h2h-hero-record,
[data-theme="light"] .h2h-hero-record-strong { color: var(--ink); }
[data-theme="light"] .h2h-form-box.h2h-form-box--hero { color: #fff; }
[data-theme="light"] .h2h-dot--empty { background: var(--line); color: var(--ink3); }
[data-theme="light"] .h2h-dot--win {
  background: color-mix(in srgb, #2E7D32 38%, var(--surface));
  color: #1B5E20;
}
[data-theme="light"] .h2h-dot--loss {
  background: color-mix(in srgb, #C62828 34%, var(--surface));
  color: #B71C1C;
}
[data-theme="light"] .h2h-dot--draw {
  background: color-mix(in srgb, var(--ink3) 22%, var(--surface));
  color: var(--ink2);
}
[data-theme="light"] .h2h-hero-logo,
[data-theme="light"] .h2h-hero-badge {
  background: var(--surface2);
  border-color: var(--line);
}
[data-theme="light"] .h2h-last10-empty { color: var(--ink3); }
[data-theme="light"] .h2h-left-body > .h2h-section:first-child { border-top-color: var(--line); }

/* Stat bars */
[data-theme="light"] .h2h-split-bar,
[data-theme="light"] .h2h-stat-bar-wrap { background: var(--line); }

/* Milestone table */
[data-theme="light"] .h2h-milestone-table th  { border-bottom-color: var(--line); color: var(--ink3); }
[data-theme="light"] .h2h-milestone-label      { border-bottom-color: var(--line); color: var(--ink2); }
[data-theme="light"] .h2h-milestone-val        { border-bottom-color: var(--line); }

/* ── CT comparison table ── */
[data-theme="light"] .h2h-ct-section           { border-color: var(--line); }
/* CT header uses var(--deep) — charcoal, team names gold ✓ */
[data-theme="light"] .h2h-ct-tabs             { background: var(--surface2); border-bottom-color: var(--line); }
[data-theme="light"] .h2h-ct-tab              { color: var(--ink3); }
[data-theme="light"] .h2h-ct-tab:hover        { color: var(--ink2); }
[data-theme="light"] .h2h-ct-tab.active       { color: var(--ink); border-bottom-color: var(--accent1); }
[data-theme="light"] .h2h-ct-label            { color: var(--ink2); border-bottom-color: var(--line); }
[data-theme="light"] .h2h-ct-val              { color: var(--ink);  border-bottom-color: var(--line); }
[data-theme="light"] .h2h-ct-val.h2h-ct-win  { color: #3D1A10; background: rgba(191,161,144,0.25); }
[data-theme="light"] .h2h-ct-table tbody tr:nth-child(odd) .h2h-ct-label,
[data-theme="light"] .h2h-ct-table tbody tr:nth-child(odd) .h2h-ct-val:not(.h2h-ct-win) {
  background: rgba(0,0,0,0.022);
}

/* CT subnav — charcoal strip matching deep */
[data-theme="light"] .h2h-ct-subnav {
  background: #2A2A2A;
  border-bottom-color: #404040;
}
[data-theme="light"] .h2h-ct-sub-btn            { color: rgba(254,223,134,0.5); border-right-color: #404040; }
[data-theme="light"] .h2h-ct-sub-btn:hover      { background: rgba(255,255,255,0.05); color: rgba(254,223,134,0.8); }
[data-theme="light"] .h2h-ct-sub-btn.active     { color: #FEDF86; background: rgba(254,223,134,0.1); }
[data-theme="light"] .h2h-ct-sub-btn.active::after { background: rgba(90,62,0,0.3); }

/* Sidebar + footer */
[data-theme="light"] .h2h-side    { border-left-color: var(--line); }
[data-theme="light"] .site-footer { border-top-color: #333; }


/* ============================================================
   TEAM PAGE
   All colours via CSS variables — works in dark + light mode
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.tm-hero {
    width: 100%;
    background: var(--deep);
    /*border-radius: 6px 6px 0 0;*/
    overflow: hidden;
    border: 1px solid var(--line2);
    border-bottom: none;
    margin-bottom: 0;
}

.tm-hero-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 28px 20px;
}

.tm-hero-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tm-hero-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tm-hero-title-wrap {
    min-width: 0;
}

.tm-team-logo-wrap {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
}

.tm-team-logo,
.tm-team-logo-fallback {
    width: 76px;
    height: 76px;
    border-radius: 8px;
    background: var(--surface2);
    border: 1px solid var(--line2);
}

.tm-team-logo {
    display: block;
    object-fit: contain;
    padding: 8px;
}

.tm-team-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink3);
}

.tm-hero-country {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

.tm-hero-name {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.05;
    letter-spacing: -0.5px;
}

.tm-hero-last10-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ── Hero right stats ────────────────────────────────────── */
.tm-hero-right {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 320px;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    padding-top: 4px;
    align-items: stretch;
    overflow: hidden;
    box-sizing: border-box;
}

.tm-hero-stats {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: space-between;
}

.tm-stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
}

.tm-stat-num {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tm-stat-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

/* ── Win bar ─────────────────────────────────────────────── */
.tm-hero-bar-wrap {
    margin: 0;
    padding: 12px 28px 16px;
    background: rgba(0,0,0,0.15);
}

.tm-hero-bar {
    position: relative;
    width: 100%;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
    min-height: 32px;
}

.tm-hero-bar-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
    padding: 0 10px;
    white-space: nowrap;
}

/* Shown on the track when fill is too narrow (e.g. 0% win rate) */
.tm-hero-bar-label--track {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    padding: 0;
    color: var(--ink2);
}

.tm-hero-bar-fill {
    display: flex;
    align-items: center;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.6s ease;
    min-height: 32px;
}

.tm-hero-bar-footer {
    display: flex;
    justify-content: space-between;
    /*margin-top: 6px;*/
    font-size: 0.7rem;
    color: var(--ink3);
    font-variant-numeric: tabular-nums;
}

/* ── Sections ────────────────────────────────────────────── */
.tm-section {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: none;
    overflow: hidden;
}

.tm-section--first {
    border-top: 1px solid var(--line);
    /*border-radius: 6px 6px 0 0;*/
    /*margin-top: 16px;*/
}

.tm-section:last-child {
    /*border-radius: 0 0 6px 6px;*/
    margin-bottom: 16px;
}

.tm-section-title {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--line);
}

/* h2h-ct-tabs inside tm-section — no negative margin needed, section handles overflow */
.tm-section .h2h-ct-table { table-layout: fixed; width: 100%; }
.tm-section .h2h-ct-th-label { width: 25%; max-width: none; }
.tm-section .h2h-ct-th       { width: 25%; max-width: none; }
.tm-section .h2h-ct-label    { width: 25%; }
.tm-section .h2h-ct-val      { width: 25%; }
.tm-section { --ou-cell-alpha: 0.75; }
[data-theme="light"] .tm-section { --ou-cell-alpha: 0.68; }
[data-theme="light"] .tm-section .h2h-ct-val[class*="h2h-ct-tier-"],
[data-theme="light"] .tm-section .ou-cell[class*="ou-cell--tier-"] .ou-pct,
[data-theme="light"] .tm-section .ou-cell[class*="ou-cell--tier-"] .ou-flat {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
[data-theme="light"] .tm-section .ou-cell:not([class*="ou-cell--tier-"]) .ou-pct {
  color: var(--ink);
  text-shadow: none;
}
[data-theme="light"] .tm-section .ou-cell:not([class*="ou-cell--tier-"]) .ou-flat {
  color: var(--ink2);
}

.tm-ct-tabs {
    margin: 0;
    border-radius: 0;
}

/* ou-block inside team page — flush, no extra border */
.tm-ou-block {
    border: none;
}
.tm-ou-block .tm-section-title {
    padding: 16px 20px 14px;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}
.tm-ou-ctx-tabs,
.tm-ou-inn-tabs {
    margin: 0;
}
.tm-ou-panel.active { overflow-x: auto; }

/* ── Venue split ─────────────────────────────────────────── */
.tm-split-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tm-split-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tm-split-val {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.tm-split-bar-wrap {
    height: 10px;
    background: var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.tm-split-bar {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tm-split-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tm-split-label small { opacity: 0.55; font-weight: 400; }

/* ── Stats grid ──────────────────────────────────────────── */
.tm-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.tm-stat-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--surface2);
    border-radius: 4px;
    border: 1px solid var(--line);
}

.tm-cell-val {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.tm-cell-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
    .tm-hero-inner   { flex-direction: column; }
    .tm-hero-right   {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        gap: 16px;
    }
    .tm-season-inline {
        grid-template-columns: minmax(0, 1fr) 88px;
    }
    .tm-stats-grid   { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .tm-split-grid   { grid-template-columns: repeat(2, 1fr); }
    .tm-stats-grid   { grid-template-columns: repeat(2, 1fr); }
    .tm-stat-num     { font-size: 1.2rem; }
}

/* ── Team stats hub (Averages / Best players / O/U) ─────── */
.tm-stats-hub {
    margin-top: 0;
}
.tm-page-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: var(--surface2);
}
.tm-page-tab {
    flex: 1;
    padding: 16px 12px;
    border: none;
    background: transparent;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
}
.tm-page-tab:hover { color: var(--ink2); }
.tm-page-tab.active { color: var(--gold); }
.tm-page-tab::after {
    content: none;
    display: none;
}
.tm-page-tab.active::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold);
}
.tm-hub-bb-tabs {
    margin: 0;
    border-bottom: 1px solid var(--line);
}
.tm-hub-pane { display: none; }
.tm-hub-pane.active { display: block; }
.tm-hub-pane .tm-bb-panel { display: none; padding: 0; }
.tm-hub-pane .tm-bb-panel.active { display: block; }
.tm-hub-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--ink3);
    font-size: 0.88rem;
}
.tm-avg-scroll,
.tm-bp-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tm-avg-matrix {
    table-layout: fixed;
    width: 100%;
    min-width: 640px;
}
.tm-avg-matrix .h2h-ct-th-label { width: 18%; }
.tm-avg-matrix .h2h-ct-th,
.tm-avg-matrix .h2h-ct-label { width: 13.6%; }
.tm-avg-subtable-wrap {
    border-top: 1px solid var(--line);
    background: var(--surface2);
}
.tm-avg-subtable-title {
    padding: 12px 20px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gold);
}
.tm-avg-hub .tm-ou-ctx-tabs { margin: 0; }
.tm-bp-pos-block { padding: 0; }
.tm-bp-dp-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    margin: 12px 0 8px;
    padding-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.tm-dp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface2);
    padding: 0 8px;
}
.tm-dp-tab {
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tm-dp-tab:hover { color: var(--ink2); }
.tm-dp-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
.tm-dp-panel { display: none; }
.tm-dp-panel.active { display: block; }
.tm-dp-panel .tm-ou-block { border-top: none; }
.tm-ou-hub .tm-dp-panels { min-height: 120px; }

[data-theme="light"] .tm-stats-hub {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="light"] .tm-page-tabs {
  background: var(--surface2);
  border-bottom-color: var(--line);
}
[data-theme="light"] .tm-page-tab { color: var(--ink3); }
[data-theme="light"] .tm-page-tab:hover { color: var(--ink2); }
[data-theme="light"] .tm-page-tab.active { color: rgb(178, 34, 34); }
[data-theme="light"] .tm-page-tab.active::after { background: rgb(178, 34, 34); }
[data-theme="light"] .tm-dp-tab { color: var(--ink3); }
[data-theme="light"] .tm-dp-tab:hover { color: var(--ink2); }
[data-theme="light"] .tm-dp-tab.active { color: rgb(178, 34, 34); border-bottom-color: rgb(178, 34, 34); }
[data-theme="light"] .tm-avg-subtable-title,
[data-theme="light"] .tm-bp-dp-title { color: rgb(178, 34, 34); }
[data-theme="light"] .tm-avg-subtable-wrap { background: var(--surface2); border-top-color: var(--line); }
[data-theme="light"] .tm-bp-view-tabs { background: var(--surface2); border-bottom-color: var(--line); }
[data-theme="light"] .tm-bp-view-tab { color: var(--ink3); }
[data-theme="light"] .tm-bp-view-tab:hover { color: var(--ink2); }
[data-theme="light"] .tm-bp-view-tab.active { color: rgb(178, 34, 34); }
[data-theme="light"] .tm-bp-view-tab.active::after { background: rgb(178, 34, 34); }
/* Player links in table body cells (not header row) */
[data-theme="light"] .tm-bp-table tbody .h2h-ct-label a.player-link,
[data-theme="light"] .h2h-ct-val--name a.player-link,
[data-theme="light"] .squad-td-name a.player-link {
  color: var(--ink);
}
[data-theme="light"] .h2h-page-tabs {
  background: var(--surface);
  border-color: var(--line);
}

/* ── Team: wicket methods ─────────────────────────────────── */
.tm-wm-section {
    margin-top: 0;
}
.tm-wm-note {
    margin: 0;
    padding: 12px 20px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--ink3);
    border-bottom: 1px solid var(--line);
    background: var(--surface2);
}
.tm-wm-section .tm-avg-scroll {
    padding: 0;
}
.tm-wm-matrix .ou-cell {
    text-align: center;
}
.tm-bp-scroll { overflow-x: auto; }
.tm-bp-table { min-width: 720px; table-layout: auto; }
.tm-bp-avg-table { min-width: 560px; max-width: 100%; }
.tm-bp-table .h2h-ct-th-rank,
.tm-bp-table .tm-bp-rank { width: 36px; text-align: center; }
.tm-bp-table .h2h-ct-th-label { min-width: 140px; }
.tm-bp-tabs { padding: 12px 20px 0; }

/* Best players: Averages | Over/Unders */
.tm-bp-split { padding: 0; }
.tm-bp-view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
  margin: 0;
}
.tm-bp-view-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink3);
  cursor: pointer;
  position: relative;
}
.tm-bp-view-tab:hover { color: var(--ink2); }
.tm-bp-view-tab.active { color: var(--gold); }
.tm-bp-view-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}
.tm-bp-view-pane { display: none; padding: 0; }
.tm-bp-view-pane.active { display: block; }
.tm-bp-ou-hub { margin-top: 0; }
.tm-bp-ou-hub .tm-dp-tabs { margin: 0 0 8px; }
.tm-bp-ou-table {
  width: 100%;
  min-width: 480px;
  table-layout: fixed;
}
.tm-bp-ou-table .tm-ou6-th-line,
.tm-bp-ou-table .ou-line {
  width: 88px;
  min-width: 88px;
}
.tm-bp-rank-cell {
  text-align: center;
  vertical-align: middle;
}
.tm-bp-rank-num {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}
.tm-bp-ou-pl-th {
  font-size: 0.88rem;
  font-weight: 700;
  vertical-align: bottom;
  line-height: 1.3;
  min-width: 110px;
  padding: 10px 8px;
}
.tm-bp-ou-pl-th a.player-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 700;
}

/* ── H2H Top players pane ─────────────────────────────────── */
#pane-top {
    border: 1px solid var(--line);
    border-top: none;
    background: var(--surface);
}
.h2h-top-players-section {
    padding: 0;
}
.h2h-top-intro {
    margin: 0;
    padding: 16px 20px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink3);
    border-bottom: 1px solid var(--line);
    background: var(--surface2);
}
.h2h-top-pos-tabs {
    margin: 0;
}
.h2h-top-players-section .h2h-ct-panel {
    display: none;
    padding: 0;
}
.h2h-top-players-section .h2h-ct-panel.active {
    display: block;
}
.h2h-top-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.h2h-top-card {
    border-bottom: 1px solid var(--line);
}
.h2h-top-card:last-child {
    border-bottom: none;
}
.h2h-top-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 16px;
    padding: 14px 20px 10px;
    background: var(--surface2);
    border-bottom: 1px solid var(--line);
}
.h2h-top-card-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gold);
}
.h2h-top-card-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.h2h-top-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.h2h-top-table {
    table-layout: fixed;
    width: 100%;
    min-width: 520px;
}
.h2h-top-table .h2h-ct-th-label { width: 26%; }
.h2h-top-table .h2h-ct-th       { width: 24%; }
.h2h-top-table .h2h-ct-label     { width: 26%; }
.h2h-top-table .h2h-ct-val,
.h2h-top-table .ou-cell          { width: 24%; }
.h2h-top-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--ink3);
    font-size: 0.9rem;
}
.h2h-top-empty code {
    font-size: 0.85em;
    color: var(--ink2);
}

[data-theme="light"] .tm-bp-dp-block .h2h-ct-table {
    background: var(--surface);
}
[data-theme="light"] .tm-wm-note {
    background: var(--surface2);
}
[data-theme="light"] #pane-top {
    background: var(--surface);
    border-color: var(--line);
}
[data-theme="light"] .h2h-top-intro,
[data-theme="light"] .h2h-top-card-head {
    background: var(--surface2);
}
[data-theme="light"] .h2h-top-card-title {
    color: rgb(178, 34, 34);
}

/* ── Light mode: hero bar on pale bg ────────────────────── */
[data-theme="light"] .tm-hero {
    background: var(--surface);
    border-color: var(--line);
}

[data-theme="light"] .tm-hero-country { color: var(--ink3); }
[data-theme="light"] .tm-hero-name    { color: var(--ink); }
[data-theme="light"] .tm-hero-last10-label { color: var(--ink3); }
[data-theme="light"] .tm-stat-label   { color: var(--ink3); }
[data-theme="light"] .tm-stat-num     { color: var(--ink); }
[data-theme="light"] .tm-hero-bar-footer { color: var(--ink3); }

[data-theme="light"] .tm-hero-bar-wrap {
    background: rgba(0,0,0,0.06);
}

[data-theme="light"] .tm-hero-bar {
    background: var(--line);
}

[data-theme="light"] .tm-stat-cell {
    background: var(--surface2);
    border-color: var(--line);
}

[data-theme="light"] .tm-section {
    background: var(--surface);
    border-color: var(--line);
}

[data-theme="light"] .tm-section-title {
    color: var(--ink);
    border-bottom-color: var(--line);
}

[data-theme="light"] .tm-split-bar-wrap {
    background: var(--line);
}

/* ============================================================
   SQUAD WIDGET
   ============================================================ */
.squad-widget {
    width: 100%;
}

.squad-widget-title {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    padding: 4px 4px 10px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.squad-widget-title::after {
    content: none;
}

.squad-widget-arrow {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: auto;
    flex-shrink: 0;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.squad-widget.open .squad-widget-arrow {
    transform: rotate(45deg);
}

.squad-widget-body {
    display: none;
    margin-top: 16px;
    padding: 0 4px 4px;
}

.squad-widget.open .squad-widget-body { display: block; }

.squad-team-label {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 14px 0 8px;
}

.squad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.squad-table thead tr {
    background: var(--deep);
}

.squad-table thead th {
    padding: 8px 10px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(254,223,134,0.6);
    text-align: left;
    white-space: nowrap;
}

.squad-table tbody tr {
    border-bottom: 1px solid var(--line);
}

.squad-table tbody tr:last-child { border-bottom: none; }

.squad-table tbody tr:hover { background: var(--surface2); }
.squad-clickable { cursor: pointer; }

.squad-td-name {
    padding: 6px 10px;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.squad-td-pos,
.squad-td-bat {
    padding: 6px 10px;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
}

.squad-td-bowl {
    padding: 6px 10px 6px 4px;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 600;
    text-align: left;
    color: #9EABCD;
}

.squad-table thead th:nth-child(4) {
    text-align: left;
    padding-left: 4px;
}

.squad-td-pos  { color: var(--ink3); }
.squad-td-bat  { color: var(--gold); }

.squad-empty {
    font-size: 0.78rem;
    color: var(--ink3);
    font-style: italic;
    padding: 8px 0;
}

/* Light mode */
[data-theme="light"] .squad-widget-title { color: var(--ink2); }
[data-theme="light"] .squad-widget-arrow {
  border-right-color: #8B6914;
  border-bottom-color: #8B6914;
}
[data-theme="light"] .squad-table thead tr { background: var(--deep); }
[data-theme="light"] .squad-td-name { color: var(--ink); }
[data-theme="light"] .squad-td-pos  { color: var(--ink3); }
[data-theme="light"] .squad-td-bat  { color: #7A5A20; }
[data-theme="light"] .squad-td-bowl { color: #2E4070; }
[data-theme="light"] .squad-table tbody tr { border-bottom-color: var(--line); }
[data-theme="light"] .squad-table tbody tr:hover { background: var(--surface2); }
.squad-clickable { cursor: pointer; }

.squad-team-header {
    margin: 18px 0 10px;
}

.squad-team-header:first-child { margin-top: 0; }

.squad-team-name {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 6px;
    display: inline-block;
}

/* ── H2H team name link ──────────────────────────────────────── */
a.player-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}
a.player-link:hover {
  text-decoration: underline;
  opacity: 0.88;
}
.h2h-ct-val--name a.player-link {
  font-weight: 600;
}

.h2h-team-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.h2h-team-link:hover { opacity: 0.75; text-decoration: underline; }

/* ── Player page ─────────────────────────────────────────────── */
.pl-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.pl-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pl-badge--pos  { background: var(--line); color: var(--ink3); }
.pl-badge--bat  { background: rgba(254,223,134,0.12); color: var(--gold); }
.pl-badge--bowl { background: rgba(158,171,205,0.12); color: #9EABCD; }

/* Season history table */
.pl-season-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.pl-season-table thead tr {
    background: var(--deep);
}

.pl-season-table thead th {
    padding: 8px 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(254,223,134,0.7);
    text-align: left;
}

.pl-season-table tbody tr {
    border-bottom: 1px solid var(--line);
}

.pl-season-table tbody tr:last-child { border-bottom: none; }
.pl-season-table tbody tr:hover { background: var(--surface2); }

.pl-season-table tbody td {
    padding: 8px 12px;
    color: var(--ink2);
    font-variant-numeric: tabular-nums;
}

.pl-season-table tbody td:first-child { color: var(--ink); font-weight: 500; }

/* Light mode */
[data-theme="light"] .pl-badge--pos  { background: var(--line2); color: var(--ink3); }
[data-theme="light"] .pl-badge--bat  { background: rgba(184,135,58,0.12); color: #7A5A20; }
[data-theme="light"] .pl-badge--bowl { background: rgba(158,171,205,0.18); color: #2E4070; }
[data-theme="light"] .pl-season-table tbody tr:hover { background: var(--surface2); }
[data-theme="light"] .pl-season-table tbody td { color: var(--ink2); }

/* ── Team name colors: gold dark / light neutral ─────────────── */
[data-theme="light"] .h2h-split-header span,
[data-theme="light"] .h2h-stat-names span {
    color: var(--ink) !important;
}

/* Table header rows stay on charcoal (--deep) in light mode — use gold, not body ink */
[data-theme="light"] .h2h-ct-table thead .h2h-ct-th,
[data-theme="light"] .h2h-ct-table thead .h2h-ct-th-rank,
[data-theme="light"] .ou-table thead .ou-th,
[data-theme="light"] .ou-table thead .ou-line-th,
[data-theme="light"] .tm-ou6-th,
[data-theme="light"] .tm-ou6-th-line,
[data-theme="light"] .tm-bp-ou-pl-th,
[data-theme="light"] .pl-stat-th,
[data-theme="light"] .pl-stat-label-th,
[data-theme="light"] .squad-table thead th {
    color: var(--gold) !important;
}

[data-theme="light"] .h2h-ct-table thead .h2h-ct-th-label,
[data-theme="light"] .ou-table thead .ou-line-th,
[data-theme="light"] .tm-ou6-th-line,
[data-theme="light"] .pl-stat-label-th {
    color: rgba(254, 223, 134, 0.72) !important;
}

[data-theme="light"] .h2h-ct-table thead a.player-link,
[data-theme="light"] .tm-bp-ou-pl-th a.player-link,
[data-theme="light"] .tm-bp-ou-table thead a.player-link {
    color: var(--gold) !important;
}

[data-theme="light"] .h2h-ct-table thead a.player-link:hover,
[data-theme="light"] .tm-bp-ou-pl-th a.player-link:hover {
    color: #fff !important;
}

/* ============================================================
   H2H PAGE-LEVEL TABS  (Stats / Overs·Unders)
   ============================================================ */
.h2h-page-tabs {
    display: flex;
    border: 1px solid var(--line);
    border-top: none;
    border-bottom: none;
}

.h2h-page-tab {
    flex: 1;
    padding: 20px 16px;
    border: none;
    background: transparent;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
    text-align: center;
}

.h2h-page-tab:hover { color: var(--ink2); }
.h2h-page-tab.active { color: var(--gold); }
.h2h-page-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}

.h2h-page-pane        { display: none; }
.h2h-page-pane.active { display: block; }

/* ============================================================
   OVERS / UNDERS — flush stack, same as pane-stats
   ============================================================ */
.h2h-ou-wrapper { }
.ou-section { width: 100%; }

/* Batting / Bowling selector — identical to h2h-ct-tabs */
.ou-main-tabs {
    display: flex;
    background: var(--surface2);
}

.ou-main-tab {
    flex: 1;
    padding: 0 8px;
    height: 44px;
    border: none;
    background: none;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}

.ou-main-tab:hover  { color: var(--ink2); }
.ou-main-tab.active { color: var(--ink); }
.ou-main-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
}

.ou-ctx {
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
    color: var(--ink2);
    padding: 8px 24px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ou-toggle {
    font-size: 0.78rem;
    font-weight: 700;
    font-style: normal;
    color: var(--gold);
    background: rgba(254,223,134,0.08);
    border: 1px solid rgba(254,223,134,0.3);
    border-radius: 3px;
    padding: 6px 14px;
    flex-shrink: 0;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.15s, border-color 0.15s;
}
.ou-toggle:hover {
    background: rgba(254,223,134,0.18);
    border-color: rgba(254,223,134,0.6);
}
[data-theme="light"] .ou-toggle {
    color: #5a3e00;
    background: rgba(90,62,0,0.08);
    border-color: rgba(90,62,0,0.3);
}
[data-theme="light"] .ou-toggle:hover {
    background: rgba(90,62,0,0.15);
    border-color: rgba(90,62,0,0.5);
}

/* Panes — no padding, flush */
.ou-pane        { display: none; }
.ou-pane.active { display: block; }

/* Each stat block = h2h-section */
.ou-block {
    width: 100%;
    background: var(--surface);
    padding: 0;
}
.ou-block:last-child {
    padding-bottom: 4px;
}

.ou-block--score-group {
    padding-top: 0;
}

.ou-block--score-group .ou-block-inner {
    padding: 0;
    background: transparent;
}

.ou-block--score-group .ou-block-inner .h2h-section-title {
    display: none;
}

.h2h-ou-block-header {
    border-bottom: 1px solid var(--line);
}

.h2h-ou-sm-tabs {
    display: flex;
    width: 100%;
}

.h2h-ou-sm-tab {
    flex: 1;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    padding: 14px 20px 12px;
    transition: color 0.12s;
    text-align: center;
}

.h2h-ou-sm-tab:hover  { color: var(--ink2); }
.h2h-ou-sm-tab.active { color: var(--gold); }

.h2h-ou-sm-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
}

.h2h-ou-sm-panel        { display: none; }
.h2h-ou-sm-panel.active { display: block; }

.ou-line--section {
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gold);
    background: var(--surface2);
    padding-top: 10px !important;
    padding-bottom: 6px !important;
}

[data-theme="light"] .ou-line--section {
    color: var(--ink2);
    background: var(--deep);
}

.ou-empty-note {
    padding: 16px 24px;
    font-size: 0.78rem;
    color: var(--ink3);
    font-style: italic;
}

[data-theme="light"] .h2h-ou-sm-tab.active { color: var(--ink); }
[data-theme="light"] .h2h-ou-sm-tab.active::after { background: rgba(90, 62, 0, 0.35); }

/* Overview / Overs / Unders tabs — break out of block padding */
.ou-tabs {
    display: flex;
}

.ou-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--surface2);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: background 0.12s, color 0.12s;
}

.ou-tab:hover  { color: var(--ink2); background: var(--surface); }
.ou-tab.active { color: var(--ink); background: var(--surface); }

.ou-block .h2h-section-title { padding-left: 24px; padding-right: 24px; }

.ou-panel        { display: none; }
.ou-panel.active { display: block; }
.ou-panel-scroll { overflow-x: auto; }

/* ── Table ── */
/* ── ou-table mirrors h2h-ct-table ── */
.ou-table { width: 100%; border-collapse: collapse; }

.ou-table thead tr { background: var(--deep); }

.ou-line-th {
  padding: 12px 20px;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(168,144,122,0.45);
  text-align: left;
  width: 30%;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.ou-th {
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #FEDF86;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.ou-line {
  padding: 16px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ou-line-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.ou-line-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ou-table tr.ou-row--detail {
  display: none;
}

.ou-table tr.ou-row--detail.is-visible {
  display: table-row;
}

.ou-row--detail .ou-line-inner {
  padding-left: 12px;
}

.ou-row--detail .ou-line-label {
  font-size: 0.78rem;
  color: var(--ink3);
}

.ou-expand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--ink3);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ou-expand:hover {
  color: var(--ink2);
  border-color: rgba(254, 223, 134, 0.35);
  background: var(--surface);
}

.ou-expand-more { display: inline; }
.ou-expand-less { display: none; }

.ou-expand[aria-expanded="true"] .ou-expand-more { display: none; }
.ou-expand[aria-expanded="true"] .ou-expand-less { display: inline; }

.ou-expand-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.ou-expand-mark::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.12s ease;
}

.ou-expand[aria-expanded="true"] .ou-expand-mark::before {
  transform: translateY(2px) rotate(225deg);
}

@media (max-width: 520px) {
  .ou-expand-text { display: none !important; }
  .ou-expand { padding: 5px; gap: 0; min-width: 20px; }
}

.ou-table tbody tr:nth-child(odd) .ou-line { background: rgba(255,255,255,0.014); }

.ou-cell {
  padding: 16px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  min-width: 90px;
}

.ou-pct {
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
  color: #fff;
}

.ou-flat {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 2px;
  line-height: 1;
}

.ou-na { color: var(--ink3); font-style: italic; font-size: 0.75rem; }
.ou-na-cell { background: rgba(100,100,100,0.06) !important; }

.ou-avg-num { display: block; font-size: 1.05rem; font-weight: 400; color: var(--ink2); line-height: 1.1; }

/* O/U cell tint strength (legacy inline rgba; tier classes below) */
.ou-section { --ou-cell-alpha: 0.75; }

/* Tier fills: 1 = very bad … 5 = very good */
.ou-section .ou-cell--tier-1,
.tm-section .ou-cell--tier-1,
.h2h-ct-tier-1 { background-color: rgba(168, 46, 30, var(--ou-cell-alpha, 0.75)); }
.ou-section .ou-cell--tier-2,
.tm-section .ou-cell--tier-2,
.h2h-ct-tier-2 { background-color: rgba(217, 106, 40, var(--ou-cell-alpha, 0.75)); }
.ou-section .ou-cell--tier-3,
.tm-section .ou-cell--tier-3,
.h2h-ct-tier-3 { background-color: rgba(201, 146, 10, var(--ou-cell-alpha, 0.75)); }
.ou-section .ou-cell--tier-4,
.tm-section .ou-cell--tier-4,
.h2h-ct-tier-4 { background-color: rgba(46, 155, 90, var(--ou-cell-alpha, 0.75)); }
.ou-section .ou-cell--tier-5,
.tm-section .ou-cell--tier-5,
.h2h-ct-tier-5 { background-color: rgba(26, 122, 46, var(--ou-cell-alpha, 0.75)); }

[data-theme="light"] .ou-section .ou-cell--tier-1,
[data-theme="light"] .tm-section .ou-cell--tier-1,
[data-theme="light"] .tm-section .h2h-ct-tier-1 {
  background-color: color-mix(in srgb, #C62828 88%, var(--surface)) !important;
}
[data-theme="light"] .ou-section .ou-cell--tier-2,
[data-theme="light"] .tm-section .ou-cell--tier-2,
[data-theme="light"] .tm-section .h2h-ct-tier-2 {
  background-color: color-mix(in srgb, #E65100 86%, var(--surface)) !important;
}
[data-theme="light"] .ou-section .ou-cell--tier-3,
[data-theme="light"] .tm-section .ou-cell--tier-3,
[data-theme="light"] .tm-section .h2h-ct-tier-3 {
  background-color: color-mix(in srgb, #F9A825 84%, var(--surface)) !important;
}
[data-theme="light"] .ou-section .ou-cell--tier-4,
[data-theme="light"] .tm-section .ou-cell--tier-4,
[data-theme="light"] .tm-section .h2h-ct-tier-4 {
  background-color: color-mix(in srgb, #2E7D32 86%, var(--surface)) !important;
}
[data-theme="light"] .ou-section .ou-cell--tier-5,
[data-theme="light"] .tm-section .ou-cell--tier-5,
[data-theme="light"] .tm-section .h2h-ct-tier-5 {
  background-color: color-mix(in srgb, #1B7A34 88%, var(--surface)) !important;
}

/* Light mode overrides */
[data-theme="light"] .ou-section { --ou-cell-alpha: 0.68; border-color: var(--line); }

[data-theme="light"] .ou-main-tabs { background: var(--surface2); border-bottom-color: var(--line); }
[data-theme="light"] .ou-main-tab.active::after { background: rgb(178,34,34); }
[data-theme="light"] .ou-main-tab { color: var(--ink3); }
[data-theme="light"] .ou-main-tab:hover { color: var(--ink2); }
[data-theme="light"] .ou-main-tab.active { color: var(--ink); }
[data-theme="light"] .ou-tab { background: var(--surface2); color: var(--ink3); border-color: var(--line); }
[data-theme="light"] .ou-tab.active::after { background: rgb(178,34,34); }
[data-theme="light"] .ou-tab:hover { background: var(--surface); color: var(--ink2); }
[data-theme="light"] .ou-tab.active { background: var(--surface); color: var(--ink); }
[data-theme="light"] .ou-table thead tr { background: var(--deep); }
[data-theme="light"] .ou-line { color: var(--ink2); border-bottom-color: var(--line); }
[data-theme="light"] .ou-table tbody tr:nth-child(odd) .ou-line { background: rgba(0,0,0,0.022); }
[data-theme="light"] .ou-avg-num { color: var(--ink2); }
[data-theme="light"] .ou-ctx { color: var(--ink2); }

[data-theme="light"] .ou-section .ou-cell[class*="ou-cell--tier-"] .ou-pct,
[data-theme="light"] .ou-section .ou-cell[class*="ou-cell--tier-"] .ou-flat {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .ou-table .ou-cell--pct:not([class*="ou-cell--tier-"]) .ou-pct,
[data-theme="light"] .ou-table .ou-cell--avg:not([class*="ou-cell--tier-"]) .ou-pct {
  color: #1a1a1a;
  text-shadow: none;
}

[data-theme="light"] .ou-table .ou-cell--pct:not([class*="ou-cell--tier-"]) .ou-flat,
[data-theme="light"] .ou-table .ou-cell--avg:not([class*="ou-cell--tier-"]) .ou-flat {
  color: rgba(26, 26, 26, 0.72);
}

[data-theme="light"] .ou-na-cell {
  background: color-mix(in srgb, var(--line2) 55%, var(--surface)) !important;
}

[data-theme="light"] .ou-expand {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink2);
}

[data-theme="light"] .ou-expand:hover {
  border-color: rgba(120, 53, 15, 0.35);
  color: var(--ink);
}

[data-theme="light"] .ou-row--detail .ou-line-label {
  color: var(--ink3);
}
[data-theme="light"] .h2h-page-tab { color: var(--ink3); }
[data-theme="light"] .h2h-page-tab:hover { color: var(--ink2); }
[data-theme="light"] .h2h-page-tab.active { color: var(--ink); }
[data-theme="light"] .h2h-page-tab.active::after { background: rgb(178,34,34); }

/* ============================================================
   TEAM PAGE — O/U BLOCK TABS
   ============================================================ */
.tm-ou-block {
}

/* Context tabs: All / Home / Away — full width like h2h-ct-tabs */
.tm-ou-ctx-tabs {
    display: flex;
    background: var(--surface2);
    margin: 0 -24px;
}

.tm-ou-ctx-tab {
    flex: 1;
    padding: 0 8px;
    height: 38px;
    border: none;
    border-right: 1px solid var(--line);
    background: none;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}
.tm-ou-ctx-tab:last-child { border-right: none; }
.tm-ou-ctx-tab:hover  { color: var(--ink2); }
.tm-ou-ctx-tab.active { color: var(--ink); }
.tm-ou-ctx-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
}

/* Inning tabs: Overall / Inning 1-4 — smaller, below ctx */
.tm-ou-inn-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    margin: 0 -24px;
}

.tm-ou-inn-tab {
    flex: 1;
    padding: 7px 4px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.12s;
}
.tm-ou-inn-tab:hover  { color: var(--ink2); }
.tm-ou-inn-tab.active { color: var(--ink); }
.tm-ou-inn-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
}

/* Panels */
.tm-ou-panel        { display: none; }
.tm-ou-panel.active { display: block; overflow-x: auto; }

/* Avg row */
.tm-ou-avg-row { background: rgba(255,255,255,0.03); }
.tm-ou-avg-label { font-weight: 700; color: var(--ink); }
.tm-ou-avg-val {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink2);
    text-align: center;
}

/* Table wrapper — no extra margin needed, panels handle it */
.tm-ou-table { width: 100%; border-collapse: collapse; }

.tm-no-data {
    padding: 24px;
    color: var(--ink3);
    font-size: 0.82rem;
    text-align: center;
    font-style: italic;
}

/* Light mode */
[data-theme="light"] .tm-ou-ctx-tab { color: var(--ink3); border-color: var(--line); }
[data-theme="light"] .tm-ou-ctx-tab.active { color: var(--ink); }
[data-theme="light"] .tm-ou-inn-tab { background: transparent; color: var(--ink3); }
[data-theme="light"] .tm-ou-inn-tab.active { color: var(--ink); }
[data-theme="light"] .tm-ou-inn-tab.active::after { background: rgba(90,62,0,0.3); }
[data-theme="light"] .tm-ou-avg-row { background: rgba(0,0,0,0.02); }

/* ── tm-ou-ctx-panel ── */
.tm-ou-ctx-panel        { display: none; }
.tm-ou-ctx-panel.active { display: block; }

/* ── 6-column O/U table ── */
.tm-ou6-table { width: 100%; border-collapse: collapse; table-layout: fixed; }

.tm-ou6-th-line {
    padding: 12px 16px;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(168,144,122,0.45);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--deep);
    width: 14%;
}

.tm-ou6-th {
    padding: 12px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #FEDF86;
    text-align: center;
    background: var(--deep);
    white-space: nowrap;
    width: 17.2%;
}

.tm-ou6-table .h2h-ct-label {
    padding: 11px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    width: 14%;
}

.tm-ou6-table .ou-cell {
    padding: 11px 6px;
    width: 17.2%;
}

[data-theme="light"] .tm-ou6-th-line { background: var(--deep); }
[data-theme="light"] .tm-ou6-th      { background: var(--deep); }

/* ── Block header: title + sm-tabs on same row ── */
.tm-ou-block-header {
}

/* sm-tabs fill the whole header row identically to tm-section-title */
.tm-ou-sm-tabs {
    display: flex;
    width: 100%;
}

/* Non-interactive title for simple blocks (no sub-metrics) */
.tm-ou-sm-title {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    padding: 14px 20px 12px;
    display: block;
}

.tm-ou-sm-tab {
    flex: 1;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    padding: 14px 20px 12px;
    transition: color 0.12s;
    text-align: center;
}
.tm-ou-sm-tab:hover  { color: var(--ink2); }
.tm-ou-sm-tab.active { color: var(--gold); }
.tm-ou-sm-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
}

.tm-ou-sm-panel        { display: none; }
.tm-ou-sm-panel.active { display: block; }

[data-theme="light"] .tm-ou-block-header { border-color: var(--line); }
[data-theme="light"] .tm-ou-sm-title { color: var(--ink); }
[data-theme="light"] .tm-ou-sm-tab { color: var(--ink3); border-left-color: var(--line); }
[data-theme="light"] .tm-ou-sm-tab:hover { color: var(--ink2); }
[data-theme="light"] .tm-ou-sm-tab.active { color: var(--ink); }
[data-theme="light"] .tm-ou-sm-tab.active::after { background: rgba(90,62,0,0.3); }

/* ============================================================
   BATTING / BOWLING BIG TABS
   ============================================================ */
.tm-bat-bow-section {
    padding: 0;
    overflow: hidden;
}

.tm-bb-tabs {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--line);
}

.tm-bb-tab {
    flex: 1;
    padding: 20px 16px;
    border: none;
    background: transparent;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.15s, background 0.15s;
    text-align: center;
}
.tm-bb-tab:hover { color: var(--ink2); }
.tm-bb-tab.active {
    color: var(--gold);
    background: transparent;
}
.tm-bb-tab::after {
    content: none;
    display: none;
}
.tm-bb-tab.active::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}

.tm-bb-panel        { display: none; }
.tm-bb-panel.active { display: block; }

[data-theme="light"] .tm-bb-tabs { border-color: var(--line); }
[data-theme="light"] .tm-bb-tab { background: transparent; color: var(--ink3); border-color: var(--line); }
[data-theme="light"] .tm-bb-tab:hover { color: var(--ink2); }
[data-theme="light"] .tm-bb-tab.active { color: var(--ink); background: transparent; }
[data-theme="light"] .tm-bb-tab.active::after { background: rgba(90,62,0,0.3); }
/* ============================================================
   TOURNAMENT / SEASON TAB SELECTOR (team + player pages)
   ============================================================ */
.tm-tourn-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--line);
    border-top: none;
    background: var(--surface2);
    overflow-x: auto;
}

.tm-tourn-tab {
    padding: 9px 18px;
    border: none;
    border-right: 1px solid var(--line);
    background: transparent;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.15s;
}
.tm-tourn-tab:last-child { border-right: none; }
.tm-tourn-tab:hover  { color: var(--ink2); }
.tm-tourn-tab.active { color: var(--gold); }
.tm-tourn-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
}

[data-theme="light"] .tm-tourn-tabs { background: var(--surface2); border-color: var(--line); }
[data-theme="light"] .tm-tourn-tab { color: var(--ink3); border-color: var(--line); }
[data-theme="light"] .tm-tourn-tab:hover  { color: var(--ink2); }
[data-theme="light"] .tm-tourn-tab.active { color: var(--ink); }
[data-theme="light"] .tm-tourn-tab.active::after { background: rgba(178,34,34,1); }

/* ============================================================
   SEASON / TOURNAMENT SELECTOR
   ============================================================ */
.tm-season-inline {
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: grid;
    /* Fixed column widths — label length must not change layout */
    grid-template-columns: 216px 88px;
    gap: 8px;
    box-sizing: border-box;
    /* allow dropdown menus to escape / stack above */
    position: relative;
    z-index: 5;
}

.tm-season-inline > .tm-dd,
.tm-season-inline > .tm-season-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* ============================================================
   CUSTOM DROPDOWN (replaces native <select> menu styling limits)
   ============================================================ */
.tm-dd {
    position: relative;
    width: 100%;
    min-width: 0;
}

/* Keep the real select for state/accessibility, but hide it. */
.tm-dd-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.tm-dd-btn {
    width: 100%;
    max-width: 100%;
    background: var(--surface2);
    border: 1px solid var(--line2);
    border-radius: 3px;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    height: 36px;
    line-height: 1;
    padding: 0 28px 0 8px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    min-width: 0;
}

.tm-dd-btn-label {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}
.tm-dd-btn:hover { border-color: var(--ink3); }
.tm-dd-btn:focus { border-color: var(--gold); }

.tm-dd-btn::after {
    content: '';
    position: absolute;
    right: 10px;
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23FEDF86' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 10px 6px;
    pointer-events: none;
}

.tm-dd-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px; /* overridden inline when opened */
    z-index: 99999;
    background: var(--surface2);
    border: 1px solid var(--line2);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    display: none;
    max-height: 280px;
}
.tm-dd.open .tm-dd-menu { display: block; }

.tm-dd-item {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: var(--gold);
    text-align: center;
    cursor: pointer;
}
.tm-dd-item:hover { background: rgba(254,223,134,0.08); }
.tm-dd-item[aria-selected="true"] { background: rgba(254,223,134,0.14); }

[data-theme="light"] .tm-dd-btn {
    background-color: var(--surface);
    border-color: var(--line2);
    color: var(--ink);
}
[data-theme="light"] .tm-dd-btn::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231A1A1A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
[data-theme="light"] .tm-dd-menu { background: var(--surface); }
[data-theme="light"] .tm-dd-item { color: var(--ink); }

.tm-season-select {
    width: 100%;
    max-width: 100%;
    background: var(--surface2);
    border: 1px solid var(--line2);
    border-radius: 3px;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    height: 36px;
    line-height: 36px;
    padding: 0 34px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    text-align-last: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23FEDF86' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.tm-season-select:hover { border-color: var(--ink3); }
.tm-season-select:focus { border-color: var(--gold); outline: none; }
.tm-season-select option { background: var(--surface2); color: var(--gold); }

[data-theme="light"] .tm-season-select {
    background-color: var(--surface);
    border-color: var(--line2);
    color: var(--ink);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231A1A1A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
[data-theme="light"] .tm-season-select option { background: var(--surface); color: var(--ink); }

.tm-season-select option {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    text-align: center;
}

/* ============================================================
   PLAYER PAGE — HERO ADDITIONS
   ============================================================ */
.pl-current-team {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--ink3);
}
.pl-current-team-link {
    margin-left: 6px;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
}
.pl-current-team-link:hover { text-decoration: underline; }

.pl-photo-wrap {
    margin-bottom: 12px;
}

.pl-photo-placeholder {
    width: 72px;
    height: 72px;
    background: var(--surface2);
    border: 2px solid var(--line2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--ink3);
}

.pl-photo-img {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--surface2);
    border: 2px solid var(--line2);
    display: block;
}

.pl-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pl-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid var(--line);
}

.pl-last10-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.pl-last-match {
    font-size: 0.68rem;
    color: var(--ink3);
    font-style: italic;
}

.pl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pl-badge {
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--surface2);
    border: 1px solid var(--line2);
    color: var(--ink2);
}

.pl-badge--pos  { color: var(--gold); border-color: rgba(254,223,134,0.3); background: rgba(254,223,134,0.08); }
.pl-badge--bat  { color: var(--win);  border-color: rgba(74,173,104,0.3);  background: rgba(74,173,104,0.08);  }
.pl-badge--bowl { color: var(--loss); border-color: rgba(232,96,74,0.3);   background: rgba(232,96,74,0.08);   }

/* ============================================================
   PLAYER STATS TABLE
   ============================================================ */
.pl-stat-scroll { overflow-x: auto; }

.pl-stat-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.pl-stat-label-th {
    padding: 10px 16px;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(168,144,122,0.45);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--deep);
    width: 20%;
}

.pl-stat-th {
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #FEDF86;
    text-align: center;
    background: var(--deep);
    white-space: nowrap;
    width: 16%;
}

.pl-stat-label {
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.pl-stat-val {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.pl-stat-avg {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.1;
}

.pl-stat-sub {
    display: block;
    font-size: 0.58rem;
    color: var(--ink3);
    margin-top: 2px;
    line-height: 1;
}

.pl-stat-na { background: rgba(100,100,100,0.06); }
.pl-stat-na .pl-stat-avg,
.pl-stat-na .pl-stat-sub { color: var(--ink3); opacity: 0.5; }

.pl-stat-table tbody tr:nth-child(odd) .pl-stat-label,
.pl-stat-table tbody tr:nth-child(odd) .pl-stat-val:not(.pl-stat-na) {
    background: rgba(255,255,255,0.014);
}

.pl-nodata {
    padding: 24px;
    text-align: center;
    color: var(--ink3);
    font-style: italic;
    font-size: 0.82rem;
}

/* Light mode */
[data-theme="light"] .pl-photo-placeholder { background: var(--surface2); border-color: var(--line); color: var(--ink3); }
[data-theme="light"] .pl-photo-img,
[data-theme="light"] .tm-team-logo,
[data-theme="light"] .tm-team-logo-fallback,
[data-theme="light"] .h2h-hero-logo {
    background: var(--surface2);
    border-color: var(--line);
}
[data-theme="light"] .pl-badge { background: var(--surface2); border-color: var(--line); color: var(--ink2); }
[data-theme="light"] .pl-stat-label-th { background: var(--deep); }
[data-theme="light"] .pl-stat-th { background: var(--deep); }
[data-theme="light"] .pl-stat-label { color: var(--ink2); border-color: var(--line); }
[data-theme="light"] .pl-stat-val { border-color: var(--line); }
[data-theme="light"] .pl-stat-avg { color: var(--ink); }
[data-theme="light"] .pl-stat-table tbody tr:nth-child(odd) .pl-stat-label,
[data-theme="light"] .pl-stat-table tbody tr:nth-child(odd) .pl-stat-val:not(.pl-stat-na) {
    background: rgba(0,0,0,0.022);
}

/* Player info blocks (position, batting, bowling, age, height) */
.pl-info-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.pl-info-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pl-info-val {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--ink);
}

.pl-info-label {
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink3);
}

[data-theme="light"] .pl-info-val   { color: var(--ink); }
[data-theme="light"] .pl-info-label { color: var(--ink3); }
[data-theme="light"] .pl-info-blocks { border-color: var(--line); }

/* Clickable h2h-dot */
a.h2h-dot, .h2h-dot--link {
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, filter 0.1s;
}
a.h2h-dot:hover, .h2h-dot--link:hover {
    transform: scale(1.2);
    filter: brightness(1.3);
}

/* Player info table */
.pl-hero .tm-hero-left {
    flex: 1 1 auto;
}

.pl-hero .tm-hero-right {
    flex: 0 0 430px;
    width: 430px;
    min-width: 430px;
    max-width: 430px;
}

.pl-hero .tm-season-inline {
    grid-template-columns: minmax(0, 1fr) 120px;
}

.pl-info-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 12px;
}

.pl-info-td-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink3);
    padding: 4px 12px 4px 0;
    white-space: nowrap;
    width: 40%;
}

.pl-info-td-val {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--ink);
    padding: 4px 0;
}

[data-theme="light"] .pl-info-td-label { color: var(--ink3); }
[data-theme="light"] .pl-info-td-val   { color: var(--ink); }

/* ── H2H dot tooltip ─────────────────────────────────────────── */
.h2h-dot {
    position: relative;
}

.h2h-dot[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--deep);
    color: var(--ink);
    font-size: 0.68rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid var(--line2);
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.h2h-dot[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--line2);
    pointer-events: none;
    z-index: 101;
}

[data-theme="light"] .h2h-dot[title]:hover::after {
    background: var(--surface);
    border-color: var(--line2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Player stats ctx tabs (All / Home / Away) ── */
.pl-ctx-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
}

.pl-ctx-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.12s;
}
.pl-ctx-tab:hover  { color: var(--ink2); }
.pl-ctx-tab.active { color: var(--ink); }
.pl-ctx-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
}

.pl-ctx-panel        { display: none; }
.pl-ctx-panel.active { display: block; }

[data-theme="light"] .pl-ctx-tab { color: var(--ink3); }
[data-theme="light"] .pl-ctx-tab:hover  { color: var(--ink2); }
[data-theme="light"] .pl-ctx-tab.active { color: var(--ink); }
[data-theme="light"] .pl-ctx-tab.active::after { background: rgba(178,34,34,1); }


/* ============================================================
   PLAYER TEAMMATES SIDEBAR WIDGET
   ============================================================ */
.page-content:has(.pl-squad-widget) .site-sidebar,
.pl-has-sidebar .site-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.page-content:has(.pl-squad-widget) .site-main,
.pl-has-sidebar .site-main {
    width: calc(100% - 276px);
}

.pl-squad-widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.pl-squad-title {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    padding: 10px 14px;
    background: var(--deep);
    border-bottom: 1px solid var(--line2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-squad-list { display: flex; flex-direction: column; }

a.pl-squad-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--line);
    transition: background 0.1s;
}
a.pl-squad-row:last-child { border-bottom: none; }
a.pl-squad-row:hover { background: var(--surface2); }

.pl-squad-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pl-squad-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-squad-pos {
    font-size: 0.62rem;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pl-squad-mp {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--ink3);
    flex-shrink: 0;
    margin-left: 8px;
}

[data-theme="light"] .pl-squad-widget { background: var(--surface); border-color: var(--line); }
[data-theme="light"] .pl-squad-title  { background: var(--deep); }
[data-theme="light"] .pl-squad-name   { color: var(--ink); }
[data-theme="light"] a.pl-squad-row:hover { background: var(--surface2); }

/* ── Player page: collapsible squad widget ── */
.pl-squad-collapsible .squad-table { display: none; }
.pl-squad-collapsible.pl-squad-open .squad-table { display: table; }

.pl-squad-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.pl-squad-toggle:hover { opacity: 0.85; }

/* Override the generic squad-widget chevron (we render our own span). */
.pl-squad-toggle::after {
    content: none;
}

.pl-squad-arrow {
    font-size: 1.1rem;
    color: var(--gold);
    transform: rotate(90deg);
    transition: transform 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
    margin-left: auto;
}

.pl-squad-open .pl-squad-arrow {
    transform: rotate(-90deg);
}

/* Squad section wrapper */
.pl-squad-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pl-squad-section-title {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    padding: 14px 0 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

[data-theme="light"] .pl-squad-section-title {
    color: var(--ink);
    border-bottom-color: var(--line);
}
/* ── Error pages (404 / 500) ──────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 20px 100px;
  gap: 10px;
}
.error-code {
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 2px;
}
.error-title {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.error-blurb {
  max-width: 420px;
  font-size: 0.92rem;
  color: var(--ink3);
  line-height: 1.5;
}
.error-home {
  margin-top: 14px;
  padding: 10px 22px;
  background: var(--gold);
  color: var(--deep);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  text-decoration: none;
}
.error-home:hover { background: var(--gold-d); }