/* ==========================================================
   v179.9.19 — WRIGLEY RESET
   One fixed Wrigley palette. Default owns all structure.
   Visual identity only: green metal, cream chalk, yellow marks.
   ========================================================== */
body[data-theme-family="wrigley"]{
  --wr-green-950:#062b20;
  --wr-green-900:#083628;
  --wr-green-850:#0b422f;
  --wr-green-800:#0f4b36;
  --wr-green-750:#14573f;
  --wr-green-700:#1a6047;
  --wr-green-650:#216b50;
  --wr-line:#6f887a;
  --wr-line-soft:#466656;
  --wr-cream:#f3ecdc;
  --wr-cream-muted:#c9c7b9;
  --wr-cream-dim:#aeb8aa;
  --wr-yellow:#efc94b;
  --wr-yellow-soft:#d9b845;
  --wr-red:#d85143;
  --wr-shadow:rgba(0,16,10,.26);
  --bg:var(--wr-green-950)!important;
  --panel:var(--wr-green-800)!important;
  --panel2:var(--wr-green-750)!important;
  --line:var(--wr-line)!important;
  --ink:var(--wr-cream)!important;
  --muted:var(--wr-cream-muted)!important;
  --accent:var(--wr-yellow)!important;
  --score-out:var(--wr-red)!important;
  --score-run:var(--wr-yellow)!important;
  color-scheme:dark;
  color:var(--wr-cream)!important;
}
/* fixed palette: saved Dark Mode preference never changes Wrigley */
body[data-theme-family="wrigley"].dark-mode{color-scheme:dark;}

body[data-theme-family="wrigley"],
body[data-theme-family="wrigley"] .app-shell,
body[data-theme-family="wrigley"] #main,
body[data-theme-family="wrigley"] main,
body[data-theme-family="wrigley"] .mode-page-shell{
  background-color:var(--wr-green-950)!important;
  background-image:
    linear-gradient(rgba(243,236,220,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(243,236,220,.025) 1px,transparent 1px),
    radial-gradient(circle at 50% -10%,rgba(58,112,82,.20),transparent 38%),
    linear-gradient(180deg,var(--wr-green-900),var(--wr-green-950))!important;
  background-size:52px 52px,52px 52px,100% 100%,100% 100%!important;
  color:var(--wr-cream)!important;
}

/* One metal-panel language across cards, workspace sections, library and reports. */
body[data-theme-family="wrigley"] :is(
  .card,.live-game-bar,.game-info,.matchup-selector,.standings-overview,.team-scorebook,
  .mode-page-head,.mode-help-strip,.summary-hero,.summary-line-card,
  .pitch-dashboard-card,.pitch-atbat,.v126-plays-toolbar,.v126-inning-card,
  .v105-linescore,.v105-stat-block,.v163-stat-card,.v163-team-card,.v163-intro,
  .saved-games-head,.saved-game-card,.saved-games-empty,.library-content>section,
  .v175-source-nav,.v175-library-summary>div,.v175-source-empty,.v175-team-card,
  .v167-summary-panel,.game-report-card,.game-report-actions,
  .v162-detail-section,.v162-detail-hero,.v162-detail-content
){
  background:linear-gradient(180deg,var(--wr-green-800),var(--wr-green-850))!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line)!important;
  box-shadow:inset 0 1px 0 rgba(243,236,220,.06),0 6px 18px var(--wr-shadow)!important;
}
body[data-theme-family="wrigley"] :is(.topbar,.v97-current-game,.live-game-bar,.v162-detail-hero){
  background:linear-gradient(180deg,var(--wr-green-850),var(--wr-green-900))!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line)!important;
}

/* Chalk typography. Serif is reserved for major titles only. */
body[data-theme-family="wrigley"] :is(.topbar h1,.v97-home-brand h1,.mode-page-head h2,.saved-games-head h2,.page-title,.modal-head>div>strong,.drawer-head h2,.v162-detail-hero h2){
  font-family:Georgia,'Times New Roman',serif!important;
  color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] :is(h1,h2,h3,h4,strong,b,label,.card-title,.pane-title,.section-page-title){color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] :is(p,small,em,.page-subtitle,.settings-hint,.v102-manager-note){color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] a{color:var(--wr-cream)!important;}

