/* ============================================================
   BJ BARRETTA TV — "PREVUE" system, skinned to bjbarretta.com
   Structure of the old Prevue Channel; colors and type of the
   BJ Barretta brand. Weather keeps its authentic WS4000 look.

   Brand palette (pulled from bjbarretta.com)
     ice mint   #DBFAF9  display text, borders, channel plates
     deep maroon#5A0C36  primary surface family
     purple     #613C93  links / interactive accent
     red        #FF3B30  live indicators only

   Type
     Bebas Neue — all display (same face as the site's hero)
     Arial      — body copy
     Star4000   — weather channel only
   ============================================================ */
@font-face {
  font-family: "Star4000";
  src: url("ws4000/fonts/Star4000.woff") format("woff");
  font-display: swap;
}

:root {
  --pv-bg: #250517;
  --pv-bg-2: #320a20;
  --pv-prog: linear-gradient(180deg, #7c1a4d 0%, #5a0c36 55%, #43082a 100%);
  --pv-prog-flat: #4d0a2f;
  --pv-chan: linear-gradient(180deg, #eefefd 0%, #dbfaf9 45%, #bfe8e6 100%);
  --pv-chan-ink: #5a0c36;
  --pv-time: linear-gradient(180deg, #93365f 0%, #6d1c44 100%);
  --pv-border: #dbfaf9;
  --pv-line: #6d2049;
  --pv-mint: #dbfaf9;
  --pv-soft: #cfe0de;
  --pv-dim: #b08ba0;
  --pv-link-dark: #613c93;   /* links on light plates */
  --pv-link-light: #c9adff;  /* links on dark surfaces */
  --pv-red: #ff3b30;
  --font-prevue: "Bebas Neue", "Arial Narrow", "Helvetica Neue Condensed", Arial, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
  --font-star: "Star4000", "Courier New", Courier, monospace;
  --col-w: 300px;
  --chan-w: 158px;
  --head-h: clamp(34px, 5.4vh, 46px);
  --crt-shadow: 2px 2px 0 #000, 0 0 5px currentColor,
                1px 0 0 rgba(255,90,90,.28), -1px 0 0 rgba(90,220,255,.28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--pv-bg);
  color: var(--pv-mint);
  font-family: var(--font-prevue);
  letter-spacing: .04em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; letter-spacing: .06em; cursor: pointer; }
p, .body-copy { font-family: var(--font-body); letter-spacing: 0; }

/* ---- shared "plate" controls ---- */
.bb-buttons button, #btn-scroll, #btn-vod, #guide-toggle, #show-guide, #unmute-tip, .vod-cat-live {
  background: var(--pv-prog);
  color: var(--pv-mint);
  border: 2px solid var(--pv-border);
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
.bb-buttons button:hover, #btn-scroll:hover, #btn-vod:hover, #guide-toggle:hover,
#show-guide:hover, .vod-cat-live:hover {
  filter: brightness(1.25);
}

/* ============ LANDING ============ */
#landing {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #591238 0%, #38081f 55%, #1b0310 100%);
  overflow-y: auto; padding: 24px;
}
#landing::after {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(0deg,
    rgba(0,0,0,.14) 0px, rgba(0,0,0,.14) 1px, transparent 1px, transparent 4px);
}
.landing-inner { text-align: center; max-width: 780px; width: 100%; position: relative; z-index: 1; }
.landing-tv { color: #a06a86; margin-bottom: 18px; animation: flicker 4s infinite; }
@keyframes flicker { 0%,92%,100% {opacity:1} 94% {opacity:.55} 96% {opacity:.9} 98% {opacity:.65} }
#landing h1 {
  font-weight: 400; letter-spacing: .14em;
  font-size: clamp(34px, 6vw, 64px); color: var(--pv-mint); margin-bottom: 30px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
}
.landing-choices {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px;
}
.landing-choices button {
  flex: 1 1 260px; max-width: 330px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  text-align: left; padding: 22px 24px;
  background: var(--pv-prog);
  border: 2px solid var(--pv-border); color: var(--pv-mint);
  transition: transform .15s, filter .15s;
}
.landing-choices button:hover { transform: translateY(-2px); filter: brightness(1.2); }
.lc-badge {
  font-size: 13px; letter-spacing: .2em; padding: 3px 9px 2px;
  color: var(--pv-chan-ink); background: var(--pv-mint);
}
.lc-badge-live { background: var(--pv-red); color: #fff; }
.lc-name { letter-spacing: .1em; font-size: clamp(22px, 2.6vw, 30px); color: var(--pv-mint); text-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.lc-sub { font-family: var(--font-body); letter-spacing: 0; font-size: 12.5px; color: var(--pv-soft); line-height: 1.5; }
.landing-desc {
  margin: 0 auto; max-width: 620px;
  color: var(--pv-soft); font-size: clamp(12.5px, 1.4vw, 15px); line-height: 1.65;
}
.landing-desc-2 { margin-top: 14px; color: #a9c6c3; }

/* ============ LIVE TV LAYOUT ============ */
#tv { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#top { display: flex; flex: 1 1 52%; min-height: 0; background: #000; }
#tv.guide-hidden #top { flex: 1 1 100%; }

#screen { position: relative; flex: 0 0 62%; background: #000; overflow: hidden; }
#tv.guide-hidden #screen { flex: 1 1 100%; }
#player-host, #player-host iframe, #weather-host {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
#screen-click { position: absolute; inset: 0; z-index: 5; }

#channel-bug {
  position: absolute; top: 14px; left: 16px; z-index: 8;
  font-family: var(--font-star);
  font-size: clamp(20px, 3vw, 34px); color: #57ff57;
  text-shadow: 0 0 8px rgba(87,255,87,.7), 2px 2px 2px rgba(0,0,0,.8);
  letter-spacing: .06em; pointer-events: none;
}

/* analog snow: real fractal noise, two layers running at different speeds,
   plus a roll bar drifting down the screen like a lost vertical hold */
#static-fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; background: #0a0a0a; overflow: hidden; }
#static-fx::before, #static-fx::after {
  content: ""; position: absolute; inset: -60%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncA type='linear' slope='2.2' intercept='-0.35'/></feComponentTransfer></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  will-change: transform;
}
#static-fx::before { animation: staticmove .08s steps(3) infinite; opacity: .95; }
#static-fx::after  { animation: staticmove2 .11s steps(4) infinite; opacity: .55; }
@keyframes staticmove {
  0%   { transform: translate3d(0,0,0) }
  33%  { transform: translate3d(-47px,31px,0) }
  66%  { transform: translate3d(38px,-42px,0) }
  100% { transform: translate3d(-29px,-23px,0) }
}
@keyframes staticmove2 {
  0%   { transform: translate3d(25px,-18px,0) scaleX(-1) }
  50%  { transform: translate3d(-33px,27px,0) scaleX(-1) }
  100% { transform: translate3d(19px,36px,0) scaleX(-1) }
}
/* the roll bar */
#static-fx > i {
  position: absolute; left: 0; right: 0; height: 22%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0) 0%, rgba(255,255,255,.10) 35%,
    rgba(255,255,255,.16) 50%, rgba(255,255,255,.10) 65%, rgba(255,255,255,0) 100%);
  animation: staticroll 1.1s linear infinite;
  pointer-events: none;
}
@keyframes staticroll { from { top: -25%; } to { top: 105%; } }

