/* Public pages only. No image inversion, scoring state, or staff theme changes. */
html[data-public-theme="dark"] { color-scheme:dark; }
.public-theme-toggle {
    position:fixed; bottom:max(16px,env(safe-area-inset-bottom)); right:16px; z-index:800;
    min-height:44px; max-width:calc(100vw - 32px); padding:10px 16px;
    border:1px solid #52637c; border-radius:999px; background:#17243a; color:#f8fafc;
    box-shadow:0 4px 18px #0003; font:600 14px/1.4 system-ui,sans-serif; cursor:pointer;
}
.public-theme-toggle:focus-visible { outline:3px solid #f59e0b; outline-offset:4px; }
body { padding-bottom:76px; }
html[data-public-theme="light"] {
    color-scheme:light;
    --bg:#e2e9f2; --bg-main:#e2e9f2; --bg-dark:#e2e9f2;
    --card:#fff; --bg-card:#fff; --card-soft:#edf2f8;
    --surface:#fff; --surface-2:#edf2f8; --surface-soft:#edf2f8;
    --text:#17243a; --text-main:#17243a; --muted:#52637a; --text-muted:#52637a;
    --line:#bac8da; --border:#bac8da; --border-color:#bac8da;
    --accent:#925900!important; --accent-hover:#704500; --accent-soft:#fff2d6;
    --green:#087a50; --success:#087a50; --red:#b42332; --blue:#1d58b2;
    --shadow:0 12px 32px #19385810; background:var(--bg); color:var(--text);
}
html[data-public-theme="light"] body { background:var(--bg)!important; color:var(--text)!important; }
html[data-public-theme="light"] .public-theme-toggle { background:#fff; border-color:var(--line); color:var(--text); }
html[data-public-theme="light"] :is(button:not(.public-theme-toggle),select,input) { background:#edf2f8; color:var(--text); border-color:var(--line); }
html[data-public-theme="light"] :is(header,.topbar,#public-site-header,#online-site-header) {
    background:#f8fafcf5; color:var(--text); border-color:var(--line);
}
html[data-public-theme="light"] :is(.hero,.public-hero,.panel,.match-sheet,.mr-panel,.mr-award,.match-card,.cup-card,.stage-card,.team-coach-card,.coach-hero,.profile-card,.feature-card,.rating-card,.history-card,.player-card,.pc-card,.tc-card,.athlete-team,.athlete-award,.athlete-match,.public-card,.home-match,.doc-card,.modal-content) {
    background:#fff; color:var(--text); border-color:var(--line); box-shadow:var(--shadow);
}
html[data-public-theme="light"] :is(.match-card.archived,.match-card.scheduled,.div-card.active,.pc-card:hover,.tc-card:hover,.mr-roster-card:hover) { background:#eaf1fc; }
html[data-public-theme="light"] :is(.hero-head,.modal-header,.table-wrapper,.filter-bar,.match-meta,.set-card,.set-pill,.stats-card,.stat-card,.score-box,.back,.back-btn,.city-select,.city-select option,.filter-group select,.tc-filters input,.tc-filters select,#psh-city,nav a,.tabs button,.tab-btn,.mr-periods button,.contact-link) {
    background:#edf2f8; color:var(--text); border-color:var(--line);
}
html[data-public-theme="light"] :is(.hero,.panel,.profile,.mr-report,.standings-table,.stats-table,.tc-card,.cup-card,.match-card,.coach-hero,.pc-card) :is(h1,h2,h3,strong) { color:var(--text); text-shadow:none; }
html[data-public-theme="light"] :is(.mr-muted,.mr-profile-link,.mr-scale-note,.mr-compare caption,.mr-compare thead th:nth-child(2),.mr-compare tbody th,.mr-set-label,.tc-meta,.coach-cover,.team-coach-role,#public-site-header .psh-city-wrap) { color:var(--muted); }
html[data-public-theme="light"] :is(.mr-compare td,.match-sheet .mr-bars tbody td,.match-sheet .mr-bars tbody th,.cup-title-large,.participant-name-button,.participant-player-name,.tc-emblem) { color:var(--text); }
html[data-public-theme="light"] :is(.mr-panel,.hero-head,.mr-award,.set-summary,.mr-panel th,.mr-panel td,.match-sheet .broadcast-panel,.match-sheet .mr-panel) { border-color:var(--line); }
html[data-public-theme="light"] :is(.mr-hero-badge,.mr-avatar-empty,.pc-photo,.coach-avatar,.team-coach-photo,.player-avatar,.avatar,.logo-placeholder,.stat-icon,.club-emblem) { background:#e2eaf5; color:#52637a; border-color:var(--line); }
html[data-public-theme="light"] .mr-bar-track { background:#e2e8f0; }
html[data-public-theme="light"] :is(.mr-gold,.mr-win,.match-sheet .mr-bars tbody td.mr-win,.mr-award-label) { color:#855100; }
html[data-public-theme="light"] .mr-periods button[aria-pressed="true"] { background:#ffdb76; color:#332100; border-color:#c5891f; }
html[data-public-theme="light"] .public-results-switch button[aria-pressed="true"] { background:#ffdb76; color:#332100; }
html[data-public-theme="light"] .public-results-win { color:#087a50; background:#e5f5ec; }
html[data-public-theme="light"] :is(.public-results-loss,.public-results-live,.error) { color:#b42332; }
html[data-public-theme="light"] .mr-lightbox { background:#fff; color:var(--text); }
html[data-public-theme="light"] .mr-lightbox button { background:#edf2f8; color:var(--text); }
html[data-public-theme="light"] .tc-card { border-top-color:var(--club); }
html[data-public-theme="light"] :is(.home-team-name,.home-match-score,.home-stat-number,.home-social,.home-footer a,.psh-navigation a,.psh-navigation button,.psh-socials a) { color:var(--text); }
html[data-public-theme="light"] :is(.hero-button,.btn-primary,.btn-login,.nav-btn.active,.modal-tab-btn.active) { color:#704500; }
/* Legacy public templates use inline white text. Scope the override to content,
   leaving photographs, video frames and branded covers untouched. */
html[data-public-theme="light"] :is(.modal-body,.section-container,.table-wrapper,.matches-grid) :is([style*="color:#fff"],[style*="color: #fff"],[style*="color:white"],[style*="color: white"]) { color:var(--text)!important; }
html[data-public-theme="light"] .filter-group select option { color:var(--text); background:#fff; }
html[data-public-theme="light"] :is(.hero-button,.btn-primary) { background:#ffdb76; border-color:#c5891f; }
html[data-public-theme="light"] :is(.club-hero,.club-tabs,.item,.player-album .player-info,.roster-view-switch,.profile-hero,.athlete-section,.playoff-shell,.premium-match,.premium-winner,.pair-modal-player,.participant-card,.player,.stat,.timeline-item,.bracket-legend) {
    background:#fff; color:var(--text); border-color:var(--line);
}
html[data-public-theme="light"] :is(.club-tabs button,.roster-view-switch button,.match-filters select,.standings-choice select,.match-row-score,.player-album .player-number,.pair-modal-close,.broadcast-button,button:not(.public-theme-toggle)) {
    color:var(--text);
}
html[data-public-theme="light"] :is(.match-filters select,.standings-choice select,.match-row-score,.player-album .player-number,.roster-view-switch button[aria-pressed="true"],.team-standing-table thead,.team-standing-table .standing-current,.item:hover,.pair-modal-close) { background:#edf2f8; }
html[data-public-theme="light"] :is(.match-row,.match-filters .future-switch,.club-tabs button[aria-selected="true"],.athlete-section h3,.athlete-muted,.athlete-match-teams b,.bracket-round-head,.premium-team.loser,.premium-score,.premium-winner-pair,.premium-winner-pair a,.legend-title,.pair-card-player,.pair-modal-head h2,.pair-modal-player .player-link,.stage-all-matches .team,.score-main,.score-divider,.participant-card-action,.set-team-name,.set-team-row.winner .set-team-name,.set-points,.broadcast-title,.public-phase-title,.public-all-matches>summary,.public-match-phase-title,.hero-description) { color:var(--text); }
html[data-public-theme="light"] :is(.status.live,.premium-team.winner,.premium-team.winner .premium-score,.premium-match-status,.home-live) { color:#087a50; }
html[data-public-theme="light"] :is(.status.finished,.athlete-entry-badge,.broadcast-button,.broadcast-icon) { color:#1d58b2; }
html[data-public-theme="light"] :is(.score-number.winner-score,.winner-badge,.set-win-mark,.set-team-row.winner .set-points,.set-summary-item .winner-point,.athlete-award>span:first-child,.athlete-count,.place.gold,.premium-winner-message) { color:#855100; }
html[data-public-theme="light"] :is(.set-summary,.set-summary-separator,.set-summary-bracket,.place.silver) { color:var(--muted); }
html[data-public-theme="light"] .hero-button.primary { background:#ffdb76; color:#332100; }
html[data-public-theme="light"] .hero-button.secondary { background:#edf2f8; color:var(--text); }
html[data-public-theme="light"] .premium-winner { background:#fff7df; }
html[data-public-theme="light"] .bronze-title { color:#743aa5; }
html[data-public-theme="light"] :is(.sched-badge,.play-btn) { background:#ffdb76; color:#332100; }
html[data-public-theme="light"] :is(.classic-bracket-shell,.classic-bracket-match,.classic-bracket-winner-card,.classic-bracket-winner-avatar) { background:#fff; color:var(--text); border-color:var(--line); }
html[data-public-theme="light"] :is(.classic-bracket-round-title,.classic-bracket-team,.classic-bracket-score,.classic-bracket-winner-name) { color:var(--text); }
html[data-public-theme="light"] :is(.classic-bracket-team.is-winner,.classic-bracket-team.is-winner .classic-bracket-score,.classic-bracket-status.is-finished) { color:#087a50; }
html[data-public-theme="light"] .classic-bracket-status.is-live { color:#1d58b2; }
html[data-public-theme="light"] :is(.classic-bracket-medal-label,.classic-bracket-match-head,.classic-bracket-winner-message) { color:#855100; }
html[data-public-theme="light"] :is(a,button,input,select,summary):focus-visible { outline:3px solid #1d58b2; outline-offset:3px; }
@media(max-width:480px) { .public-theme-toggle { right:12px; padding:9px 13px; font-size:13px; } }

/* Contrast polish: dark brand surfaces are intentional, not leftover dark theme. */
html[data-public-theme="light"] :is(#online-site-header,#public-site-header) {
    background:#142038; color:#f8fafc; border-bottom-color:#344966;
    --psh-accent:#ffcf70;
}
html[data-public-theme="light"] #public-site-header .psh-brand,
html[data-public-theme="light"] #online-site-header #header-logo,
html[data-public-theme="light"] #online-site-header .nav-btn,
html[data-public-theme="light"] #public-site-header .psh-navigation a {
    color:#f8fafc; background:transparent;
}
html[data-public-theme="light"] #online-site-header .nav-btn.active,
html[data-public-theme="light"] #online-site-header .nav-btn:hover,
html[data-public-theme="light"] #public-site-header .psh-navigation a:hover,
html[data-public-theme="light"] #public-site-header .psh-navigation a[aria-current="page"] {
    color:#ffcf70; box-shadow:inset 0 -2px #ffcf70;
}
html[data-public-theme="light"] #online-site-header #city-selector,
html[data-public-theme="light"] #public-site-header #psh-city {
    background:#243650; color:#f8fafc; border-color:#60718b;
}
html[data-public-theme="light"] #public-site-header .psh-city-wrap { color:#dce7f6; }
html[data-public-theme="light"] :is(.panel,.athlete-section,.profile-hero,.pc-card,.tc-card,.match-sheet,.mr-panel) {
    box-shadow:0 4px 16px #19385812;
}
html[data-public-theme="light"] :is(.branch-team a,.branch-entry a) { color:#855100; }
html[data-public-theme="light"] .branch-season { border-color:var(--line); background:#f5f8fc; }
html[data-public-theme="light"] .branch-season summary {
    background:#d5e0ee; color:#17243a; border-bottom:1px solid var(--line);
}
html[data-public-theme="light"] :is(.branch-nav,nav.club-tabs) { background:#d5e0ee; border-color:var(--line); }
html[data-public-theme="light"] :is(.branch-nav a,nav.club-tabs button) {
    background:transparent; color:#243650;
}
html[data-public-theme="light"] nav.club-tabs button[aria-selected="true"] {
    background:#142038; color:#fff; box-shadow:inset 0 -3px #ffcf70;
}
html[data-public-theme="light"] .branch-nav a:hover { background:#c5d4e7; }
html[data-public-theme="light"] #profile > header.club-hero {
    background:linear-gradient(145deg,var(--team-header-color,#18243a),var(--team-header-deep,#142038));
    color:#f8fafc;
}
html[data-public-theme="light"] #profile > header.club-hero :is(h1,h2,h3,.muted,.branch-coach,.team-coach-card,.team-coach-info) {
    color:#f8fafc;
}
html[data-public-theme="light"] #profile > header.club-hero :is(.club-eyebrow,.team-coach-role,a:not(.branch-coach)) { color:#ffcf70; }
html[data-public-theme="light"] #profile > header.club-hero .team-coach-card {
    background:#243650; border-color:#60718b; box-shadow:none;
}
html[data-public-theme="light"] #profile > header.club-hero .team-coach-card:hover { background:#304766; }
html[data-public-theme="light"] .match-row { background:#fff; border-color:var(--line); }
html[data-public-theme="light"] .match-row:hover,
html[data-public-theme="light"] .match-row:focus-visible { background:#dce8f7; color:#17243a; }
html[data-public-theme="light"] :is(.match-row-date,.match-row-meta) { color:#52637a; }
html[data-public-theme="light"] .team-standing-table :is(th,td) { border-color:var(--line); }
html[data-public-theme="light"] .team-standing-table thead { background:#d5e0ee; }
html[data-public-theme="light"] .team-standing-table .standing-current { background:#dce8f7; }
