:root {
  color-scheme: dark;

  /* ── Brand tokens (Navy Dark Mode) ─────────────────────────── */
  --brand-dark:    #0A192F;
  --brand-accent:  #2DD4BF;   /* Teal */
  --brand-surface: #112240;   /* Navy card surface */
  --brand-muted:   #64748b;   /* Slate muted */
  --brand-card:    #112240;
  /* A navy face (lib/identityHue) on the dark theme's navy cards: lifted so it shows. */
  --face-navy:     #1F3D66;

  /* ── Aliases (used by Tailwind config & legacy refs) ────────── */
  --brand-primary:      #0A192F;
  /* Brand green = teal (#2DD4BF). The teal hex stays — it IS the
   * brand. The "dentist / spa" feel that came up in user feedback
   * came from HOW teal was being deployed (smooth full-panel mint
   * washes), not the colour itself. Fix is at the composition
   * layer: teal as accent against dark or warm bases, not as the
   * panel surface. See FirstRunSetupCard / MorningBrief for the
   * pattern. */
  --brand-green-rgb:        45 212 191;
  --brand-green:        rgb(var(--brand-green-rgb));
  --brand-green-hover-rgb:  20 184 166;
  --brand-green-hover:  rgb(var(--brand-green-hover-rgb));
  --brand-green-dim:    rgba(45, 212, 191, 0.14);
  --brand-glow:         rgba(45, 212, 191, 0.35);
  /* Teal as CONTENT (text, labels, icons, links) — School of Squash's
   * fill/ink split. --brand-green is the FILL (buttons, pills, bars) and is
   * the same bright #2DD4BF in both themes; on white that is 1.8:1, so text
   * uses the ink instead: teal-700 on light (AA), the fill itself on navy. */
  --brand-ink-rgb:          45 212 191;
  --brand-ink:          rgb(var(--brand-ink-rgb));
  /* Pink as CONTENT, same fill/ink split (School of Squash's values). */
  --brand-pink-ink-rgb:     244 114 182;
  --on-pink-rgb:            45 10 24;
  --brand-orange:       #FF6B35;   /* Energy accent — celebrations, streaks */
  --brand-amber:        #FFB800;   /* Achievement accent — level-ups, badges */
  --brand-gold:         #C9960C;
  /* Gold as CONTENT (text, icons) and as a tint. Gold means earned: personal
   * bests, streaks, paid up. Bright on navy, deepened on the light canvas. */
  --brand-gold-ink:     #F3D27A;
  --brand-gold-dim:     rgba(201, 150, 12, 0.18);

  /* ── Brand pink (Secondary accent — the "PEAK" hot-pink) ─────
   * Co-equal brand accent alongside teal, taken from the coaching
   * poster (PEAK column / "OWN THE GLASS"). Teal = primary/positive,
   * pink = the counter-accent: highlights, peak/premium tiers, the
   * second half of a two-tone moment. It is NOT the danger colour —
   * that stays --color-danger (#FF4560, a redder coral). On the navy
   * base the bright #FF2E7E reads as energy; light mode deepens it
   * (see the data-theme block) the same way teal deepens, so it grounds
   * on white instead of vibrating. Structured to mirror --brand-green:
   * base / hover / dim (soft tint bg) / glow. */
  --brand-pink-rgb:         255 46 126;
  --brand-pink:         rgb(var(--brand-pink-rgb));
  --brand-pink-hover:   #F11E6E;
  --brand-pink-dim:     rgba(255, 46, 126, 0.14);
  --brand-pink-glow:    rgba(255, 46, 126, 0.35);

  /* ── Backgrounds (Navy Dark) ────────────────────────────────── */
  --bg-main-rgb:     10 25 47;
  /* Ink for text/icons sitting ON a solid brand fill (teal). It is the
     theme's DARK colour in both themes: navy here, near-black on light.
     Using --bg-main directly works on dark but renders near-white ink on
     teal in the light theme (2.28:1 — fails WCAG AA). */
  --text-on-brand-rgb: var(--bg-main-rgb);
  /* Ink for text/icons ON the navy surface (--brand-dark), which is the
     same navy in both themes. --text-inverse flips to black on dark and
     made the navy session cards black-on-navy there. Defined once here so
     the light theme inherits it: white on navy, always. */
  --text-on-night-rgb: 255 255 255;
  --bg-main:     rgb(var(--bg-main-rgb));   /* App root: deep navy */
  --bg-panel-rgb:    17 34 64;
  --bg-panel:    rgb(var(--bg-panel-rgb));   /* Panels, Cards: mid navy */
  --bg-surface-rgb:  35 53 84;
  --bg-surface:  rgb(var(--bg-surface-rgb));   /* Elevated surfaces: lighter navy */
  --bg-card-rgb:     17 34 64;
  --bg-card:     rgb(var(--bg-card-rgb));
  --bg-elevated-rgb: 35 53 84;
  --bg-elevated: rgb(var(--bg-elevated-rgb));   /* Tertiary (modals, popovers) */
  --bg-subtle:   rgba(255, 255, 255, 0.04); /* Soft highlight */
  --bg-modal:    #0B1220;   /* Deep modal / sheet background */
  --bg-deep:     #10192C;   /* Avatar containers, sidebar logo bg */

  /* ── Canonical surface tiers for new UI work ───────────────── */
  --surface-canvas:   var(--bg-main);
  --surface-panel:    var(--bg-panel);
  --surface-card:     var(--bg-card);
  --surface-elevated: var(--bg-elevated);
  --surface-overlay:  rgba(10, 25, 47, 0.88);

  /* ── Text ───────────────────────────────────────────────────── */
  --text-main-rgb:      255 255 255;
  --text-main:      rgb(var(--text-main-rgb));
  --text-secondary-rgb: 235 235 245;
  --text-secondary: rgb(var(--text-secondary-rgb)); /* iOS Secondary Label (60% opacity look) */
  --text-muted-rgb:     174 174 178;
  --text-muted:     rgb(var(--text-muted-rgb)); /* Raised to 4.67:1 on --bg-surface — WCAG AA */
  --text-dim-rgb:       174 174 178;
  --text-dim:       rgb(var(--text-dim-rgb)); /* Raised to 4.67:1 on --bg-surface — WCAG AA */
  --text-highlight: #FFFFFF;
  --text-inverse:   #000000;

  /* ── Typography ─────────────────────────────────────────────── */
  --font-sans:       'Geist', system-ui, sans-serif;
  --font-display:    'Sora', 'Geist', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', monospace;
  --font-scoreboard: 'Share Tech Mono', monospace;

  /* ── Semantic ───────────────────────────────────────────────── */
  /* The brand's three roles, not stock hues: success is the brand teal,
     warning is the brand pink (attention), info is teal too. Danger keeps
     its red and is for destructive actions and errors only. Referencing
     the brand vars means each theme picks up its own teal and pink. */
  --color-success:        var(--brand-ink);
  --color-success-bg:     rgb(var(--brand-green-rgb) / 0.12);
  --color-success-border: rgb(var(--brand-green-rgb) / 0.28);
  --color-warning:        var(--brand-pink);
  --color-warning-bg:     rgb(var(--brand-pink-rgb) / 0.12);
  --color-warning-border: rgb(var(--brand-pink-rgb) / 0.28);
  --color-danger:         #FF4560;
  --color-danger-bg:      rgba(255, 69, 96, 0.12);
  --color-danger-border:  rgba(255, 69, 96, 0.28);
  --color-info:           var(--brand-ink);
  --color-info-bg:        rgb(var(--brand-green-rgb) / 0.10);
  --color-info-border:    rgb(var(--brand-green-rgb) / 0.24);

  /* ── Accents (Apple defaults redefined back to original) ────── */
  --accent-cyan:   #2DD4BF;
  --accent-orange: #fb923c;
  --accent-pink:   #FF2E7E;   /* Brand hot-pink — was pastel #f472b6 */
  --accent-yellow: #facc15;

  /* ── Borders ────────────────────────────────────────────────── */
  --border-color:  rgba(255, 255, 255, 0.07); /* Navy needs slightly brighter hairlines */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-brand:  rgba(45, 212, 191, 0.35);

  /* ── Shadows ────────────────────────────────────────────────── */
  /* Three levels (sm lift · md card · lg floating); no glows. */
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md:     0 1px 2px rgba(0, 0, 0, 0.24), 0 6px 16px -4px rgba(0, 0, 0, 0.32);
  --shadow-lg:     0 16px 40px -12px rgba(0, 0, 0, 0.55);
  --shadow-xl:     var(--shadow-lg);
  --shadow-glow:   none;
  --shadow-glow-sm: none;
  --shadow-pink-glow: none;

  /* ── Radii ──────────────────────────────────────────────────── */
  --radius-sm:   0.75rem;
  --radius-md:   1rem;
  --radius-lg:   1.5rem;
  --radius-xl:   2rem;
  --radius-full: 9999px;
  /* No pills (owner, 29 Oct 2026): controls are soft rectangles; circles only for faces and dots. */
  --radius-control: 0.75rem;
  --radius-tag: 0.5rem;

  /* ── Layout rhythm ──────────────────────────────────────────── */
  --space-panel:  1.5rem;
  --space-section: 2rem;
  --space-page-x: clamp(1rem, 3vw, 2rem);

  /* ── Interaction ────────────────────────────────────────────── */
  --focus-ring:        rgba(45, 212, 191, 0.35);
  --focus-ring-strong: rgba(45, 212, 191, 0.55);
  --selection-bg:      rgba(45, 212, 191, 0.22);
  --selection-text:    #FFFFFF;

  /* ── Semantic shorthand aliases (map to canonical tokens above) ─ */
  --primary:            var(--brand-green);
  --primary-hover:      var(--brand-green-hover);
  --primary-dim:        var(--brand-green-dim);
  --secondary:          var(--bg-surface);
  --success:            var(--color-success);
  --success-bg:         var(--color-success-bg);
  --danger:             var(--color-danger);
  --danger-bg:          var(--color-danger-bg);
  --warning:            var(--color-warning);
  --warning-bg:         var(--color-warning-bg);
  --info:               var(--color-info);
  --info-bg:            var(--color-info-bg);
  --neutral-0:          var(--bg-main);
  --neutral-100:        var(--bg-panel);
  --neutral-200:        var(--bg-surface);
  --neutral-400:        var(--text-muted);
  --neutral-700:        var(--text-secondary);
  --neutral-900:        var(--text-main);
}

