/* =========================================================================
   ASROMA.GE — design tokens                                    tokens.css
   Direction "Notte": squared, hairline, scoreboard tiles, condensed numerals.
   Layers
     1. Primitives  (:root)            raw ramps — never use these in page CSS
     2. Semantic    (light = default)  html[data-theme="light"] / :root
     3. Semantic    (dark)             html[data-theme="dark"]  + the ink-island scope .on-dark
   Rules: page/component CSS uses ONLY semantic tokens (section 2/3 names).
   The theme is decided by boot.js (attribute on <html>); no prefers-color-scheme here.
   Breakpoints (not expressible as custom properties): 600px · 900px · 1200px (min-width, mobile-first).
   ========================================================================= */

:root {
  /* ---------------------------------------------------------------- 1. PRIMITIVES */
  /* neutrals — 800/850/900 are the client's graphite / charcoal / ink */
  --gray-0: #FFFFFF;
  --gray-25: #F8F8F9;
  --gray-50: #F3F3F5;
  --gray-100: #EDEEF0;
  --gray-150: #E4E5E8;
  --gray-200: #D5D7DC;
  --gray-300: #BDBFC6;
  --gray-400: #9699A2;
  --gray-500: #6E717A;
  --gray-600: #50535C;
  --gray-700: #3A3B42;
  --gray-800: #2B2C31;
  --gray-850: #1D1E22;
  --gray-900: #111215;
  --gray-950: #0B0B0D;

  /* Roma red (#970A2C is the brand value) */
  --roma-red-900: #5A0619;
  --roma-red-800: #6E0720;
  --roma-red-700: #850A26;
  --roma-red-600: #970A2C;
  --roma-red-500: #A80F33;
  --roma-red-400: #C01841;
  --roma-red-300: #EA3552;
  --roma-red-200: #FF6B81;
  --roma-red-50: #F7E7EB;

  /* Roma yellow (#FBBA00 is the brand value) */
  --roma-yellow-800: #6B4F00;
  --roma-yellow-700: #8A6600;
  --roma-yellow-600: #E0A600;
  --roma-yellow-500: #FBBA00;
  --roma-yellow-400: #FFC933;
  --roma-yellow-100: #FFF1C7;
  --roma-yellow-50: #FFF7E0;

  /* semantic extras (tiny signals only, never surfaces) */
  --green-600: #177F4E;
  --green-400: #3DBE7E;
  --orange-700: #B45309;
  --orange-400: #F59E0B;
  --vermilion-600: #C3261C;
  --vermilion-300: #FF7A6B;
  --blue-600: #2563A8;
  --blue-300: #6EA8F0;

  /* ---------------------------------------------------------------- TYPE */
  --font-display: "Archivo", "Noto Sans Georgian", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Noto Sans Georgian", monospace;
  /* Archivo width axis (62–100) */
  --stretch-xc: 62.5%;   /* extra-condensed: scores, countdowns, section titles */
  --stretch-c: 75%;      /* condensed: buttons, labels, nav, chips */
  --stretch-n: 100%;

  /* fixed type scale — 11 steps, nothing else allowed. 11px only for count badges. */
  --fs-2xs: 11px;
  --fs-xs: 12px;     /* micro labels, meta */
  --fs-sm: 13px;     /* secondary UI */
  --fs-md: 14px;     /* UI default */
  --fs-base: 15px;   /* reading text */
  --fs-lg: 18px;     /* lead, card titles (body font) */
  --fs-xl: 24px;     /* display section titles, dialog titles */
  --fs-2xl: 28px;    /* poll questions, stat values, compact countdown digits */
  --fs-3xl: clamp(32px, 2.2rem + 1vw, 44px);   /* page titles */
  --fs-4xl: clamp(40px, 2rem + 3vw, 64px);     /* countdown digits, big stats */
  --fs-5xl: clamp(56px, 2rem + 6vw, 112px);    /* hero score */

  --lh-tight: 1;
  --lh-snug: 1.25;
  --lh-normal: 1.5;
  --lh-loose: 1.65;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;

  --tracking-label: .1em;    /* condensed uppercase labels */
  --tracking-btn: .06em;
  --tracking-display: .015em;

  /* ---------------------------------------------------------------- SPACE (4px base) */
  --sp-0: 0;
  --sp-px: 1px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* ---------------------------------------------------------------- SHAPE */
  --r-xs: 3px;    /* chips, badges, level tags */
  --r-sm: 4px;    /* buttons, inputs, tiles */
  --r-md: 6px;    /* cards, avatars md */
  --r-lg: 8px;    /* heroes, dialogs, big avatars */
  --r-full: 999px; /* ONLY discs (clubs) and dots */

  --bw: 1px;
  --bw-2: 2px;
  --bw-accent: 3px;   /* yellow hairline, active markers */

  /* ---------------------------------------------------------------- MOTION */
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* ---------------------------------------------------------------- Z-INDEX */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 40;
  --z-header: 60;
  --z-tabbar: 70;
  --z-dropdown: 80;
  --z-drawer: 90;
  --z-proto: 95;
  --z-modal: 100;
  --z-toast: 110;

  /* ---------------------------------------------------------------- LAYOUT */
  --header-h: 56px;          /* mobile; 64px from 900px (incl. 3px yellow hairline) */
  --header-hairline: 3px;
  --tabbar-h: 60px;          /* mobile bottom tab bar (+ safe-area) */
  --sidebar-w: 320px;
  --content-max: 1376px;     /* shell max width (main + sidebar + gaps) */
  --main-max: 1032px;        /* comfortable main-column width */
  --reading-max: 68ch;
  --gutter: 16px;            /* 24px from 600px, 32px from 1200px */
  --shell-gap: 24px;
  --section-gap: 32px;       /* vertical rhythm between page sections */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --tap: 44px;               /* minimum touch target */

  /* ---------------------------------------------------------------- THEME-INDEPENDENT COLOURS */
  /* brand constants (use the semantic --red / --yellow below for UI) */
  --brand-red: #970A2C;
  --brand-yellow: #FBBA00;
  --on-red: #FFFFFF;
  --on-yellow: #1D1E22;
  /* always-dark islands (header, hero, sidebar next-match card, tab bar, footer) */
  --island-bg: #111215;        /* header / tab bar / footer band */
  --island-surface: #1D1E22;   /* hero / scoreboard card */
  --island-raised: #2B2C31;
  /* avatar fills (white initials, ≥ 7:1) */
  --av-1: #474952;
  --av-2: #5B4B57;
  --av-3: #3F5560;
  --av-4: #6B2A3A;
  --av-5: #4A5A48;
  --av-6: #5E5040;
  --av-fg: #FFFFFF;
  /* club monogram discs (data colours — use via .club--* classes only) */
  --club-roma-bg: #970A2C;  --club-roma-fg: #FBBA00;  --club-roma-ring: #FBBA00;
  --club-psg-bg: #12285A;   --club-psg-fg: #FFFFFF;   --club-psg-ring: #D3122F;
  --club-mon-bg: #C8102E;   --club-mon-fg: #FFFFFF;   --club-mon-ring: #FFFFFF;
  --club-bol-bg: #1B2B5E;   --club-bol-fg: #FFFFFF;   --club-bol-ring: #A31230;
  --club-laz-bg: #9CCFF0;   --club-laz-fg: #0F2A47;   --club-laz-ring: #FFFFFF;
  --club-scp-bg: #00704A;   --club-scp-fg: #FFFFFF;   --club-scp-ring: #FFFFFF;
  --club-par-bg: #F3D21C;   --club-par-fg: #1B2F6B;   --club-par-ring: #1B2F6B;
  --club-juv-bg: #F2F2F2;   --club-juv-fg: #111215;   --club-juv-ring: #111215;
  --club-generic-bg: #50535C; --club-generic-fg: #FFFFFF; --club-generic-ring: #9699A2;
  /* media placeholders stay dark in both themes (broadcast look) */
  --ph-a: #34353C;
  --ph-b: #1B1C20;
  --ph-pattern: rgba(255, 255, 255, .05);
  --ph-glyph: rgba(255, 255, 255, .09);
  --ph-fg: rgba(255, 255, 255, .62);
}

