/* Layout: a dark living room at night. A chunky toy-red TV glows on the left,
   a TV-guide column sits beside it, stacking under it on phones. */
:root {
  --room: #110d22;          /* night indigo walls */
  --room-2: #1c1638;        /* lifted surface */
  --line: #2f2858;
  --ink: #f6f2ff;
  --muted: #a49dc8;

  --tomato: #ff5a3c;        /* TV body */
  --tomato-dark: #c8331b;
  --sun: #ffc233;
  --sky: #3b8cff;
  --leaf: #2fcb75;
  --bezel: #17122a;
  --osd: #7dff9b;           /* phosphor green on-screen text */

  --glow: var(--tomato);    /* set per channel from JS */
  --p-bright: 1;            /* picture settings, set from JS */
  --p-contrast: 1.05;
  --p-colour: 1.15;
  --magenta: #ff5fb4;

  --font-display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-osd: "VT323", "Courier New", ui-monospace, monospace;

  --step--1: 0.85rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--room);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 8px; }

.room {
  min-height: 100vh;
  padding-inline: max(16px, 3vw);
  padding-block: 18px 28px;
  background:
    radial-gradient(1200px 700px at 30% 45%, color-mix(in srgb, var(--glow) 14%, transparent), transparent 70%),
    radial-gradient(900px 500px at 85% 0%, #2a1f5a55, transparent 70%),
    var(--room);
  transition: background 1.2s ease;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  width: 100%;
  margin-inline: auto;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-antu { width: 44px; height: 52px; transform: rotate(-8deg); transition: transform .3s; }
.logo:hover .logo-antu { transform: rotate(6deg) translateY(-2px); }
.logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-3);
  line-height: 1;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
}
.l1 { color: var(--sun); text-shadow: 3px 3px 0 var(--tomato-dark); }
.l2 {
  color: var(--ink);
  background: var(--tomato);
  border-radius: 12px;
  padding: 0 8px;
  margin-left: 4px;
  transform: rotate(-4deg) translateY(-2px);
  display: inline-block;
  box-shadow: 3px 3px 0 #000a;
}
.logo-tld { font-family: var(--font-body); font-weight: 800; font-size: var(--step--1); color: var(--sky); margin-left: 6px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em;
  padding: 6px 12px; border-radius: 999px;
  background: var(--room-2); border: 2px solid var(--line); color: var(--muted);
}
.live-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live-pill.is-on { color: var(--ink); border-color: var(--tomato); }
.live-pill.is-on .dot { background: var(--tomato); animation: blink 1.4s steps(2) infinite; }
.clock {
  font-family: var(--font-osd); font-size: 1.8rem; line-height: 1; color: var(--osd);
  text-shadow: 0 0 8px #7dff9b88; font-variant-numeric: tabular-nums;
}

/* ---------- Stage ---------- */
.stage {
  /* The TV is sized from the screen height so the TV and sidebar always fit on screen. */
  --tv-w: clamp(440px, calc((100dvh - 250px) * 1.36), 820px);
  display: grid;
  grid-template-columns: minmax(0, var(--tv-w)) minmax(300px, 400px);
  justify-content: center;
  column-gap: clamp(24px, 4vw, 56px);
  row-gap: 14px;
  align-items: start;
  padding-top: 76px; /* room for the antenna */
  max-width: 1240px;
  width: 100%;
  margin-inline: auto;
}
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .keys { order: 1; }
}

/* ---------- The TV ---------- */
.tv-wrap { position: relative; min-width: 0; }
.tv-glow {
  position: absolute; inset: 20% 6% 10%;
  background: var(--glow);
  filter: blur(80px);
  opacity: .0;
  transition: opacity 1s, background 1s;
  pointer-events: none;
}
.is-on .tv-glow { opacity: .35; }