/* Home */
body[data-theme-family="wrigley"].home-page .v97-home{background:transparent!important;color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"].home-page :is(.v97-settings-button,.v97-brand-mark,.v97-save-line>span){
  background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;
}
body[data-theme-family="wrigley"].home-page .v97-current-game{
  background:linear-gradient(180deg,var(--wr-green-800),var(--wr-green-850))!important;
  border-color:var(--wr-line)!important;
}
body[data-theme-family="wrigley"].home-page .v97-current-head>span i{background:var(--wr-yellow)!important;box-shadow:0 0 0 4px rgba(239,201,75,.14)!important;}
body[data-theme-family="wrigley"].home-page :is(.v97-current-head em,.v97-home-tabs,.v97-home-actions button,.v97-continue,.launch-postgame){
  background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"].home-page .v97-home-tabs button{background:transparent!important;color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"].home-page .v97-home-tabs button.active{color:var(--wr-cream)!important;box-shadow:inset 0 -3px var(--wr-yellow)!important;}
body[data-theme-family="wrigley"].home-page .v97-action-icon{background:var(--wr-green-850)!important;color:var(--wr-yellow)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"].home-page .v97-continue{border-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"].home-page .v97-home-footer{border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"].home-page .v97-home-footer>span{color:var(--wr-yellow)!important;}

/* Workspace navigation and mobile bar */
body[data-theme-family="wrigley"] :is(.mode-workspace-tabs,.workspace-tabs,.v163-stats-nav,.mobile-action-bar){
  background:var(--wr-green-850)!important;border-color:var(--wr-line)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.mode-workspace-tabs,.workspace-tabs,.v163-stats-nav) button{
  background:transparent!important;color:var(--wr-cream-muted)!important;border-color:var(--wr-line-soft)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.mode-workspace-tabs,.workspace-tabs,.v163-stats-nav) button.active{
  background:var(--wr-green-900)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;box-shadow:inset 0 -4px var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] :is(.mode-workspace-tabs,.workspace-tabs,.v163-stats-nav) button.active *{color:var(--wr-yellow)!important;-webkit-text-fill-color:currentColor!important;}
body[data-theme-family="wrigley"] .mobile-action-bar button,
body[data-theme-family="wrigley"] .mobile-action-bar button *{color:var(--wr-cream)!important;-webkit-text-fill-color:currentColor!important;}
body[data-theme-family="wrigley"] .mobile-action-bar button.is-active:not(.score-command){box-shadow:inset 0 3px var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] #mobileScore{background:var(--wr-green-900)!important;border-color:var(--wr-line)!important;color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] #mobileScore>span{color:var(--wr-yellow)!important;-webkit-text-fill-color:var(--wr-yellow)!important;}

/* Scorecard: green tables, yellow notation, no pale islands. */
body[data-theme-family="wrigley"] :is(.unified-score-table,.unified-score-table table,.unified-score-table thead,.unified-score-table tbody,.unified-score-table tfoot){background:transparent!important;color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] .unified-score-table :is(th,td){background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] .unified-score-table thead th,
body[data-theme-family="wrigley"] .unified-score-table :is(.sticky-lineup-banner,.sticky-totals-label){background:var(--wr-green-850)!important;color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] .unified-score-table .current-batter .sticky-ord{background:var(--wr-yellow)!important;color:var(--wr-green-950)!important;}
body[data-theme-family="wrigley"] .unified-score-table :is(.pa-code,.notation,.rbi-code,.score-path,.score-mark){color:var(--wr-yellow)!important;stroke:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] .standalone-out{color:var(--wr-red)!important;}
body[data-theme-family="wrigley"] :is(.pane-title,.team-scorebook-head,.overview-title,.card-title,.defense-pane-title){background:var(--wr-green-850)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] :is(.section-collapse,.add-pitcher-btn){background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-line)!important;}

/* Defensive alignment */
body[data-theme-family="wrigley"] :is(.team-defense-field,.v140-defense-field,.v1697-defense-field,.fielder-grid){
  background:linear-gradient(180deg,var(--wr-green-750),var(--wr-green-800))!important;border-color:var(--wr-line)!important;color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] .team-defense-pos{
  background:var(--wr-green-850)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] .team-defense-pos>span{background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] .team-defense-pos :is(b,strong,small){color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] .team-defense-pos.is-filled{border-color:var(--wr-yellow)!important;}

/* Stats, Pitches, Plays: all data surfaces stay green. */
body[data-theme-family="wrigley"] :is(table,thead,tbody,tfoot,tr){background:transparent!important;color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] :is(th,td){border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.v105-stat-table,.v105-stat-table th,.v105-stat-table td,.v163-stat-table,.v163-stat-table th,.v163-stat-table td,.report-table,.report-table th,.report-table td){background:var(--wr-green-800)!important;color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] :is(.v105-stat-table th,.v163-stat-table th,.report-table th){background:var(--wr-green-850)!important;color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] :is(.team-total,.team-total-row,.v105-team-total,tfoot tr){background:var(--wr-green-850)!important;color:var(--wr-cream)!important;box-shadow:inset 0 3px var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] :is(.pitch-kpis>span,.pitch-outcomes>span,.pitch-event-kpis>span,.team-stat-kpis>span,.v105-stat-kpis>span){
  background:var(--wr-green-750)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;
}
body[data-theme-family="wrigley"] .pitch-dashboard-head>b{background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] .pitch-usage span{background:var(--wr-green-900)!important;}
body[data-theme-family="wrigley"] .pitch-usage span>i{background:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] :is(.v126-play-event,.v105-play-event){background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.v126-result-pill,.play-kind){background:var(--wr-green-900)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] :is(.v126-play-filters,.v105-play-filters) button.active{background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-yellow)!important;}

