/* Tactivela design tokens v0.7.2 (Exploration, not yet approved).
   v0.7.1: no token changed -- the drill designer's item sizes, straight lines and notes (8 Oct 2026; sections 7.7, 9.4).
   v0.7: the front door and club colours (Nathan, 8 Oct 2026) -- the fixed --tk-door-* colours of the DSi blue
         front door (always light, the same in both kits) and the club accent blocks (:root[data-club], end of file).
   v0.6: icon and token redesign (Nathan, 3 Oct 2026) -- fine line icons at stroke 1.5, no icon tiles,
         bigger icons with the name underneath, new pitch tokens, the Pass V symbol (the --tk-icon-* sizes).
   v0.5: every screen rotates (28 Sep 2026) -- the side safe areas and the compact app bar on a short
         landscape screen (the media block near the end).
   v0.4: tablet and PC layouts (28 Sep 2026) -- the rail, column and breakpoint notes below.
   v0.3: rounded corners everywhere (Nathan, 26 Sep 2026) -- see the --tk-radius-* scale.
   Night kit is the default. Day kit applies with data-theme="light" on <html>,
   or automatically when no data-theme is set and the device prefers light.
   Source of truth for the look. Keep tokens/tokens.json in step when a value changes.
   The --tk-* prefix: named after the app's first name, TactiKit; kept so nothing already saved on a device is lost. */

:root {
  --tk-purple: #7B2FD6;
  --tk-purple-deep: #4A1590;
  --tk-touchline: #FFD400;
  --tk-on-touchline: #0B0812;
  --tk-on-accent: #FFFFFF;
  --tk-pitch: #11692B;
  --tk-pitch-deep: #0A4A1C;
  --tk-pitch-stripe: rgba(255, 255, 255, 0.035);
  --tk-pitch-line: rgba(255, 255, 255, 0.55);
  --tk-pitch-edge: rgba(255, 255, 255, 0.70);
  --tk-surface-afl: #1F4A14;
  --tk-surface-court: #6A3410;
  --tk-surface-netball: #154460;
  --tk-surface-ice: #163556;
  --tk-keeper: #08C968;
  --tk-keeper-edge: #A8FFD4;
  --tk-opponent: #D6283A;
  --tk-opponent-edge: #FFAAAA;
  --tk-nametag: #07060C;
  --tk-rpe-easy: #2FD37A;
  --tk-rpe-moderate: #C9B21F;
  --tk-rpe-hard: #F5A623;
  --tk-rpe-max: #D6283A;
  --tk-ink-yellow: #FFD400;
  --tk-ink-white: #FFFFFF;
  --tk-ink-red: #FF4444;
  --tk-ink-cyan: #00ACDD;
  --tk-ink-green: #44FF88;
  --tk-ink-orange: #FF9D2E;
  --tk-ink-halo: rgba(0, 0, 0, 0.35);

  /* The front door (v0.7): the DSi blue page with sign-in, the same in both kits (it is always light).
     Only modules/auth uses these, and only on the front door. */
  --tk-door-navy: #004166;        /* Deep Navy: the top bar, headings */
  --tk-door-blue: #0166A3;        /* Mid Blue: primary button, links */
  --tk-door-blue-hover: #00557D;  /* Structural Blue: primary button hover */
  --tk-door-cyan: #00ACDD;        /* DSi Cyan: the symbol's pass, "vela" on the bar, the outer focus ring, dots */
  --tk-door-page: #F4F7F8;        /* page background */
  --tk-door-surface: #FFFFFF;     /* hero, panel, footer */
  --tk-door-panel: #F1F4F5;       /* panel header strip */
  --tk-door-line: #DCE5E8;        /* card and divider lines (decorative) */
  --tk-door-field: #7D8B94;       /* input and outline-button borders, 3.5:1 on white */
  --tk-door-text: #15222C;        /* body text */
  --tk-door-muted: #5E6A73;       /* quiet text */
  --tk-door-danger: #C62828;      /* errors */
  --tk-font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --tk-font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tk-font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;   /* the front door: nothing to download */
  --tk-fs-hero: 64px;
  --tk-fs-title: 30px;
  --tk-fs-h2: 22px;
  --tk-fs-h3: 18px;
  --tk-fs-body: 16px;
  --tk-fs-body-s: 14px;
  --tk-fs-meta: 13px;
  --tk-fs-label: 12px;
  --tk-fs-micro: 11px;
  --tk-track-label: 0.18em;
  --tk-track-button: 0.10em;
  --tk-track-title: 0.03em;
  --tk-space-1: 4px;
  --tk-space-2: 8px;
  --tk-space-3: 12px;
  --tk-space-4: 16px;
  --tk-space-5: 20px;
  --tk-space-6: 24px;
  --tk-space-8: 32px;
  --tk-space-10: 40px;
  --tk-space-16: 64px;
  --tk-border: 2px;
  --tk-hairline: 1px;
  --tk-touchline-width: 3px;
  --tk-radius-sm: 6px;       /* tags, badges, name tags, swatches, number tiles */
  --tk-radius: 10px;         /* buttons, inputs, chips, tools, cards, rows, tiles, the pitch */
  --tk-radius-lg: 16px;      /* mode cards, panels, sheets, the add button */
  --tk-radius-pill: 999px;   /* toasts and anything fully rounded */
  --tk-radius-symbol: 20.8%;
  --tk-touch: 44px;

  /* Icons and tokens (v0.6) */
  --tk-icon-stroke: 1.5;        /* Line icon stroke. Fine line style chosen on 3 October 2026 */
  --tk-icon-stroke-small: 2;    /* Stroke for 18 and 20 px icons, so the smallest icons stay legible */
  --tk-icon-mode: 40px;         /* Mode card icon on the main menu. No tile */
  --tk-icon-quick: 36px;        /* Quick access icon, with the name underneath */
  --tk-icon-tool: 30px;         /* Drill and tactics tool icon, with the name underneath */
  --tk-token-list: 34px;        /* Pitch token in the equipment list, with the name underneath */
  --tk-btn-h: 48px;
  --tk-appbar-h: 64px;       /* becomes --tk-appbar-h-compact on a short landscape screen (end of file) */
  --tk-appbar-h-compact: 48px; /* the one-line app bar on a phone held sideways */
  --tk-nav-h: 62px;
  --tk-rail-w: 96px;         /* the tab rail down the left on tablets and PCs */
  --tk-column: 720px;        /* one column of reading content: lists, settings, the menu */
  --tk-column-wide: 1080px;  /* two-column screens on a PC */
  --tk-side-w: 320px;        /* a side panel beside a pitch or board: the bench, the drawing tools */
  /* Breakpoints (media queries cannot read tokens): tablet 700px and up, PC 1100px and up. */
  --tk-safe-top: env(safe-area-inset-top, 0px);
  --tk-safe-bottom: env(safe-area-inset-bottom, 0px);
  /* The notch or Dynamic Island of a phone held sideways (0 in portrait, and in the Android app,
     which keeps the page clear of the cutout itself). The screen pads its sides with these;
     the app bar, hero and navigation paint their colour out to the edges (tactivela.css). */
  --tk-safe-left: env(safe-area-inset-left, 0px);
  --tk-safe-right: env(safe-area-inset-right, 0px);
  --tk-dur-fast: 120ms;
  --tk-dur: 180ms;
  --tk-dur-slow: 260ms;
  --tk-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tk-z-nav: 50;
  --tk-z-sheet: 200;
  --tk-z-toast: 300;
}