/* ── Light theme overrides ─────────────────────────────────────────────
   Activated by setting `<html data-theme="light">` (and removing the
   `dark` class so Tailwind's `dark:` variants stop applying). Every
   token below is the light counterpart of the dark default at the
   top of this file — same NAMES so component classes don't have to
   change, just different VALUES.

   Picking the palette: dark theme is navy-on-navy because it reads
   as "premium late-night phone use". Light theme reads as "outdoor
   coach in full sunlight" — so the canvas is near-white (not full
   white, full white feels harsh and rejects shadow), the panels are
   white-on-canvas with a soft hairline, and text drops to a dark
   slate (not pure black — pure black + white burns the eye).

   Brand green stays the same hex on both themes. It's bright enough
   to sit on white without looking washed-out, and dark enough to
   pop against the dark navy. The semantic colours (success, warning,
   danger, info) similarly use the same hex with adjusted alpha-bg
   so the same "this is success" visual rhythm carries across both
   themes. */
:root[data-theme="light"] {
  --face-navy:          #0A192F;
  --brand-gold-ink:     #7A5A06;
  --brand-gold-dim:     rgba(201, 150, 12, 0.14);
  color-scheme: light;

  /* Backgrounds — neutral grey palette. Earlier passes used a warm
   * cream / parchment (caramel undertone); per product direction we
   * moved to a clean neutral grey instead. The trick that dodges the
   * old "hospital / dentist" cool-slate problem: make the CANVAS a
   * distinct grey (zinc-100) while PANELS are pure white. White cards
   * read as clearly "lifted" off a grey canvas — they only vanished
   * back on the near-white cream. Neutral (not blue-cool) grey keeps
   * it modern-app clean — Linear / Vercel light — without the medical
   * feel a bluer slate brings. Elevation is carried by the strong
   * border + shadow treatment in the blocks below. */
  --bg-main-rgb:     241 246 245;
  /* See the dark block: on light, ink on a teal fill must be near-black. */
  --text-on-brand-rgb: var(--text-main-rgb);
  --bg-main:     rgb(var(--bg-main-rgb));   /* App canvas: faint teal-tinted off-white */
  --bg-panel-rgb:    255 255 255;
  --bg-panel:    rgb(var(--bg-panel-rgb));   /* Cards: white — lifts cleanly off the grey */
  --bg-surface-rgb:  226 239 236;
  --bg-surface:  rgb(var(--bg-surface-rgb));   /* Elevated: teal-tinted, never neutral grey */
  --bg-card-rgb:     255 255 255;
  --bg-card:     rgb(var(--bg-card-rgb));
  --bg-elevated-rgb: 217 234 230;
  --bg-elevated: rgb(var(--bg-elevated-rgb));   /* Tertiary: deeper teal tint */
  --bg-subtle:   rgba(24, 24, 27, 0.05);   /* neutral alpha */
  --bg-modal:    #FFFFFF;
  --bg-deep:     #E4E4E7;

  --surface-canvas:   var(--bg-main);
  --surface-panel:    var(--bg-panel);
  --surface-card:     var(--bg-card);
  --surface-elevated: var(--bg-elevated);
  --surface-overlay:  rgba(15, 23, 42, 0.55);

  /* Text — neutral grey ladder (zinc-900 → zinc-400). Not pure black
   * on white (that burns the eye), not warm-tinted (the caramel is
   * gone). Reads clean, modern, high-contrast. */
  --text-main-rgb:      24 24 27;
  --text-main:      rgb(var(--text-main-rgb));
  --text-secondary-rgb: 63 63 70;
  --text-secondary: rgb(var(--text-secondary-rgb));
  --text-muted-rgb:     92 107 105;
  --text-muted:     rgb(var(--text-muted-rgb));
  --text-dim-rgb:       124 141 138;
  --text-dim:       rgb(var(--text-dim-rgb));
  --text-highlight: #18181B;
  --text-inverse:   #FFFFFF;

  /* Borders — neutral grey alpha (zinc-900 base). Tones with the grey
   * canvas. Teal brand border unchanged. */
  --border-color:  rgba(24, 24, 27, 0.12);
  --border-subtle: rgba(24, 24, 27, 0.07);
  --border-strong: rgba(24, 24, 27, 0.20);
  --border-brand:  rgba(45, 212, 191, 0.45);  /* School of Squash's teal border */

  /* Shadows — neutral grey alpha (zinc-900 base), strong spread so
   * cards have real depth on the grey canvas. Sport apps use depth as
   * a structural device (tile / pill / chip language). */
  --shadow-sm:      0 1px 2px rgba(10, 25, 47, 0.06);
  --shadow-md:      0 1px 2px rgba(10, 25, 47, 0.04), 0 4px 12px -2px rgba(10, 25, 47, 0.07);
  --shadow-lg:      0 16px 36px -12px rgba(10, 25, 47, 0.20), 0 2px 6px rgba(10, 25, 47, 0.05);
  --shadow-xl:      var(--shadow-lg);
  --shadow-glow:    none;
  --shadow-glow-sm: none;

  /* Light-mode brand green — School of Squash's #2DD4BF fill, the same
   * as the dark theme (2026-09-23, owner's call: "replace our green with
   * the one we use in SoS"). This used to be deepened to teal-500 #14B8A6
   * so that teal TEXT stayed readable on white; SoS solves that with a
   * separate ink instead, so the fill can stay bright. Text, labels and
   * icons use --brand-ink (teal-700 here), never --brand-green. */
  --brand-green-rgb:        45 212 191;
  --brand-green:        rgb(var(--brand-green-rgb));
  --brand-green-hover-rgb:  20 184 166;
  --brand-green-hover:  rgb(var(--brand-green-hover-rgb));
  --brand-green-dim:    rgba(45, 212, 191, 0.14);
  --brand-glow:         rgba(45, 212, 191, 0.30);
  --brand-ink-rgb:          15 118 110;
  --brand-pink-ink-rgb:     190 24 93;

  /* Light-mode brand-pink — same deepening logic as teal above. The
   * bright #FF2E7E vibrates on a near-white canvas (high saturation +
   * lightness reads as neon); dropping to #E11D6B keeps the hot-pink
   * hue but lowers lightness so it reads as an athletic accent and
   * carries ~4.2:1 white-on-pink contrast (AA for fills/large text).
   * Dark theme keeps the brighter #FF2E7E — on navy it pops as energy. */
  --brand-pink-rgb:         225 29 107;
  --brand-pink:         rgb(var(--brand-pink-rgb));
  --brand-pink-hover:   #C2185B;
  --brand-pink-dim:     rgba(225, 29, 107, 0.12);
  --brand-pink-glow:    rgba(225, 29, 107, 0.30);
  --accent-pink:        #E11D6B;
  --shadow-pink-glow:   none;

  /* Semantic backgrounds — push the alpha so the tint reads on white */
  --color-success-bg:     rgb(var(--brand-green-rgb) / 0.10);
  --color-success-border: rgb(var(--brand-green-rgb) / 0.30);
  --color-warning-bg:     rgb(var(--brand-pink-rgb) / 0.10);
  --color-warning-border: rgb(var(--brand-pink-rgb) / 0.30);
  --color-danger-bg:      rgba(255, 69, 96, 0.10);
  --color-danger-border:  rgba(255, 69, 96, 0.30);
  --color-info-bg:        rgb(var(--brand-green-rgb) / 0.10);
  --color-info-border:    rgb(var(--brand-green-rgb) / 0.30);

  --selection-bg:   rgba(45, 212, 191, 0.18);
  --selection-text: #18181B;
}

