/*
 * tokens.css - the ONE design system for IPTV G9 (loaded right after base.css; overrides its :root values and adds the
 * rest). Every screen styles itself from these variables only, so the app feels like one product.
 *
 * Identity: "IPTV G9" - deep OLED black, one confident accent (iris violet) used for focus, progress and primary
 * actions; live red only for LIVE / recording / the guide's now-line. Typeface: Manrope (bundled, OFL).
 * Rules: true black backgrounds (OLED), no large static bright areas, overlays auto-hide; motion uses transform /
 * opacity only (60 fps on the TV); no backdrop-filter (too slow on Tizen); shadows are static (animate opacity of a
 * glow layer, never box-shadow itself).
 * Sizes are rem: html font-size comes from the height-based UI scale (js/ui/ui-scale.js) - keep it that way.
 */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---------- colour: surfaces (OLED: true black base, lifted surfaces for depth) ---------- */
  --c-bg: #000000;            /* app background (true black) */
  --c-bg-2: #07080b;          /* section bands, sidebars */
  --c-surface-1: #0d0f14;     /* cards, rows */
  --c-surface-2: #151821;     /* raised cards, menus */
  --c-surface-3: #1e2230;     /* hovered / pressed surface */
  --c-panel: var(--c-surface-1);
  --c-panel-2: var(--c-surface-2);
  --c-line: rgba(255, 255, 255, 0.08);
  --c-line-strong: rgba(255, 255, 255, 0.16);

  /* ---------- colour: text ---------- */
  --c-fg: #f2f3f7;
  --c-fg-2: #c9ccd6;          /* secondary text */
  --c-muted: #8a8fa0;
  --c-dim: #5a5f70;

  /* ---------- colour: accent (iris violet) ---------- */
  --c-accent: #7b61ff;
  --c-accent-hi: #a594ff;      /* text/icons on dark */
  --c-accent-lo: #4b38c7;      /* pressed */
  --c-accent-fg: #ffffff;
  --c-accent-soft: rgba(123, 97, 255, 0.16);
  --c-accent-glow: rgba(123, 97, 255, 0.55);

  /* ---------- colour: semantic ---------- */
  --c-live: #ff3d57;           /* LIVE badge, now-line, REC */
  --c-rec: #ff3d57;
  --c-ok: #2fd27c;
  --c-warn: #ffb547;
  --c-error: #ff5c6c;
  --c-gold: #ffc94a;           /* ratings, stars */
  --c-catchup: #48c6ff;        /* catch-up ⟲ markers */
  --c-red: #ff3d57; --c-green: #2fd27c; --c-yellow: #ffd23f; --c-blue: #3d8bff;   /* remote colour keys */
  --c-focus: var(--c-accent);
  --c-focus-bg: var(--c-accent-soft);
  --c-selected: rgba(123, 97, 255, 0.22);
  --c-overlay: rgba(0, 0, 0, 0.72);

  /* ---------- gradients / scrims (over video and backdrops) ---------- */
  --scrim-bottom: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 45%, rgba(0,0,0,0) 100%);
  --scrim-top: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
  --scrim-left: linear-gradient(to right, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.75) 35%, rgba(0,0,0,0) 75%);
  --scrim-hero: linear-gradient(to right, #000 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.2) 70%, rgba(0,0,0,0.55) 100%), linear-gradient(to top, #000 0%, rgba(0,0,0,0) 40%);
  --grad-card: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  --grad-accent: linear-gradient(135deg, #8f78ff 0%, #6a4fff 55%, #4b38c7 100%);

  /* ---------- type ---------- */
  --font: "Manrope", "Segoe UI", "Samsung One", Roboto, Arial, sans-serif;
  --fw-regular: 450; --fw-medium: 560; --fw-semibold: 650; --fw-bold: 760; --fw-heavy: 800;
  --fs-xs: 1rem;              /* 16 px at 1080 tall (21 at 1440) - the smallest text anywhere */
  --fs-s: 1.125rem;
  --fs-m: 1.3rem;
  --fs-l: 1.65rem;
  --fs-xl: 2.25rem;
  --fs-xxl: 3rem;
  --fs-display: 4rem;         /* hero titles */
  --fs-num: 2.6rem;           /* big channel numbers */
  --lh-tight: 1.1; --lh: 1.35; --lh-loose: 1.55;
  --ls-caps: 0.08em;          /* small caps labels */

  /* ---------- spacing (keep sp-1..5; 6-7 for heroes/sections) ---------- */
  --sp-1: 0.375rem; --sp-2: 0.75rem; --sp-3: 1.25rem; --sp-4: 2rem; --sp-5: 3rem; --sp-6: 4.5rem; --sp-7: 6.5rem;
  --gutter: 3rem;             /* outer safe margin (TV overscan-safe) */

  /* ---------- radii ---------- */
  --r-xs: 0.25rem; --r-s: 0.5rem; --r-m: 0.75rem; --r-l: 1.1rem; --r-xl: 1.6rem; --r-pill: 999px;
  --radius: var(--r-m);

  /* ---------- depth ---------- */
  --sh-1: 0 0.15rem 0.5rem rgba(0,0,0,0.45);
  --sh-2: 0 0.5rem 1.5rem rgba(0,0,0,0.55);
  --sh-3: 0 1.25rem 3rem rgba(0,0,0,0.7);

  /* ---------- the selected state (remote focus AND mouse hover look identical) ---------- */
  --focus-w: 0.2rem;
  --focus-scale: 1.05;          /* cards/tiles/posters; rows use --focus-scale-row */
  --focus-scale-row: 1.0;
  --focus-ring: 0 0 0 var(--focus-w) var(--c-accent);
  --focus-glow: 0 0 1.75rem 0.15rem var(--c-accent-glow);
  --focus-shadow: var(--focus-ring), var(--focus-glow), var(--sh-2);

  /* ---------- motion (transform / opacity only) ---------- */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 320ms;

  /* ---------- dialogs (all modals, menus, player panels share these) ---------- */
  --dlg-bg: var(--c-surface-2);
  --dlg-radius: var(--r-l);
  --dlg-shadow: var(--sh-3);
  --dlg-pad: var(--sp-4);
  --dlg-w: min(46rem, 90vw);

  /* ---------- layering ---------- */
  --z-overlay: 50; --z-panel: 60; --z-modal: 80; --z-toast: 90; --z-osd: 95;
}

/* ---------- global base on top of base.css ---------- */
body { font-family: var(--font); font-weight: var(--fw-regular); letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "tnum" 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* Generic selected state: components may refine it, but keep the same language (accent ring + glow + slight scale).
   Glow is a pseudo-element faded with opacity, so focus changes never animate box-shadow. */
.u-focusable { position: relative; transition: transform var(--dur) var(--ease); }
.u-focusable::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: var(--focus-shadow); opacity: 0; transition: opacity var(--dur) var(--ease); }
.u-focusable.is-focused { transform: scale(var(--focus-scale)); z-index: 2; }
.u-focusable.is-focused::after { opacity: 1; }

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