/* Strike zones: the one strong yellow visual language. */
body[data-theme-family="wrigley"] :is(.v138-strike-zone,.v142-strike-zone,.v1625-zone,.v1627-zone,.pitch-zone,.mini-strike-zone,[class*="strike-zone"]){
  background:transparent!important;border-color:var(--wr-yellow)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.v138-strike-zone,.v142-strike-zone,.v1625-zone,.v1627-zone,.pitch-zone,.mini-strike-zone,[class*="strike-zone"]) :is(i,span){border-color:var(--wr-line-soft)!important;}

/* Library */
body[data-theme-family="wrigley"] :is(.scorebook-library-page,.v175-library){color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] :is(.v175-source-nav,.library-tabs,.library-controls,.v175-library-summary>div,.v175-team-mark,.v175-season-title,.v175-season-tabs,.v175-source-empty,.saved-game-card,.collection-card){
  background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.v175-source-nav button,.library-tabs button){background:transparent!important;color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] :is(.v175-source-nav button.active,.library-tabs button.active){background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;box-shadow:inset 0 -4px var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] :is(.v175-source-nav button small,.saved-games-head>span,.saved-status,.saved-current){background:var(--wr-green-850)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] :is(.saved-primary,[data-history-new],.v175-source-empty>button){background:var(--wr-green-900)!important;color:var(--wr-cream)!important;border-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] :is(.saved-delete,.danger,.danger-zone button){background:var(--wr-green-900)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;}

/* Modals + drawer: same green panel system, no cream/white islands. */
body[data-theme-family="wrigley"] :is(.modal,#drawerShade){background:rgba(1,20,13,.74)!important;}
body[data-theme-family="wrigley"] :is(.modal-card,#drawer){
  background:linear-gradient(180deg,var(--wr-green-800),var(--wr-green-850))!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;box-shadow:0 18px 50px rgba(0,15,9,.38)!important;
}
body[data-theme-family="wrigley"] :is(.modal-head,.drawer-head,.setup-actions,.play-actions,.play-footer,.v137-editor-footer,.v140-defense-footer,.v167-postgame-footer){
  background:var(--wr-green-850)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;
}
body[data-theme-family="wrigley"] :is(.sheet-handle,.drawer-handle){background:var(--wr-line)!important;}
body[data-theme-family="wrigley"] :is(.modal section,.modal article,.modal .card,.modal [class$="-panel"],.modal [class$="-readout"],.modal [class$="-strip"],.modal [class$="-preview"],.modal [class$="-segment"],.modal [class$="-toggle"],.modal [class$="-row"],.modal [class$="-bar"],.modal [class$="-box"]){
  background:var(--wr-green-750)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(input,select,textarea){
  background:var(--wr-green-900)!important;color:var(--wr-cream)!important;-webkit-text-fill-color:var(--wr-cream)!important;border-color:var(--wr-line)!important;caret-color:var(--wr-yellow)!important;accent-color:var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] :is(input,textarea)::placeholder{color:var(--wr-cream-dim)!important;-webkit-text-fill-color:var(--wr-cream-dim)!important;opacity:1!important;}
body[data-theme-family="wrigley"] :is(.modal button,#drawer button,.v101-menu-tile,.v101-quick-grid button,.export-import-tile){
  background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.modal button.active,.modal button.selected,.modal button.is-selected,.modal button[aria-pressed="true"],.modal button[aria-selected="true"],#drawer button.is-on){
  background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-yellow)!important;box-shadow:inset 0 -3px var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] :is(button.primary,#applyPlayBtn,#applyPlay,.v162-jump-button,.v167-postgame-footer button.primary){
  background:var(--wr-green-900)!important;color:var(--wr-cream)!important;border-color:var(--wr-yellow)!important;box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.v101-menu-icon,.v101-quick-icon,.game-info-icon,.v102-info-icon){
  background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-line)!important;
}
body[data-theme-family="wrigley"] #playModal :is([data-v140-result="Ball"],[data-v141-quick="Ball"],[data-v140-result="Called Strike"],[data-v141-quick="Strike"]){
  color:var(--wr-cream)!important;-webkit-text-fill-color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] #playModal :is([data-v140-result="Called Strike"],[data-v141-quick="Strike"]){border-color:var(--wr-yellow)!important;}

