:root {
  --accent: #e50914;
  --accent-text: var(--accent);
  --live: #e50914;
  --highlight: #f5eb4e;
  --bg: #0a0a0a;
  --bg2: #151515;
  --bg3: #222222;
  --line: #2e2e2e;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; }
.ico {
  width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Top bar ---------------------------------------------------------------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 24px; border-bottom: 3px solid var(--accent); background: #000;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; min-width: 0; }
.brand img { height: 36px; width: auto; max-width: 120px; object-fit: contain; }
.brand.has-logo img { height: 52px; max-width: 160px; flex-shrink: 0; }
.brand.has-logo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.topbar nav > a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.topbar nav > a.active, .topbar nav > a:hover { color: var(--text); background: var(--bg3); }
.topbar nav > a.active { color: var(--highlight); }
.langs { display: inline-flex; margin-left: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.langs a { text-decoration: none; padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.langs a.active { background: var(--bg3); color: var(--text); }

/* Live layout ------------------------------------------------------------ */
.live-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; align-items: start; gap: 20px;
  max-width: 1500px; margin: 0 auto; padding: 20px 24px;
}
.screen-wrap { min-width: 0; }
.screen {
  position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden;
}
.screen:fullscreen { border-radius: 0; aspect-ratio: auto; }
.screen iframe, #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { position: absolute; inset: 0; }
.badge-live {
  position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 6px;
  background: var(--live); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 6px; text-transform: uppercase; pointer-events: none;
}
.badge-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
/* Channel logo burnt into the corner, like a TV station bug. Moves up while the controls are shown. */
.bug {
  position: absolute; right: 2.5%; bottom: 4%; width: clamp(64px, 14%, 180px); height: auto;
  opacity: .9; pointer-events: none; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
  transition: transform .2s;
}
.screen.is-awake .bug, .screen:focus-within .bug { transform: translateY(-40px); }
@media (hover: none) { .bug { transform: translateY(-40px); } }
/* The bottom ticker takes the lowest strip of the picture: the logo sits above it. */

/* Tickers ---------------------------------------------------------------- */
.ticker {
  position: absolute; left: 0; right: 0; display: flex; align-items: stretch; height: 34px;
  font-size: 15px; font-weight: 700; line-height: 34px; overflow: hidden; z-index: 1;
}
.ticker[hidden] { display: none; }
.ticker { transition: transform .5s ease, opacity .5s ease; }
.ticker-top.is-away { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.ticker-bottom.is-away { transform: translateY(100%); opacity: 0; pointer-events: none; }
.bug, .ad-overlay { transition: transform .2s, bottom .5s ease; }
.ticker-top { top: 0; background: rgba(0, 0, 0, .55); }
/* Bottom ticker: on the picture (so it shows in fullscreen and in the embed); the
   controls, the logo and the image banner move up above it while it is shown. */
.ticker-bottom { bottom: 0; background: rgba(0, 0, 0, .72); color: #fff; }
.controls { z-index: 2; }
.screen.has-tickerBottom .controls { bottom: 34px; }
.screen.has-tickerBottom .bug { bottom: calc(4% + 34px); }
.screen.has-tickerBottom .ad-overlay { bottom: calc(6% + 34px); }
.ticker-label {
  flex-shrink: 0; padding: 0 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.ticker-top .ticker-label { background: var(--highlight); color: #1a1a00; }
.ticker-view { flex: 1; min-width: 0; overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: ticker linear infinite; }
.ticker-run { display: flex; flex-shrink: 0; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { color: inherit; text-decoration: none; white-space: nowrap; padding: 0 28px 0 0; }
.ticker-bottom .ticker-item::after { content: "•"; padding-left: 28px; color: var(--accent-text); }
.ticker-top .ticker-item > span { display: inline-block; padding: 0 14px; }
a.ticker-item:hover > span, a.ticker-item:hover { text-decoration: underline; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation-duration: 0s !important; } }

/* Image banner over the video ------------------------------------------- */
.ad-overlay {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); z-index: 1;
  max-width: 64%; animation: ad-in .4s ease-out;
}
.ad-overlay[hidden] { display: none; }
.ad-overlay img { display: block; max-width: 100%; max-height: 22vh; border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.ad-overlay a[href] { cursor: pointer; }
.ad-close {
  position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: #000; color: #fff; cursor: pointer; font-size: 13px;
}
@keyframes ad-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Page banners ----------------------------------------------------------- */
.ad-slot { position: relative; }
.ad-slot[hidden] { display: none; }
.ad-slot img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
/* Slideshow: slides are stacked in one grid cell, so the box takes the tallest one. */
.slides { display: grid; overflow: hidden; border-radius: var(--radius); }
.slide { grid-area: 1 / 1; transition: opacity .7s ease, transform .7s ease; }
.slide .ad-img { display: block; }
.show-fade .slide { opacity: 0; }
.show-fade .slide.is-on { opacity: 1; }
.show-slide .slide { transform: translateX(100%); }
.show-slide .slide.is-before { transform: translateX(-100%); }
.show-slide .slide.is-on { transform: none; }
.slide:not(.is-on) { pointer-events: none; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--line); cursor: pointer; transition: width .2s, background .2s; }
.dots button.is-on { width: 22px; border-radius: 4px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }
.ad-tag {
  position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(0,0,0,.6); color: #fff; padding: 2px 6px; border-radius: 4px; pointer-events: none;
}
.live-layout .ad-below { grid-column: 1; }
.live-layout .side { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.wide-layout .ad-below { max-width: 1200px; margin: 16px auto; padding: 0 24px; }
.wide-layout .ad-below .ad-tag { right: 30px; }

.card {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, #1d2a1d, #050505);
}
.card[hidden] { display: none; }
.card-title { font-size: clamp(20px, 4vw, 40px); font-weight: 800; }
.card-sub { color: var(--muted); margin-top: 6px; }

.tune-in {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 12px; padding: 14px 26px 14px 18px;
  background: rgba(0,0,0,.65); color: #fff; border: 2px solid rgba(255,255,255,.85); border-radius: 999px;
  font-size: 18px; font-weight: 700; cursor: pointer; backdrop-filter: blur(4px);
}
.tune-in:hover { background: var(--accent); border-color: var(--accent); }
.tune-in[hidden] { display: none; }
/* Green veil over the whole picture while the "Watch live" button is shown. */
.tune-veil { position: absolute; inset: 0; background: var(--accent); opacity: .93; cursor: pointer; z-index: 1; }
.tune-in { z-index: 2; }
.tune-in[hidden] + .tune-veil { display: none; }
.tune-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); font-size: 14px; }
.tune-icon .ico { margin-left: 2px; }
.controls button { display: inline-grid; place-items: center; }
.more .ico { width: 1em; height: 1em; vertical-align: -.15em; }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 24px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.75));
  opacity: 0; transition: opacity .2s, bottom .5s ease;
}
.screen.is-awake .controls, .screen:focus-within .controls { opacity: 1; }
@media (hover: none) { .controls { opacity: 1; } }

/* TV menu: replaces the top bar on the live page. Shown while the viewer moves over the picture. */
.tv-menu {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s, top .5s ease;
}
.screen.is-awake .tv-menu, .tv-menu.is-open, .tv-menu:has(:focus-visible) { opacity: 1; visibility: visible; }
.screen.has-tickerTop .tv-menu { top: 46px; }
.tv-menu-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(0,0,0,.6); color: #fff; font-size: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.tv-menu-btn:hover, .tv-menu.is-open .tv-menu-btn { background: var(--accent); }
.tv-menu-list {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; display: flex; flex-direction: column; gap: 2px;
  padding: 8px; background: rgba(12,12,12,.96); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.tv-menu-list[hidden] { display: none; }
.tv-menu-list > a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tv-menu-list > a:hover { color: var(--text); background: var(--bg3); }
.tv-menu-list > a.active { color: var(--highlight); }
.tv-menu-list > .tv-menu-brand {
  display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700;
  padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0;
}
.tv-menu-brand img { height: 36px; width: auto; max-width: 110px; object-fit: contain; }
.tv-menu-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-menu-list .langs { align-self: flex-start; margin: 6px 0 2px 12px; }
.controls button {
  background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; width: 36px; height: 32px; cursor: pointer; font-size: 16px;
}
.controls button:hover { background: rgba(255,255,255,.25); }
.controls input[type=range] { width: 110px; accent-color: var(--accent); }
.controls .spacer { flex: 1; }
.ctl-link { color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; opacity: .85; }

.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.now .program { color: var(--accent-text); font-weight: 700; font-size: 13px; }
.now .title { font-size: 18px; font-weight: 700; margin: 2px 0 12px; overflow-wrap: anywhere; }
.progress { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .5s linear; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.upnext { list-style: none; margin: 0; padding: 0; }
.upnext li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.upnext li:first-child { border-top: 0; }
.upnext .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 1px; flex-shrink: 0; white-space: nowrap; }
.upnext .v { min-width: 0; overflow-wrap: anywhere; }
.prog-name { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.more { display: inline-block; margin-top: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.more:hover { color: var(--text); }
.tz-note { color: var(--muted); font-size: 12px; margin: 0; }

.live-layout .next-bar, .wide-layout .side { display: none; }

/* Wide layout: edge-to-edge player, one line for what comes next. ---------- */
.wide-layout .screen {
  border-radius: 0; aspect-ratio: auto; width: 100%;
  height: min(56.25vw, calc(100vh - 140px)); min-height: 200px;
}
.next-bar {
  display: flex; align-items: baseline; gap: 12px; padding: 14px 24px;
  background: var(--bg2); border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0;
}
.next-bar .label { margin: 0; color: var(--accent-text); flex-shrink: 0; }
.next-bar .t { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.next-bar .v { font-size: 18px; font-weight: 700; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-bar .ico { color: var(--muted); align-self: center; }
.next-bar:hover .ico { color: var(--text); }

/* Embed mode ------------------------------------------------------------- */
body.is-embed { background: #000; min-height: 0; }
body.is-embed .screen { border-radius: 0; height: 100vh; aspect-ratio: auto; }

/* Guide ------------------------------------------------------------------ */
.guide-page { max-width: 920px; margin: 0 auto; padding: 24px; }
.guide-page h1 { margin: 0 0 16px; font-size: 26px; }
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.day-tabs button {
  flex-shrink: 0; background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; text-transform: capitalize;
}
.day-tabs button[aria-selected=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.guide { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.prog { --prog: var(--line); background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--prog); border-radius: 10px; }
.prog.is-past { opacity: .55; }
.prog.is-live { border-color: var(--accent); border-left-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.prog summary { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.prog summary::-webkit-details-marker { display: none; }
.prog .range { font-variant-numeric: tabular-nums; font-weight: 700; }
.prog .name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.prog .count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--bg3); color: var(--muted); vertical-align: 2px; margin-left: 4px; }
.tag-live { background: var(--live); color: #fff; }
.tag-special { background: var(--highlight); color: #1a1a00; }
.items { list-style: none; margin: 0; padding: 0 14px 10px; }
.items li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.items li.is-past { color: var(--muted); }
.items li.is-live { color: var(--accent-text); font-weight: 700; }
.items .t, .items .d { font-variant-numeric: tabular-nums; color: var(--muted); }
.items .v { min-width: 0; overflow-wrap: anywhere; }
.items em { color: var(--muted); font-style: normal; font-size: 12px; }
.items li.folded { display: none; }
.items li.show-earlier { display: block; }
.show-earlier button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 0; font-size: 13px; text-decoration: underline; }
.show-earlier button:hover { color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

@media (max-width: 900px) {
  .live-layout { grid-template-columns: 1fr; padding: 0 0 20px; gap: 0; }
  .screen { border-radius: 0; }
  .side { padding: 16px; }
  .live-layout .side, .live-layout .ad-below { grid-column: auto; grid-row: auto; }
  .ad-below { padding: 16px 16px 0; }
  .live-layout .ad-side { width: 100%; max-width: 420px; margin: 0 auto; }
  .wide-layout .ad-below { padding: 0 16px; }
  .ticker { height: 28px; line-height: 28px; font-size: 13px; }
  .screen.has-tickerBottom .controls { bottom: 28px; }
  .screen.has-tickerBottom .bug { bottom: calc(4% + 28px); }
  .screen.has-tickerBottom .ad-overlay { bottom: calc(4% + 28px); }
  .next-bar { padding: 12px 16px; gap: 10px; }
  .next-bar .v { font-size: 15px; white-space: normal; }
  .topbar { padding: 8px 16px; }
  .brand.has-logo img { height: 42px; }
  .guide-page { padding: 16px; }
  .prog summary { grid-template-columns: 1fr auto; }
  .prog .range { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
}
@media (max-width: 480px) {
  .topbar nav > a { padding: 6px 8px; }
  .brand { font-size: 16px; }
  .brand.has-logo img { height: 36px; }
  .langs { margin-left: 4px; }
  .controls input[type=range] { width: 70px; }
}
.webtv-now .next-label { margin-top: 14px; }

/* Parts placed one by one (WordPress shortcode [webtv element="…"]) ---------- */
.guide-page.guide-next { padding: 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.guide-next .guide { margin-top: 0; }
.guide-next-list li { border-left: 3px solid var(--prog, var(--line)); padding-left: 10px; }
.guide-next-list li:first-child { border-top: 0; }
.guide-next-list li.is-live .v { font-weight: 700; color: var(--accent-text); }
.guide-page.guide-day h1 { font-size: 22px; }
.webtv-now.next-bar { border: 1px solid var(--line); border-radius: var(--radius); }