#standby { position: absolute; inset: 0; z-index: 6; background: #1c0410; display: flex; align-items: center; justify-content: center; }
.standby-inner { text-align: center; }
.standby-bars { display: flex; height: 120px; width: 240px; margin: 0 auto 26px; }
.standby-bars i { flex: 1; }
.standby-bars i:nth-child(1){background:#c0c0c0}.standby-bars i:nth-child(2){background:#c0c000}
.standby-bars i:nth-child(3){background:#00c0c0}.standby-bars i:nth-child(4){background:#00c000}
.standby-bars i:nth-child(5){background:#c000c0}.standby-bars i:nth-child(6){background:#c00000}
.standby-bars i:nth-child(7){background:#0000c0}
#standby p { letter-spacing: .35em; color: var(--pv-soft); font-size: 16px; }

#unmute-tip {
  position: absolute; z-index: 9; bottom: 16px; left: 16px;
  font-size: 14px; letter-spacing: .1em; padding: 9px 14px;
}
@media (hover: none), (max-width: 860px) {
  /* on a phone this is the only way to get audio — make it unmissable */
  #unmute-tip {
    left: 50%; transform: translateX(-50%); bottom: 12px;
    font-size: 16px; padding: 12px 22px; background: var(--pv-hot, #ffb545);
    color: var(--pv-chan-ink); text-shadow: none;
  }
}

/* ---- info panel ---- */
#info {
  flex: 1 1 38%; min-width: 0;
  background: linear-gradient(180deg, #6d1642 0%, #4a0a2c 60%, #38081f 100%);
  border-left: 3px solid #000;
  padding: clamp(14px, 2.4vw, 34px);
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  overflow: hidden;
}
#info-ch {
  letter-spacing: .16em;
  font-size: clamp(16px, 1.9vw, 25px); color: var(--pv-mint);
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
#info-ch a {
  color: var(--pv-link-light); text-decoration: none; font-size: .85em; letter-spacing: .08em;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
#info-ch a:hover { text-decoration: underline; }
#info-title {
  color: var(--pv-mint);
  font-size: clamp(20px, 2.6vw, 34px); line-height: 1.1; letter-spacing: .04em;
  text-shadow: 1px 1px 0 rgba(0,0,0,.55);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#info-desc {
  font-family: var(--font-body); letter-spacing: 0;
  color: var(--pv-soft); font-size: clamp(11.5px, 1.2vw, 15px); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
#info-link a {
  display: inline-block; margin-top: 2px;
  color: var(--pv-link-light); text-decoration: none;
  letter-spacing: .12em; font-size: clamp(15px, 1.5vw, 20px);
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
#info-link a:hover { text-decoration: underline; }
#info-meta { font-size: clamp(14px, 1.4vw, 18px); color: var(--pv-mint); letter-spacing: .1em; }
#info-next { font-size: clamp(13px, 1.3vw, 17px); color: var(--pv-dim); letter-spacing: .05em; }
#info-next b { color: var(--pv-mint); font-weight: 400; }

#tv.guide-hidden #info { display: none; }
#show-guide {
  display: none; position: fixed; bottom: 12px; right: 14px;
  z-index: 30; font-size: 11px; letter-spacing: .18em; padding: 5px 12px;
  opacity: .5; transition: opacity .2s;
}
#show-guide:hover { opacity: 1; }
#tv.guide-hidden #show-guide { display: block; }

/* ============ GUIDE — vintage Prevue, BJ palette ============ */
#guide {
  flex: 1 1 48%; min-height: 0; position: relative;
  display: flex; flex-direction: column;
  background: var(--pv-bg);
  border-top: 3px solid #000;
}
#tv.guide-hidden #guide { display: none; }

#guide-toggle {
  position: absolute; top: -3px; right: 16px; transform: translateY(-100%);
  z-index: 20; border-bottom: none;
  font-size: 11px; letter-spacing: .22em; padding: 5px 18px 3px;
}