html,
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Tabular numerics by default ──────────────────────────────────────────
   Every digit-bearing context (stat cards, prices, time strings, level
   numbers, counters) gets fixed-width digits so values don't shift micro-
   pixels as they update. Was applied piecemeal via `tabular-nums` — now
   global. The few places where proportional digits look better (large
   display headings) can opt out with `font-feature-settings: "pnum"`. */
:root {
  font-feature-settings: "tnum" 1, "cv11" 1;
  font-variant-numeric: tabular-nums;
}

/* ── Film grain overlay — the texture of premium dark UI ─────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
}

#root {
  position: relative;
  z-index: 1;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

.dark body {
  background-color: var(--bg-main);
  color: var(--text-main);
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
}

@supports (scrollbar-width: none) {
  .hide-scrollbar {
    scrollbar-width: none;
  }
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
}

@supports (scrollbar-width: none) {
  .scrollbar-hide {
    scrollbar-width: none;
  }
}

.radar-poly {
  fill: rgba(45, 212, 191, 0.2);
  stroke: #2DD4BF;
  stroke-width: 2;
  stroke-linejoin: round;
}

.radar-bg {
  fill: none;
}

/* Dynamic Utility Classes for avoiding inline style lint warnings */
.dynamic-width {
  width: var(--progress, 0%);
}

