@font-face { font-family: Peyda; font-weight: 400; font-display: swap; src: url(../fonts/Peyda-Regular.woff2) format('woff2'); }
@font-face { font-family: Peyda; font-weight: 500; font-display: swap; src: url(../fonts/Peyda-Medium.woff2) format('woff2'); }
@font-face { font-family: Peyda; font-weight: 600; font-display: swap; src: url(../fonts/Peyda-SemiBold.woff2) format('woff2'); }
@font-face { font-family: Peyda; font-weight: 700; font-display: swap; src: url(../fonts/Peyda-Bold.woff2) format('woff2'); }
@font-face { font-family: Peyda; font-weight: 800; font-display: swap; src: url(../fonts/Peyda-ExtraBold.woff2) format('woff2'); }

/* ================================================================ palettes
   Four themes from Parkinox — rose (burgundy & pink), midnight (indigo &
   violet), forest (dark green & jade), sunset (orange & amber) — each with a
   light and a dark mode. Every theme/mode redefines the
   same raw palette tokens; components only use the semantic tokens below.
   (Token names follow Parkinox, so --blue-* / --cyan are role names, not hues.) */
:root, :root[data-theme="rose"] {
  color-scheme: light;
  --ink: #38232d; --ink-soft: #80636f; --heading: var(--blue-950);
  --blue-950: #561e36; --blue-800: #7e2f4e; --blue-700: #9e3f62;
  --blue-100: #f6dfe7; --cyan: #df7895;
  --surface: #fffafb; --surface-soft: #fdf2f5; --line: #edd8df;
  --app-bg: #f8edf1;
  --success: #16845c; --warning: #b7740c; --danger: #b43c45;
  --on-primary: #ffffff;
  --swatch: #df7895;
}
:root[data-theme="midnight"] {
  --ink: #302c47; --ink-soft: #77718d;
  --blue-950: #292350; --blue-800: #40376f; --blue-700: #50448b;
  --blue-100: #e6e2f5; --cyan: #8b79cf;
  --surface: #fdfcff; --surface-soft: #f3f1fa; --line: #ddd9ec;
  --app-bg: #eeecf5;
  --swatch: #8b79cf;
}
:root[data-theme="forest"] {
  --ink: #1e332d; --ink-soft: #61766f;
  --blue-950: #183d35; --blue-800: #215746; --blue-700: #286b57;
  --blue-100: #dceee6; --cyan: #58aa83;
  --surface: #fbfefc; --surface-soft: #f0f7f3; --line: #d5e5dd;
  --app-bg: #ebf3ef;
  --swatch: #58aa83;
}
:root[data-theme="sunset"] {
  --ink: #432d24; --ink-soft: #816b5f;
  --blue-950: #623321; --blue-800: #85472a; --blue-700: #a75a32;
  --blue-100: #f7e5d6; --cyan: #e59a4b;
  --surface: #fffdf9; --surface-soft: #faf3ea; --line: #eadccd;
  --app-bg: #f5eee6;
  --swatch: #e59a4b;
}
:root[data-mode="dark"] {
  color-scheme: dark;
  --success: #62d3a2; --warning: #f0b760; --danger: #f1848d;
  --on-primary: #f7fbfd;
}
:root[data-mode="dark"], :root[data-theme="rose"][data-mode="dark"] {
  --ink: #f8eef2; --ink-soft: #b99aa7; --heading: #fbf2f5;
  --blue-950: #3f1628; --blue-800: #8a3558; --blue-700: #e0829f;
  --blue-100: #35182a; --cyan: #ef8fab;
  --surface: #22131a; --surface-soft: #1a0f14; --line: #432a35;
  --app-bg: #140a0f;
}
:root[data-theme="midnight"][data-mode="dark"] {
  --ink: #efedf9; --ink-soft: #a39ec0; --heading: #f4f2fc;
  --blue-950: #231d45; --blue-800: #4d4190; --blue-700: #a795e6;
  --blue-100: #211b3f; --cyan: #a08fe0;
  --surface: #161327; --surface-soft: #110e1f; --line: #312b4d;
  --app-bg: #0b0916;
}
:root[data-theme="forest"][data-mode="dark"] {
  --ink: #eaf5f0; --ink-soft: #93b0a5; --heading: #f1f9f5;
  --blue-950: #123027; --blue-800: #22634e; --blue-700: #5fbf92;
  --blue-100: #16302a; --cyan: #6cc79a;
  --surface: #11201b; --surface-soft: #0c1814; --line: #273d35;
  --app-bg: #08120f;
}
:root[data-theme="sunset"][data-mode="dark"] {
  --ink: #f8f0e8; --ink-soft: #bba48f; --heading: #fcf5ee;
  --blue-950: #3d2215; --blue-800: #8a4a28; --blue-700: #eea45a;
  --blue-100: #362313; --cyan: #f0aa5c;
  --surface: #22160f; --surface-soft: #1a110b; --line: #45311f;
  --app-bg: #140c07;
}

/* ================================================================ semantic tokens (all themes) */
:root {
  --bg: var(--app-bg);
  --card: var(--surface);
  --card-soft: var(--surface-soft);
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --accent: var(--blue-700);         /* links, category labels */
  --border: var(--line);
  --tint: var(--blue-100);           /* chips, placeholders, progress track */
  --tint-text: var(--blue-700);
  --hover: color-mix(in srgb, var(--blue-700) 8%, transparent);
  --primary: var(--blue-800);
  --primary-hover: color-mix(in srgb, var(--blue-800) 82%, white);
  --success-bg: color-mix(in srgb, var(--success) 14%, var(--surface));
  --warning-bg: color-mix(in srgb, var(--warning) 14%, var(--surface));
  --danger-bg: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --success-text: var(--success);
  --warning-text: var(--warning);
  --danger-text: var(--danger);
  --on-dark-soft: color-mix(in srgb, var(--on-primary) 72%, transparent);
  --on-dark-line: color-mix(in srgb, var(--on-primary) 15%, transparent);
  --overlay: color-mix(in srgb, var(--blue-950) 85%, transparent);  /* controls on video */
  --glow: color-mix(in srgb, var(--cyan) 25%, transparent);
  --logo-bg: var(--blue-100);         /* light tint behind the university logo */
  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--blue-950) 7%, transparent), 0 2px 8px color-mix(in srgb, var(--blue-950) 6%, transparent);
  --shadow: 0 14px 36px color-mix(in srgb, var(--blue-950) 14%, transparent);
  --backdrop: color-mix(in srgb, var(--blue-950) 45%, transparent);
  --radius: 14px;
  --radius-sm: 10px;
}
:root[data-mode="dark"] {
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --backdrop: rgba(0, 0, 0, 0.6);
  --logo-bg: color-mix(in srgb, var(--blue-700) 22%, white);
}