.tv-top {
  position: absolute; top: -76px; left: 50%; transform: translateX(-50%);
  width: 190px; max-width: 70%;
  z-index: 2; pointer-events: none;
}
.antenna { display: block; width: 100%; height: auto; overflow: visible; }
.antenna line { stroke: #c9c3e6; stroke-width: 4; stroke-linecap: round; }
.antenna circle { fill: #c9c3e6; }
.antenna-base { fill: #3a3160; }
/* Crochet doily under the antenna: every early-2000s TV had one */
.doily {
  position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  width: 150px; height: 16px; z-index: -1; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 3px, #f3ecdc 3.5px) 0 0 / 12px 12px,
    #f3ecdc;
  -webkit-mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100%;
          mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100%;
  opacity: .9;
}

.tv {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, var(--tomato) 0%, var(--tomato-dark) 100%);
  border-radius: 38px;
  padding: clamp(12px, 2.4vw, 24px);
  padding-bottom: 0;
  box-shadow:
    inset 0 6px 0 #ffffff40,
    inset 0 -10px 0 #00000040,
    0 4px 0 #8c1f0e,
    0 40px 70px #000000b0;
}
.bezel {
  background: var(--bezel);
  border-radius: 28px;
  padding: clamp(8px, 1.6vw, 16px);
  box-shadow: inset 0 0 0 3px #00000080, inset 0 8px 24px #000;
}
.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  overflow: hidden;
  border-radius: 10% / 13%;
  background: #05040a;
  isolation: isolate;
}

.picture { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; }
.is-on .picture { opacity: 1; }
.picture iframe, #yt {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  transform: scale(1.04);  /* crops YouTube's edge chrome a little */
  filter: brightness(var(--p-bright)) contrast(var(--p-contrast)) saturate(var(--p-colour));
  transition: transform .4s ease;
}