/* Night kit (default) */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --tk-bg: #07060C;
  --tk-surface: #0E0B17;
  --tk-card: #161224;
  --tk-card-raised: #1E1830;
  --tk-nav: #0B0914;
  --tk-line: #2E2447;
  --tk-line-strong: #4A3A6E;
  --tk-field-line: #6E5E96;
  --tk-scrim: rgba(3, 2, 8, 0.78);
  --tk-text: #F4F1FA;
  --tk-text-muted: #A99CC4;
  --tk-text-subtle: #8A7CAE;
  --tk-violet: #A45BFF;
  --tk-violet-soft: #C9A6FF;
  --tk-tile: #4A1590;
  --tk-now: #FFD400;
  --tk-now-dim: #8A7400;
  --tk-wordmark-kit: #FFD400;   /* colours "vela" in the live wordmark; named for "Kit" (TactiKit), name kept */
  --tk-streak: #4A1590;
  --tk-streak-opacity: 0.45;
  --tk-ok: #2FD37A;
  --tk-ok-tint: rgba(47, 211, 122, 0.10);
  --tk-warn: #F5A623;
  --tk-warn-tint: rgba(245, 166, 35, 0.10);
  --tk-bad: #FF5A5A;
  --tk-bad-text: #FF7A7A;
  --tk-bad-tint: rgba(255, 90, 90, 0.10);
  --tk-na: #A7A5B4;
  --tk-na-tint: rgba(140, 138, 153, 0.10);
  --tk-info: #5AA9E6;
  --tk-opp-text: #FF8A8A;
  --tk-now-tint: rgba(255, 212, 0, 0.10);
  --tk-violet-tint: rgba(164, 91, 255, 0.12);
  --tk-focus-ring: rgba(164, 91, 255, 0.45);
  --tk-shadow-sheet: 0 -12px 32px rgba(0, 0, 0, 0.55);
  --tk-shadow-drag: 0 6px 20px rgba(0, 0, 0, 0.60);
  --tk-meta-theme: #0E0B17;
  --tk-statusbar: #0E0B17;
}