.dynamic-bg {
  background-color: var(--bg-color, transparent);
}

.dynamic-size {
  width: var(--size, auto);
  height: var(--size, auto);
}

.radar-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.dark .radar-bg {
  stroke: #334155;
}

.font-display {
  font-family: var(--font-display);
}

@media (min-width: 768px) {
  body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
  }
}

.btn-hover-effect:active {
  transform: translateY(1px) scale(0.98);
  transition: transform 0.1s;
}

/* Physical press depth for all interactive elements */
button:active:not([disabled]),
[role="button"]:active:not([disabled]) {
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}

/* Premium focus ring — applies to inputs globally */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring), 0 0 0 1px var(--focus-ring-strong) inset;
  border-color: var(--focus-ring-strong) !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.nav-active {
  color: #2DD4BF;
}

.material-fill-1 {
  font-variation-settings: 'FILL' 1;
}

@keyframes subtle-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-subtle-pulse {
  animation: subtle-pulse 2s ease-in-out infinite;
}

/* Premium Athlete Profile Styles */
html {
  scroll-behavior: smooth;
}

/* Soft shadows for premium cards */
.shadow-soft-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.02),
    0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.shadow-soft-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* Glow effect for chart points */
.glow-point {
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.6));
}

/* Circular progress animation */
@keyframes progress-fill {
  from {
    stroke-dashoffset: 264;
  }
}

