/* ============================================================================
   COACH DAY — the coach app's light mode as ONE token layer (Aug 22 2026)
   ============================================================================
   Loaded by every coach/*.html AFTER css/design-system.css and BEFORE
   css/theme.css. Scoped to html[data-theme="light"], the attribute the coach
   app already writes (coach/app.html:9). Maps the --gc-* tokens the app
   consumes onto the Volt Day palette (platform/css/volt-day.css). The 1,300+
   colour-only html[data-theme="light"] rules that used to live in theme.css
   are gone (scripts/strip-coach-light-colours.js); scripts/audit-coach-day-
   colors.js refuses any that come back.

   Laws:
   - Volt is a FILL with dark ink (--gc-text-on-accent) — never volt text.
   - Only --gc-* custom properties may live here (the gate enforces it).
   - Status hues are one step deeper than volt-day.css because the coach app
     paints them as TEXT on white (audit-coach-day-contrast.js: #16a34a =
     3.30:1, #d97706 = 3.23:1 — both fail AA; #15803d / #b45309 = 5.0:1).
   ============================================================================ */

html[data-theme="light"] {
    /* Surfaces — daylight ladder */
    --gc-bg-app:      #eef1f5;
    --gc-bg-panel:    #ffffff;
    --gc-bg-elevated: #f2f4f8;
    --gc-bg-sunken:   #e4e8ee;
    --gc-bg-hover:    rgba(13, 18, 32, 0.05);
    --gc-bg-active:   rgba(13, 18, 32, 0.09);
    --gc-bg-input:    rgba(13, 18, 32, 0.04);

    /* Ink */
    --gc-text-color-primary:   #0d1220;
    --gc-text-color-secondary: #4c5563;
    --gc-text-color-muted:     #5b6472;
    --gc-text-color-disabled:  #a3adb9;
    --gc-text-color-inverse:   #ffffff;
    --gc-text-color-link:      #1d4ed8;
    --gc-text-on-accent:       #0a0d14;

    /* Borders */
    --gc-border-subtle:  rgba(13, 18, 32, 0.10);
    --gc-border-default: rgba(13, 18, 32, 0.16);
    --gc-border-strong:  rgba(13, 18, 32, 0.26);
    --gc-border-focus:   #8fd400;

    /* Accent — volt, fill-first */
    --gc-accent-primary:      #8fd400;
    --gc-accent-primaryHover: #7ab600;
    --gc-accent-primaryMuted: rgba(184, 255, 0, 0.28);
    --gc-accent-primaryGlow:  rgba(143, 212, 0, 0.35);

    /* Phantom tokens the coach app consumes; design-system.css :root carries
       their dark values so a control is never invisible in one mode only */
    --gc-accent-color:  #8fd400;
    --gc-primary:       #8fd400;
    --gc-primary-hover: #7ab600;
    --gc-accent-hover:  #7ab600;
    --gc-text-color-faint: #a3adb9;
    --gc-accent-text: #0d1220;
    /* The ACTIVE segment / chip: an ink plate with inverse text by day
       (design-system.css :root carries the night pair — elevated fill,
       primary text — never a white plate at night) */
    --gc-control-active-bg:   #0d1220;
    --gc-control-active-text: #ffffff;

    /* Status — text-grade on white (see header) */
    --gc-status-success:       #15803d;
    --gc-status-successMuted:  rgba(21, 128, 61, 0.13);
    --gc-status-successBorder: rgba(21, 128, 61, 0.32);
    --gc-status-error:         #d92d20;
    --gc-status-errorMuted:    rgba(217, 45, 32, 0.12);
    --gc-status-errorBorder:   rgba(217, 45, 32, 0.32);
    --gc-status-errorText:     #d92d20;
    --gc-status-warning:       #b45309;
    --gc-status-warningMuted:  rgba(180, 83, 9, 0.13);
    --gc-status-warningBorder: rgba(180, 83, 9, 0.32);
    --gc-status-warningText:   #9a4507;   /* text/glyph on the warning tint — the fill hue reads 4.2:1 there */
    --gc-status-info:          #2563eb;
    --gc-status-infoMuted:     rgba(37, 99, 235, 0.12);
    --gc-status-infoBorder:    rgba(37, 99, 235, 0.32);

    /* Overlay + depth — ink-alpha on daylight, never white-alpha */
    --gc-overlay:   rgba(13, 18, 32, 0.78);   /* was 0.55 — the modal has to lift off the page in daylight too */
    --gc-shadow-md: 0 4px 12px rgba(13, 18, 32, 0.12), 0 2px 4px rgba(13, 18, 32, 0.08);
    --gc-shadow-lg: 0 18px 40px rgba(13, 18, 32, 0.18), 0 4px 10px rgba(13, 18, 32, 0.10);

    /* Voice */
    --gc-font-body: 'Rajdhani', system-ui, sans-serif;
}