/* Day kit, chosen in Settings */
:root[data-theme="light"] {
  color-scheme: light;
  --tk-bg: #F6F4FA;
  --tk-surface: #FFFFFF;
  --tk-card: #F3EFF9;
  --tk-card-raised: #EAE3F5;
  --tk-nav: #FFFFFF;
  --tk-line: #DDD5EA;
  --tk-line-strong: #BFB2D6;
  --tk-field-line: #8F84A8;
  --tk-scrim: rgba(21, 18, 42, 0.45);
  --tk-text: #15122A;
  --tk-text-muted: #5E5475;
  --tk-text-subtle: #6F6589;
  --tk-violet: #6A22C0;
  --tk-violet-soft: #5B1FA8;
  --tk-tile: #7B2FD6;
  --tk-now: #7A5C00;
  --tk-now-dim: #C2A64A;
  --tk-wordmark-kit: #5B1FA8;
  --tk-streak: #E9DDFB;
  --tk-streak-opacity: 1;
  --tk-ok: #136536;
  --tk-ok-tint: rgba(19, 101, 54, 0.09);
  --tk-warn: #854B00;
  --tk-warn-tint: rgba(133, 75, 0, 0.09);
  --tk-bad: #C62828;
  --tk-bad-text: #AD2121;
  --tk-bad-tint: rgba(198, 40, 40, 0.08);
  --tk-na: #5A586E;
  --tk-na-tint: rgba(90, 88, 110, 0.09);
  --tk-info: #1F6FB2;
  --tk-opp-text: #B3202F;
  --tk-now-tint: rgba(122, 92, 0, 0.08);
  --tk-violet-tint: rgba(106, 34, 192, 0.08);
  --tk-focus-ring: rgba(106, 34, 192, 0.30);
  --tk-shadow-sheet: 0 -12px 32px rgba(21, 18, 42, 0.14);
  --tk-shadow-drag: 0 6px 20px rgba(21, 18, 42, 0.28);
  --tk-meta-theme: #FFFFFF;
  --tk-statusbar: #4A1590;
}

/* Day kit, following the device when the coach picks Auto */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --tk-bg: #F6F4FA;
    --tk-surface: #FFFFFF;
    --tk-card: #F3EFF9;
    --tk-card-raised: #EAE3F5;
    --tk-nav: #FFFFFF;
    --tk-line: #DDD5EA;
    --tk-line-strong: #BFB2D6;
    --tk-field-line: #8F84A8;
    --tk-scrim: rgba(21, 18, 42, 0.45);
    --tk-text: #15122A;
    --tk-text-muted: #5E5475;
    --tk-text-subtle: #6F6589;
    --tk-violet: #6A22C0;
    --tk-violet-soft: #5B1FA8;
    --tk-tile: #7B2FD6;
    --tk-now: #7A5C00;
    --tk-now-dim: #C2A64A;
    --tk-wordmark-kit: #5B1FA8;
    --tk-streak: #E9DDFB;
    --tk-streak-opacity: 1;
    --tk-ok: #136536;
    --tk-ok-tint: rgba(19, 101, 54, 0.09);
    --tk-warn: #854B00;
    --tk-warn-tint: rgba(133, 75, 0, 0.09);
    --tk-bad: #C62828;
    --tk-bad-text: #AD2121;
    --tk-bad-tint: rgba(198, 40, 40, 0.08);
    --tk-na: #5A586E;
    --tk-na-tint: rgba(90, 88, 110, 0.09);
    --tk-info: #1F6FB2;
    --tk-opp-text: #B3202F;
    --tk-now-tint: rgba(122, 92, 0, 0.08);
    --tk-violet-tint: rgba(106, 34, 192, 0.08);
    --tk-focus-ring: rgba(106, 34, 192, 0.30);
    --tk-shadow-sheet: 0 -12px 32px rgba(21, 18, 42, 0.14);
    --tk-shadow-drag: 0 6px 20px rgba(21, 18, 42, 0.28);
    --tk-meta-theme: #FFFFFF;
    --tk-statusbar: #4A1590;
  }
}