.circular-progress-animated {
  animation: progress-fill 1s ease-out forwards;
}

/* Premium card hover effect */
.premium-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

/* Micro label style */
.micro-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #94a3b8;
}

/* Big number style */
.big-number {
  font-size: 1.875rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}


/* Circular Progress (for Elite Performance Pillars) */
.circular-progress {
  transform: rotate(-90deg);
}

.radar-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.dark .radar-grid {
  stroke: #334155;
}

/* Reference Specification Styles */
.radar-bg-dots {
  background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
  background-size: 20px 20px;
}

.glass {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.radar-line {
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 1;
}

.glow-primary {
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.4));
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.animate-marquee {
  animation: marquee 20s linear infinite;
  display: inline-block;
  white-space: nowrap;
}

@keyframes hud-pulse {
  0% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 0.3;
  }
}

.animate-hud-pulse {
  animation: hud-pulse 4s ease-in-out infinite;
}

/* Wood texture for Squash Court Card */
.wood-texture {
  background-color: #C4A77D;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 10px,
      rgba(0,0,0,0.03) 10px,
      rgba(0,0,0,0.03) 12px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,0.02) 3px,
      rgba(0,0,0,0.02) 6px
    );
}

/* Hexagon pattern for Athlete Profile Card */
.hexagon-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%2300D4AA' fill-opacity='0.05' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9z'/%3E%3C/svg%3E");
}

/* T-Control zone highlight */
.zone-highlight {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 0 15px rgba(245, 158, 11, 0.15);
}

/* Shadow soft for analytics cards */
.shadow-soft {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
}

/* Streak flame — animations for each health state. Flame shape is drawn with
 * a lucide icon; these classes control the aura / flicker on top.
 *
 *   healthy  → steady amber/orange glow, gentle breath every 3s.
 *   at-risk  → amber glow with a slightly faster flicker, reminds without alarming.
 *   cracked  → red, faster flicker (1s), pulled toward destructive colour.
 *   frozen   → cool blue aura, still, no flicker.
 *   dormant  → no aura, muted colour.
 *
 * Respects prefers-reduced-motion by replacing animation with a static glow. */
/* Streak flame on brand colours: teal = healthy or frozen (safe),
   pink = at risk or broken (attention). */
@keyframes streak-flame-breath {
  0%, 100% { filter: drop-shadow(0 0 5px rgb(var(--brand-green-rgb) / 0.45))
                     drop-shadow(0 0 14px rgb(var(--brand-green-rgb) / 0.20)); }
  50%      { filter: drop-shadow(0 0 9px rgb(var(--brand-green-rgb) / 0.70))
                     drop-shadow(0 0 22px rgb(var(--brand-green-rgb) / 0.35)); }
}
@keyframes streak-flame-flicker-amber {
  0%, 100% { filter: drop-shadow(0 0 5px rgb(var(--brand-pink-rgb) / 0.40))
                     drop-shadow(0 0 12px rgb(var(--brand-pink-rgb) / 0.20));
             transform: translateY(0) scale(1); }
  20%      { transform: translateY(-0.5px) scale(1.02); }
  50%      { filter: drop-shadow(0 0 10px rgb(var(--brand-pink-rgb) / 0.75))
                     drop-shadow(0 0 20px rgb(var(--brand-pink-rgb) / 0.32));
             transform: translateY(0) scale(1); }
  75%      { transform: translateY(0.5px) scale(0.985); }
}
@keyframes streak-flame-flicker-red {
  0%, 100% { filter: drop-shadow(0 0 4px rgb(var(--brand-pink-rgb) / 0.50))
                     drop-shadow(0 0 10px rgb(var(--brand-pink-rgb) / 0.25));
             transform: translateY(0) scale(1); opacity: 0.85; }
  30%      { opacity: 1; filter: drop-shadow(0 0 9px rgb(var(--brand-pink-rgb) / 0.80))
                                  drop-shadow(0 0 18px rgb(var(--brand-pink-rgb) / 0.35));
             transform: translateY(-1px) scale(1.03); }
  60%      { opacity: 0.7; transform: translateY(0.5px) scale(0.97); }
}
.streak-flame-healthy { animation: streak-flame-breath 3s ease-in-out infinite; color: var(--brand-green); }
.streak-flame-at-risk { animation: streak-flame-flicker-amber 1.6s ease-in-out infinite; color: var(--brand-pink); }
.streak-flame-cracked { animation: streak-flame-flicker-red 1s ease-in-out infinite; color: var(--brand-pink); }
.streak-flame-frozen  { animation: none; color: var(--brand-green);
                        filter: drop-shadow(0 0 6px rgb(var(--brand-green-rgb) / 0.60))
                                drop-shadow(0 0 16px rgb(var(--brand-green-rgb) / 0.25)); }
