/* Semantic page colours. Brand colours remain fixed for logos and navigation. */
:root {
    color-scheme: light dark;
    --bg: light-dark(#eef1f4, #141a24);
    --panel: light-dark(rgba(255, 255, 255, .94), rgba(34, 42, 56, .96));
    --panel-strong: light-dark(#ffffff, #222a38);
    --ink: light-dark(#252a37, #edf1f7);
    --muted: light-dark(#586074, #b5c0d0);
    --line: light-dark(rgba(37, 42, 55, .14), rgba(199, 208, 216, .2));
    --accent-ink: light-dark(#6b5910, #e3cf5b);
    --link: light-dark(#6542bb, #c5afff);
    --danger: light-dark(#a63f3f, #ffaaa4);
    --success: light-dark(#1d7a54, #83dcb3);
    --warning: light-dark(#93552f, #f5ba82);
    --shadow: 0 18px 40px light-dark(rgba(37, 42, 55, .1), rgba(0, 0, 0, .18));
}
/* Numeric channels cannot use light-dark(); keep these explicit for rgba(). */
:root { --surface-rgb:255, 255, 255; --ink-rgb:37, 42, 55; }
:root[data-theme="dark"] { --surface-rgb:34, 42, 56; --ink-rgb:237, 241, 247; }
@media (prefers-color-scheme:dark) {
    :root:not([data-theme]) { --surface-rgb:34, 42, 56; --ink-rgb:237, 241, 247; }
}
body { background:var(--bg); }
h1, h2, h3, h4, h5, h6, .eyebrow { color:var(--ink); }
input, select, textarea { background:var(--panel-strong); }
input::placeholder, textarea::placeholder { color:var(--muted); opacity:1; }
th, td { border-bottom-color:var(--line); }
.button.danger, button.danger { background:light-dark(#a63f3f,#a83e3e); border-color:transparent; color:#fff; }
.pill.success { color:var(--success); }
.pill.warning { color:var(--warning); }
:focus-visible { outline:3px solid var(--accent-ink); outline-offset:3px; }

/* Shared notices are quiet status strips, not another layer of page cards.
 * Keep prose in the page ink; reserve semantic colour for the icon and rule. */
.message {
    --notice-accent:var(--accent-ink);
    margin:0;
    padding:11px 14px;
    border:0;
    border-inline-start:2px solid var(--notice-accent);
    border-radius:0 5px 5px 0;
    background:light-dark(rgba(37,42,55,.045),rgba(199,208,216,.055));
    color:var(--ink);
    font-size:.9rem;
    line-height:1.5;
    box-shadow:none;
}
.message.success { --notice-accent:var(--success); color:var(--ink); }
.message.warning { --notice-accent:var(--warning); color:var(--ink); }
.message.error { --notice-accent:var(--danger); color:var(--ink); }
.site-notice { display:flex; align-items:flex-start; gap:10px; }
.site-notice__icon { flex:0 0 auto; margin-top:.1em; color:var(--notice-accent); font-size:1.2em; line-height:1.5; }
.site-notice__copy { min-width:0; margin:0; overflow-wrap:anywhere; }
.site-notice__severity { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.season-notice { margin-bottom:14px; }
.season-notice strong { font-weight:700; }
.season-notice__detail { color:var(--muted); }
@media (max-width:360px) {
    .season-notice__detail { display:block; }
    .season-notice__detail [aria-hidden] { display:none; }
}

/* These are brand artwork/chrome, not theme-dependent application surfaces. */
.app-sidebar, .app-mobile-bottom-nav, .app-mobile-switcher,
.app-mobile-global-menu, .tournament-nav, .mobile-drawer,
.mobile-bottom-nav, .pwa-update-banner, .auth-story,
.edge-index-hero, .edge-visual, .edge-story-hero,
.edge-preview-banner { color-scheme:dark; }
:root[data-theme="dark"] .brand img,
:root[data-theme="dark"] .auth-wordmark img { filter:brightness(0) invert(1); }

/* Former full-page dark islands now use the same surfaces as league pages. */
.auth-page { background:var(--bg); }
.auth-layout { background:var(--panel-strong); border-color:var(--line); }

/* Authenticated content navigation follows the page; the sidebar stays navy. */
.app-league-header, .app-league-subnav, .app-mobile-league-bar {
    background:var(--panel);
    border-color:var(--line);
    color:var(--ink);
}
.app-league-header { --app-nav-navy:var(--ink); }
.app-league-subnav, .app-mobile-league-bar { --app-nav-navy:var(--ink); }
.app-league-header .app-nav-badge { color:#fff; }
.app-nav-icon-button { background:var(--panel-strong); color:var(--ink); border-color:var(--line); }
.app-league-tab, .app-league-header__copy > p:last-child,
.app-league-header .app-nav-eyebrow { color:var(--muted); }
.app-league-tab.is-active, .app-league-tab:hover { color:var(--ink); }
.app-league-tab.is-prominent:not(.is-active) { color:var(--accent-ink); }
.app-nav-dropdown > summary { background:var(--panel-strong); color:var(--muted); border-color:var(--line); }
.media-fallback-player[data-media-role="WK"] { color:light-dark(#075985,#a7d9ff); }
.media-fallback-player[data-media-role="BAT"] { color:light-dark(#166534,#a2dfab); }
.media-fallback-player[data-media-role="BOWL"] { color:light-dark(#9a3412,#ffc199); }
.media-fallback-fantasy { color:light-dark(hsl(var(--media-fallback-hue,214) 55% 20%),hsl(var(--media-fallback-hue,214) 68% 88%)); }
.player-stage .button.ghost, .player-panel .button.ghost,
.live-stage .button.ghost, .live-panel .button.ghost { color:var(--accent-ink); }
@media (max-width:799px) {
    .app-navigation-v2 { background:var(--panel-strong); border-color:var(--line); }
    .app-mobile-league-trigger { background:var(--panel-strong); color:var(--ink); border-color:var(--line); }
    .app-mobile-league-trigger__copy span, .app-mobile-league-trigger__caret { color:var(--muted); }
    .app-mobile-league-trigger .app-nav-badge { color:#fff; }
}

/* Signature footer: utility links first, the existing wordmark as the sign-off. */
.site-footer--signature {
    display:block;
    margin-top:52px;
    padding:30px 4px 0;
    border-top:1px solid var(--line);
    color:var(--ink);
    font-family:var(--font-ui, "IBM Plex Sans", "Segoe UI", Arial, sans-serif);
    font-weight:400;
    letter-spacing:0;
}
.site-footer__links { display:grid; grid-template-columns:1fr 1fr 1.15fr; gap:24px; max-width:1000px; }
.site-footer--signature nav { display:flex; align-items:flex-start; flex-direction:column; gap:10px; }
.site-footer--signature h2 { margin:0 0 6px; color:var(--muted); font-size:1rem; line-height:1.4; font-weight:var(--font-heading-weight); letter-spacing:0; }
.site-footer--signature a { color:inherit; text-decoration:none; }
.site-footer--signature a:hover { text-decoration:underline; text-underline-offset:5px; }
.site-footer__signature { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; border-top:1px solid var(--line); margin-top:30px; padding-top:18px; }
.site-footer__brand { display:block; width:260px; max-width:100%; flex-shrink:0; }
.site-footer__wordmark { display:block; width:100%; height:auto; }
:root[data-theme="dark"] .site-footer__wordmark { filter:brightness(0) invert(1); }
@media (prefers-color-scheme:dark) {
    :root:not([data-theme]) .site-footer__wordmark { filter:brightness(0) invert(1); }
}
.site-footer__preferences { display:grid; grid-template-columns:auto auto; align-items:center; gap:6px 12px; font-size:.82rem; color:var(--muted); }
.site-footer__preferences select { width:auto; max-width:100%; min-height:40px; padding:6px 28px 6px 10px; border-radius:6px; font-size:.85rem; font-weight:400; }
.site-footer__preferences small { grid-column:1/-1; text-align:right; font-size:.75rem; }
@media (max-width:600px) {
    .site-footer__links { grid-template-columns:1fr 1fr; gap:26px 18px; }
    .site-footer__links nav:last-child { grid-column:1/-1; }
    .site-footer__signature { align-items:flex-start; flex-direction:column; gap:18px; }
    .site-footer__brand { width:240px; }
    .site-footer__preferences small { text-align:left; }
    .site-footer__preferences select { font-size:1rem; }
}
@media (pointer:coarse) {
    .site-footer--signature nav a { display:flex; align-items:center; min-height:44px; }
    .site-footer__preferences select { min-height:44px; }
}