#guide-head {
  display: flex; flex: 0 0 var(--head-h); gap: 3px;
  background: var(--pv-bg); padding: 3px 3px 0 3px;
}
#clock-cell {
  flex: 0 0 var(--chan-w); display: flex; align-items: center; justify-content: center;
  font-size: clamp(16px, 2.6vh, 22px); letter-spacing: .06em;
  color: var(--pv-mint); background: linear-gradient(180deg, #47102c 0%, #2c0619 100%);
  border: 2px solid var(--pv-border);
  font-variant-numeric: tabular-nums;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
#slot-heads { flex: 1; overflow: hidden; min-width: 0; }
.slot-head-inner { display: flex; height: 100%; will-change: transform; }
.slot-head {
  flex: 0 0 var(--col-w); display: flex; align-items: center; justify-content: center;
  font-size: clamp(16px, 2.6vh, 22px); color: var(--pv-mint);
  background: var(--pv-time);
  border: 2px solid var(--pv-border);
  font-variant-numeric: tabular-nums; letter-spacing: .06em;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}

#guide-body {
  flex: 1; position: relative; overflow: auto; min-height: 0; padding: 0 3px;
  background: var(--pv-bg);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#guide-body::-webkit-scrollbar { display: none; }
#guide-rows { position: relative; min-width: 100%; }

.g-row {
  display: flex; gap: 3px; padding-top: 3px;
  cursor: pointer; position: relative; width: 100%;
}
.g-row.tuned .chan-cell { box-shadow: inset 0 0 0 3px var(--pv-link-dark); }
/* pinned so the channel stays readable while the timeline scrolls sideways */
.chan-cell {
  flex: 0 0 var(--chan-w); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: var(--pv-chan); color: var(--pv-chan-ink);
  border: 2px solid var(--pv-border);
  z-index: 4; padding: 4px 3px; text-align: center;
  position: sticky; left: 0;
  overflow: hidden;
}
.chan-num { font-size: clamp(24px, 4.2vh, 42px); line-height: 1; color: var(--pv-chan-ink); }
.chan-name { font-size: clamp(12px, 1.9vh, 17px); letter-spacing: .1em; color: var(--pv-chan-ink); }
/* interactive = purple, bold, underlined — reads clearly on the mint plate */
.chan-link {
  font-size: clamp(12px, 1.9vh, 16px); letter-spacing: .04em;
  color: var(--pv-link-dark); font-weight: 700; text-decoration: underline;
  font-family: var(--font-body);
  font-size: clamp(10.5px, 1.6vh, 13px);
}
.chan-link:hover { color: #7d55b5; }

.row-track { position: relative; flex: 0 0 auto; overflow: hidden; }
.g-block {
  position: absolute; top: 3px; bottom: 0;
  background: var(--pv-prog); color: var(--pv-mint);
  border: 2px solid var(--pv-border);
  display: flex; align-items: center;
  padding: 0 12px; overflow: hidden;
}
.g-block span:last-child {
  color: var(--pv-mint); font-size: clamp(15px, 2.5vh, 22px);
  line-height: 1.08; letter-spacing: .04em;
  white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 1px 1px 0 rgba(0,0,0,.55);
}
.g-block .cont { margin-right: 8px; font-size: .7em; color: var(--pv-soft); flex-shrink: 0; }
.g-block.narrow { padding: 0 5px; }
.g-block.narrow span:last-child { font-size: clamp(12px, 2vh, 16px); -webkit-line-clamp: 3; }
.g-block.tiny { padding: 0 3px; }
.g-block.tiny span:last-child { font-size: 11px; line-height: 1.05; -webkit-line-clamp: 4; letter-spacing: 0; }

/* the red bar riding the timeline — starts under the time header */
#now-line {
  position: absolute; top: calc(var(--head-h) + 3px); bottom: 44px; width: 2px;
  background: var(--pv-red); z-index: 15; pointer-events: none;
  box-shadow: 0 0 5px rgba(255,59,48,.8);
}
#now-line::before {
  content: ""; position: absolute; top: 0; left: -3px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 6px solid var(--pv-red);
}