.streak-flame-dormant { animation: none; color: var(--text-muted); opacity: 0.55; }

@media (prefers-reduced-motion: reduce) {
  .streak-flame-healthy,
  .streak-flame-at-risk,
  .streak-flame-cracked {
    animation: none;
  }
  .streak-flame-healthy { filter: drop-shadow(0 0 8px rgb(var(--brand-green-rgb) / 0.55)); }
  .streak-flame-at-risk { filter: drop-shadow(0 0 8px rgb(var(--brand-pink-rgb) / 0.55)); }
  .streak-flame-cracked { filter: drop-shadow(0 0 8px rgb(var(--brand-pink-rgb) / 0.60)); }
}

/* Pre-session anticipation pulse — applied to calendar tiles whose session
 * starts within 24h. A tighter, cleaner halo: inner soft glow + outer
 * expanding ring, like a heartbeat. 3.4s cycle so it doesn't feel anxious.
 * Respects prefers-reduced-motion. */
@keyframes pre-session-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(45, 212, 191, 0.55),
      0 0 10px 0 rgba(45, 212, 191, 0.18),
      inset 0 0 0 1px rgba(45, 212, 191, 0.18);
  }
  55% {
    box-shadow:
      0 0 0 6px rgba(45, 212, 191, 0.0),
      0 0 22px 0 rgba(45, 212, 191, 0.35),
      inset 0 0 0 1px rgba(45, 212, 191, 0.45);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(45, 212, 191, 0.0),
      0 0 12px 0 rgba(45, 212, 191, 0.20),
      inset 0 0 0 1px rgba(45, 212, 191, 0.22);
  }
}
.pre-session-pulse {
  animation: pre-session-pulse 3.4s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pre-session-pulse {
    animation: none;
    box-shadow:
      0 0 0 2px rgba(45, 212, 191, 0.30),
      0 0 18px 0 rgba(45, 212, 191, 0.22),
      inset 0 0 0 1px rgba(45, 212, 191, 0.35);
  }
}

/* Tile fade-in — subtle stagger across session tiles when the week mounts
 * or changes. Playtomic's micro-motion signature. Cheap (transform +
 * opacity) so it stays 60fps even on mid-range phones. */