/* White-alpha scrollbars are invisible on daylight */
html[data-theme="light"] * { scrollbar-color: rgba(13, 18, 32, 0.18) transparent; }

/* DARK ISLANDS — plates that stay night in every theme (the stadium rail is
   the team's brand panel; its photo and team gradients never flip). The
   night ladder is re-declared inside them so the tokenised text stays legible. */
html[data-theme="light"] .game-state-sidebar.sidebar-v2 {
    --gc-bg-app: #0a0d14;
    --gc-bg-panel: #172032;
    --gc-bg-elevated: #1e293b;
    --gc-bg-sunken: #020617;
    --gc-bg-input: rgba(0, 0, 0, 0.3);
    --gc-bg-hover: rgba(255, 255, 255, 0.05);
    --gc-bg-active: rgba(255, 255, 255, 0.1);
    --gc-text-color-primary: #ffffff;
    --gc-text-color-secondary: #94a3b8;
    --gc-text-color-muted: #94a3b8;
    --gc-text-color-disabled: #475569;
    --gc-text-color-inverse: #0a0d14;
    --gc-border-subtle: rgba(255, 255, 255, 0.08);
    --gc-border-default: rgba(255, 255, 255, 0.15);
    --gc-border-strong: rgba(255, 255, 255, 0.25);
    --gc-accent-text: #8fd400;
}

/* ── DARK ISLANDS INSIDE DAY MODE (Aug 22 2026 — Carlos: "our gold is now brown",
   the install modal unreadable, the wordmark black on a dark rail).
   MECHANISM: a token layer is per-THEME, but several surfaces are dark by design
   in BOTH themes — the scoreboard sidebar, the PWA install overlay, the play
   designer's rail. In day mode they kept reading the DAY values, which are chosen
   to sit on white: gold #b45309 reads brown on ink, text #0d1220 vanishes.
   FIX: the island re-declares the night values, so a token means the same thing
   as the ground it is painted on. Add gc-dark-island to any new always-dark
   surface rather than hand-colouring it. ── */
html[data-theme="light"] .game-state-sidebar,
html[data-theme="light"] .sidebar-v2,
html[data-theme="light"] #pwaInstallOverlay,
html[data-theme="light"] .pwa-install-overlay,
html[data-theme="light"] .pm-sidebar-left,
html[data-theme="light"] .pm-rail-right,
html[data-theme="light"] .gc-dark-island {
    --gc-bg-app:      #0f1420;
    --gc-bg-panel:    #161d2b;
    --gc-bg-elevated: #1e293b;
    --gc-bg-sunken:   #0d1117;
    --gc-bg-hover:    rgba(255, 255, 255, 0.06);
    --gc-bg-active:   rgba(255, 255, 255, 0.10);
    --gc-bg-input:    rgba(255, 255, 255, 0.05);
    --gc-text-color-primary:   #f1f5f9;
    --gc-text-color-secondary: #94a3b8;
    --gc-text-color-muted:     #7c8898;
    --gc-text-color-disabled:  #55606f;
    --gc-text-color-inverse:   #0d1220;
    --gc-text-color-faint:     #55606f;
    --gc-border-subtle:  rgba(255, 255, 255, 0.08);
    --gc-border-default: rgba(255, 255, 255, 0.14);
    --gc-border-strong:  rgba(255, 255, 255, 0.24);
    --gc-status-warning:     #f59e0b;
    --gc-status-warningText: #f59e0b;
    --gc-status-error:       #ef4444;
    --gc-status-errorText:   #f87171;
    --gc-accent-primary:      #22c55e;
    --gc-accent-primaryHover: #16a34a;
    --gc-accent-color:        #22c55e;
    --gc-accent-hover:        #16a34a;
    --gc-control-active-bg:   #1e293b;
    --gc-control-active-text: #f1f5f9;
}
/* the wordmark follows the GROUND, not the theme: a dark island keeps the
   night (light-ink) asset. reference_brand_logo_assets: night = -text.webp. */
html[data-theme="light"] .pm-sidebar-left img[src*="logo-text-black"],
html[data-theme="light"] .game-state-sidebar img[src*="logo-text-black"],
html[data-theme="light"] .gc-dark-island img[src*="logo-text-black"] { filter: invert(1) hue-rotate(180deg); }