/* bottom bar */
#bottom-bar {
  flex: 0 0 44px; display: flex; align-items: center; gap: 18px;
  padding: 0 10px; background: var(--pv-bg-2); border-top: 3px solid #000;
}
#btn-scroll, #btn-vod, #btn-site { height: 30px; font-size: 13px; padding: 0 14px; }
#btn-site {
  display: inline-flex; align-items: center; text-decoration: none;
  background: var(--pv-prog); color: var(--pv-mint);
  border: 2px solid var(--pv-border); text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}
#btn-site:hover { filter: brightness(1.25); }
.bb-hint { flex: 1; text-align: center; font-size: 13px; letter-spacing: .2em; color: var(--pv-dim); }
.bb-buttons { display: flex; gap: 8px; margin-left: auto; }
.bb-buttons button { min-width: 40px; height: 30px; font-size: 14px; }
#btn-cc { letter-spacing: .06em; font-size: 13px; opacity: .6; }
#btn-cc.on { opacity: 1; background: var(--pv-mint); color: var(--pv-chan-ink); text-shadow: none; }
.bb-brand { letter-spacing: .1em; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.bb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pv-red); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% {opacity:.55} 50% {opacity:1} }
.bb-sub { font-size: 12px; color: var(--pv-dim); letter-spacing: .2em; }

