/* ============================================================================
   BE Fit Club · css/tokens.css · A · Floodlight design tokens (Build spec, exact)
   ----------------------------------------------------------------------------
   Theme = data-theme on <html>: "dark" or "light" (the shell resolves Auto).
   Any element can re-scope with its own data-theme (e.g. the referee console).
   Rules: colour = team only · ink = action · amber = needs attention.
   Round 5 "Floodlight with aura": light (glows, gradients) ONLY on elements marked
   .hero (one per screen) or .lit (the listed components: score block, Goal tiles,
   team washes, the "you" row, podium, leader rows, sum total, stoppage escalation,
   Goal sheet title bar, share cards, the front-door brand card). Everything else
   stays flat. No emoji, no old brand green, no medal colours (Gold is a team).
   ========================================================================== */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D10;          /* canvas */
  --s1: #15181D;          /* cards, lists, tiles */
  --s2: #1E2229;          /* secondary buttons, sheet tiles */
  --s3: #2A2F38;          /* selected segment */
  --line: #242830;        /* hairlines */
  --ink: #F2F3F5;         /* text, primary buttons, live dot (17.5:1) */
  --ink2: #AAB1BC;        /* secondary text (9.0:1) */
  --ink3: #8A929D;        /* labels, positions (6.2:1; 5.1:1 on --s2) */
  --ink-pressed: #D9DCE1; /* LogButton pressed */
  --on-ink: #0B0D10;      /* text on an --ink fill */

  --red: #F2555A;
  --green: #3DD68C;
  --blue: #5B8DEF;
  --gold: #E8B931;

  --warn: #FF9F43;        /* attention text */
  --warnfill: #FF9F43;    /* attention fills (bars) */
  --on-warn: #1A0E00;     /* text on a --warnfill (9.3:1) */
  --yel: #F5D90A;         /* yellow card glyph only */

  --hl: #1A1E25;          /* highlighted row ("you") */
  --sheet: #15181D;
  --navref: #0F1115;      /* referee nav */
  --dimc: rgba(0,0,0,.62);/* behind sheets */
  --halo: rgba(242,243,245,.18);
  --ring: none;           /* light theme draws a 1 px ring on cards */
  --shadow-float: 0 10px 30px rgba(0,0,0,.5);

  /* round 5: light recipes (percentages are used inside color-mix with the team colour --tc) */
  --tint-hero: 18%;       /* score halves, share-card areas */
  --tint-tile: 14%;       /* Goal tiles, Save keeper tiles */
  --tint-soft: 10%;       /* team chips, active team tab */
  --tint-ring: 40%;       /* 1 px ring on chips and Goal tiles */
  --glow: 26%;            /* bottom glow strength (heroes only) */
  --sheen: linear-gradient(180deg, rgba(255,255,255,.035), transparent 45%);   /* hero cards */
  --edge: inset 0 1px 0 rgba(255,255,255,.06);                                 /* every card, row group, tile */
  --attn: color-mix(in srgb, var(--warn) 10%, var(--s1));                     /* sync waiting, stoppage nudge, money owed */
  --cred: #E5484D;        /* red card shape */

  /* practice mode (the incognito look): used ONLY for practice, never on data, chips or numbers */
  --practice: #A47CFF;
  --on-practice: #1A0B33;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F4F6;
  --s1: #FFFFFF;
  --s2: #ECEEF1;
  --s3: #DCDFE4;
  --line: #E4E7EB;
  --ink: #0B0D10;         /* 17.7:1 */
  --ink2: #474E59;        /* 7.6:1 */
  --ink3: #626A76;        /* 5.0:1; 4.7:1 on --s2 */
  --ink-pressed: #2A2F38;
  --on-ink: #F3F4F6;

  --red: #D93B41;
  --green: #16935A;       /* marks only */
  --blue: #2F6FDB;
  --gold: #A97C0A;

  --warn: #B54E09;        /* attention text (5.2:1) */
  --warnfill: #FFA654;    /* attention fills (dark text 9.8:1) */
  --on-warn: #1A0E00;
  --yel: #EAB308;

  --hl: #E9EEF5;
  --sheet: #FFFFFF;
  --navref: #FFFFFF;
  --dimc: rgba(11,13,16,.38);
  --halo: rgba(11,13,16,.14);
  --ring: 0 0 0 1px var(--line);
  --shadow-float: 0 10px 30px rgba(11,13,16,.18);

  --tint-hero: 12%;
  --tint-tile: 10%;
  --tint-soft: 8%;
  --tint-ring: 35%;
  --glow: 14%;            /* light halves the glow */
  --sheen: linear-gradient(180deg, #fff, #F7F8FA);
  --edge: 0 0 0 1px var(--line);
  --attn: color-mix(in srgb, #FF9F43 14%, #fff);
  --cred: #D93B41;

  --practice: #6D4AE0;
  --on-practice: #FFFFFF;
}

/* ---- Practice mode: the incognito look (html.practice is set by js/core/practice.js) ------------------------
   Only the surfaces change, and the ink and team colours stay as they are. The rules name the two theme attributes
   too, because any element with its own data-theme (the always-dark front door, the console, sheets) re-declares
   the tokens. The texture, the frame and the violet bar are in css/welcome.css under "Practice mode". */
html.practice,
html.practice [data-theme="dark"] {
  --bg: #110E18;
  --s1: #1A1625;
  --s2: #241E31;
  --s3: #30293F;
  --line: #2A2437;
  --sheet: #1A1625;
  --navref: #0E0B14;
  --hl: #211B2E;
}
html.practice[data-theme="light"],
html.practice [data-theme="light"] {
  --bg: #F1EEFA;
  --s1: #FFFFFF;
  --s2: #E9E4F7;
  --s3: #DCD4F2;
  --line: #E2DBF3;
  --sheet: #FFFFFF;
  --navref: #FFFFFF;
  --hl: #ECE7F8;
}

:root {
  /* type: Geist for words; Geist Mono for minutes and columns (never above 24 px);
     hero numerals (score, points, podium, share cards) in Geist 700 tabular (.hn) */
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --fs-xs: 12px;          /* positions, tiny labels (12 px floor, audit rule 10) */
  --fs-meta: 12px;
  --fs-body: 14px;
  --fs-title: 18px;       /* sheet titles, tile labels */
  --fs-head: 26px;        /* page heads */
  --fs-score: 56px;       /* score block, Home and Match (console 46, compact 40) */
  --fs-score-console: 46px;
  --fs-score-compact: 40px;
  --fs-profile: 64px;     /* your points hero (64–72) */
  --fs-podium: 30px;      /* podium #1 34, others 24 */
  --fs-leader: 34px;
  --fs-share: 96px;       /* share cards 96–140 */

  /* spacing: 4 px grid · gutter 16 · card padding 14 · card gap 10 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px;
  --gutter: 16px;
  --card-pad: 14px;
  --card-gap: 10px;

  /* radii */
  --r-chip: 10px;         /* chips, segments */
  --r-btn: 12px;          /* buttons, tiles */
  --r-card: 14px;
  --r-sheet: 22px;

  /* heights */
  --h-header: 56px;
  --h-nav: 64px;
  --h-row: 48px;
  --h-trow: 46px;
  --h-btn: 52px;
  --h-btn-sm: 48px;
  --h-goal: 92px;         /* referee Goal tile */
  --h-action: 72px;       /* referee action tile */
  --h-tile: 64px;         /* player tile (equal tiles, names up to 2 lines) */
  --h-target: 48px;       /* referee targets: nothing under 48 */
  --h-target-player: 44px;
  --h-pill: 28px;         /* status pills (not tappable) */
  --sheet-safe: 34px;     /* space under the last action on a sheet */
  --safe-b: env(safe-area-inset-bottom, 0px);

  --rail: 232px;          /* laptop left rail */
  --content-max: 1040px;
  --phone-max: 480px;
}

/* Team colour hooks: set --tc on anything team-coloured (always with the team word).
   These four are the built-in colours. js/core/teams.js also writes a .t-<teamId> rule for
   every team in settings/teams (so a team's id and its colour can differ), after this file. */
.t-green { --tc: var(--green); }
.t-red   { --tc: var(--red); }
.t-blue  { --tc: var(--blue); }
.t-gold  { --tc: var(--gold); }

/* Team-coloured numerals: light theme darkens them 15% for contrast (never team text under 18 px in light). */
.tnum { color: var(--tc); }
[data-theme="light"] .tnum { color: color-mix(in srgb, var(--tc) 85%, #000); }

/* Hero numerals: Geist 700, tabular, tight (score 56 / 46 / 40, your points 64–72, podium 30 / 24,
   leader 34, share cards 96–140). Not Geist Mono: its slashed zero reads as Ø. */
.hn { font-family: var(--font); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1; }