/* Play Details */
body[data-theme-family="wrigley"] :is(.v162-facts>span,.v162-facts>div,.v162-detail-facts>span,.v162-detail-facts>div){background:var(--wr-green-850)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.v1627-log-row,.v1625-log-row){background:transparent!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.v1627-log-row.v1625-active,.v1625-log-row.active){background:var(--wr-green-900)!important;border-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] :is(.v1627-filter,.v16210-filter).active{background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-yellow)!important;}

/* Standings */
body[data-theme-family="wrigley"] :is(.standings-card,.standings-grid,.standings-grid>div){background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.standings-head,.standings-grid>.head,.standings-foot){background:var(--wr-green-850)!important;color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] .standings-grid>.standings-selected{background:var(--wr-green-900)!important;color:var(--wr-cream)!important;border-color:var(--wr-yellow)!important;box-shadow:inset 4px 0 var(--wr-yellow)!important;}

/* Selection and focus */
body[data-theme-family="wrigley"] :focus-visible{outline-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] ::selection{background:var(--wr-yellow)!important;color:var(--wr-green-950)!important;}

/* Keep text strictly cream/white; yellow is reserved for selected/notation accents. */
body[data-theme-family="wrigley"] :is(.modal,.card,#drawer,.mode-page-shell,.saved-games-page) :is(span,strong,b,small,p,label,em,h1,h2,h3,h4){-webkit-text-fill-color:currentColor;}
/* Fixed-palette icon treatment: no moon/sun metaphor inside Wrigley. */
body[data-theme-family="wrigley"] #drawerDarkBtn>span{position:relative!important;color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] #drawerDarkBtn>span svg{opacity:0!important;}
body[data-theme-family="wrigley"] #drawerDarkBtn>span::after{content:"●";position:absolute;inset:0;display:grid;place-items:center;color:var(--wr-yellow);font-size:18px;}
body[data-theme-family="wrigley"] #appearanceDarkBtn>span{font-size:0!important;color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] #appearanceDarkBtn>span::after{content:"●";font-size:18px;color:var(--wr-yellow);}


/* ==========================================================
   v179.9.19 — HARD THEME ISOLATION / LEGACY COMPATIBILITY
   Wrigley never inherits theme-default or dark-mode appearance.
   These tokens catch older components that still read custom vars.
   ========================================================== */
body[data-theme-family="wrigley"]{
  --custom-bg:var(--wr-green-950)!important;
  --custom-bg2:var(--wr-green-900)!important;
  --custom-header:var(--wr-green-900)!important;
  --custom-panel:var(--wr-green-800)!important;
  --custom-panel2:var(--wr-green-750)!important;
  --custom-line:var(--wr-line)!important;
  --custom-drawer:var(--wr-green-800)!important;
  --custom-drawer2:var(--wr-green-750)!important;
  --custom-accent:var(--wr-yellow)!important;
  --custom-accent-safe:var(--wr-yellow)!important;
  --custom-accent-ink:var(--wr-green-950)!important;
  --custom-selected:var(--wr-green-850)!important;
  --custom-text:var(--wr-cream)!important;
  --custom-muted:var(--wr-cream-muted)!important;
  --custom-grid:var(--wr-green-800)!important;
  --custom-grid-sticky:var(--wr-green-750)!important;
  --custom-grid-head:var(--wr-green-850)!important;
  --custom-grid-line:var(--wr-line-soft)!important;
  --custom-score-mark:var(--wr-yellow)!important;
  --custom-score-outline:var(--wr-green-950)!important;
  --score-grid-bg:var(--wr-green-800)!important;
  --score-grid-sticky:var(--wr-green-750)!important;
  --score-grid-head:var(--wr-green-850)!important;
  --score-grid-line:var(--wr-line-soft)!important;
}

/* Prevent neutral / white islands in legacy direct children. */
body[data-theme-family="wrigley"] :is(
  .game-info>div,.game-info-grid>div,.game-info-field,.game-info-value,
  .matchup-selector>*,.matchup-team-target,.live-team,.live-inning,
  .standings-overview>*,.standings-overview table,.standings-overview th,.standings-overview td,
  .pitch-kpi,.pitch-stat,.pitch-metric,.pitch-summary-stat,.pitch-tracking-stat,
  .v163-stat-table,.v163-stat-table th,.v163-stat-table td,.v163-team-summary,
  .v162-detail-facts>*,.v162-facts>*,.v162-pitch-log,.v162-pitch-map,
  .defense-field,.defense-position,.team-defense-footer,
  .v175-library-head,.v175-library-card,.v175-count,.v175-team-card,
  .saved-appearance-note,.saved-filter-bar,
  .settings-section,.settings-card,.shortcut-grid kbd
){
  background-color:var(--wr-green-800)!important;
  background-image:none!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}

/* Home game strip was a common Default-white leak. */
body[data-theme-family="wrigley"].home-page .v97-game-row{
  background:var(--wr-green-900)!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line-soft)!important;
}
body[data-theme-family="wrigley"].home-page .v97-game-row :is(span,b,small,em){color:var(--wr-cream)!important;}