/* ============ ON DEMAND ============ */
#vod {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #4a0a2c 0%, var(--pv-bg) 60%, #170210 100%);
  overflow: hidden;
}
#vod-main { flex: 1; display: flex; min-height: 0; }
#vod-rail {
  flex: 0 0 236px; padding: 34px 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
}
.vod-cat {
  text-align: left; padding: 12px 20px 10px;
  background: var(--pv-prog); border: 2px solid var(--pv-border);
  color: var(--pv-mint);
  font-size: 21px; letter-spacing: .1em;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  transition: filter .12s;
}
.vod-cat:hover:not(.active) { filter: brightness(1.25); }
.vod-cat.active {
  background: var(--pv-mint); color: var(--pv-chan-ink); text-shadow: none;
}
.vod-cat-live {
  margin-top: 18px; font-size: 16px; letter-spacing: .12em;
  display: flex; align-items: center; gap: 9px; justify-content: flex-start;
}

#vod-pane { flex: 1; overflow-y: auto; padding: 34px clamp(16px, 3vw, 40px) 44px; }
#vod-show-list { display: flex; flex-direction: column; gap: 10px; max-width: 980px; }
.vod-show {
  display: flex; gap: 16px; align-items: center; text-align: left;
  background: var(--pv-prog-flat); border: 1px solid var(--pv-line);
  padding: 10px; color: var(--pv-mint); transition: border-color .15s;
}
.vod-show:hover { border-color: var(--pv-border); }
.vod-thumb {
  flex: 0 0 150px; aspect-ratio: 16/9; overflow: hidden;
  background: #000; position: relative; border: 1px solid var(--pv-line);
}
.vod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vod-dur {
  position: absolute; bottom: 5px; right: 5px;
  background: rgba(0,0,0,.85); color: #fff;
  font-size: 12px; letter-spacing: .08em; padding: 2px 6px 1px;
}
.vod-show-text { min-width: 0; }
.vod-show-title { font-size: 19px; letter-spacing: .05em; color: var(--pv-mint); margin-bottom: 4px; text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.vod-show-desc {
  font-family: var(--font-body); letter-spacing: 0;
  color: var(--pv-soft); font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

#vod-player {
  position: fixed; inset: 0; z-index: 60; background: rgba(16,2,10,.94);
  display: flex; align-items: center; justify-content: center; padding: 3vh 3vw;
}
#vod-player-box { width: min(1100px, 96vw); }
#vod-close {
  background: none; border: none; color: var(--pv-soft); font-size: 22px;
  float: right; margin-bottom: 8px;
}
#vod-close:hover { color: #fff; }
#vod-player-host { clear: both; aspect-ratio: 16/9; background: #000; border: 2px solid var(--pv-border); overflow: hidden; }
#vod-player-host iframe { width: 100%; height: 100%; border: 0; }
#vod-player-meta { margin-top: 14px; }
#vod-player-meta h3 { color: var(--pv-mint); font-size: 23px; letter-spacing: .05em; margin-bottom: 6px; }
#vod-player-meta p { font-family: var(--font-body); color: var(--pv-soft); font-size: 13.5px; line-height: 1.5; max-height: 60px; overflow: hidden; }

/* ============ WEATHERSTAR 4000 ============ */
/* Authentic to the I Love the 90s app — intentionally its own look. */
#weather-host {
  background: #000;
  font-family: var(--font-star);
  font-weight: 400;
  color: #fff;
  letter-spacing: 0;
  user-select: none;
  display: flex; align-items: center; justify-content: center;
}
.ws-frame {
  position: relative; aspect-ratio: 4 / 3;
  height: 100%; max-width: 100%; max-height: 100%;
  background: #182a80; overflow: hidden;
  container-type: size;
}
.ws-crt {
  position: absolute; inset: 0;
  filter: blur(0.35px) contrast(1.04) saturate(1.1);
  animation: crtFlicker 4s ease-in-out infinite;
}
@keyframes crtFlicker { 0%,100% {opacity:1} 50% {opacity:.965} }