/* ================================================================ design layer
   Cinematic TV interface (after "MI IPTV"): dark by default, a blurred image of what
   is on air behind everything, translucent glass surfaces, one accent from the theme,
   hierarchy by size and brightness, focus that lifts. */
:root {
  --accent-ink: var(--blue-700);       /* accent text/icons on surfaces */
  --accent-fill: var(--blue-800);      /* buttons, badges */
  --glass: color-mix(in srgb, var(--surface) 70%, transparent);
  --glass-hi: color-mix(in srgb, var(--surface) 92%, transparent);
  --glass-line: color-mix(in srgb, var(--ink) 9%, transparent);
  --faint: color-mix(in srgb, var(--ink-soft) 75%, transparent);
  --live: #e5484d;
  --r: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --blur: blur(22px) saturate(1.25);
  --pad: clamp(16px, 3.6vw, 56px);
}
:root[data-mode="dark"] {
  --accent-ink: var(--cyan);
  --accent-fill: var(--blue-800);
  --glass: color-mix(in srgb, var(--surface) 58%, transparent);
  --glass-hi: color-mix(in srgb, var(--blue-100) 78%, transparent);
  --glass-line: rgba(255, 255, 255, 0.08);
  --faint: color-mix(in srgb, var(--ink-soft) 70%, transparent);
}

/* ================================================================ base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-padding-top: 96px; scroll-behavior: smooth; }
html:not(.ready) body { opacity: 0; }
body {
  font-family: Peyda, Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: opacity 0.35s, background-color 0.3s, color 0.3s;
}
html.pl-open { overflow: hidden; }
a { color: var(--accent-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.num { font-feature-settings: 'tnum'; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .fl { fill: currentColor; stroke: none; }
.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.wrap { width: min(1400px, 100% - 32px); margin-inline: auto; }

/* Blurred picture of what is on air, behind every page. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.backdrop i {
  position: absolute; inset: -60px; background: center / cover no-repeat;
  filter: blur(46px) saturate(1.3); opacity: 0; transition: opacity 1.2s var(--ease); transform: scale(1.08);
}
.backdrop i.on { opacity: 0.55; }
:root:not([data-mode="dark"]) .backdrop i.on { opacity: 0.35; }
.backdrop::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1100px 600px at 85% 10%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 70%),
    linear-gradient(to top, var(--bg) 8%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, color-mix(in srgb, var(--bg) 78%, transparent));
}

/* ================================================================ brand & round buttons */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--heading); font-size: 1.45rem; font-weight: 800; direction: ltr; white-space: nowrap; flex: none; }
.brand:hover { color: var(--heading); }
.brand b, .pl-brand b { color: var(--cyan); font-weight: inherit; }
.brand > span:last-child, .pl-brand > span:last-child { position: relative; top: 0.134em; } /* Peyda's Latin letters ride high */
.logo {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue-800), var(--cyan));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--cyan) 30%, transparent);
}
.logo svg { width: 26px; height: 26px; }
.logo .ln { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.logo .fl { fill: #fff; }
.round {
  width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--text);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: background 0.2s, transform 0.2s var(--ease), border-color 0.2s, color 0.2s;
}
.round:hover, .round:focus-visible { background: var(--glass-hi); transform: scale(1.06); border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent); color: var(--accent-ink); }
.round.sm { width: 36px; height: 36px; }
.round.sm .ic { width: 18px; height: 18px; }
.uni-badge { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--logo-bg); border: 1px solid var(--glass-line); }
.uni-badge img { height: 34px; width: auto; }

/* ================================================================ top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 24px var(--pad) 8px; position: relative; z-index: 20; }
.topbar .divider { width: 1px; height: 32px; background: var(--glass-line); }
.topbar .spacer { flex: 1; }
.topbar.inner { padding-top: 22px; }
.page-title { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--heading); white-space: nowrap; }
.top-clock { color: var(--text-soft); font-weight: 600; font-size: 1.05rem; }
.search-pill {
  display: flex; align-items: center; gap: 4px; padding: 5px; padding-inline-end: 18px; border-radius: 999px; min-width: 260px;
  background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: border-color 0.2s, background 0.2s;
}
.search-pill:focus-within { border-color: color-mix(in srgb, var(--accent-ink) 50%, transparent); background: var(--glass-hi); }
.search-pill .round { background: color-mix(in srgb, var(--ink) 8%, transparent); border: 0; }
.search-pill input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 0.98rem; color: var(--text); }
.search-pill input::placeholder { color: var(--faint); }

/* theme menu */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 12px); inset-inline-end: 0; z-index: 40; width: 250px; padding: 14px;
  border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); background: var(--glass-hi);
  animation: pop 0.22s var(--ease);
}
.menu-label { font-size: 0.8rem; color: var(--text-soft); margin: 2px 4px 8px; }
.menu-label:not(:first-child) { margin-top: 14px; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text); font-size: 0.92rem; }
.swatch .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 25%, transparent); }
.swatch:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.swatch[aria-checked="true"] { border-color: var(--glass-line); background: color-mix(in srgb, var(--ink) 9%, transparent); font-weight: 700; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.segmented button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px; border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--text-soft); }
.segmented .ic { width: 18px; height: 18px; }
.segmented [aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }

@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ badges */
.badge-live {
  display: inline-flex; align-items: center; gap: 6px; background: var(--live); color: #fff;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 1px; padding: 1px 9px; border-radius: 6px; direction: ltr;
}
.badge-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.tag { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 1px 10px; border-radius: 6px; background: var(--accent-fill); color: #fff; }
.tag.soft { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--text); }
.tag.live { background: var(--live); }

/* ================================================================ home: live channel first, browse below
   First screen = the channel full screen with a set-top-box style OSD (after the beIN
   concept); scrolling reveals Netflix-style rows on a page tinted by the picture. */