/* Game information: simple green cells, yellow icons, cream values. */
body[data-theme-family="wrigley"] :is(.game-info,.v102-game-info,.v102-info-grid){background:var(--wr-green-800)!important;color:var(--wr-cream)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] :is(.game-info-item,.game-info-cell,.v102-info-grid>label,.v102-info-grid>div){background:var(--wr-green-750)!important;color:var(--wr-cream)!important;border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.game-info-icon,.v102-info-icon){background:var(--wr-green-900)!important;color:var(--wr-yellow)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] :is(.game-info-value,.v102-info-grid input,.v102-info-grid select){background:var(--wr-green-900)!important;color:var(--wr-cream)!important;-webkit-text-fill-color:var(--wr-cream)!important;}

/* Team matchup header: full names centered, with no visual native selector chrome. */
body[data-theme-family="wrigley"] .matchup-selector{background:var(--wr-green-800)!important;border-color:var(--wr-line)!important;}
body[data-theme-family="wrigley"] .matchup-team-target{background:transparent!important;border:0!important;box-shadow:none!important;}
body[data-theme-family="wrigley"] .matchup-team-copy strong{color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] .matchup-team-copy small{color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] .matchup-separator{color:var(--wr-yellow)!important;}

/* Strike zones and score notation. */
body[data-theme-family="wrigley"] :is(.strike-zone,.pitch-zone,.v140-strike-zone,.v162-strike-zone,.v16210-zone,.mini-strike-zone){border-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] :is(.strike-zone,.pitch-zone,.v140-strike-zone,.v162-strike-zone,.v16210-zone,.mini-strike-zone) :is(i,span,div){border-color:var(--wr-line-soft)!important;}
body[data-theme-family="wrigley"] :is(.pa-code,.notation,.rbi-code,.score-path,.score-mark,.score-notation){color:var(--wr-yellow)!important;stroke:var(--wr-yellow)!important;}

/* Pitch semantics: yellow Ball, red Strike, cream neutral. */
body[data-theme-family="wrigley"] #playModal :is([data-v140-result="Ball"],[data-v141-quick="Ball"],.pitch-result-ball){color:var(--wr-yellow)!important;border-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] #playModal :is([data-v140-result="Called Strike"],[data-v141-quick="Strike"],.pitch-result-strike){color:var(--wr-red)!important;border-color:var(--wr-red)!important;}

/* Ensure disabled / empty states remain legible instead of becoming cream-on-cream. */
body[data-theme-family="wrigley"] :is(button,select,input,textarea):disabled{opacity:.58!important;}
body[data-theme-family="wrigley"] :is(.empty,.empty-state,.report-empty,.v175-source-empty) :is(p,small,span){color:var(--wr-cream-muted)!important;}

/* Wrigley has no dark-mode variant: defensive guard even if stale classes arrive. */
body[data-theme-family="wrigley"].dark-mode,
body[data-theme-family="wrigley"].dark{
  color-scheme:dark!important;
}

/* ==========================================================
   v179.9.19 — SEAMLESS SURFACE SYSTEM
   One visible surface per component. Inner wrappers inherit the
   parent surface unless they are genuinely interactive controls.
   The More sheet is the reference language for the whole theme.
   ========================================================== */
body[data-theme-family="wrigley"]{
  /* Legacy premium UI tokens must resolve to Wrigley too.  Keeping
     surface and surface-2 equal prevents nested Default-style boxes. */
  --ui-bg:var(--wr-green-950)!important;
  --ui-surface:var(--wr-green-800)!important;
  --ui-surface-2:var(--wr-green-800)!important;
  --ui-line:var(--wr-line)!important;
  --ui-text:var(--wr-cream)!important;
  --ui-muted:var(--wr-cream-muted)!important;
  --ui-shadow:none!important;
  --text:var(--wr-cream)!important;
  --ink:var(--wr-cream)!important;
  --card:var(--wr-green-800)!important;
  --soft:var(--wr-green-800)!important;
  --surface-soft:var(--wr-green-800)!important;
  --selected:var(--wr-green-850)!important;
}

/* No nested card should create its own contrasting fill just because the
   Default theme used a second white/gray surface. */