/* Club colours (v0.7, Nathan, 8 Oct 2026): TK.Shell sets data-club on <html> from the club's jersey colour
   (user.jerseyIdx) while a club is open, and removes it otherwise. Only the accents follow the club: the primary
   button fill (--tk-purple), --tk-tile, --tk-violet, --tk-violet-soft, --tk-violet-tint, --tk-focus-ring and the
   header streak. Never the logo (--tk-wordmark-kit), the yellow "now" (--tk-now, --tk-touchline), the pitch,
   jerseys, opponent, RPE, status colours, grounds or text. Purple (the default) and Gold have no block: a Gold club
   keeps the purple accents, because gold labels could not be told from the yellow "now". Each club is written three
   times, scoped like the kits above: night (with the dark kit), day, and the Auto copy of the day block, which must
   equal the day block. Every pair is measured in design system 4.8. */

/* Red */
:root[data-club="red"],
:root[data-club="red"][data-theme="dark"] {
  --tk-purple: #C62828;
  --tk-tile: #C62828;
  --tk-violet: #FF6B6B;
  --tk-violet-soft: #FFB3B3;
  --tk-violet-tint: rgba(255, 107, 107, 0.12);
  --tk-focus-ring: rgba(255, 107, 107, 0.45);
  --tk-streak: #6E1414;
}
:root[data-club="red"][data-theme="light"] {
  --tk-purple: #C62828;
  --tk-tile: #C62828;
  --tk-violet: #B42323;
  --tk-violet-soft: #9E1C1C;
  --tk-violet-tint: rgba(180, 35, 35, 0.08);
  --tk-focus-ring: rgba(180, 35, 35, 0.30);
  --tk-streak: #FBE0E0;
}
@media (prefers-color-scheme: light) {
  :root[data-club="red"]:not([data-theme]) {
    --tk-purple: #C62828;
    --tk-tile: #C62828;
    --tk-violet: #B42323;
    --tk-violet-soft: #9E1C1C;
    --tk-violet-tint: rgba(180, 35, 35, 0.08);
    --tk-focus-ring: rgba(180, 35, 35, 0.30);
    --tk-streak: #FBE0E0;
  }
}

/* Blue */
:root[data-club="blue"],
:root[data-club="blue"][data-theme="dark"] {
  --tk-purple: #2348B8;
  --tk-tile: #2348B8;
  --tk-violet: #5B8CFF;
  --tk-violet-soft: #AFC6FF;
  --tk-violet-tint: rgba(91, 140, 255, 0.12);
  --tk-focus-ring: rgba(91, 140, 255, 0.45);
  --tk-streak: #1A2C78;
}
:root[data-club="blue"][data-theme="light"] {
  --tk-purple: #2348B8;
  --tk-tile: #2348B8;
  --tk-violet: #2348B8;
  --tk-violet-soft: #1D3C9C;
  --tk-violet-tint: rgba(35, 72, 184, 0.08);
  --tk-focus-ring: rgba(35, 72, 184, 0.30);
  --tk-streak: #DEE5FA;
}
@media (prefers-color-scheme: light) {
  :root[data-club="blue"]:not([data-theme]) {
    --tk-purple: #2348B8;
    --tk-tile: #2348B8;
    --tk-violet: #2348B8;
    --tk-violet-soft: #1D3C9C;
    --tk-violet-tint: rgba(35, 72, 184, 0.08);
    --tk-focus-ring: rgba(35, 72, 184, 0.30);
    --tk-streak: #DEE5FA;
  }
}

/* Green */
:root[data-club="green"],
:root[data-club="green"][data-theme="dark"] {
  --tk-purple: #157A31;
  --tk-tile: #157A31;
  --tk-violet: #3FD06A;
  --tk-violet-soft: #9BEBB1;
  --tk-violet-tint: rgba(63, 208, 106, 0.12);
  --tk-focus-ring: rgba(63, 208, 106, 0.45);
  --tk-streak: #0E4A1F;
}
:root[data-club="green"][data-theme="light"] {
  --tk-purple: #157A31;
  --tk-tile: #157A31;
  --tk-violet: #11722C;
  --tk-violet-soft: #0F6527;
  --tk-violet-tint: rgba(17, 114, 44, 0.08);
  --tk-focus-ring: rgba(17, 114, 44, 0.30);
  --tk-streak: #DCF2E2;
}
@media (prefers-color-scheme: light) {
  :root[data-club="green"]:not([data-theme]) {
    --tk-purple: #157A31;
    --tk-tile: #157A31;
    --tk-violet: #11722C;
    --tk-violet-soft: #0F6527;
    --tk-violet-tint: rgba(17, 114, 44, 0.08);
    --tk-focus-ring: rgba(17, 114, 44, 0.30);
    --tk-streak: #DCF2E2;
  }
}