@property --amb { syntax: '<color>'; inherits: true; initial-value: #3a2230; }
:root { transition: --amb 2.2s ease; --amb-deep: color-mix(in srgb, var(--amb) 32%, #07070b); --sp: 0; }
body.home { background: color-mix(in srgb, var(--amb) 20%, var(--bg)); }
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1400px 800px at 50% 0%, color-mix(in srgb, var(--amb) 38%, transparent), transparent 70%),
    linear-gradient(to bottom, color-mix(in srgb, var(--amb) 30%, var(--bg)), var(--bg) 85%);
}

/* header over the picture; solid once scrolled */
.home-nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 40; padding: 18px var(--pad); color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent);
  transition: background 0.45s var(--ease), padding 0.45s var(--ease), box-shadow 0.45s;
}
.home-nav .brand { color: #fff; }
.home-nav.solid {
  padding-top: 12px; padding-bottom: 12px;
  background: color-mix(in srgb, color-mix(in srgb, var(--amb) 22%, var(--bg)) 88%, transparent);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
:root:not([data-mode="dark"]) .home-nav.solid { color: var(--text); }
:root:not([data-mode="dark"]) .home-nav.solid .brand { color: var(--heading); }
.nav-links { display: flex; gap: 26px; margin-inline-start: 28px; }
.nav-links a { color: inherit; opacity: 0.72; font-weight: 500; font-size: 0.98rem; transition: opacity 0.2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { opacity: 1; }
.nav-links a.active { font-weight: 800; }
.home-nav .round { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.14); color: inherit; }
:root:not([data-mode="dark"]) .home-nav.solid .round { background: var(--glass); border-color: var(--glass-line); }
.home .rail { display: none; }
:root[data-mode="dark"] .home .rail {
  background: color-mix(in srgb, color-mix(in srgb, var(--bg) 85%, transparent) calc(var(--sp) * 100%), color-mix(in srgb, var(--amb-deep) 70%, transparent));
  border-top-color: color-mix(in srgb, var(--glass-line) calc(var(--sp) * 100%), transparent);
}

/* ---- the hero */
.hero { position: relative; height: 100svh; min-height: 580px; overflow: hidden; background: #000; color: #fff; isolation: isolate; }
/* The media layer is its own stacking context: browser extensions (e.g. Video Speed Controller)
   inject huge-z-index overlays next to <video>; isolated here, they can never cover the OSD. */
.hero-media { position: absolute; inset: 0; z-index: 0; isolation: isolate; overflow: hidden; }
.hero-media > .hero-art, .hero-media > .hero-glow, .hero-media > video { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media video { object-fit: cover; z-index: 1; transition: opacity 0.9s var(--ease); background: transparent; }
/* set by app.js when the picture's shape differs a lot from the screen (portrait phones, 4:3, vertical clips) */
.hero.fit-contain .hero-media video { object-fit: contain; }
/* Ambient light: a tiny live copy of the picture, blurred into the empty bands. */
.hero-media .hero-glow {
  inset: -12%; width: 124%; height: 124%; z-index: 0; opacity: 0;
  filter: blur(46px) saturate(1.5) brightness(0.85);
  transition: opacity 1.4s ease; animation: glowDrift 18s ease-in-out infinite alternate;
}
.hero.playing .hero-glow { opacity: 1; }
.hero.show-mode .hero-glow { opacity: 0; }
@keyframes glowDrift {
  0% { transform: scale(1.04) translate(0, 0); }
  50% { transform: scale(1.14) translate(-2%, 1.5%); }
  100% { transform: scale(1.08) translate(2%, -1%); }
}
.hero-art { background: center / cover no-repeat; transform: scale(1.04); transition: transform 8s linear, opacity 0.8s; }
.hero.show-mode video { opacity: 0; }
.hero.show-mode .hero-art { transform: scale(1.12); }
.hero-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8, 8, 12, 0.7), transparent 24%),
    linear-gradient(to top, var(--amb-deep) 0%, color-mix(in srgb, var(--amb-deep) 80%, transparent) 26%, color-mix(in srgb, var(--amb-deep) 12%, transparent) 58%, transparent 70%);
  transition: background 0.8s;
}
.hero.show-mode .hero-shade {
  background:
    linear-gradient(to bottom, rgba(8, 8, 12, 0.6), transparent 24%),
    linear-gradient(to left, rgba(10, 10, 16, 0.92), rgba(10, 10, 16, 0.55) 45%, transparent 75%),
    linear-gradient(to top, color-mix(in srgb, var(--amb) 20%, var(--bg)) 0%, transparent 35%);
}

/* top corners: weather and date/time */
.osd-top, .osd, .show { position: absolute; z-index: 3; inset-inline: var(--pad); }
.osd-top { top: 104px; display: flex; justify-content: space-between; align-items: flex-start; }
.wx { display: flex; align-items: center; gap: 18px; }
.wx-temp { display: flex; align-items: flex-start; font-size: 3.1rem; line-height: 1; font-weight: 700; direction: ltr; }
.wx-temp sup { font-size: 1.15rem; font-weight: 500; margin-top: 4px; margin-inline-start: 4px; opacity: 0.85; }
.wx-sep, .dt-sep { width: 1px; height: 34px; background: rgba(255, 255, 255, 0.3); }
.wx-icon { width: 54px; height: 54px; overflow: visible; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3)); }
.wx-text { display: flex; flex-direction: column; line-height: 1.5; }
.wx-text small { font-size: 0.8rem; opacity: 0.75; }
.wx-text b { font-size: 1.12rem; }
.dt { text-align: end; line-height: 1.6; }
.dt > b { font-size: 1.3rem; display: block; }
.dt > div { display: flex; gap: 12px; align-items: center; justify-content: flex-end; font-size: 1rem; opacity: 0.9; }
.dt-sep { height: 14px; }
#dtTime { display: inline-block; min-width: 5.4em; text-align: end; }