body[data-theme-family="wrigley"] :is(
  .game-field-copy,.v102-info-tile,.v102-info-tile>span,
  .v101-quick-tile>span,.v101-menu-icon,.v101-export-icon,
  .v101-appearance-display button>span,.v101-archive-row>span,
  .v171-assist-strip>div,.v172-guardrail-strip>div,
  .pitch-kpis>span,.pitch-outcomes>span,.pitch-event-kpis>span,
  .team-stat-kpis>span,.v105-stat-kpis>span,
  .v162-facts>div,.v162-detail-facts>div,
  .v163-source-note,.v163-id-pane,.v163-stat-grid,
  .v175-count,.saved-status,.saved-current
){
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}

/* ---------- Scorecard game information ---------- */
body[data-theme-family="wrigley"] .game-info{
  background:var(--wr-green-800)!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .game-info .game-field{
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .game-info .game-info-icon{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] .game-info .game-field-copy :is(input,textarea){
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] .game-info .game-field-copy :is(input,textarea):focus{
  outline:0!important;
  box-shadow:none!important;
}

/* Matchup names sit directly on the matchup panel; native select chrome stays hidden. */
body[data-theme-family="wrigley"] .matchup-selector :is(.matchup-team,.matchup-team-target,.matchup-team-copy){
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .matchup-selector :is(select,.team-header-select){
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
}

/* ---------- More sheet: reference treatment ---------- */
body[data-theme-family="wrigley"] #drawer{
  --ui-surface:var(--wr-green-800)!important;
  --ui-surface-2:var(--wr-green-800)!important;
  --ui-text:var(--wr-cream)!important;
  --ui-muted:var(--wr-cream-muted)!important;
  --ui-line:var(--wr-line)!important;
}
body[data-theme-family="wrigley"] #drawer :is(.drawer-head strong,.drawer-head b,.drawer-head h2){
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] #drawer .drawer-head small,
body[data-theme-family="wrigley"] #drawer .drawer-label{color:var(--wr-cream-muted)!important;-webkit-text-fill-color:currentColor!important;}
body[data-theme-family="wrigley"] #drawer :is(.v101-quick-tile,.v101-menu-tile){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #drawer .v101-quick-tile>span,
body[data-theme-family="wrigley"] #drawer .v101-menu-icon{
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  color:var(--wr-yellow)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #drawer :is(.v101-quick-tile,.v101-menu-tile) :is(strong,b){color:var(--wr-cream)!important;}
body[data-theme-family="wrigley"] #drawer :is(.v101-quick-tile,.v101-menu-tile) small{color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] #drawer .v101-danger-tile{
  background:transparent!important;
  color:#ef9b91!important;
  border-color:color-mix(in srgb,var(--wr-red) 55%,var(--wr-line))!important;
}
body[data-theme-family="wrigley"] #drawer .v101-danger-tile :is(strong,small,.v101-menu-icon){color:#ef9b91!important;}

/* Bottom navigation never turns into a white selected tile in Wrigley. */
body[data-theme-family="wrigley"] .v92-action-bar,
body[data-theme-family="wrigley"] .v90-action-bar{
  background:var(--wr-green-850)!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .v92-action-bar button.is-active:not(.score-command),
body[data-theme-family="wrigley"] .v90-action-bar button.is-active:not(.score-command){
  background:var(--wr-green-850)!important;
  color:var(--wr-cream)!important;
  box-shadow:inset 0 3px var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] .v92-action-bar button.is-active:not(.score-command) :is(span,small),
body[data-theme-family="wrigley"] .v90-action-bar button.is-active:not(.score-command) :is(span,small){color:var(--wr-cream)!important;}

/* ---------- Game Information modal ---------- */
body[data-theme-family="wrigley"] #gameInfoManagerModal .v102-info-grid{
  background:transparent!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #gameInfoManagerModal .v102-info-tile{
  background:transparent!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #gameInfoManagerModal .v102-info-tile>span{
  background:transparent!important;
  border:0!important;
  color:var(--wr-yellow)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #gameInfoManagerModal .v102-info-tile :is(input,textarea){
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] #gameInfoManagerModal .v102-team-pair :is(select){
  background:transparent!important;
  border-color:var(--wr-line)!important;
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
}

/* ---------- Lineups ---------- */
body[data-theme-family="wrigley"] #lineupManagerModal .v102-side-tabs{
  background:transparent!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #lineupManagerModal .v102-side-tabs button{
  background:transparent!important;
  color:var(--wr-cream-muted)!important;
  border-color:transparent!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #lineupManagerModal .v102-side-tabs button.active{
  background:var(--wr-green-850)!important;
  color:var(--wr-cream)!important;
  border-color:transparent!important;
  box-shadow:inset 0 -4px var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] #lineupManagerModal .v102-lineup-list,