/* overlays */
.scanlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: repeating-linear-gradient(180deg, #00000038 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.glass {
  position: absolute; inset: 0; pointer-events: none; z-index: 7;
  border-radius: inherit;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 60%, #000000b5 100%),
    linear-gradient(135deg, #ffffff1c 0%, transparent 28%);
  box-shadow: inset 0 0 40px #000c, inset 0 0 4px #000;
}
.is-on .glass { animation: flicker 6s infinite; }
.shield { position: absolute; inset: 0; z-index: 8; } /* stops clicks reaching the player: no scrubbing */

.static {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5;
  image-rendering: pixelated; opacity: 0; pointer-events: none;
}
.static.is-active { opacity: 1; }

/* ---------- Program cards ---------- */
.card {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; justify-items: center; text-align: center;
  gap: 4px; padding: 8%;
  color: var(--ink);
  overflow: hidden;
}
.card-bg {
  position: absolute; inset: -50%; z-index: -1;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--glow) 55%, #2a2150) 0 14%, transparent 14.5%),
    repeating-conic-gradient(from 0deg at 50% 50%, #2a2150 0 15deg, #221a45 15deg 30deg);
}
.card[data-kind="ident"] .card-bg { animation: spin 18s linear infinite; }
.card-antu { width: clamp(70px, 18%, 130px); aspect-ratio: 120 / 140; height: auto; animation: bob 1.6s ease-in-out infinite; }
.card-kicker {
  margin: 8px 0 0; font-weight: 800; font-size: clamp(.65rem, 1.6vw, .85rem);
  letter-spacing: .14em; text-transform: uppercase; color: var(--sun);
}
.card-title {
  margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.05;
  font-size: clamp(1.2rem, 4.4vw, 2.6rem); text-wrap: balance;
  text-shadow: 3px 3px 0 #000a;
}
.card-sub { margin: 4px 0 0; color: #d6d0f2; font-size: clamp(.7rem, 1.7vw, .95rem); max-width: 40ch; }

/* ---------- On-screen display ---------- */
.osd {
  position: absolute; top: 7%; right: 8%; z-index: 9;
  font-family: var(--font-osd); color: var(--osd);
  font-size: clamp(1.6rem, 5.5vw, 3.6rem); line-height: 1; text-align: right;
  text-shadow: 0 0 6px #7dff9baa, 2px 2px 0 #000;
  opacity: 0; transition: opacity .2s; pointer-events: none;
  white-space: pre;
}
.osd.is-shown { opacity: 1; }
.osd small { display: block; font-size: .5em; }

.bug {
  position: absolute; top: 7%; left: 8%; z-index: 4;
  display: none; align-items: center; gap: 4px;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(.6rem, 1.5vw, .85rem);
  color: #fff; opacity: .75; letter-spacing: .06em;
}
.bug svg { width: clamp(16px, 3vw, 26px); aspect-ratio: 120/140; height: auto; }
.is-on .bug { display: flex; }

.banner {
  position: absolute; left: 6%; right: 6%; bottom: 7%; z-index: 9;
  display: flex; gap: 12px; align-items: stretch;
  background: linear-gradient(180deg, #1c1638f0, #110d22f0);
  border: 2px solid color-mix(in srgb, var(--glow) 70%, #fff);
  border-radius: 16px; padding: 10px 14px;
  transform: translateY(140%); transition: transform .35s cubic-bezier(.3,1.4,.5,1);
  font-size: clamp(.65rem, 1.6vw, .9rem);
}
.banner.is-shown { transform: none; }
.banner-ch {
  display: grid; place-items: center;
  min-width: 3.2em; padding-inline: 6px; border-radius: 10px;
  background: var(--glow); color: #120d22;
  font-family: var(--font-osd); font-size: 2.6em; line-height: 1;
}
.banner-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.banner-body p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-name { font-family: var(--font-display); font-weight: 800; font-size: 1.25em; line-height: 1.1; }
.banner b { color: var(--sun); text-transform: uppercase; font-size: .8em; letter-spacing: .1em; margin-right: 4px; }
.banner-next { color: var(--muted); }
.banner-bar { height: 5px; border-radius: 3px; background: #ffffff22; overflow: hidden; }
.banner-bar span { display: block; height: 100%; background: var(--glow); width: 0; }

/* ---------- Power-off screen ---------- */
.off {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 8%;
  background: radial-gradient(circle at 50% 45%, #1d1838 0%, #07060d 70%);
}
.is-on .off { display: none; }
.tune-in {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 3.4vw, 1.9rem);
  padding: .35em 1.1em .3em .7em; border: 0; border-radius: 999px;
  background: var(--sun); color: #1a1430;
  box-shadow: 0 6px 0 #b98200, 0 0 0 6px #ffc23326, 0 0 60px #ffc23355;
  transition: transform .12s, box-shadow .12s;
}
.tune-in:hover { transform: translateY(-2px); }
.tune-in:active { transform: translateY(4px); box-shadow: 0 2px 0 #b98200, 0 0 0 6px #ffc23326; }
.tune-in-icon {
  width: 1.1em; height: 1.1em; border-radius: 50%;
  border: .16em solid currentColor; border-top-color: transparent; position: relative;
}
.tune-in-icon::after {
  content: ""; position: absolute; left: 50%; top: -.28em; width: .16em; height: .55em;
  background: currentColor; transform: translateX(-50%); border-radius: 2px;
}
.off-hint { margin: 0; color: var(--muted); font-size: clamp(.75rem, 1.8vw, 1rem); }

/* CRT power on / off */
.screen.powering-on .picture,
.screen.powering-on .card { animation: crt-on .55s ease-out both; }
.screen.powering-off::after {
  content: ""; position: absolute; inset: 0; z-index: 11; background: #fff;
  animation: crt-off .45s ease-in forwards;
}

/* ---------- Control panel ---------- */
.panel {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 14px 6px 16px;
}
.brandplate {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1;
  color: #ffe9e2; text-shadow: 0 1px 0 #0004;
  background: #00000030; border-radius: 10px; padding: 7px 10px 6px;
  display: grid; gap: 2px;
}
.brandplate small { font-family: var(--font-body); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; font-weight: 700; }
.grille {
  height: 34px; min-width: 40px; border-radius: 10px;
  background: radial-gradient(circle, #00000070 2px, transparent 2.5px) 0 0 / 9px 9px;
}
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.knob {
  display: grid; place-items: center; line-height: 1;
  width: 46px; height: 40px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #ffd666, var(--sun));
  color: #3a2600; font-weight: 800; font-size: .9rem;
  box-shadow: 0 4px 0 #a06f00, inset 0 2px 0 #fff8;
  transition: transform .08s, box-shadow .08s;
}
.knob span { font-size: .55rem; letter-spacing: .08em; }
.knob:active { transform: translateY(3px); box-shadow: 0 1px 0 #a06f00, inset 0 2px 0 #fff8; }
.knob[aria-pressed="true"] { background: linear-gradient(180deg, #8fc0ff, var(--sky)); color: #071a3a; box-shadow: 0 4px 0 #1b4f9e, inset 0 2px 0 #fff8; }
.power {
  width: 48px; height: 48px; border-radius: 50%; border: 0; margin-left: 4px;
  background: radial-gradient(circle at 40% 35%, #4a416e, #1a1430);
  box-shadow: 0 4px 0 #0b0818, inset 0 2px 0 #ffffff30;
  display: grid; place-items: center;
}
.power:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b0818; }
.led { width: 10px; height: 10px; border-radius: 50%; background: #5a1010; box-shadow: inset 0 1px 2px #0008; }
.is-on .led { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b, 0 0 2px #fff; }
@media (max-width: 560px) {
  .panel { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; }
  .grille, .brandplate { display: none; }
  .controls { justify-content: center; gap: 6px; }
  .knob { width: 40px; height: 36px; }
  .power { width: 42px; height: 42px; }
}

.tv-feet { display: flex; justify-content: space-between; padding-inline: 14%; }
.tv-feet span { width: 70px; height: 14px; background: #2b2450; border-radius: 0 0 14px 14px; }

.keys {
  grid-column: 1; margin: 0; color: var(--muted); font-size: var(--step--1);
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center;
}
kbd {
  font-family: var(--font-body); font-weight: 800; font-size: .75rem;
  background: var(--room-2); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: 7px; padding: 1px 7px; color: var(--ink);
}
@media (hover: none) { .keys { display: none; } }

/* ---------- Sidebar ---------- */
.side {
  min-width: 0;
  background: var(--room-2);
  border: 3px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 8px 0 #0b0818;
  overflow: hidden;
  display: flex; flex-direction: column;
  /* Never taller than the TV column: the row height comes from the TV, the panel scrolls. */
  align-self: stretch; height: 0; min-height: 100%;
}
.panel-body {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}
@media (max-width: 900px) {
  .side { height: auto; min-height: 0; max-height: min(760px, 88dvh); }
}
.tabs { flex: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px; background: #0000002e; }
.tab {
  border: 0; border-radius: 14px; padding: 9px 6px;
  background: transparent; color: var(--muted);
  font-family: var(--font-display); font-weight: 800; font-size: 1rem; line-height: 1.1;
}
.tab:hover { color: var(--ink); background: #ffffff0d; }
.tab[aria-selected="true"] { background: var(--sun); color: #1a1430; box-shadow: 0 3px 0 #a06f00; }
.panel-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 18px 18px; display: grid; gap: 18px; align-content: start;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.side-section h3 { margin: 0 0 8px; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.side-section h3 span { color: var(--ink); }
.hint { margin: 0; color: var(--muted); }
.eyebrow { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sun); }

.later { list-style: none; margin: 0; padding: 0; display: grid; }
.later li { display: grid; grid-template-columns: 4.8em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 2px dashed var(--line); }
.later li:first-child { border-top: 0; }
.l-time { font-family: var(--font-osd); font-size: 1.3rem; line-height: 1.15; color: var(--osd); font-variant-numeric: tabular-nums; }
.l-body { display: grid; min-width: 0; }
.l-title { font-weight: 800; line-height: 1.25; }
.l-meta { color: var(--muted); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ch-btn {
  width: 100%; text-align: left; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 7px; border-radius: 18px; background: #ffffff08; border: 2px solid transparent;
  transition: background .15s, border-color .15s;
}
.ch-btn:hover { background: #ffffff12; }
.ch-btn[aria-current="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.ch-art { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0b0818; }
.ch-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-num {
  position: absolute; left: 6px; bottom: 6px; padding: 0 6px; border-radius: 8px;
  background: var(--c); color: #120d22; font-family: var(--font-osd); font-size: 1.3rem; line-height: 1.1;
}
.ch-text { display: grid; gap: 3px; min-width: 0; }
.ch-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.ch-now { color: var(--muted); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bar { height: 4px; border-radius: 2px; background: #ffffff18; overflow: hidden; }
.ch-bar span { display: block; height: 100%; background: var(--c); }

/* Settings: styled like an old TV's on-screen menu */
.settings fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.settings legend {
  font-family: var(--font-osd); font-size: 1.35rem; color: var(--osd); letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 4px; padding: 0;
}
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 0; border-top: 2px dashed var(--line);
}
.row > span { display: grid; font-weight: 700; }
.row small { color: var(--muted); font-weight: 600; font-size: .78rem; line-height: 1.35; }
.settings select {
  font: inherit; font-weight: 700; font-size: .9rem; color: var(--ink);
  background: var(--room); border: 2px solid var(--line); border-radius: 10px; padding: 6px 8px; max-width: 11rem;
}
.settings input[type="range"] { width: 9.5rem; accent-color: var(--sun); }
.switch {
  appearance: none; width: 46px; height: 26px; border-radius: 999px; margin: 0; position: relative; cursor: pointer;
  background: var(--room); border: 2px solid var(--line); transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s;
}
.switch:checked { background: var(--leaf); border-color: var(--leaf); }
.switch:checked::after { transform: translateX(20px); background: #fff; }
.reset {
  justify-self: start; margin-top: 6px; border: 2px solid var(--line); background: transparent; color: var(--ink);
  font-weight: 800; border-radius: 10px; padding: 6px 12px;
}
.reset:hover { border-color: var(--muted); }

/* Picture settings applied to the screen */
.screen.is-zoomed #yt { transform: scale(1.36); }
.no-crt .scanlines { display: none; }
.no-crt .glass { animation: none; }

/* ---------- TV guide grid ---------- */
.epg {
  max-width: 1240px; width: 100%; margin-inline: auto;
  background: var(--room-2); border: 3px solid var(--line); border-radius: 28px; box-shadow: 0 8px 0 #0b0818;
  padding: 18px 0 8px; display: grid; gap: 10px;
  --epg-label: 150px;
}
.epg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-inline: 18px; }
.epg-head h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); line-height: 1.1; }
.epg-head p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.epg-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 8px; }
.epg-grid { position: relative; width: max-content; min-width: 100%; }
.epg-row { display: flex; align-items: stretch; min-height: 58px; }
.epg-label {
  position: sticky; left: 0; z-index: 2; flex: 0 0 var(--epg-label); width: var(--epg-label);
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 18px; text-align: left;
  background: var(--room-2); border: 0; border-right: 2px solid var(--line);
  color: var(--ink); font-weight: 800; font-size: var(--step--1); line-height: 1.1;
}
.epg-times .epg-label { color: var(--muted); font-weight: 700; }
.epg-num {
  flex: none; display: grid; place-items: center; min-width: 2.2em; padding: 2px 4px; border-radius: 8px;
  background: var(--c); color: #120d22; font-family: var(--font-osd); font-size: 1.3rem; line-height: 1;
}
.epg-row.is-current .epg-label { box-shadow: inset 4px 0 0 var(--c); }
.epg-track { position: relative; flex: none; }
.epg-times { min-height: 30px; }
.epg-tick {
  position: absolute; top: 4px; padding-left: 6px; border-left: 2px solid var(--line);
  font-family: var(--font-osd); font-size: 1.15rem; color: var(--osd); white-space: nowrap;
}
.epg-prog {
  position: absolute; top: 4px; bottom: 4px; display: grid; align-content: center; gap: 1px;
  padding: 4px 10px; overflow: hidden; text-align: left;
  border: 0; border-left: 3px solid var(--room-2); border-radius: 12px;
  background: #ffffff0d; color: var(--ink); cursor: default;
}
.epg-prog b, .epg-prog span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-prog b { font-size: .88rem; }
.epg-prog span { font-size: .74rem; color: var(--muted); }
.epg-prog.is-cut { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.epg-prog.is-live { background: color-mix(in srgb, var(--c) 26%, transparent); cursor: pointer; }
.epg-prog.is-live:hover { background: color-mix(in srgb, var(--c) 40%, transparent); }
.epg-prog.is-live span { color: var(--ink); }
.epg-nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--tomato); z-index: 1; pointer-events: none; box-shadow: 0 0 8px var(--tomato); }
@media (max-width: 560px) { .epg { --epg-label: 64px; } .epg-name { display: none; } .epg-label { padding-left: 12px; } }

.footer { max-width: 1240px; width: 100%; margin-inline: auto; color: var(--muted); font-size: var(--step--1); }
.footer p { margin: 0; max-width: 70ch; }

/* ---------- Animations ---------- */
@keyframes blink { 50% { opacity: .2; } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 48% { opacity: 1; } 50% { opacity: .92; } 52% { opacity: 1; } }
@keyframes crt-on {
  0% { transform: scale(1, .004); filter: brightness(6); }
  45% { transform: scale(1, .004); filter: brightness(6); }
  100% { transform: none; filter: none; }
}
@keyframes crt-off {
  0% { transform: scale(1, 1); opacity: .9; }
  50% { transform: scale(1, .004); opacity: 1; }
  100% { transform: scale(0, .004); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 520px) {
  .logo-word { font-size: var(--step-2); }
  .logo-antu { width: 34px; height: 40px; }
  .live-pill { display: none; }
  .tv { border-radius: 26px; }
  .bezel { border-radius: 20px; }
  .panel-body { padding: 14px; }
  .ch-btn { grid-template-columns: 84px minmax(0, 1fr); }
  .settings input[type="range"] { width: 7.5rem; }
}

/* ---------- Heading, about, FAQ, consent ---------- */
.logo-h1 { margin: 0; font-size: inherit; font-weight: inherit; }

.about {
  max-width: 1240px; width: 100%; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px;
  padding-block: 12px;
}
.about h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); line-height: 1.1; text-wrap: balance; }
.about p { margin: 0 0 10px; color: var(--muted); max-width: 62ch; }
.about-intro { grid-column: 1 / -1; }
.about-intro h2 { font-size: var(--step-3); color: var(--sun); }
.about-intro p { color: var(--ink); font-size: 1.05rem; }
.about-channels ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.about-ch h3 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.about-num { font-family: var(--font-osd); font-size: 1.3rem; line-height: 1; padding: 2px 6px; border-radius: 8px; background: var(--c); color: #120d22; }
.about-ch p { margin: 0; font-size: var(--step--1); }
.about-ch .about-blocks { opacity: .8; }
.faq details { border-top: 2px dashed var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 800; list-style-position: outside; }
.faq summary:hover { color: var(--sun); }
.faq details p { margin: 8px 0 0; }
@media (max-width: 760px) { .about { grid-template-columns: minmax(0, 1fr); } }

.consent {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: 560px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 16px; border-radius: 18px;
  background: var(--room-2); border: 3px solid var(--line); box-shadow: 0 8px 0 #0b0818, 0 20px 50px #000a;
}
.consent p { margin: 0; flex: 1 1 260px; font-size: var(--step--1); }
.consent-actions { display: flex; gap: 8px; }
.consent button { border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 800; }
.consent-no { background: transparent; color: var(--muted); border: 2px solid var(--line) !important; }
.consent-yes { background: var(--sun); color: #1a1430; box-shadow: 0 3px 0 #a06f00; }

/* Current program: first row of the "Now & next" list */
.later li.is-now {
  margin: 0 -10px 4px; padding: 10px; border: 0; border-radius: 14px;
  background: color-mix(in srgb, var(--glow) 16%, transparent);
}
.later li.is-now + li { border-top: 0; }
.l-now {
  display: inline-block; margin-bottom: 3px; padding: 1px 7px; border-radius: 999px; justify-self: start;
  background: var(--tomato); color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.l-bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: #ffffff1f; overflow: hidden; }
.l-bar span { display: block; height: 100%; width: 0; background: var(--glow); }
.l-link { justify-self: start; margin-top: 5px; color: var(--sky); font-size: .78rem; font-weight: 700; }