/* bottom: channel information, statistics and EPG */
.osd {
  bottom: 44px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas: "ch epg" "st epg"; column-gap: 6vw; row-gap: 26px; align-items: end;
}
.osd-ch { grid-area: ch; display: flex; align-items: center; gap: 28px; }
.ch-tile {
  width: 170px; height: 170px; flex: none; border-radius: 22px; background: #fff; color: #1a1a24;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.ch-tile .logo { width: 70px; height: 70px; border-radius: 18px; }
.ch-tile .logo svg { width: 46px; height: 46px; }
.ch-tile b { font-size: 1.15rem; font-weight: 800; direction: ltr; }
.ch-tile b i { font-style: normal; color: var(--blue-800); }
.ch-meta { min-width: 0; }
.ch-num { font-size: 4rem; font-weight: 800; line-height: 1; letter-spacing: 1px; }
.ch-name { font-size: 2.1rem; font-weight: 800; line-height: 1.5; direction: ltr; text-align: end; white-space: nowrap; }
.ch-name span { font-size: 1rem; font-weight: 500; opacity: 0.7; margin-inline-start: 10px; }
.ch-tech { display: flex; gap: 22px; flex-wrap: wrap; font-size: 1.02rem; line-height: 1.9; }
.ch-tech.dim { opacity: 0.6; }
.osd-stats { grid-area: st; display: flex; align-items: center; gap: 34px; font-size: 0.95rem; }
.meter { display: inline-flex; align-items: center; gap: 10px; }
.meter em { font-style: normal; opacity: 0.85; }
.meter i { width: 132px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); overflow: hidden; direction: ltr; }
.meter b { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.9s var(--ease); }
.meter.s b { background: #3b82f6; }
.meter.q b { background: #22c55e; }

.osd-epg { grid-area: epg; display: flex; flex-direction: column; gap: 14px; }
.epg-head { display: flex; align-items: center; gap: 8px; }
.epg-head .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 6px; font-size: 1.05rem; font-weight: 600; background: rgba(255, 255, 255, 0.18); }
.chip.live { background: var(--live); }
.osd-ic { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: #fff; cursor: pointer; border-radius: 50%; transition: background 0.2s, transform 0.2s; }
.osd-ic:hover, .osd-ic:focus-visible { background: rgba(255, 255, 255, 0.14); transform: scale(1.08); }
.osd-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.osd-ic .fl { fill: currentColor; stroke: none; }
.hero .osd-ic .off, .hero.muted .osd-ic .on { display: none; }
.hero.muted .osd-ic .off { display: inline; }
.epg-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0; font-size: 1.15rem; }
.epg-row .lbl { margin-inline-start: 14px; padding: 1px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.4); }
.epg-row .lbl.on { background: #fff; color: #111; border-color: #fff; }
.epg-row .t { padding: 2px 14px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); white-space: nowrap; }
.epg-row .n { padding-inline-start: 26px; margin-inline-start: 26px; border-inline-start: 1px solid rgba(255, 255, 255, 0.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-row.next { opacity: 0.82; }
.epg-bar { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.22); overflow: hidden; margin-top: 4px; }
.epg-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--live); transition: width 1s linear; }
.keys { display: flex; justify-content: space-between; gap: 14px; margin-top: 8px; }
.key { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 1.08rem; border: 0; background: none; padding: 4px 2px; cursor: pointer; opacity: 0.92; transition: opacity 0.2s, transform 0.2s; }
.key:hover, .key:focus-visible { opacity: 1; transform: translateY(-2px); color: #fff; }
.key i { width: 13px; height: 13px; border-radius: 2px; }
.key.red i { background: #ef4444; } .key.green i { background: #22c55e; }
.key.yellow i { background: #facc15; } .key.blue i { background: #38bdf8; }
.osd-msg { position: absolute; bottom: 100%; inset-inline-end: 0; margin-bottom: 20px; padding: 12px 18px; border-radius: 12px; background: rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; }

/* OSD entrance, idle fade and show-mode exit */
.osd-top, .osd { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.home .osd-top { animation: osdIn 1s var(--ease) 0.2s both; }
.home .osd-ch { animation: osdIn 0.9s var(--ease) 0.35s both; }
.home .osd-stats { animation: osdIn 0.9s var(--ease) 0.5s both; }
.home .osd-epg { animation: osdIn 0.9s var(--ease) 0.45s both; }
@keyframes osdIn { from { opacity: 0; transform: translateY(30px); } }
.hero.idle .osd, .hero.idle .osd-top { opacity: 0; transform: translateY(18px); }
.hero.idle .hero-shade { opacity: 0.45; }
.hero.show-mode .osd, .hero.show-mode .osd-top { opacity: 0; transform: translateY(30px); pointer-events: none; }

/* show card */
.show { inset-inline-end: auto; bottom: 18vh; max-width: min(640px, 80vw); }
.show > * { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.show.in > * { opacity: 1; transform: none; }
.show.in > :nth-child(1) { transition-delay: 0.25s; } .show.in > :nth-child(2) { transition-delay: 0.32s; }
.show.in > :nth-child(3) { transition-delay: 0.39s; } .show.in > :nth-child(4) { transition-delay: 0.46s; }
.show.in > :nth-child(5) { transition-delay: 0.53s; }
.show-kicker { display: inline-block; font-weight: 700; color: var(--cyan); letter-spacing: 0.3px; }
.show-title { margin: 6px 0 12px; font-size: clamp(2.2rem, 4.6vw, 4rem); font-weight: 800; line-height: 1.25; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45); }
.show-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-weight: 600; opacity: 0.9; }
.show-meta .chip { height: 26px; font-size: 0.85rem; padding: 0 10px; background: none; border: 1px solid rgba(255, 255, 255, 0.5); }
.show-desc { margin: 16px 0 26px; line-height: 2; opacity: 0.82; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.show-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn.big { padding: 13px 30px; font-size: 1.05rem; border-radius: 10px; }
.show .btn:not(.primary) { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.18); }
.show .btn:not(.primary):hover { background: rgba(255, 255, 255, 0.24); }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.3); animation: pulse 1.4s infinite; }

.scroll-cue { position: absolute; z-index: 3; bottom: 6px; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; color: #fff; opacity: 0.55; font-size: 0.78rem; transition: opacity 0.3s; }
.scroll-cue:hover { opacity: 1; color: #fff; }
.scroll-cue svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.hero:not(.show-mode) .scroll-cue { display: none; }

/* the picked card flying into the hero */
.fly { position: fixed; z-index: 35; border-radius: 10px; background: center / cover no-repeat; pointer-events: none; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.fly.go { transition: left 0.75s var(--ease), top 0.75s var(--ease), width 0.75s var(--ease), height 0.75s var(--ease), border-radius 0.75s var(--ease); }
.fly.out { opacity: 0; transition: opacity 0.5s ease; }

/* ---- browse rows */
.browse {
  position: relative; z-index: 1; padding: 6px 0 40px; margin-top: -2px;
  /* starts in the picture's deep tint and settles into the theme as you scroll */
  background: linear-gradient(to bottom, var(--amb-deep) 0, color-mix(in srgb, var(--amb) 20%, var(--bg)) 90vh);
}
.row-sec { margin: 26px 0 8px; }
.row-head { display: flex; align-items: baseline; gap: 16px; padding: 0 var(--pad); }
.row-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--heading); }
:root[data-mode="dark"] .browse h2 {
  color: #fff; -webkit-text-stroke: 0.35px rgba(255, 255, 255, 0.9); paint-order: stroke fill;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.55), 0 2px 14px rgba(0, 0, 0, 0.55);
}
.row-head a { font-size: 0.86rem; font-weight: 600; opacity: 0; transform: translateX(10px); transition: opacity 0.3s, transform 0.3s; }
.row-sec:hover .row-head a, .row-head a:focus-visible { opacity: 1; transform: none; }
.row-wrap { position: relative; }
.row-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; scroll-padding-inline: var(--pad);
  /* generous padding so the hover shadow fades out completely instead of being clipped */
  padding: 40px var(--pad) 70px; margin: -18px 0 -40px;
}
.row-track::-webkit-scrollbar { display: none; }
.card {
  --i: 0;
  position: relative; flex: none; width: clamp(220px, 20vw, 300px); aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: 10px; overflow: hidden;
  background: #111; color: #fff; text-align: start; cursor: pointer; scroll-snap-align: start;
  --card-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: transform 0.75s var(--card-ease), box-shadow 0.75s var(--card-ease);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.card-img { position: absolute; inset: 0; background: center / cover no-repeat; transition: transform 1.4s var(--card-ease), filter 0.6s; }
.card-body {
  position: absolute; inset: auto 0 0; padding: 26px 12px 9px; display: flex; flex-direction: column; line-height: 1.5;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}
.card-body b { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body small { font-size: 0.76rem; opacity: 0.78; }
.card-new { position: absolute; top: 8px; inset-inline-start: 8px; font-size: 0.72rem; font-weight: 800; padding: 1px 8px; border-radius: 4px; background: var(--live); }
/* hovered card grows; its neighbours make room (RTL: following cards sit to the left) */
.card:hover, .card:focus-visible {
  transform: scale(1.12); z-index: 4; outline: none; transition-delay: 0.08s;
  /* negative spread keeps the shadow within the track's padding: it fades instead of being cut */
  box-shadow: 0 34px 48px -20px rgba(0, 0, 0, 0.6), 0 14px 26px -12px rgba(0, 0, 0, 0.4);
}
.card:hover .card-img, .card:focus-visible .card-img { transform: scale(1.06); }
.card:focus-visible { box-shadow: 0 0 0 3px #fff, 0 34px 48px -20px rgba(0, 0, 0, 0.6); }
.row-track .card:hover ~ .card, .row-track .card:focus-visible ~ .card { transform: translateX(-9%); transition-delay: 0.08s; }
.row-track .card:has(~ .card:hover), .row-track .card:has(~ .card:focus-visible) { transform: translateX(9%); transition-delay: 0.08s; }
.row-track .card:first-child { transform-origin: right center; }
.row-track .card:last-child { transform-origin: left center; }
.row-nav {
  position: absolute; top: 22px; bottom: 30px; z-index: 6; width: calc(var(--pad) - 6px); min-width: 40px; border: 0; cursor: pointer; color: #fff;
  display: grid; place-items: center; opacity: 0; transition: opacity 0.3s;
}
.row-nav.prev { inset-inline-start: 0; background: linear-gradient(to left, rgba(0, 0, 0, 0.65), transparent); }
.row-nav.next { inset-inline-end: 0; background: linear-gradient(to right, rgba(0, 0, 0, 0.65), transparent); }
.row-nav.next .ic { transform: rotate(180deg); }
.row-nav .ic { width: 30px; height: 30px; stroke-width: 2.4; }
.row-wrap:hover .row-nav { opacity: 1; }
.row-wrap.at-start .row-nav.prev, .row-wrap.at-end .row-nav.next { opacity: 0 !important; pointer-events: none; }
.reveal.in .card { animation: rise 0.7s var(--ease) backwards; animation-delay: calc(var(--i) * 60ms); }

.reveal { opacity: 0; transform: translateY(46px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; padding: 26px var(--pad); margin-top: 18px; }
.overview h2, .overview h3 { margin: 0 0 12px; font-size: 1.35rem; font-weight: 800; color: var(--heading); }
.overview h3 { font-size: 1.1rem; }
.overview p { margin: 0; line-height: 2.05; color: var(--text-soft); max-width: 760px; }
.overview > div:last-child { display: flex; flex-direction: column; gap: 6px; }
.overview > div:last-child a { color: var(--text-soft); width: fit-content; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent); text-underline-offset: 5px; }
.overview > div:last-child a:hover { color: var(--accent-ink); }
.ov-stats { display: flex; gap: 30px; margin-top: 18px; color: var(--text-soft); }
.ov-stats b { font-size: 1.7rem; font-weight: 800; color: var(--heading); margin-inline-end: 6px; }

.cast { display: flex; gap: 34px; overflow-x: auto; scrollbar-width: none; padding: 20px var(--pad) 12px; }
.cast::-webkit-scrollbar { display: none; }
.cast-item { flex: none; display: flex; align-items: center; gap: 14px; }
.cast-av { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--glass); border: 1px solid var(--glass-line); color: var(--accent-ink); }
.cast-av svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cast-item.lead .cast-av { background: linear-gradient(135deg, var(--blue-800), var(--cyan)); color: #fff; border: 0; }
.cast-item b { display: block; font-weight: 700; color: var(--heading); }
.cast-item small { color: var(--text-soft); font-size: 0.82rem; }
.home .site-footer { background: color-mix(in srgb, var(--amb) 10%, var(--bg)); }

@media (max-width: 1200px) {
  .ch-tile { width: 130px; height: 130px; }
  .ch-tile .logo { width: 54px; height: 54px; }
  .ch-num { font-size: 3rem; }
  .ch-name { font-size: 1.6rem; }
  .ch-tech { font-size: 0.9rem; gap: 14px; }
  .nav-links { gap: 18px; margin-inline-start: 14px; }
  .osd { column-gap: 4vw; }
}
@media (max-width: 980px) {
  .nav-links { display: none; }
  .home { padding-bottom: 70px; }
  .home .rail { display: flex; }
  .osd-top { top: 78px; }
  .wx-temp { font-size: 2.2rem; }
  .wx-icon { width: 40px; height: 40px; }
  .wx-text small { display: none; }
  .osd { grid-template-columns: 1fr; grid-template-areas: "ch" "epg"; bottom: calc(86px + env(safe-area-inset-bottom)); row-gap: 18px; } /* clear the bottom tab bar */
  .osd-stats, .ch-tech { display: none; }
  .hero-media video { object-position: 50% 30%; }
  .ch-tile { width: 76px; height: 76px; border-radius: 16px; gap: 0; }
  .ch-tile b { display: none; }
  .ch-tile .logo { width: 48px; height: 48px; }
  .ch-num { font-size: 1.8rem; }
  .ch-name { font-size: 1.3rem; }
  .ch-name span { display: none; }
  .osd-ch { gap: 16px; }
  .epg-row { font-size: 1rem; }
  .epg-row .n { padding-inline-start: 14px; margin-inline-start: 14px; }
  .keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
  .key { font-size: 0.98rem; }
  .show { bottom: 12vh; }
  .card { width: 64vw; }
  .row-nav { display: none; }
  .row-track .card:hover ~ .card, .row-track .card:has(~ .card:hover) { transform: none; }
  .card:hover { transform: none; }
  .overview { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .wx-sep, .wx-text { display: none; }
  .dt > b { font-size: 1.05rem; }
  .dt > div { font-size: 0.85rem; }
  .ch-num { display: none; }
  .epg-row .t { font-size: 0.9rem; padding: 1px 8px; }
  .chip { height: 28px; font-size: 0.9rem; padding: 0 12px; }
  .ov-stats { flex-wrap: wrap; gap: 16px; }
}

/* ================================================================ inner pages: rail + content */
.app { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 0; border-inline-end: 1px solid var(--glass-line);
  background: color-mix(in srgb, var(--bg) 40%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.rail-brand { margin-bottom: 22px; }
.rail-item {
  position: relative; width: 64px; padding: 10px 0 8px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--faint); font-size: 0.72rem; font-weight: 600; transition: color 0.2s, background 0.2s;
}
.rail-item .ic { width: 24px; height: 24px; }
.rail-item:hover, .rail-item:focus-visible { color: var(--text); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.rail-item.active { color: var(--heading); background: var(--glass-hi); }
.rail-item.active .ic { color: var(--accent-ink); }
.rail-item.active::before { content: ''; position: absolute; inset-inline-start: -16px; top: 22%; bottom: 22%; width: 4px; border-radius: 4px; background: var(--accent-ink); }
.content { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 18px var(--pad) 40px; animation: fade 0.5s; }

/* ================================================================ archive browser */
.browser {
  display: grid; grid-template-columns: 210px minmax(320px, 430px) minmax(0, 1fr); gap: 28px;
  height: calc(100vh - 96px); padding: 12px var(--pad) 0;
}
.col { min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 30px 4px 60px;
  mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 88%, transparent); }
.col::-webkit-scrollbar { display: none; }
.cats { display: flex; flex-direction: column; gap: 4px; }
.cat {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 0; background: none; cursor: pointer;
  color: var(--faint); text-align: start; transition: color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
.cat .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--ink) 8%, transparent); font-weight: 800; font-size: 1rem; color: var(--text-soft); transition: all 0.25s; }
.cat .t { display: flex; flex-direction: column; line-height: 1.5; font-weight: 600; }
.cat small { font-size: 0.75rem; opacity: 0; max-height: 0; transition: all 0.25s; }
.cat:hover, .cat:focus-visible { color: var(--text); outline: none; }
.cat.active { color: var(--heading); transform: scale(1.04); }
.cat.active .t { font-weight: 800; font-size: 1.05rem; }
.cat.active small { opacity: 1; max-height: 20px; color: var(--text-soft); }
.cat.active .ico { width: 48px; height: 48px; background: var(--accent-fill); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-ink) 25%, transparent); }

.vlist { display: flex; flex-direction: column; gap: 14px; }
.vitem {
  --i: 0;
  position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 10px; border-radius: var(--r);
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--text); text-align: start; cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
  animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--i) * 45ms);
}
.vitem::before {
  content: ''; position: absolute; inset-inline-start: -14px; top: 18%; bottom: 18%; width: 4px; border-radius: 4px;
  background: var(--heading); opacity: 0; transition: opacity 0.25s;
}
.vitem:hover, .vitem:focus-visible, .vitem.sel {
  transform: scale(1.04); background: var(--glass-hi); outline: none; border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.vitem.sel::before, .vitem:focus-visible::before { opacity: 1; }
.vitem .th { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.vitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vitem .dur { position: absolute; bottom: 5px; inset-inline-start: 5px; font-size: 0.72rem; padding: 0 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.72); color: #fff; }
.vitem .meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vitem .h { margin: 0; font-size: 1rem; font-weight: 700; color: var(--heading); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vitem .sub { font-size: 0.8rem; color: var(--text-soft); }
.vitem .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 50px 20px; text-align: center; color: var(--text-soft); border: 1px dashed var(--glass-line); border-radius: var(--r-lg); }

.preview { position: relative; min-height: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; display: flex; align-items: flex-end; }
.preview .pv-art {
  position: absolute; inset: 0; background: center / cover no-repeat; transition: opacity 0.6s var(--ease);
  mask-image: linear-gradient(to left, #000 50%, transparent), linear-gradient(to top, transparent, #000 35%);
  -webkit-mask-image: linear-gradient(to left, #000 50%, transparent);
  mask-composite: intersect;
}
.preview .pv-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), color-mix(in srgb, var(--bg) 30%, transparent) 55%, transparent); }
.preview .pv-body { position: relative; padding: 0 12px 48px; max-width: 640px; animation: rise 0.5s var(--ease); }
.pv-kicker .sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.pv-kicker { font-size: 0.85rem; color: var(--text-soft); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.preview h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.35; font-weight: 800; color: var(--heading); }
.preview p { margin: 0 0 22px; color: var(--text-soft); line-height: 1.95; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--text); padding: 10px 22px; border-radius: 999px; font-weight: 700;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover, .btn:focus-visible { transform: scale(1.04); background: var(--glass-hi); border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent); color: var(--accent-ink); }
.btn.primary { background: var(--accent-fill); border-color: transparent; color: #fff; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent-fill) 45%, transparent); }
.btn.primary:hover, .btn.primary:focus-visible { color: #fff; background: color-mix(in srgb, var(--accent-fill) 82%, white); }
.btn .ic { width: 20px; height: 20px; }
.btn.sm { padding: 5px 14px; font-size: 0.86rem; }
.btn.danger { color: var(--danger-text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ================================================================ full-screen player */
.pl { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; opacity: 0; transition: opacity 0.35s var(--ease); --live: #e5484d; }
.pl.open { opacity: 1; }
.pl-media { position: absolute; inset: 0; z-index: 0; isolation: isolate; overflow: hidden; } /* see .hero-media */
.pl video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.pl-glow { position: absolute; inset: -12%; width: 124%; height: 124%; filter: blur(50px) saturate(1.4) brightness(0.8); animation: glowDrift 18s ease-in-out infinite alternate; }
.pl-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.55)); transition: opacity 0.4s; }
.pl-top, .pl-bottom { position: absolute; inset-inline: 0; padding: 26px var(--pad); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.pl-top { top: 0; display: flex; align-items: center; justify-content: space-between; }
.pl-brand { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 800; direction: ltr; }
.pl-top-end { display: flex; align-items: center; gap: 16px; font-size: 1.1rem; font-weight: 600; }
.pl-bottom { bottom: 0; display: flex; flex-direction: column; gap: 14px; }
.pl-info { max-width: 70%; }
.pl-badge { display: inline-block; font-size: 0.78rem; font-weight: 800; padding: 1px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.18); }
.pl-badge.live { background: var(--live); }
.pl-title { margin: 8px 0 0; font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 800; line-height: 1.4; }
.pl-sub { margin: 0; font-size: 0.95rem; color: rgba(255, 255, 255, 0.7); }
.pl-seek { --p: 0%; width: 100%; height: 4px; -webkit-appearance: none; appearance: none; border-radius: 99px; cursor: pointer; direction: ltr; transform: scaleX(-1);
  background: linear-gradient(to right, var(--cyan) var(--p), rgba(255, 255, 255, 0.25) var(--p)); }
.pl-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); }
.pl-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.pl.is-live .pl-seek, .pl.is-live [data-act="rew"], .pl.is-live [data-act="fwd"] { visibility: hidden; }
.pl-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.pl-time { font-size: 1.05rem; font-weight: 600; }
.pl-transport { display: flex; align-items: center; gap: 18px; }
.pl-tools { display: flex; gap: 12px; justify-content: flex-end; }
.pl .round { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.14); color: #fff; }
.pl .round:hover, .pl .round:focus-visible { background: rgba(255, 255, 255, 0.24); color: #fff; }
.pl .round.big { width: 64px; height: 64px; }
.pl .round.big .ic { width: 28px; height: 28px; }
.pl .i-play, .pl.paused .i-pause, .pl .i-mute, .pl.muted .i-vol, .pl .i-shrink, .pl.fs .i-expand { display: none; }
.pl.paused .i-play, .pl.muted .i-mute, .pl.fs .i-shrink { display: block; }
.pl-quality { position: relative; overflow: hidden; }
.pl-quality select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pl-quality select option { color: #000; }
.pl.idle { cursor: none; }
.pl.idle .pl-top { opacity: 0; transform: translateY(-14px); }
.pl.idle .pl-bottom { opacity: 0; transform: translateY(14px); }
.pl.idle .pl-shade { opacity: 0; }
.pl-spinner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.pl-spinner { grid-auto-flow: column; gap: 10px; place-content: center; }
.pl-spinner span { width: 11px; height: 11px; border-radius: 50%; background: var(--cyan); animation: pulse 0.9s infinite; }
.pl-spinner span:nth-child(2) { animation-delay: 0.15s; }
.pl-spinner span:nth-child(3) { animation-delay: 0.3s; }
.pl-msg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 14px 22px; border-radius: 14px; background: rgba(0, 0, 0, 0.6); }

/* ================================================================ schedule */
.day-tabs { display: flex; gap: 10px; margin: 6px 0 22px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: none; min-width: 108px; display: flex; flex-direction: column; align-items: center; padding: 10px 16px; border-radius: 16px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--text-soft); transition: all 0.25s var(--ease);
}
.day-tab strong { color: var(--text); font-weight: 700; }
.day-tab span { font-size: 0.78rem; }
.day-tab:hover, .day-tab:focus-visible { transform: translateY(-3px); background: var(--glass-hi); }
.day-tab[aria-selected="true"] { background: var(--accent-fill); border-color: transparent; color: rgba(255, 255, 255, 0.8); }
.day-tab[aria-selected="true"] strong { color: #fff; }
.guide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.g-row { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: stretch; animation: rise 0.5s var(--ease) both; }
.g-time { display: flex; flex-direction: column; justify-content: center; }
.g-time strong { font-size: 1.25rem; font-weight: 800; color: var(--heading); }
.g-time span { font-size: 0.78rem; color: var(--text-soft); }
.g-card {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 18px; align-items: center; padding: 10px; border-radius: var(--r);
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--text); transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s;
}
.g-card:hover, .g-card:focus-visible { transform: scale(1.02); background: var(--glass-hi); border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); outline: none; color: var(--text); }
.g-card img { width: 180px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; display: block; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.g-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.g-info strong { font-size: 1.08rem; font-weight: 700; color: var(--heading); }
.g-info span:not(.g-tag) { font-size: 0.85rem; color: var(--text-soft); }
.g-tag { width: fit-content; font-size: 0.74rem; font-weight: 700; padding: 1px 10px; border-radius: 6px; background: var(--accent-fill); color: #fff; }
.g-tag.live { background: var(--live); }
.g-filler { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--r); border: 1px dashed var(--glass-line); color: var(--text-soft); }
.g-row.live .g-card, .g-row.live .g-filler { border: 1px solid var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 20%, transparent); }
.g-row.live .g-time strong { color: var(--accent-ink); }
.g-row.past { opacity: 0.5; }
.g-note { padding: 14px 18px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-line); color: var(--text-soft); line-height: 1.9; }