.ws-head {
  position: absolute; top: 0; left: 0; right: 0; height: 21%;
  background: linear-gradient(180deg, #241a6e 0%, #1a1458 100%);
  padding: 0 3%; display: flex; align-items: center; gap: 2.5%;
}
.ws-logo {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; line-height: 1;
  min-width: 15%; padding: .2em .5em; min-height: 50%; margin-top: 8px;
  background: linear-gradient(180deg, #3a5ad8 0%, #1c2ea0 100%);
  border: 3px solid #e8e8f8; border-radius: 10px;
  text-shadow: var(--crt-shadow);
  font-size: max(7px, 2.2cqw);
  position: relative; z-index: 2;
}
.ws-logo div + div { margin-top: .2em; }
.ws-titles { flex: 1; min-width: 0; line-height: 1.15; }
.ws-titles div {
  color: #f5d90a; text-shadow: var(--crt-shadow);
  font-size: max(14px, 5.2cqw);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-clockbox { text-align: right; flex-shrink: 0; line-height: 1.2; }
.ws-clock { font-size: max(11px, 3.7cqw); text-shadow: var(--crt-shadow); }
.ws-date { font-size: max(10px, 3.4cqw); text-shadow: var(--crt-shadow); }

.ws-body {
  position: absolute; left: 0; right: 0; top: 21%;
  bottom: calc(clamp(24px, 2.4cqw, 34px) + 8px);
  background: linear-gradient(180deg, #96b8ee 0%, #5876d8 40%, #2440a8 78%, #182a80 100%);
  overflow: hidden;
}
.ws-panel-host { height: 100%; }

.ws-alertp {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 0 5%;
}
.ws-alert-sign { font-size: max(22px, 9cqw); line-height: 1; }
.ws-alert-name { color: #f5d90a; font-size: max(14px, 5.4cqw); margin-top: 2%; line-height: 1.15; }
.ws-alert-until { font-size: max(11px, 3.8cqw); margin-top: 2.5%; }
.ws-alert-area { font-size: max(9px, 2.9cqw); margin-top: 2.5%; line-height: 1.25; max-width: 90%; }

.ws-cc { height: 100%; display: flex; align-items: center; justify-content: space-around; padding: 0 4%; }
.ws-cc-col { text-align: center; }
.ws-cc-icon img { width: max(46px, 21cqw); image-rendering: pixelated; margin: 0 auto; display: block; }
.ws-cond { font-size: max(11px, 4cqw); }
.ws-temp { font-size: max(40px, 19cqw); line-height: 1; }
.ws-feels { color: #f5d90a; font-size: max(10px, 3.4cqw); margin-top: 3%; }
.ws-stats {
  font-size: max(10px, 3.3cqw); line-height: 1.9;
  display: grid; grid-template-columns: auto auto; column-gap: .9em;
}
.ws-stats .k { color: #f5d90a; }
.ws-stats .v { text-align: right; }

.ws-periodwrap { height: 100%; display: flex; padding: 2.5% 3%; }
.ws-period {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, #96b8ee 0%, #5876d8 40%, #2440a8 78%, #182a80 100%);
  border: 3px solid #e8e8f8; padding: 2% 3%;
}
.ws-lf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4%; flex-shrink: 0; }
.ws-lf-day { color: #f5d90a; font-size: max(12px, 4.6cqw); }
.ws-lf-temp { display: flex; align-items: baseline; gap: .3em; }
.ws-lf-temp .k { color: #f5d90a; font-size: max(10px, 3.2cqw); }
.ws-lf-temp .v { font-size: max(15px, 6cqw); }
.ws-lf-text {
  flex: 1; min-height: 0; overflow: hidden; margin-top: .35em;
  line-height: 1.35; font-size: max(10px, 3.4cqw);
}

.ws-ef { height: 100%; display: flex; align-items: stretch; gap: 1.5%; padding: 2.5% 3%; }
.ws-ef-day {
  flex: 1; min-width: 0; text-align: center;
  background: linear-gradient(180deg, #96b8ee 0%, #5876d8 40%, #2440a8 78%, #182a80 100%);
  border: 3px solid #e8e8f8; border-radius: 6px;
  padding: 2% 2% 2.5% 2%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) calc(2.3 * max(10px, 3.4cqw)) auto;
  justify-items: center; row-gap: max(2px, .8cqw);
}
.ws-ef-day .d { color: #f5d90a; font-size: max(11px, 4.2cqw); line-height: 1.2; }
.ws-ef-day .i { min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.ws-ef-day .i img { max-width: max(34px, 14cqw); max-height: 100%; image-rendering: pixelated; }
.ws-ef-day .c { font-size: max(10px, 3.4cqw); line-height: 1.15; overflow: hidden; width: 100%; }
.ws-ef-temps { display: flex; align-items: flex-end; justify-content: center; gap: 16%; width: 100%; }
.ws-ef-temps .k { color: #f5d90a; font-size: max(10px, 3.4cqw); }
.ws-ef-temps .v { font-size: max(13px, 6cqw); }

.ws-almanac { height: 100%; display: flex; align-items: center; justify-content: space-around; padding: 0 4%; }
.ws-alm-sun { font-size: max(11px, 3.7cqw); line-height: 2; }
.ws-alm-sun .k { color: #f5d90a; }
.ws-alm-gap { margin-top: 4%; }
.ws-alm-moon { text-align: center; }
.ws-alm-moon img { width: max(52px, 22cqw); image-rendering: pixelated; margin: 0 auto; display: block; }
.ws-alm-moon div { font-size: max(11px, 3.7cqw); margin-top: 4%; text-shadow: var(--crt-shadow); }

.ws-ticker {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(clamp(24px, 2.4cqw, 34px) + 8px);
  background: linear-gradient(180deg, #241a6e 0%, #1a1458 100%);
  border-top: 2px solid #d8d8e8;
  display: flex; align-items: center; overflow: hidden; white-space: nowrap;
}
.ws-ticker-inner {
  display: inline-block; padding-left: 100%; white-space: nowrap;
  font-size: clamp(12px, 2.6cqw, 18px);
  text-shadow: var(--crt-shadow);
  animation: wsTicker 20s linear infinite;
}
@keyframes wsTicker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

.ws-scan {
  position: absolute; inset: 0; z-index: 40; pointer-events: none;
  background-image: repeating-linear-gradient(0deg,
    rgba(0,0,0,.1) 0px, rgba(0,0,0,.1) 1px, transparent 1px, transparent 4px);
}
.ws-vig {
  position: absolute; inset: 0; z-index: 41; pointer-events: none;
  background: radial-gradient(transparent 62%, rgba(0,0,0,.28) 100%);
}

#jazz-host { position: fixed; width: 1px; height: 1px; left: -10px; bottom: -10px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  :root { --chan-w: 104px; }
  #clock-cell { font-size: 13px; }
  /* stack video + info snugly; give every leftover pixel to the guide */
  #top { flex-direction: column; flex: 0 0 auto; }
  #screen { flex: 0 0 auto; aspect-ratio: 16/9; }
  /* the weather feed is 4:3 — give it a taller frame so the type stays readable */
  #tv.ch-weather #screen { aspect-ratio: 4/3; }
  #info { flex: 0 0 auto; padding: 12px 16px 40px; gap: 5px; border-left: none; border-top: 3px solid #000; }
  #guide-toggle { right: 8px; font-size: 10px; padding: 4px 12px 2px; }
  #info-desc { -webkit-line-clamp: 2; }
  /* keep channel names and links inside their boxes */
  .chan-num { font-size: 21px; }
  .chan-name { font-size: 10.5px; line-height: 1.02; letter-spacing: .03em; overflow-wrap: anywhere; }
  .chan-link { font-size: 9px; line-height: 1.05; overflow-wrap: anywhere; }
  .bb-hint { display: none; }
  #bottom-bar { gap: 6px; padding: 0 6px; }
  #btn-scroll, #btn-vod, #btn-site { font-size: 10.5px; padding: 0 8px; letter-spacing: .04em; }
  .bb-buttons { gap: 5px; }
  .bb-buttons button { min-width: 34px; }
  .vod-thumb { flex-basis: 110px; }
  #vod-main { flex-direction: column; }
  #vod-rail { flex: 0 0 auto; flex-direction: row; padding: 14px 16px; gap: 8px; overflow-x: auto; }
  .vod-cat { font-size: 16px; padding: 9px 16px 7px; white-space: nowrap; }
  .vod-cat-live { margin-top: 0; }
}