/* =================================================================== 2. LIGHT (default) */
:root,
html[data-theme="light"],
html:not([data-theme="dark"]) .on-theme {
  /* .on-theme = back to the page theme inside an .on-dark island (e.g. a dropdown panel
     or dialog that lives in the header markup). Only needs a rule for the light theme. */
  color-scheme: light;

  /* surfaces */
  --bg: #EDEEF0;              /* page canvas */
  --bg-sunken: #E4E5E8;       /* recessed bands, table stripes on canvas */
  --surface-1: #FFFFFF;       /* cards */
  --surface-2: #F3F3F5;       /* raised / hover / quiet fills */
  --surface-3: #E4E5E8;       /* pressed / stronger fills, tracks */
  --well: #F3F3F5;            /* scoreboard tile / countdown unit background */
  --surface-inverse: #111215;
  --text-inverse: #F5F5F6;

  /* lines */
  --border-subtle: #E4E5E8;
  --border: #D5D7DC;
  --border-strong: #8E919A;

  /* text */
  --text-strong: #111215;
  --text: #2A2B30;
  --text-muted: #5C5F68;
  --text-faint: #6E717A;

  /* red = live / Roma */
  --red: #970A2C;
  --red-hover: #850A26;
  --red-press: #6E0720;
  --red-soft: #F7E7EB;
  --red-text: #970A2C;        /* red for small text / icons on this surface */
  --live: #C8102E;            /* LIVE dots */

  /* yellow = act / yours */
  --yellow: #FBBA00;
  --yellow-hover: #FFC933;
  --yellow-press: #E0A600;
  --yellow-soft: #FFF1C7;
  --yellow-text: #6B4F00;     /* yellow-family text readable on light */
  --highlight: #111215;       /* "yours" numbers: ink on light, yellow on dark */
  --accent-num: #970A2C;      /* the one accented digit (countdown seconds / live minute) */

  /* status (tiny signals) */
  --success: #177F4E;  --success-soft: #E3F3EA;
  --warning: #B45309;  --warning-soft: #FCEFD9;
  --danger: #C3261C;   --danger-soft: #FBE7E5;
  --info: #2563A8;     --info-soft: #E4EEF9;

  /* interaction */
  --focus: #111215;
  --focus-halo: rgba(251, 186, 0, .55);
  --overlay: rgba(11, 11, 13, .56);
  --hover-tint: rgba(17, 18, 21, .04);
  --shadow-sm: 0 1px 2px rgba(17, 18, 21, .06);
  --shadow-pop: 0 12px 32px -6px rgba(17, 18, 21, .22), 0 0 0 1px rgba(17, 18, 21, .06);

  /* data bars */
  --bar-track: #E4E5E8;
  --bar-fill: #A6A9B2;
  --bar-strong: #111215;

  /* level badges L1–L6 : bg / fg / line / key-bg / key-fg */
  --lv1-bg: transparent; --lv1-fg: #5C5F68; --lv1-line: #BDBFC6; --lv1-key-bg: transparent; --lv1-key-fg: #2A2B30;
  --lv2-bg: #E4E5E8;     --lv2-fg: #2A2B30; --lv2-line: #D5D7DC; --lv2-key-bg: #D5D7DC;     --lv2-key-fg: #111215;
  --lv3-bg: #FFF7E0;     --lv3-fg: #111215; --lv3-line: #FBBA00; --lv3-key-bg: #FBBA00;     --lv3-key-fg: #1D1E22;
  --lv4-bg: #FBBA00;     --lv4-fg: #1D1E22; --lv4-line: #FBBA00; --lv4-key-bg: #E0A600;     --lv4-key-fg: #1D1E22;
  --lv5-bg: #970A2C;     --lv5-fg: #FFFFFF; --lv5-line: #970A2C; --lv5-key-bg: #FBBA00;     --lv5-key-fg: #1D1E22;
  --lv6-bg: #111215;     --lv6-fg: #FBBA00; --lv6-line: #FBBA00; --lv6-key-bg: #FBBA00;     --lv6-key-fg: #111215;

  /* pitch */
  --pitch-grass: #3A7550;
  --pitch-grass-alt: #356C4A;
  --pitch-line: rgba(255, 255, 255, .62);

  /* charts */
  --chart-1: #111215;
  --chart-2: #E0A600;
  --chart-3: #970A2C;
  --chart-4: #9699A2;
  --chart-5: #2563A8;
  --chart-grid: #E4E5E8;
  --chart-axis: #6E717A;
}

