/* ============================================================
   CricPedia Broadcast Polish v1 — "Arena + Album"
   Presentation ONLY. No data, no logic, no id/class renames.
   Shell goes dark stadium; cards stay bright album cards with
   gold frames. Every rule is additive; nothing structural moves.
   ============================================================ */

/* ---------- Arena shell ---------- */
html body {
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(245, 158, 11, 0.16), transparent 60%),
    linear-gradient(180deg, #0B1220 0%, #0F172A 34%, #052E22 100%);
  background-attachment: fixed;
}

body > header {
  background: linear-gradient(135deg, #0B1220 0%, #12233A 46%, #064E3B 100%) !important;
  border-bottom: 2px solid #F59E0B !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  color: #F1F5F9;
}
body > header .brand-subtitle { color: #CBD5E1 !important; }
/* Header pills that carried light-green inline styles (readable on the
   old white header, invisible on the dark arena header) go light. */
body > header #header-datetime-chip { background: rgba(255,255,255,0.12) !important; color: #F1F5F9 !important; border-color: rgba(255,255,255,0.30) !important; }
body > header .desktop-only-btn { background: rgba(255,255,255,0.10) !important; color: #F1F5F9 !important; border-color: rgba(255,255,255,0.25) !important; }
body > header .header-actions a.action-btn { background: rgba(255,255,255,0.10) !important; color: #F1F5F9 !important; border-color: rgba(255,255,255,0.25) !important; }
body > header .brand-title { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)); }

body nav.sidebar {
  background: linear-gradient(180deg, #0F172A 0%, #0B1F1A 100%);
  border-right: 2px solid rgba(245, 158, 11, 0.35);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}
body nav.sidebar .nav-btn { color: #CBD5E1; }
body nav.sidebar .nav-btn:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
body nav.sidebar .nav-btn.active {
  background: linear-gradient(135deg, var(--nav-active-bg1), var(--nav-active-bg2));
  color: var(--nav-active-text);
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}
body nav.sidebar h3, body nav.sidebar h4 { color: #FDE68A; }

/* Light content well inside the dark arena */
body .tab-view {
  color: #0F172A;
  background: linear-gradient(180deg, #FDFBF5 0%, #F8F4EA 100%);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

/* ---------- Stage titles (JS marks the first h2 of each tab) ---------- */
.pol-stage-title {
  background: linear-gradient(135deg, #0F172A 0%, #064E3B 100%) !important;
  color: #FDE68A !important;
  padding: 13px 18px !important;
  border-radius: 12px !important;
  border-left: 6px solid #F59E0B !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  margin-bottom: 10px !important;
}

/* ---------- Album cards: gold frames, deeper shadows, gentle lift ---------- */
body .tab-view .match-card,
body .tab-view .record-item-card,
body .tab-view .milestone-card,
body .tab-view .player-item-card,
body .tab-view .player-card,
body .tab-view .series-squad-player-card,
body .tab-view .grassroots-card,
body .tab-view .grassroots-kpi-card,
body .tab-view .icc-detail-stat-card,
body .tab-view .scorecard-summary-card,
body .tab-view .hlx-box,
body .tab-view .sidebar-match-card,
body .tab-view .live-match-box {
  border: 1.5px solid rgba(217, 119, 6, 0.45);
  box-shadow: 0 10px 26px rgba(7, 53, 31, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
}
body .tab-view .match-card { position: relative; }
body .tab-view .match-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F59E0B, #D97706, #F59E0B);
  border-radius: 14px 14px 0 0;
  pointer-events: none;
}
body .tab-view .match-card:hover,
body .tab-view .record-item-card:hover,
body .tab-view .milestone-card:hover,
body .tab-view .player-item-card:hover,
body .tab-view .player-card:hover,
body .tab-view .series-squad-player-card:hover,
body .tab-view .live-match-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(7, 53, 31, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: rgba(217, 119, 6, 0.75);
}

/* Gold buttons glow a little more */
body .action-btn.gold { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45); }
body .section-update-bar { border-color: rgba(217, 119, 6, 0.55); box-shadow: 0 4px 14px rgba(7, 53, 31, 0.08); }
body .section-update-btn { border-color: rgba(217, 119, 6, 0.6); }

/* ---------- Scorecard tables: broadcast header rows ---------- */
body .scorecard-table th,
body .career-table th,
body .player-modal table th,
body .scorecard-modal-box table th,
body #tab-rankings table th,
body #tab-compare table th,
body #tab-rules table th {
  background: #064E3B;
  color: #FDE68A;
}

/* ============================================================
   PER-SECTION STAGES — scoped by tab id, additive only.
   ============================================================ */

/* ---------- Scorecard Hub = Match Theatre ---------- */
body #tab-scorecard-hub .scorecard-hub-hero {
  border: 2px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 158, 11, 0.15);
}
body .player-modal { border: 2px solid #D97706; box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45); }
body .player-modal-header,
body .hub-scm-title { border-bottom: 3px solid #F59E0B; padding-bottom: 10px; }
body .hub-scm-body h3, body .hub-scm-body h4 {
  color: #064E3B; border-left: 5px solid #F59E0B; padding-left: 10px; letter-spacing: 0.2px;
}
/* Ball-by-ball slot + fall of wickets read as a commentary feed */
body .hub-bbb-slot > * { border-left: 3px solid #F59E0B; padding-left: 10px; margin-bottom: 8px; }
body .fow { background: rgba(245, 158, 11, 0.08); border-left: 3px solid #F59E0B; padding: 6px 10px; border-radius: 8px; }
body .hub-highlights-slot iframe { border: 2px solid #D97706; border-radius: 12px; }

/* ---------- Live Centre = TV score bug + commentary feed ---------- */
body #tab-live .live-filter-pill.active { background: var(--gold-gradient); color: #1A1200; border-color: #B45309; }
body #tab-live .live-ticker-score { color: #B45309; font-weight: 900; }
body #tab-live .tile-runs { color: #92400E; font-weight: 900; }
[data-theme="dark"] body #tab-live .tile-runs { color: #F8FAFC; }
body #tab-live .tile-fmt-pill { border-color: rgba(217, 119, 6, 0.6); }
body #tab-live .commentary { border-left: 3px solid #F59E0B; padding-left: 10px; }
body #tab-live .live-ticker-striker { border: 1.5px solid rgba(217, 119, 6, 0.5); border-radius: 10px; }

/* ---------- Highlights = story poster cards ---------- */
body #highlights-index-container > *,
body #hlx-search-results > *,
body .hlx-box {
  border: 1.5px solid rgba(217, 119, 6, 0.5);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(7, 53, 31, 0.14);
  overflow: hidden;
}
body #highlights-index-container iframe,
body #hlx-search-results iframe { border: 2px solid #D97706; border-radius: 12px; }
body #hlx-search-input:focus { border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); outline: none; }
body #hlx-tab-browse.active, body #hlx-tab-search.active { background: var(--gold-gradient); color: #1A1200; border-color: #B45309; }

/* ---------- World Records = Hall of Fame plaques ---------- */
body #tab-records .record-item-card {
  border: 2px solid rgba(217, 119, 6, 0.6);
  box-shadow: 0 12px 30px rgba(7, 53, 31, 0.14), inset 0 0 0 1px rgba(245, 158, 11, 0.15);
}
body #tab-records .record-item-card:hover { border-color: #D97706; }

/* ---------- Match Results = Results Reel ---------- */
body #tab-results button.active { background: var(--gold-gradient); color: #1A1200; border-color: #B45309; }
body #tab-results .match-card { border-left: 5px solid #D97706; }

/* ---------- Schedule = Season Map journey ---------- */
body #tab-schedule .calmg-month-head {
  background: linear-gradient(135deg, #0F172A 0%, #064E3B 100%) !important;
  color: #FDE68A !important; border-left: 6px solid #F59E0B;
  padding: 10px 16px; border-radius: 10px;
}
body #tab-schedule .calmg-month { border-left: 3px solid rgba(217, 119, 6, 0.35); padding-left: 14px; }
body #tab-schedule .calfx-teamrow { border: 1.5px solid rgba(217, 119, 6, 0.45); border-radius: 12px; }
body #tab-schedule .calfx-when { font-weight: 800; color: #92400E; }

/* ---------- Players = trading cards; Legends inherit ---------- */
body #tab-players .player-item-card img,
body #tab-players .player-card img {
  border-radius: 12px; border: 2px solid rgba(245, 158, 11, 0.65);
}
body #tab-players .player-item-card,
body #tab-players .player-card { border-radius: 18px; }

/* ---------- Milestones = Trophy Cabinet ---------- */
body #tab-milestones .milestone-card { border: 2px solid rgba(217, 119, 6, 0.6); }
body #tab-milestones .milestone-figure { color: #B45309; font-weight: 900; }
body #tab-milestones .milestone-verif-pill { border-color: rgba(217, 119, 6, 0.6); }

/* ---------- Press Box = Newsroom front page ---------- */
body #tab-pressbox h3 { font-family: Georgia, 'Times New Roman', serif; letter-spacing: 0.1px; }
body #pressbox-news-container > :first-child,
body #pressbox-videos-container > * {
  border: 2px solid rgba(217, 119, 6, 0.55); border-radius: 16px;
  box-shadow: 0 12px 28px rgba(7, 53, 31, 0.13);
}
body #pressbox-article-body { border: 1.5px solid rgba(217, 119, 6, 0.45); border-radius: 16px; }
body #pressbox-news-container article:hover { background: rgba(245, 158, 11, 0.07); }
body #pressbox-news-container article { border-radius: 8px; }

/* ---------- Squads = Dressing-Room team sheets ----------
   Rendered markup uses cp11 list rows (not .series-squad-player-card).
   No captain marker exists in squad markup/store, so no armband is
   faked; team colours come from each column's own rendered header. */
body #tab-series-squads .cp-squads-col {
  background: #FFFFFF; border: 1.5px solid rgba(217, 119, 6, 0.45);
  border-radius: 14px; padding: 14px;
  box-shadow: 0 10px 26px rgba(7, 53, 31, 0.10);
}
body #tab-series-squads .cp11-avatar {
  border-radius: 50%; border: 2px solid rgba(245, 158, 11, 0.7); object-fit: cover;
}
body #tab-series-squads .cp11-names li {
  border-bottom: 1px solid rgba(217, 119, 6, 0.20); padding: 7px 0;
}
body #tab-series-squads .cp11-names li:hover { background: rgba(245, 158, 11, 0.06); }
body #tab-series-squads h3, body #tab-series-squads h4 {
  background: linear-gradient(135deg, #0F172A 0%, #064E3B 100%) !important;
  color: #FDE68A !important; padding: 9px 14px; border-radius: 10px; border-left: 5px solid #F59E0B;
}
body #tab-series-squads .cp-squads-col.pol-team-pak { border-left: 5px solid #01411C; }
body #tab-series-squads .cp-squads-col.pol-team-ind { border-left: 5px solid #1D4ED8; }
body #tab-series-squads .cp-squads-col.pol-team-eng { border-left: 5px solid #1E3A8A; }
body #tab-series-squads .cp-squads-col.pol-team-aus { border-left: 5px solid #EAB308; }
body #tab-series-squads .cp-squads-col.pol-team-nz { border-left: 5px solid #111827; }
body #tab-series-squads .cp-squads-col.pol-team-sa { border-left: 5px solid #15803D; }
body #tab-series-squads .cp-squads-col.pol-team-sl { border-left: 5px solid #7C3AED; }
body #tab-series-squads .cp-squads-col.pol-team-wi { border-left: 5px solid #7F1D1D; }
body #tab-series-squads .cp-squads-col.pol-team-ban { border-left: 5px solid #047857; }
body #tab-series-squads .cp-squads-col.pol-team-zim { border-left: 5px solid #DC2626; }
body #tab-series-squads .cp-squads-col.pol-team-ire { border-left: 5px solid #16A34A; }
body #tab-series-squads .cp-squads-col.pol-team-afg { border-left: 5px solid #2563EB; }
body #tab-series-squads .cp-squads-col.pol-team-nam { border-left: 5px solid #1D4ED8; }
body #tab-series-squads .cp-squads-col.pol-team-ned { border-left: 5px solid #EA580C; }
body #tab-series-squads .cp-squads-col.pol-team-sco { border-left: 5px solid #1E40AF; }
body #tab-series-squads .cp-squads-col.pol-team-nep { border-left: 5px solid #DC2626; }

/* ---------- Rankings / Compare / Rules / Grassroots / AI-QA / About ---------- */
body #tab-rankings .icc-card-top-line, body #tab-rankings .pm-icc-rank-tile,
body #tab-compare [class*="card"], body #tab-rules [class*="card"],
body #tab-grassroots .grassroots-card, body #tab-grassroots .grassroots-kpi-card {
  border-color: rgba(217, 119, 6, 0.45);
}
body #tab-ai-qa input[type="text"]:focus,
body #tab-ai-qa textarea:focus { border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); outline: none; }
body #tab-about > div:first-child { border: 2px solid rgba(245, 158, 11, 0.55); }

/* ---------- Scorecard modal + Playing 11 ---------- */
/* Playing 11 paper box (rendered above the innings heading by
   playing11.js + paperbox.js): gold album frame + avatar rings. */
body .scorecard-modal-box .cp11-box {
  border: 1.5px solid rgba(217, 119, 6, 0.5); border-radius: 14px;
  box-shadow: 0 10px 26px rgba(7, 53, 31, 0.10);
}
body .scorecard-modal-box .cp11-avatar {
  border-radius: 50%; border: 2px solid rgba(245, 158, 11, 0.7); object-fit: cover;
}
body .scorecard-modal-box .cp11-bar-btn.cp11-bar-on {
  background: var(--gold-gradient); color: #1A1200; border-color: #B45309;
}
body .scorecard-modal-box { border: 2px solid #D97706; }
body .mrm-tabs-bar button.active, body .mrm-tabs-bar .active { background: var(--gold-gradient); color: #1A1200; border-color: #B45309; }

/* ============================================================
   MATCH-DAY HERO + MOBILE BARS + FLASH
   ============================================================ */
#pol-hero {
  background: linear-gradient(135deg, #0B1220 0%, #12233A 50%, #064E3B 100%);
  border: 2px solid #F59E0B;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.pol-hero-eyebrow { color: #FBBF24; letter-spacing: 2px; font-weight: 900; font-size: 12px; }
.pol-hero-sub { color: #CBD5E1; font-size: 13px; margin: 4px 0 14px 0; }
#pol-hero .match-card { margin-bottom: 0; }
.pol-hero-cta {
  margin-top: 12px; background: var(--gold-gradient); color: #1A1200;
  border: none; padding: 9px 16px; border-radius: 20px;
  font-weight: 800; font-family: inherit; font-size: 13px; cursor: pointer;
}
@keyframes polFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.85); }
}
.pol-flash { animation: polFlash 1.2s ease 2; }
@media (prefers-reduced-motion: reduce) { .pol-flash { animation: none; } }

/* ---------- Mobile bars stay arena-dark, active goes gold ---------- */
body #mobile-category-bar { background: #0F172A; border-bottom: 2px solid rgba(245, 158, 11, 0.5); }
body #mobile-category-bar .mobile-cat-pill.active {
  background: var(--gold-gradient) !important; color: #1A1200 !important; border-color: #B45309 !important;
}
body #mobile-bottom-nav { background: #0F172A; border-top: 2px solid rgba(245, 158, 11, 0.5); }
body #mobile-bottom-nav .mobile-nav-item.active { color: #FBBF24; }

/* ---------- Highlights story-swipe on phones ----------
   The container holds ONE grid wrapper div (inline display:grid), so
   the swipe row is retargeted to that wrapper (display beats the inline
   grid via !important); its .hlx-box cards become 86% snap cards. */
@media (max-width: 640px) {
  body #highlights-index-container > div {
    display: flex !important; overflow-x: auto; gap: 14px; padding-bottom: 10px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  body #highlights-index-container > div > .hlx-box { flex: 0 0 86%; scroll-snap-align: start; }
}