/* Black */
:root[data-club="black"],
:root[data-club="black"][data-theme="dark"] {
  --tk-purple: #3D3D4A;
  --tk-tile: #3D3D4A;
  --tk-violet: #A8A8B8;
  --tk-violet-soft: #D4D4DE;
  --tk-violet-tint: rgba(168, 168, 184, 0.12);
  --tk-focus-ring: rgba(168, 168, 184, 0.45);
  --tk-streak: #2E2E38;
}
:root[data-club="black"][data-theme="light"] {
  --tk-purple: #3D3D4A;
  --tk-tile: #3D3D4A;
  --tk-violet: #3D3D4A;
  --tk-violet-soft: #2E2E38;
  --tk-violet-tint: rgba(61, 61, 74, 0.08);
  --tk-focus-ring: rgba(61, 61, 74, 0.30);
  --tk-streak: #E6E6EC;
}
@media (prefers-color-scheme: light) {
  :root[data-club="black"]:not([data-theme]) {
    --tk-purple: #3D3D4A;
    --tk-tile: #3D3D4A;
    --tk-violet: #3D3D4A;
    --tk-violet-soft: #2E2E38;
    --tk-violet-tint: rgba(61, 61, 74, 0.08);
    --tk-focus-ring: rgba(61, 61, 74, 0.30);
    --tk-streak: #E6E6EC;
  }
}

/* White */
:root[data-club="white"],
:root[data-club="white"][data-theme="dark"] {
  --tk-purple: #55556A;
  --tk-tile: #55556A;
  --tk-violet: #C8C8D4;
  --tk-violet-soft: #E6E6EE;
  --tk-violet-tint: rgba(200, 200, 212, 0.12);
  --tk-focus-ring: rgba(200, 200, 212, 0.45);
  --tk-streak: #3C3C4A;
}
:root[data-club="white"][data-theme="light"] {
  --tk-purple: #55556A;
  --tk-tile: #55556A;
  --tk-violet: #55556A;
  --tk-violet-soft: #454556;
  --tk-violet-tint: rgba(85, 85, 106, 0.08);
  --tk-focus-ring: rgba(85, 85, 106, 0.30);
  --tk-streak: #ECECF2;
}
@media (prefers-color-scheme: light) {
  :root[data-club="white"]:not([data-theme]) {
    --tk-purple: #55556A;
    --tk-tile: #55556A;
    --tk-violet: #55556A;
    --tk-violet-soft: #454556;
    --tk-violet-tint: rgba(85, 85, 106, 0.08);
    --tk-focus-ring: rgba(85, 85, 106, 0.30);
    --tk-streak: #ECECF2;
  }
}

/* Teal */
:root[data-club="teal"],
:root[data-club="teal"][data-theme="dark"] {
  --tk-purple: #0B7070;
  --tk-tile: #0B7070;
  --tk-violet: #2EC4C4;
  --tk-violet-soft: #9AE6E6;
  --tk-violet-tint: rgba(46, 196, 196, 0.12);
  --tk-focus-ring: rgba(46, 196, 196, 0.45);
  --tk-streak: #0A4848;
}
:root[data-club="teal"][data-theme="light"] {
  --tk-purple: #0B7070;
  --tk-tile: #0B7070;
  --tk-violet: #0B6E6E;
  --tk-violet-soft: #085C5C;
  --tk-violet-tint: rgba(11, 110, 110, 0.08);
  --tk-focus-ring: rgba(11, 110, 110, 0.30);
  --tk-streak: #D8F1F1;
}
@media (prefers-color-scheme: light) {
  :root[data-club="teal"]:not([data-theme]) {
    --tk-purple: #0B7070;
    --tk-tile: #0B7070;
    --tk-violet: #0B6E6E;
    --tk-violet-soft: #085C5C;
    --tk-violet-tint: rgba(11, 110, 110, 0.08);
    --tk-focus-ring: rgba(11, 110, 110, 0.30);
    --tk-streak: #D8F1F1;
  }
}

/* A short landscape screen (a phone held sideways, 500px tall or less): the app bar goes to one line
   (tactivela.css), so everything that sits below it (the storage warning, for one) follows this value. */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --tk-appbar-h: var(--tk-appbar-h-compact); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --tk-dur-fast: 0ms; --tk-dur: 0ms; --tk-dur-slow: 0ms; }
}