@keyframes session-tile-enter {
  0% { opacity: 0; transform: translateY(4px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.session-tile-enter {
  animation: session-tile-enter 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .session-tile-enter { animation: none; }
}

/* ── Parent Home ────────────────────────────────────────────────────────
   Surfaces that differ by theme live here so the components stay on plain
   tokens. Dark is the :root default; light is :root[data-theme="light"].
   One navy ticket (the next session), a faint teal wash at the top of the
   canvas, and one elevation recipe for every white card. */
.home-wash {
  background:
    radial-gradient(110% 55% at 0% 0%, rgb(var(--brand-green-rgb) / 0.14), transparent 62%),
    radial-gradient(70% 35% at 100% 0%, rgb(var(--brand-green-rgb) / 0.06), transparent 70%);
}
:root[data-theme="light"] .home-wash {
  background:
    radial-gradient(110% 55% at 0% 0%, rgb(var(--brand-green-rgb) / 0.20), transparent 62%),
    radial-gradient(70% 35% at 100% 0%, rgb(var(--brand-green-rgb) / 0.10), transparent 70%);
}
/* ── Sky: a colour field behind a page's header that fades into the canvas by
   ~420px and changes with the time of day (lib/sky.ts picks the class). The
   light canvas gets tints; the navy canvas gets a glow of the same hues.
   Cards stay white: the sky is the only thing that moves with the clock. */
.sky-dawn, .sky-day, .sky-dusk, .sky-night { pointer-events: none; }
.sky-dawn {
  background:
    radial-gradient(120% 400px at 0% 0%, rgb(201 150 12 / 0.20), transparent 60%),
    radial-gradient(90% 340px at 100% 0%, rgb(var(--brand-green-rgb) / 0.22), transparent 62%);
}
.sky-day {
  background:
    radial-gradient(120% 400px at 8% 0%, rgb(var(--brand-green-rgb) / 0.30), transparent 62%),
    radial-gradient(80% 320px at 100% 0%, rgb(201 150 12 / 0.14), transparent 60%);
}
.sky-dusk {
  background:
    radial-gradient(120% 420px at 0% 0%, rgb(var(--brand-pink-rgb) / 0.20), transparent 60%),
    radial-gradient(90% 340px at 100% 0%, rgb(var(--brand-green-rgb) / 0.24), transparent 62%);
}
.sky-night {
  background:
    radial-gradient(120% 400px at 0% 0%, rgb(var(--brand-green-rgb) / 0.16), transparent 60%),
    radial-gradient(90% 340px at 100% 0%, rgb(var(--brand-pink-rgb) / 0.10), transparent 62%);
}
:root[data-theme="light"] .sky-dawn {
  background:
    radial-gradient(120% 400px at 0% 0%, rgb(201 150 12 / 0.34), transparent 60%),
    radial-gradient(90% 340px at 100% 0%, rgb(var(--brand-green-rgb) / 0.40), transparent 62%);
}
:root[data-theme="light"] .sky-day {
  background:
    radial-gradient(120% 400px at 8% 0%, rgb(var(--brand-green-rgb) / 0.62), transparent 62%),
    radial-gradient(80% 320px at 100% 0%, rgb(201 150 12 / 0.26), transparent 60%);
}
:root[data-theme="light"] .sky-dusk {
  background:
    radial-gradient(120% 420px at 0% 0%, rgb(var(--brand-pink-rgb) / 0.34), transparent 60%),
    radial-gradient(90% 340px at 100% 0%, rgb(var(--brand-green-rgb) / 0.42), transparent 62%);
}
:root[data-theme="light"] .sky-night {
  background:
    radial-gradient(120% 400px at 0% 0%, rgb(10 25 47 / 0.14), transparent 60%),
    radial-gradient(90% 340px at 100% 0%, rgb(var(--brand-green-rgb) / 0.30), transparent 62%);
}
/* Squash court lines as a faint diagonal texture on a dark surface. */
.court-lines {
  background-image: repeating-linear-gradient(115deg, transparent 0 26px, rgb(255 255 255 / 0.14) 26px 27px);
}
/* The fill ring on the brief's next-up pane draws itself on mount. */
@keyframes ring-draw { from { stroke-dashoffset: var(--ring-circ, 113); } }
.ring-draw { animation: ring-draw 900ms cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .ring-draw { animation: none; } }
.home-card {
  box-shadow: 0 0 0 1px rgb(var(--brand-green-rgb) / 0.10), var(--shadow-md);
}
:root[data-theme="light"] .home-card {
  box-shadow: var(--shadow-md);
}
/* Home's coat (owner, 2026-10-29: "way better now, build it"): on Home the
   cards sit on a teal hairline at a 20px corner, no shadow, so the Next up
   ticket is the one object with weight (components/coach/HomeOneLayout). */
.home-coat .home-card {
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgb(var(--brand-green-rgb) / 0.16);
}
:root[data-theme="light"] .home-coat .home-card {
  box-shadow: 0 0 0 1px rgb(var(--brand-green-rgb) / 0.30);
}
/* Navy in both themes. On the dark canvas it lifts on a teal hairline
   instead of a shadow. */
.home-ticket {
  background: linear-gradient(160deg, #143058 0%, #0F2647 55%, #0C1F3B 100%);
  box-shadow: inset 0 0 0 1px rgb(var(--brand-green-rgb) / 0.28);
}
:root[data-theme="light"] .home-ticket {
  background: linear-gradient(160deg, #0E2340 0%, var(--brand-dark) 55%, #081527 100%);
  box-shadow: var(--shadow-lg);
}
.home-ticket-glow { background: radial-gradient(closest-side, rgb(45 212 191 / 0.22), transparent); }
/* Teal TEXT inside a navy or photo-dark surface. --brand-ink is teal-700 for
   light surfaces; on navy that is 3.2:1, so dark surfaces pin it back to the
   bright #2DD4BF fill (9.7:1). Custom properties inherit, which also covers
   text passed in from another component (e.g. a dashboard's chips rendered
   inside a hero). */
.home-ticket,
.bg-brand-dark,
.bg-black\/40, .bg-black\/60, .bg-black\/80,
.from-black\/60, .from-black\/70, .from-black\/80 {
  --brand-ink-rgb: 45 212 191;
  --brand-ink:     rgb(45 212 191);
  --color-success: rgb(45 212 191);
  --color-info:    rgb(45 212 191);
  /* Gold text too: the dark-theme gold ink, not light's deep #7A5A06. */
  --brand-gold-ink: #F3D27A;
  /* Money owed on navy reads in the bright pink (#FF2E7E, about 5:1), not light's deep #E11D6B (3.8:1). */
  --brand-pink-rgb: 255 46 126;
  --brand-pink:     rgb(255 46 126);
}
/* The same bright pink for money owed on the next-session card when it wears the session's own dark
   colour instead of navy (NextSessionTicket's tinted coat), which .home-ticket above doesn't reach. */
.ticket-owed {
  --brand-pink-rgb: 255 46 126;
  --brand-pink:     rgb(255 46 126);
}

/* ── School of Squash skin (owner decision 2026-09-23: the schedule screens
   are a pixel-exact copy of SoS). Wrapping a subtree in .sos-skin gives it
   SoS's own surface / text / border / warning values (School_Of_Squash_App_2
   styles/tokens.css) so the ported timetables render with SoS's palette
   without changing the rest of Cadens. Both the channel (-rgb) and the plain
   form are set: Tailwind classes read the channels, var() users the plain. */
.sos-skin {
  /* Radii: SoS keeps Tailwind's default rounded-sm…xl (Cadens maps them to
     its own inverted scale — rounded-xl is 32px here, 12px in SoS) and has
     sheet/card tiers of its own. */
  --radius-sm: 0.125rem; --radius-md: 0.375rem; --radius-lg: 0.5rem; --radius-xl: 0.75rem;
  --radius-sheet: 2.5rem; --radius-card: 1.5rem;
  --bg-panel-rgb: 17 34 64;     --bg-panel: #112240;
  --bg-surface-rgb: 35 53 84;   --bg-surface: #233554;
  --bg-card-rgb: 17 34 64;      --bg-card: #112240;
  --bg-elevated-rgb: 35 53 84;  --bg-elevated: #233554;
  --text-main-rgb: 255 255 255;      --text-main: #FFFFFF;
  --text-secondary-rgb: 235 235 245; --text-secondary: #EBEBF5;
  --text-muted-rgb: 174 174 178;     --text-muted: #AEAEB2;
  --text-dim-rgb: 174 174 178;       --text-dim: #AEAEB2;
  --border-color:  rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.14);
  --color-warning:        #f59e0b;
  --color-warning-bg:     rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.22);
}
:root[data-theme="light"] .sos-skin {
  --bg-panel-rgb: 243 248 248;    --bg-panel: #F3F8F8;
  --bg-surface-rgb: 235 242 244;  --bg-surface: #EBF2F4;
  --bg-card-rgb: 243 248 248;     --bg-card: #F3F8F8;
  --bg-elevated-rgb: 248 251 251; --bg-elevated: #F8FBFB;
  --text-main-rgb: 15 23 42;         --text-main: #0F172A;
  --text-secondary-rgb: 51 65 85;    --text-secondary: #334155;
  --text-muted-rgb: 90 106 128;      --text-muted: #5A6A80;
  --text-dim-rgb: 148 163 184;       --text-dim: #94A3B8;
  --border-color:  rgba(15, 27, 46, 0.10);
  --border-subtle: rgba(15, 27, 46, 0.06);
  --border-strong: rgba(15, 27, 46, 0.16);
  --color-warning:        #B45309;
  --color-warning-bg:     rgba(245, 158, 11, 0.14);
  --color-warning-border: rgba(245, 158, 11, 0.30);
}
.home-sheen {
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.07) 48%, transparent 60%);
  transform: translateX(-120%);
  animation: home-sheen 1.6s 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes home-sheen { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .home-sheen { display: none; } }

/* Compete (owner, 7 Nov 2026: "dynamic and engaging"): the page moves when
   you land. Cards rise in one after another, the level chart draws itself,
   the bars grow, the leader's gold ring breathes, the Latest dot blinks. */
@keyframes compete-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes compete-draw { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
@keyframes compete-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes compete-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(201 150 12 / 0); } 50% { box-shadow: 0 0 0 7px rgb(201 150 12 / 0.22); } }
@keyframes compete-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes compete-fade { to { opacity: 1; } }
.compete-rise { animation: compete-rise 0.45s cubic-bezier(.2,.7,.2,1) both; }
.compete-draw { stroke-dasharray: 700; stroke-dashoffset: 700; animation: compete-draw 1.6s 0.5s cubic-bezier(.4,0,.2,1) forwards; }
.compete-pop { opacity: 0; animation: compete-fade 0.5s 2s forwards; }
.compete-grow { transform-origin: left; animation: compete-grow 0.9s 0.8s cubic-bezier(.2,.7,.2,1) both; }
.compete-lead { animation: compete-pulse 3s 2.2s ease-in-out infinite; }
.compete-live { animation: compete-blink 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .compete-rise, .compete-draw, .compete-pop, .compete-grow, .compete-lead, .compete-live { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

/* The americano score: one drag sets both sides (components/americano/ScoreSheet). The filled
   part of the track is side A's share of the game's points. */
.americano-split { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: grab; touch-action: pan-y; }
.americano-split::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, rgb(var(--brand-green-rgb)) var(--p, 50%), rgb(var(--brand-green-rgb) / 0.18) var(--p, 50%)); }
.americano-split::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, rgb(var(--brand-green-rgb)) var(--p, 50%), rgb(var(--brand-green-rgb) / 0.18) var(--p, 50%)); }
.americano-split::-webkit-slider-thumb { -webkit-appearance: none; width: 38px; height: 38px; margin-top: -15px; border-radius: 50%; background: var(--bg-card); border: 2.5px solid rgb(var(--text-main-rgb)); box-shadow: 0 4px 10px -3px rgb(10 25 47 / 0.5); }
.americano-split::-moz-range-thumb { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-card); border: 2.5px solid rgb(var(--text-main-rgb)); box-shadow: 0 4px 10px -3px rgb(10 25 47 / 0.5); }
.americano-split:focus-visible { outline: 2px solid rgb(var(--brand-green-rgb)); outline-offset: 2px; border-radius: 12px; }

/* The americano's navy face (lib/identityHue: one of the six face colours is the brand navy).
   On a dark card it sank into the surface, so in the dark theme it lifts to the same navy the
   night ticket uses for it. Dark is the :root default; light is :root[data-theme="light"]. */
:root { --americano-navy-face: #1F3D66; }
:root[data-theme="light"] { --americano-navy-face: #0A192F; }