body[data-theme-family="wrigley"] #lineupManagerModal .v102-lineup-row{
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #lineupManagerModal .v102-lineup-row:active{
  background:var(--wr-green-850)!important;
}

/* ---------- Editor ---------- */
body[data-theme-family="wrigley"] #playModal .play-card{--v137-line:var(--wr-line-soft)!important;--v137-soft:var(--wr-green-800)!important;}
body[data-theme-family="wrigley"] #playModal :is(.v137-editor-section,#pitchTools,.v171-assist-strip,.v172-guardrail-strip){
  background:var(--wr-green-750)!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #playModal :is(.v171-assist-strip,.v172-guardrail-strip) :is(button){
  background:transparent!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #playModal :is(.v171-assist-badge,.v172-guardrail-badge){
  background:var(--wr-green-900)!important;
  color:var(--wr-yellow)!important;
  border:1px solid var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] #playModal :is(input,select,textarea){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line)!important;
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #playModal .v137-zone{
  background-color:transparent!important;
  border-color:var(--wr-line-soft)!important;
}
body[data-theme-family="wrigley"] #playModal .v137-zone:before{
  border-color:var(--wr-yellow)!important;
  background:transparent!important;
}
body[data-theme-family="wrigley"] #playModal .v137-zone i,
body[data-theme-family="wrigley"] #playModal .v137-mini-zone i{
  background:var(--wr-cream)!important;
  border-color:var(--wr-green-950)!important;
  color:var(--wr-green-950)!important;
}
body[data-theme-family="wrigley"] #playModal .v137-mini-zone{background:transparent!important;border-color:var(--wr-line-soft)!important;}

/* Pitch result buttons: no blue. */
body[data-theme-family="wrigley"] #playModal :is([data-v140-result="Ball"],[data-v141-quick="Ball"],.pitch-result-ball){
  background:transparent!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line)!important;
}
body[data-theme-family="wrigley"] #playModal :is([data-v140-result="Called Strike"],[data-v141-quick="Strike"],.pitch-result-strike){
  background:transparent!important;
  color:var(--wr-red)!important;
  border-color:var(--wr-red)!important;
}

/* ---------- Pitches / Plays / Stats ---------- */
body[data-theme-family="wrigley"] :is(
  .pitch-kpis>span,.pitch-outcomes>span,.pitch-event-kpis>span,
  .team-stat-kpis>span,.v105-stat-kpis>span,.v105-rate-grid span,
  .v163-overview-kpis>span
){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.v105-team-head,.v163-team-head,.v163-section-head,.v105-subhead){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
}
body[data-theme-family="wrigley"] :is(.v105-stat-block,.v163-stat-body,.v163-split,.v163-id-pane,.v163-stat-grid){
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.v105-stat-block th,.v105-stat-block td,.v163-id-head,.v163-id-row,.v163-stat-head,.v163-stat-cell){
  background:transparent!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] :is(.v105-stat-block thead th,.v163-id-head,.v163-stat-head){
  color:var(--wr-cream-muted)!important;
}
body[data-theme-family="wrigley"] .v163-source-note{
  background:transparent!important;
  color:var(--wr-cream-muted)!important;
  border-left-color:var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] :is(.v126-play-event,.v162-event,.v161-event){
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}

/* ---------- Play Details ---------- */
body[data-theme-family="wrigley"] #v162PlayDetailModal .v162-detail-section{
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #v162PlayDetailModal .v162-facts>div{
  background:transparent!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #v162PlayDetailModal :is(.v16210-zone-block,.v1627-zone-block,.v1627-zone-canvas){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1627-zone-box,
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1625-zone-box,
body[data-theme-family="wrigley"] #v162PlayDetailModal .v162-mini-zone-box{
  border-color:var(--wr-yellow)!important;
}
/* neutralize blue ball markers without losing pitch-result meaning */
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1625-zone-marker.tone-ball{
  background:var(--wr-cream)!important;
  color:var(--wr-green-950)!important;
  border-color:var(--wr-green-950)!important;
}
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1625-zone-marker.tone-called,
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1625-zone-marker.tone-swing,
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1625-zone-marker.tone-foul{
  background:var(--wr-red)!important;
  border-color:var(--wr-cream)!important;
}
body[data-theme-family="wrigley"] #v162PlayDetailModal .v1625-zone-marker.tone-play{
  background:var(--wr-yellow)!important;
  color:var(--wr-green-950)!important;
  border-color:var(--wr-green-950)!important;
}

