/* SHOT design tokens. Values mirror SHOTclubhouse/DESIGN.md (canon). Change there first. */
:root,
/* Mixed mode (demo only, docs/WIDGETS.md "Mixed mode"): the brand frame (top bar, bottom nav,
   the web sidebar, the sheet header bar, the toast) and a handful of named hero bands (Live now,
   the Pulse live score strip, THE LOCKER. header, the Perform team header card) stay on this
   exact dark token set even though the content area around them turns light. .w-band is the
   shared class those bands carry (SHOT.w.band, assets/js/widgets.js); scoping this same
   declaration block onto it -- rather than copying the values a third time -- is what keeps dark
   and mixed's dark bits pixel-identical. */
[data-theme="mixed"] .w-band {
  color-scheme: dark;

  /* Pillars */
  --shot-teal: #1ABC9C;
  --shot-purple: #6B00DB;
  --shot-gold: #F7B613;

  /* Surfaces */
  --shot-background: #0A0A0A;
  --shot-surface: #141414;
  --shot-surface-hover: #1A1A1A; /* production index.css:212 */
  --shot-surface-light: #242424;
  --shot-surface-elevated: #1A1A1A;
  --shot-input: #2A2A2A;
  --shot-border: #2A2A2A;

  /* Chrome and chips, copied from production (docs/PARITY-PARTICIPATION-2026-11-24.md Part 2, 8.1):
     the header and bottom bar paint --shot-chrome (index.css:263), the section chips use the blue-tinted
     off fill and border from shotColors.ts, and Home paints pure black under its cards (Home.tsx:169).
     Light has its own values below; Mixed keeps the dark frame (see :root[data-theme="mixed"] below). */
  --shot-chrome: #121212;
  --shot-chrome-border: rgba(255,255,255,.1);
  --shot-chip-off: #1E1E2E;
  --shot-chip-border: #2A2A3A;
  --shot-nav-off: #9CA3AF;
  --shot-canvas-home: #000000;
  --shot-more-panel: #111111; /* More category panels (More.tsx:639) */

  /* Text */
  --shot-text: #FFFFFF;
  --shot-text-secondary: #B3B3B3;
  /* Input placeholder: its own token so light can keep placeholders lighter than real text. */
  --shot-placeholder: #B3B3B3;
  /* #808080 measured 4.35-4.4:1 on --shot-surface/--shot-surface-elevated, just under the 4.5:1 AA
     minimum (docs/A11Y.md finding 2). #8C8C8C clears 4.5:1 on every surface it pairs with, including
     the lightest, --shot-surface-light (#242424, 4.62:1); background and surface both clear 5.4+:1. */
  --shot-text-muted: #8C8C8C;
  --shot-text-disabled: #4B5563;

  /* Semantic */
  --shot-success: #10B981;
  --shot-warning: #F59E0B;
  --shot-error: #EF4444;
  --shot-info: #3B82F6;
  --shot-live: #FF3B3B; /* Pulse live state only */
  /* Text colour for a SOLID --shot-error fill (a danger button, an unread count badge): white on
     this red measures 3.76:1, short of the 4.5:1 AA floor (tools/contrast.mjs), same hue and the
     same fill on every surface it sits on. This is the dark maroon the RSVP "no" button already
     used for the identical problem (perform-events.css); one shared token now covers every
     white-on-error-fill call site instead of that one already-correct spot and every other one
     left unfixed. --shot-error itself is unchanged, so red as a non-text edge/dot/fill (3:1 is
     enough there) is unaffected everywhere else it appears. One value for every theme: the fill
     it sits on never changes by theme, so this tint does not need to either. */
  --shot-error-fill-text: #2a0808;

  /* An inactive/"off" control's own fill against the surface it sits on (an unchecked toggle
     track today): --shot-surface-light measured only 1.19-1.26:1 against --shot-surface here and
     on the light block below, short of the 3:1 AA floor for a UI component boundary
     (tools/contrast.mjs) in every theme, not just one. #707070 clears 3:1 against every dark
     surface up to and including --shot-surface-light (#242424, the hardest case, 3.13:1). */
  --shot-control-off: #707070;

  /* Status colours (Liam's rule, app-wide, docs/WIDGETS.md "Status colours"): upcoming is teal,
     a live match is red (the pulsing --shot-live dot, label in normal text), a live session is teal "On now", past is gold, overdue is red. Each has a plain accent
     (edges, dots, icons -- a non-text UI element, 3:1 is enough) and a "-text" tint measured at
     >=4.5:1 (WCAG AA body text) against every dark surface it can sit on (background, surface,
     surface-hover, surface-light, surface-elevated). Teal and gold clear 4.5:1 as text unchanged
     (measured 6.44-8.22:1 and 8.62-10.99:1); purple's raw hex fails everywhere (max 2.50:1), so
     its text tint is the already-established #D1B3FF (same one pillarBars/.w-badge--purple use);
     red clears 4.5:1 on background/surface/surface-elevated but drops to 4.13:1 on surface-light,
     so it uses the already-established #FF8A8A tint (.badge-red / the old .w-badge--overdue). */
  --status-upcoming: var(--shot-teal);
  --status-upcoming-text: var(--shot-teal);
  --status-live: var(--shot-live);
  --status-live-text: var(--shot-text);
  --accent-purple-text: #D1B3FF;
  --status-past: var(--shot-gold);
  --status-past-text: var(--shot-gold);
  --status-overdue: var(--shot-error);
  --status-overdue-text: #FF8A8A;

  /* Success/error/warning as running text (docs/WIDGETS.md "Light mode"): the raw --shot-success/
     --shot-error/--shot-warning hues all already clear 4.5:1 as text on every dark surface (same
     reasoning as teal/gold above), so these default to the raw hue and only the light block below
     redefines them. Kept as separate tokens rather than reusing --shot-success/--shot-error/
     --shot-warning directly so a future non-text use of any of the three (a fill, an icon) never
     has to care which "flavour" it is. --shot-warning-text was missing outright until
     tools/contrast.mjs caught .w-concern's raw amber failing 4.5:1 on a light card (2.15:1); the
     light value reuses clubhouse.js's own already-established CHIP_TEXT_TINTS_LIGHT amber rather
     than inventing a new one. */
  --shot-success-text: var(--shot-success);
  --shot-error-text: var(--shot-error);
  --shot-warning-text: var(--shot-warning);

  /* Hairline divider (row/card dividers) and the shared focus ring: both are decorative on the
     near-black canon surfaces at these values, but need a theme-aware counterpart once a light
     surface exists (docs/WIDGETS.md "Light mode"). */
  --hairline: rgba(255,255,255,.05);
  --focus-ring: rgba(26,188,156,.6);

  /* Type */
  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Montserrat', system-ui, sans-serif;
  --font-pulse: 'Inter', system-ui, sans-serif;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Spacing (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;

  /* Elevation */
  --e-subtle: 0 2px 8px rgba(0,0,0,.4);
  --e-default: 0 10px 15px -3px rgba(0,0,0,.2), 0 4px 6px -4px rgba(0,0,0,.2);
  --e-elevated: 0 20px 25px -5px rgba(0,0,0,.3), 0 8px 10px -6px rgba(0,0,0,.3);
  --e-deep: 0 4px 16px rgba(0,0,0,.5);
  /* Cast upward, not down: a bottom sheet rises from the bottom of the screen, so its shadow falls
     on the content above it (docs/REAL-APP-SURFACES.md, SHOTclubhouse's BottomSheetJourney.tsx:
     shadow-[0_-4px_24px_rgba(0,0,0,0.4)]). --e-deep stays as-is for anything that IS cast down
     (a centred modal); this is the one real bottom-sheet-specific value found. */
  --e-sheet: 0 -4px 24px rgba(0,0,0,.4);

  /* Real-app surface depth cross-check (docs/REAL-APP-SURFACES.md). Card backgrounds are flat,
     not gradients -- SHOTclubhouse/src/styles/preview-surface-override.css neutralises every
     Tailwind bg-gradient-to-* class app-wide, and DESIGN.md agrees independently ("no decorative
     borders, use shadows"; "never gradient"). --surface-card-bg is the token indirection point
     the brief asked for regardless: it resolves flat today because that is what actually renders,
     not because DESIGN.md says so -- if the override is ever removed this is the one line to
     change, not an invented gradient. */
  --surface-card-bg: var(--shot-surface);
  /* Hairline border, evidenced on specific real surfaces (ClubHeader.tsx, TeamCard.tsx,
     StatsRow.tsx, PulseSportSheet.tsx ring) -- NOT applied to the generic card/section/eventCard
     family, which the live app keeps shadow-only (GenericScoreCard.tsx, DESIGN.md §5/§7.1); see
     docs/REAL-APP-SURFACES.md "DESIGN.md conflicts" #1 for why this is scoped rather than global. */
  --surface-card-border: rgba(255,255,255,.06);
  --surface-card-border-hover: rgba(255,255,255,.1);
  /* The one real card-surface gradient this pass replicates: AnnouncementTile.tsx's "breaking"
     tile, an inline style (not a Tailwind class), so the override above cannot flatten it -- it
     genuinely renders. Reused for eventCard/scoreCard's `status.tone === 'live'`, the demo's own
     equivalent "urgent, in progress" semantic. A live match is red; the purple tint below (`--surface-recent-bg`) is for recent or in-progress cards that are not a live match. */
  --surface-recent-bg: rgba(107,0,219,.12);
  --surface-live-bg: rgba(255,59,59,.08);

  /* Motion */
  --t-fast: 200ms;
  --t-base: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Shell */
  --topbar-h: 72px; /* production --shot-header-h (index.css:192) */
  --nav-h: 64px;
  --app-max: 480px;

  /* Responsive layout (docs/WIDGETS.md "Responsive layout"). Breakpoints match
     SHOTclubhouse/DESIGN.md §4.2 (md 768px, lg 1024px, xl 1280px container 1200px); CSS custom
     properties can't drive @media conditions, so the numbers are repeated literally in each
     @media rule in base.css/widgets.css -- these two are for the sidebar/content widths only. */
  --sidebar-w: 240px;
  --tablet-col: 720px;
  --web-max: 1200px;
}

/* =====================================================================================
   Light mode (demo only, docs/WIDGETS.md "Light mode"). Dark (the block above, no
   data-theme attribute) is the canon default from SHOTclubhouse/DESIGN.md and this block
   must never change it. Every value below is a genuine WCAG AA re-check for a light
   surface, not a straight re-skin: --shot-teal/--shot-purple/--shot-gold/--shot-success/
   --shot-error stay the exact brand hues in both themes (fills, edges, icons, dots -- 3:1
   is enough there and the fills define the brand), but four of those five fail 4.5:1 the
   moment they sit under a light surface as text, which is what the "-text" tokens below
   fix, verified against the palest surface each renders on
   (--shot-surface-light, #E7E5DE, 0.783 relative luminance -- the hardest case, since
   background/surface are both brighter). Ratios quoted are against that surface unless
   stated; every one clears the AA text minimum (4.5:1) with margin.
   ===================================================================================== */
:root[data-theme="light"],
/* Mixed mode (docs/WIDGETS.md "Mixed mode"): the main content area (#main, so every card,
   list and section inside it) and sheet bodies are light even though the frame and the named
   hero bands above stay dark. Scoped straight onto #main/.sheet-body so descendants pick this
   same light token set up through ordinary CSS custom-property inheritance -- no component CSS
   is duplicated to make this work, only the tokens are re-scoped.
   .gallery-body (widgets.html only, docs/WIDGETS.md "Contrast rule"): the gallery has no brand
   frame to keep dark -- no top bar, no bottom nav -- it is one plain content page, so the whole
   page re-scopes light under Mixed rather than trying to draw a #main-style boundary around
   content that was never split into a frame and a content area to begin with. Previously nothing
   re-scoped the gallery's <body> at all, so its page background (and everything outside the
   #main it does have, like the heading and the theme picker) stayed on the dark values while
   #main's own cards correctly went light -- light card, light-toned text, painted straight onto
   the still-black page. */
[data-theme="mixed"] #main,
[data-theme="mixed"] .sheet-body,
[data-theme="mixed"] .gallery-body {
  color-scheme: light;

  /* Surfaces: off-white page, white cards -- elevated reads brighter than the page in both
     themes (dark goes #0A0A0A -> #141414, light goes #F5F4F0 -> #FFFFFF), same logic, opposite
     direction. */
  --shot-background: #F5F4F0;
  --shot-surface: #FFFFFF;
  --shot-surface-hover: #EEEDE7;
  --shot-surface-light: #E7E5DE;
  --shot-surface-elevated: #FFFFFF;
  --shot-input: #EEEDE7;
  --shot-border: #DEDCD3;

  /* Text: near-black primary, and two near-black greys darkened on 24 Sep 2026 at Liam's request
     (the previous #55534B / #656357 passed AA but read as grey and were hard for him to read).
     Both now clear AAA 7:1 on every light surface, measured on the palest (--shot-surface-light
     #E7E5DE): secondary 10.19:1, muted 7.88:1 (on white: 12.84:1 and 9.93:1). */
  --shot-text: #14140F;
  --shot-text-secondary: #33322D;
  --shot-text-muted: #44433C;
  /* Placeholder keeps the old secondary grey so it still reads as a hint, not typed text
     (6.57:1 on --shot-input #EEEDE7). */
  --shot-placeholder: #55534B;
  --shot-text-disabled: #A8A69C;

  /* Same inactive-control-fill problem as the dark block, mirrored: a light --shot-surface-light-
     toned off track measured 1.26:1 against a white row, short of the 3:1 AA floor
     (tools/contrast.mjs). #7E7E7E clears 3:1 against every light surface including the hardest,
     --shot-surface-light (#E7E5DE, 3.22:1). A raw-teal pressed pill border and a raw-teal "on"
     toggle fill have the identical problem on this light content area (1.91:1 and 2.41:1 against
     a light card/row) -- both reuse --status-upcoming-text below rather than a new hue, the same
     text-safe teal tint used wherever teal renders as text or a control boundary on this surface. */
  --shot-control-off: #7E7E7E;

  /* Status "-text" tints (docs/WIDGETS.md "Status colours"): the raw hue is what fails.
     The darker teal, gold and red values clear the light surfaces; purple's raw brand hex
     (#6B00DB) already clears ~6.6:1 on the same surface, the mirror image of dark mode where
     the raw hex fails and the *tint* (#D1B3FF) is what passes -- so light reuses the raw hue
     as its own "-text" value instead of a separate tint. */
  --status-upcoming-text: #09644F;
  --accent-purple-text: #6B00DB;
  --status-live-text: var(--shot-text);
  --status-past-text: #7A5600;
  --status-overdue-text: #B42318;
  /* #0A7A4C measured 4.5:1 on paper but only 4.26:1 once axe measured it against the real
     composited .w-badge--done background (#D0EBDE, a touch greyer than a flat white/rgba blend
     suggested) -- darkened to #0A6B43 for a genuine margin (~5.2:1 against that background). */
  --shot-success-text: #0A6B43;
  --shot-error-text: #B42318;
  /* Same value as clubhouse.js's CHIP_TEXT_TINTS_LIGHT['#f59e0b'] (docs/WIDGETS.md "Contrast
     rule"): one established amber-as-text tint, not two independently invented ones. */
  --shot-warning-text: #8A5A00;

  /* Hairline dividers and the focus ring need a dark-on-light counterpart; a straight opacity
     flip on the dark value would be all but invisible on a bright surface. */
  --hairline: rgba(10,10,10,.08);
  --focus-ring: rgba(11,110,90,.8);

  /* Chrome and chips, light values (full Light only: Mixed keeps the dark frame, see below). */
  --shot-chrome: #FFFFFF;
  --shot-chrome-border: var(--shot-border);
  --shot-chip-off: #E7E5DE;
  --shot-chip-border: #DEDCD3;
  --shot-nav-off: #44433C;
  --shot-canvas-home: var(--shot-background);
  --shot-more-panel: var(--shot-surface);

  /* Lighter shadows: the canon's black shadows barely register against near-black surfaces, so
     dropping the same alpha onto a bright surface reads as unreasonably heavy. Still black
     (a cast shadow's real-world colour, independent of the surface it falls on), just softer. */
  --e-subtle: 0 1px 3px rgba(20,20,15,.08);
  --e-default: 0 4px 10px -2px rgba(20,20,15,.10), 0 2px 4px -2px rgba(20,20,15,.06);
  --e-elevated: 0 12px 20px -6px rgba(20,20,15,.14), 0 4px 8px -4px rgba(20,20,15,.08);
  --e-deep: 0 4px 16px rgba(20,20,15,.16);
  /* Upward-cast counterpart to dark's --e-sheet above, same softening ratio the rest of this
     block already uses for light. */
  --e-sheet: 0 -4px 24px rgba(20,20,15,.14);

  /* Real-app surface depth, light counterparts (docs/REAL-APP-SURFACES.md).
     --surface-card-bg must be RESTATED here, not just inherited from the dark block above: a
     custom property that references another custom property (--surface-card-bg: var(--shot-
     surface)) resolves once, at the element where it is declared, using that element's own
     cascade -- not re-resolved per descendant. Declared only on :root, it would permanently
     resolve to dark's --shot-surface (#141414) and inherit that fixed value into this block's
     #main/.sheet-body/.gallery-body, even though --shot-surface itself is correctly re-scoped to
     white there. Confirmed empirically (a var()-chained token that DOES change by theme is a new
     case here: every existing chained token in this file happens to alias a theme-invariant brand
     hue, which is why this never surfaced before). Restating it here forces a fresh resolution
     against this block's own --shot-surface. */
  --surface-card-bg: var(--shot-surface);
  /* Dark-alpha hairline, mirroring the existing --hairline treatment immediately below rather
     than a new design. */
  --surface-card-border: rgba(10,10,10,.08);
  --surface-card-border-hover: rgba(10,10,10,.14);
  /* No sensible light equivalent for a purple gradient tuned against a near-black card (task
     brief: use the existing flat surface plus a light-appropriate wash via the same token) -- a
     flat tint at the same alpha Light already uses for purple elsewhere (badge-purple/live below),
     not a new gradient design. */
  --surface-live-bg: rgba(255,59,59,.06);
  --surface-recent-bg: rgba(107,0,219,.08);
}

/* Full Light only, never Mixed (the shared block above also feeds Mixed's #main, which keeps its
   amber text tints): gold is a FILL with dark ink, never gold text. No gold hue clears 4.5:1 on
   these surfaces without turning brown, so the two gold "-text" tokens become near-black and the
   gold itself moves to a fill or marker beside the text (docs/WIDGETS.md "Gold in Light").
   --gold-fill is the brand #F7B613, --gold-tint a paler fill where a large area would shout. */
:root[data-theme="light"] {
  --status-past-text: #1F1700;
  --shot-warning-text: #1F1700;
  --gold-fill: #F7B613;
  --gold-tint: #FCE7B0;
  --gold-ink: #14140F;
}

/* Mixed keeps the brand frame dark (production's Mixed header and bottom bar are #0A0A0A, index.css:329). */
:root[data-theme="mixed"] { --shot-chrome: #0A0A0A; }

/* Type scale (5 Oct 2026), from SHOTclubhouse DESIGN.md §3 "Scale": caption 12, bodySmall and
   labels 14, body 16, then 18 / 20 / 24. tools/type-scale.mjs --check fails on anything else
   below 24px, apart from graphics sized to their own box (crests, avatars, pitch dots, the
   bell's count bubble). */
:root {
  --fs-caption: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lg: 18px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
}