/* ================================================================ about */
.about { max-width: 1200px; }
.about-hero { position: relative; padding: clamp(28px, 4vw, 56px); border-radius: var(--r-lg); overflow: hidden; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.about-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(700px 320px at 100% 0%, color-mix(in srgb, var(--cyan) 22%, transparent), transparent 70%); pointer-events: none; }
.about-hero > * { position: relative; }
.eyebrow { display: inline-block; font-size: 0.82rem; font-weight: 700; padding: 2px 12px; border-radius: 6px; background: var(--accent-fill); color: #fff; }
.about-hero h1 { margin: 14px 0 10px; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.35; font-weight: 800; color: var(--heading); }
.about-hero .lead { margin: 0; max-width: 780px; font-size: 1.05rem; line-height: 2; color: var(--text-soft); }
.about-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 30px 0 0; max-width: 680px; }
.stats div { padding: 14px 18px; border-radius: var(--r); background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--glass-line); }
.stats dt { font-size: 0.8rem; color: var(--text-soft); }
.stats dd { margin: 2px 0 0; font-size: 1.6rem; font-weight: 800; color: var(--heading); }
.about-section { margin-top: 52px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.section-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--heading); display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ''; width: 4px; height: 22px; border-radius: 4px; background: var(--accent-ink); }
.sub-head { margin: 0 0 14px; font-size: 1rem; font-weight: 700; color: var(--text-soft); }
.feature-grid, .team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature, .team-card, .person, .check-list li, .join {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-lg);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.feature, .team-card { padding: 24px; transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s; }
.feature:hover, .team-card:hover { transform: translateY(-6px); background: var(--glass-hi); border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); }
.feature h3, .team-card h3 { margin: 16px 0 6px; font-size: 1.08rem; font-weight: 700; color: var(--heading); }
.feature p, .team-card p { margin: 0; color: var(--text-soft); font-size: 0.92rem; line-height: 1.9; }
.icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: var(--accent-ink); }
.icon svg, .avatar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.team-card { text-align: center; }
.team-card .icon { margin-inline: auto; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { position: relative; padding: 15px 54px 15px 18px; line-height: 1.9; }
.check-list li::before { content: ''; position: absolute; right: 18px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-ink); }
.check-list li::after { content: ''; position: absolute; right: 25px; top: 50%; width: 7px; height: 11px; border: solid var(--bg); border-width: 0 2.5px 2.5px 0; transform: translate(0, -62%) rotate(45deg); }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.person { display: flex; align-items: center; gap: 16px; padding: 20px 22px; }
.person.lead { border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent); }
.person > div { display: flex; flex-direction: column; gap: 2px; }
.person .role { width: fit-content; font-size: 0.76rem; font-weight: 700; padding: 0 10px; border-radius: 6px; background: color-mix(in srgb, var(--accent-ink) 16%, transparent); color: var(--accent-ink); }
.person strong { color: var(--heading); font-size: 1.15rem; font-weight: 800; }
.person span:not(.role):not(.avatar) { color: var(--text-soft); font-size: 0.9rem; }
.person .reg { white-space: nowrap; }
.avatar { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: var(--accent-ink); }
.person.lead .avatar { background: linear-gradient(135deg, var(--blue-800), var(--cyan)); color: #fff; }
.join { display: flex; gap: 28px; align-items: center; padding: 32px; }
.join-logo { height: 110px; width: auto; flex: none; padding: 10px 12px; background: var(--logo-bg); border-radius: var(--r); }
.join h2 { margin: 0 0 8px; color: var(--heading); font-size: 1.4rem; font-weight: 800; }
.join p { margin: 0; color: var(--text-soft); }
.perks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.perks li { padding: 3px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: var(--accent-ink); }
.muted-text { color: var(--text-soft); margin: 0 0 12px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li { direction: ltr; padding: 4px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; background: var(--glass); border: 1px solid var(--glass-line); }

/* ================================================================ footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--glass-line); color: var(--text-soft); font-size: 0.88rem; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding: 36px var(--pad) 24px; }
.f-brand .brand { font-size: 1.25rem; }
.f-brand .logo { width: 34px; height: 34px; }
.f-brand .logo svg { width: 23px; height: 23px; }
.f-brand p { margin: 12px 0 0; max-width: 340px; line-height: 1.9; }
.f-col { display: flex; flex-direction: column; gap: 6px; }
.f-col h4 { margin: 0 0 6px; color: var(--heading); font-size: 0.95rem; font-weight: 700; }
.f-col a { color: var(--text-soft); width: fit-content; }
.f-col a:hover { color: var(--accent-ink); }
.f-uni-row { display: flex; align-items: center; gap: 12px; line-height: 1.9; }
.f-uni-row img { height: 56px; width: auto; padding: 5px 7px; background: var(--logo-bg); border-radius: 10px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 14px var(--pad) 22px; border-top: 1px solid var(--glass-line); font-size: 0.8rem; }
.footer-bottom .motto { direction: ltr; letter-spacing: 0.5px; color: var(--accent-ink); }

/* ================================================================ admin compatibility (old header markup) */
.panel { background: var(--glass) !important; border-color: var(--glass-line) !important; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: var(--r-lg) !important; }

/* ================================================================ responsive */
@media (max-width: 1200px) {
  .browser { grid-template-columns: 170px minmax(270px, 1fr) minmax(260px, 1fr); gap: 20px; }
  .feature-grid, .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .search-pill { min-width: 0; flex: 1; }
  .topbar .divider { display: none; }
  /* rail becomes a bottom tab bar */
  .app { grid-template-columns: 1fr; padding-bottom: 76px; }
  .rail {
    position: fixed; top: auto; bottom: 0; inset-inline: 0; height: auto; z-index: 50; flex-direction: row; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--glass-line);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
  }
  .rail-brand { display: none; }
  .rail-item { width: auto; flex: 1; padding: 6px 0; }
  .rail-item.active::before { inset-inline: 30%; top: -6px; bottom: auto; width: auto; height: 3px; }
  .browser { display: flex; flex-direction: column; height: auto; gap: 8px; }
  .col { mask-image: none; -webkit-mask-image: none; overflow: visible; padding: 4px 0 0; }
  .cats { flex-direction: row; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .cat { flex: none; padding: 6px 14px 6px 6px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; }
  .cat .ico { width: 30px; height: 30px; font-size: 0.85rem; }
  .cat.active { transform: none; }
  .cat.active .ico { width: 30px; height: 30px; box-shadow: none; }
  .cat.active .t { font-size: 0.95rem; }
  .cat small { display: none; }
  .preview { display: none; }
  .vitem { grid-template-columns: 130px 1fr; }
  .vitem:hover, .vitem.sel { transform: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .f-brand { grid-column: 1 / -1; }
  .join { flex-direction: column; align-items: flex-start; }
  .people { grid-template-columns: 1fr; }
  .pl-info { max-width: 100%; }
  .pl-bar { grid-template-columns: auto 1fr; }
  .pl-transport { justify-content: center; grid-column: 1 / -1; grid-row: 1; }
  .pl-tools .round, .pl-top .round { width: 40px; height: 40px; }
}
@media (max-width: 560px) {
  .topbar { gap: 10px; padding-top: 16px; }
  .brand > span:last-child { display: none; }
  .uni-badge, .top-clock { display: none; }
  .page-title { font-size: 1.25rem; }
  .feature-grid, .team-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .g-row { grid-template-columns: 1fr; gap: 6px; }
  .g-time { flex-direction: row; align-items: baseline; gap: 8px; }
  .g-card { grid-template-columns: 110px 1fr; }
  .g-card img { width: 110px; }
  .g-card .badge-live { grid-column: 2; justify-self: start; }
  .pl-top, .pl-bottom { padding: 16px; }
  .pl .round.big { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

.toast { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 200; max-width: 80vw; padding: 10px 16px; border-radius: 10px; background: #b43c45; color: #fff; font-size: 0.85rem; direction: ltr; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