/* ---------- Library ---------- */
body[data-theme-family="wrigley"] :is(.v175-source-nav,.v175-library-summary>div,.v175-source-empty,.v175-team-card,.v175-library-block,.v175-compact-card,.saved-game-card,.collection-card){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .v175-source-nav button.active{
  background:var(--wr-green-850)!important;
  color:var(--wr-cream)!important;
  box-shadow:inset 0 -4px var(--wr-yellow)!important;
}
body[data-theme-family="wrigley"] :is(.v175-source-nav button small,.saved-games-head>span,.v175-count){
  background:transparent!important;
  border-color:var(--wr-line)!important;
  color:var(--wr-cream-muted)!important;
}
body[data-theme-family="wrigley"] .v175-source-empty>button{
  background:var(--wr-green-850)!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-line)!important;
}

/* ---------- New Game / Preferences / Export and other utility sheets ---------- */
body[data-theme-family="wrigley"] .modal-card :is(
  .settings-section,.settings-card,.theme-sub,.v168-export-section,.v168-backup-note,
  .v101-notes-card,.v101-final-card,.v101-archive-row,.v101-postgame-actions button,
  .export-import-tile,.v101-export-grid button,.setup-source-card,.setup-step-card
){
  background:transparent!important;
  background-image:none!important;
  border-color:var(--wr-line-soft)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .modal-card :is(input,select,textarea){
  background:transparent!important;
  background-image:none!important;
  color:var(--wr-cream)!important;
  -webkit-text-fill-color:var(--wr-cream)!important;
  border-color:var(--wr-line)!important;
  box-shadow:none!important;
}
body[data-theme-family="wrigley"] .modal-card :is(button.primary,.primary,#applyPlayBtn){
  background:var(--wr-green-850)!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-yellow)!important;
}

/* One accent rule: yellow may indicate selection/scorekeeping, never entire cream cards. */
body[data-theme-family="wrigley"] :is(.active,.selected,.is-selected,[aria-selected="true"],[aria-pressed="true"]){
  --wrigley-selection-accent:var(--wr-yellow);
}

/* Final nested-surface guard.  The outer modal/sheet is the visible surface;
   ordinary internal wrappers do not create a second colored card. */
body[data-theme-family="wrigley"] .modal :is(
  section,article,.card,[class$="-panel"],[class$="-readout"],[class$="-strip"],
  [class$="-preview"],[class$="-segment"],[class$="-toggle"],[class$="-bar"],[class$="-box"]
){
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
/* Editor workflow sections are intentional top-level sections, so they keep one
   quiet panel surface; their children remain transparent. */
body[data-theme-family="wrigley"] #playModal :is(.v137-editor-section,#pitchTools,.v171-assist-strip,.v172-guardrail-strip){
  background:var(--wr-green-750)!important;
  border-color:var(--wr-line-soft)!important;
}
/* Utility headings and footers are divisions, not contrasting cards. */
body[data-theme-family="wrigley"] :is(.modal-head,.drawer-head,.setup-actions,.play-actions,.play-footer,.v137-editor-footer,.v140-defense-footer,.v167-postgame-footer){
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}

/* Remaining hard-coded accent neutralization from older scorekeeping modules. */
body[data-theme-family="wrigley"] #playModal .v137-zone-head button{color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] #playModal .fielder-grid-pos.selected{
  background:var(--wr-green-850)!important;
  color:var(--wr-cream)!important;
  border-color:var(--wr-yellow)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--wr-yellow) 20%,transparent)!important;
}
body[data-theme-family="wrigley"] #playModal .complete-pa-heading span::before{
  background:var(--wr-green-900)!important;
  color:var(--wr-yellow)!important;
  border:1px solid var(--wr-yellow)!important;
}

/* Play Details uses Wrigley result colors rather than the old blue/purple palette. */
body[data-theme-family="wrigley"] #v162PlayDetailModal .tone-ball{--v1627-tone:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] #v162PlayDetailModal :is(.tone-called,.tone-swing){--v1627-tone:var(--wr-red)!important;}
body[data-theme-family="wrigley"] #v162PlayDetailModal :is(.tone-foul,.tone-play,.tone-event){--v1627-tone:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] #v162PlayDetailModal :is(.tone-hbp,.tone-neutral){--v1627-tone:var(--wr-cream-muted)!important;}

/* Stats / Library old blue identity accents. */
body[data-theme-family="wrigley"] .v163-team.away{border-top-color:var(--wr-yellow)!important;}
body[data-theme-family="wrigley"] .v163-team-head>div:first-child>small{color:var(--wr-cream-muted)!important;}
body[data-theme-family="wrigley"] .v175-compact-source.personal{
  color:var(--wr-yellow)!important;
  border-color:var(--wr-line)!important;
}
body[data-theme-family="wrigley"] .v175-status-filters button.active{
  background:var(--wr-green-850)!important;
  color:var(--wr-yellow)!important;
  border-color:var(--wr-yellow)!important;
}