/* =================================================================== 3. DARK + INK ISLANDS
   .on-dark is THE on-dark scope: put it on any always-dark region (header, hero,
   sidebar next-match card, tab bar, footer, inverse card). It re-maps every semantic
   token to its dark value, so the same components render correctly inside it. */
html[data-theme="dark"],
.on-dark {
  color-scheme: dark;

  --bg: #111215;
  --bg-sunken: #0B0B0D;
  --surface-1: #1D1E22;
  --surface-2: #2B2C31;
  --surface-3: #3A3B42;
  --well: #111215;
  --surface-inverse: #F5F5F6;
  --text-inverse: #111215;

  --border-subtle: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .15);
  --border-strong: rgba(255, 255, 255, .42);

  --text-strong: #F5F5F6;
  --text: #DCDDE1;
  --text-muted: #A3A6AE;
  --text-faint: #8A8D96;

  --red: #A80F33;
  --red-hover: #C01841;
  --red-press: #850A26;
  --red-soft: rgba(234, 53, 82, .16);
  --red-text: #FF6B81;
  --live: #EA3552;

  --yellow: #FBBA00;
  --yellow-hover: #FFC933;
  --yellow-press: #E0A600;
  --yellow-soft: rgba(251, 186, 0, .14);
  --yellow-text: #FBBA00;
  --highlight: #FBBA00;
  --accent-num: #FBBA00;

  --success: #3DBE7E;  --success-soft: rgba(61, 190, 126, .14);
  --warning: #F59E0B;  --warning-soft: rgba(245, 158, 11, .14);
  --danger: #FF7A6B;   --danger-soft: rgba(255, 122, 107, .14);
  --info: #6EA8F0;     --info-soft: rgba(110, 168, 240, .14);

  --focus: #FBBA00;
  --focus-halo: rgba(251, 186, 0, .35);
  --overlay: rgba(0, 0, 0, .66);
  --hover-tint: rgba(255, 255, 255, .05);
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-pop: 0 16px 40px -6px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1);

  --bar-track: #2B2C31;
  --bar-fill: #62646E;
  --bar-strong: #F5F5F6;

  --lv1-bg: transparent; --lv1-fg: #A3A6AE; --lv1-line: rgba(255, 255, 255, .28); --lv1-key-bg: transparent; --lv1-key-fg: #DCDDE1;
  --lv2-bg: #3A3B42;     --lv2-fg: #F5F5F6; --lv2-line: #3A3B42; --lv2-key-bg: #50535C;     --lv2-key-fg: #FFFFFF;
  --lv3-bg: rgba(251, 186, 0, .12); --lv3-fg: #F5F5F6; --lv3-line: #FBBA00; --lv3-key-bg: #FBBA00; --lv3-key-fg: #1D1E22;
  --lv4-bg: #FBBA00;     --lv4-fg: #1D1E22; --lv4-line: #FBBA00; --lv4-key-bg: #E0A600;     --lv4-key-fg: #1D1E22;
  --lv5-bg: #A80F33;     --lv5-fg: #FFFFFF; --lv5-line: #A80F33; --lv5-key-bg: #FBBA00;     --lv5-key-fg: #1D1E22;
  --lv6-bg: #0B0B0D;     --lv6-fg: #FBBA00; --lv6-line: #FBBA00; --lv6-key-bg: #FBBA00;     --lv6-key-fg: #111215;

  --pitch-grass: #24533A;
  --pitch-grass-alt: #214D35;
  --pitch-line: rgba(255, 255, 255, .42);

  --chart-1: #F5F5F6;
  --chart-2: #FBBA00;
  --chart-3: #FF6B81;
  --chart-4: #62646E;
  --chart-5: #6EA8F0;
  --chart-grid: rgba(255, 255, 255, .08);
  --chart-axis: #8A8D96;
}

/* dark theme only: islands step one notch darker so they still read as "ink" on a dark page */
html[data-theme="dark"] {
  --island-bg: #0B0B0D;
  --island-surface: #1D1E22;
}

/* the island scope also sets its own text colour (inherit-safe) */
.on-dark,
.on-theme { color: var(--text); }
