:root {
  font-family:
    Arial,
    Helvetica,
    sans-serif;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;

  background: #050505;
  color: white;
}

button {
  font: inherit;
}

.cheezcable {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.top-panel {
  min-height: 150px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 28px 34px;

  background: #090909;
  border: 3px solid #3b3b3b;

  border-radius: 8px 8px 0 0;
}

.top-panel h1 {
  margin: 0;

  font-size: clamp(2rem, 5vw, 4rem);
}

.top-panel p {
  margin: 6px 0 0;

  font-size: 1.1rem;
  opacity: 0.75;
}

.clock {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: bold;

  color: #ffca28;
}

.guide-header,
.channel-row {
  display: grid;

  grid-template-columns:
    80px
    minmax(140px, 0.8fr)
    minmax(240px, 1.5fr)
    minmax(220px, 1.2fr);

  align-items: center;
}

.guide-header {
  min-height: 40px;

  padding: 0 14px;

  background: #222;
  border-left: 3px solid #3b3b3b;
  border-right: 3px solid #3b3b3b;

  font-weight: bold;
  font-size: 0.8rem;

  letter-spacing: 0.08em;
}

.channel-row {
  width: 100%;
  min-height: 90px;

  padding: 0;

  border: 0;
  border-top: 1px solid #444;

  background: #161616;
  color: white;

  text-align: left;
  cursor: pointer;
}

.channel-row:last-child {
  border-bottom: 3px solid #3b3b3b;
}

.channel-row:hover,
.channel-row:focus-visible {
  background: #252525;
}

.channel-row.selected {
  outline: 4px solid #6ca84f;
  outline-offset: -4px;

  background: #292138;
}

.channel-number {
  padding: 18px;

  font-size: 2.2rem;
  font-weight: 900;

  color: #ffca28;

  text-align: center;
}

.channel-name,
.program-now,
.program-next {
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 14px 18px;

  border-left: 1px solid #444;
}

.channel-name {
  font-size: 1.15rem;
  font-weight: bold;
}

.program-now strong {
  font-size: 1.2rem;
}

.program-now small,
.program-next small {
  display: block;

  margin-bottom: 4px;

  opacity: 0.6;
}

.loading,
.guide-error {
  padding: 40px;

  border: 3px solid #3b3b3b;
  border-top: 1px solid #444;

  text-align: center;

  background: #161616;
}

@media (max-width: 760px) {
  .guide-header {
    display: none;
  }

  .channel-row {
    grid-template-columns: 70px 1fr;
  }

  .program-now,
  .program-next {
    grid-column: 2;
  }

  .channel-name,
  .program-now,
  .program-next {
    border-left: 1px solid #444;
  }

  .program-next {
    padding-top: 0;
  }
}

/* Keep shell chrome and the guide outside the provider's playback rectangle. */
[hidden] { display: none !important; }
.cheezcable {
  width: 100%; height: 100dvh; min-height: 420px; margin: 0; padding: 0;
  display: grid; grid-template-rows: auto minmax(200px, 1fr) auto auto;
  background: #080909;
}
.shell-header {
  display: flex; align-items: center; gap: 24px; padding: 14px 24px;
  background: #101211; border-bottom: 1px solid #30362f;
}
.brand { font-size: 1.25rem; font-weight: 900; white-space: nowrap; }
.brand span { color: #ffca28; }
.channel-identity { display: grid; gap: 4px; flex: 1; }
#channel-bug { text-transform: uppercase; letter-spacing: .06em; }
#source-attribution { color: #abb6ac; font-size: .8rem; }
.clock { font-size: 1.15rem; white-space: nowrap; }
#player-surface {
  position: relative; min-width: 200px; min-height: 200px;
  display: grid; place-items: center; background: #000; overflow: hidden;
}
#player-surface iframe { width: 100%; height: 100%; border: 0; display: block; }
.standby { padding: 24px; text-align: center; color: #b9c0b8; }
.standby-mark { display: inline-block; color: #ffca28; font-size: 3rem; font-weight: 900; letter-spacing: -.1em; }
.standby h1 { color: #fff; font-size: clamp(1.25rem, 3vw, 2rem); }
.standby p { font-size: .9rem; }
.shell-controls {
  display: flex; align-items: center; gap: 10px; padding: 10px 24px;
  border-top: 1px solid #30362f; background: #101211;
}
#playback-status { flex: 1; margin: 0; font-size: .85rem; color: #bac4b8; }
.shell-controls button, #remote-panel button {
  border: 1px solid #56634e; border-radius: 6px; padding: 9px 15px;
  color: white; background: #20291b; cursor: pointer; white-space: nowrap;
}
button:focus-visible { outline: 3px solid #ffca28; outline-offset: -3px; }
button:disabled { opacity: .5; cursor: default; }
#guide-overlay { max-height: 42dvh; overflow: auto; background: #101211; border-top: 2px solid #ffca28; }
.guide-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; }
.guide-title h2 { margin: 0; font-size: 1rem; }
.guide-title span { font-size: .75rem; text-transform: uppercase; color: #adb99f; }
.guide-header, .channel-row { grid-template-columns: 80px minmax(100px, .8fr) minmax(140px, 1.5fr) minmax(140px, 1.2fr); }
.guide-header { padding: 0; border: 0; background: #252c21; }
.guide-header span { padding: 0 18px; }
.channel-row { min-height: 78px; }
.channel-row.selected { background: #25301e; }
.channel-number { font-size: 1.8rem; }
.channel-name, .program-now, .program-next { padding: 12px 18px; }
.program-now strong { font-size: 1rem; }
.channel-name { font-size: 1rem; }
@media (max-width: 760px) {
  .shell-header { gap: 12px; padding: 12px; flex-wrap: wrap; }
  .brand { font-size: 1rem; }
  .channel-identity { font-size: .8rem; }
  .clock { font-size: .9rem; }
  .shell-controls { padding: 8px 12px; flex-wrap: wrap; }
  #playback-status { flex-basis: 100%; }
  .channel-row { grid-template-columns: 60px 1fr; }
  .channel-number { grid-row: span 3; padding: 12px; }
  .program-now, .program-next { grid-column: 2; }
  .channel-name, .program-now, .program-next { padding: 8px 12px; }
  #guide-overlay { max-height: 36dvh; }
}

/* On short landscape screens the guide sits beside, never over, the player. */
@media (max-height: 500px) and (min-width: 560px) {
  .cheezcable {
    min-height: 300px;
    grid-template-columns: minmax(200px, 1fr) minmax(250px, 40%);
    grid-template-rows: auto minmax(200px, 1fr) auto;
    grid-template-areas: "header header" "player guide" "controls controls";
  }
  .cheezcable:has(#guide-overlay[hidden]) {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "player" "controls";
  }
  .shell-header { grid-area: header; padding: 8px 12px; }
  #player-surface { grid-area: player; }
  .shell-controls { grid-area: controls; flex-wrap: nowrap; padding: 6px 12px; }
  #playback-status { flex-basis: auto; }
  #guide-overlay { grid-area: guide; max-height: none; min-height: 0; border-left: 1px solid #30362f; }
  .guide-title { padding: 8px 12px; flex-wrap: wrap; gap: 4px; }
  .guide-header { display: none; }
  .channel-row { grid-template-columns: 50px 1fr; }
  .channel-number { grid-row: span 3; padding: 8px; }
  .program-now, .program-next { grid-column: 2; }
  .channel-name, .program-now, .program-next { padding: 6px 10px; }
}

/* Text-only remote; all controls remain outside the video rectangle. */
#channel-entry:empty { display: none; }
#channel-entry { color: #ffca28; font: bold 1rem monospace; }
/* Open remote reserves a right-hand column alongside player and guide. */
.cheezcable:has(#remote-panel:not([hidden])) {
  grid-template-columns: minmax(200px, 1fr) clamp(160px, 28vw, 300px);
  grid-template-rows: auto minmax(200px, 1fr) auto auto;
  grid-template-areas: "header header" "player remote" "controls remote" "guide remote";
}
.cheezcable:has(#remote-panel:not([hidden])) .shell-header { grid-area: header; }
.cheezcable:has(#remote-panel:not([hidden])) #player-surface { grid-area: player; }
.cheezcable:has(#remote-panel:not([hidden])) .shell-controls { grid-area: controls; flex-wrap: wrap; }
.cheezcable:has(#remote-panel:not([hidden])) #guide-overlay { grid-area: guide; max-height: 36dvh; }

#remote-panel {
  grid-area: remote; min-height: 0; min-width: 0; overflow: auto;
  background: #101211;
  padding: 12px; border: 1px dashed #89977d; font-family: monospace;
}
.remote-heading { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 10px; }
.remote-heading span, #remote-panel small { color: #b9c4b2; font-size: .8rem; }
.remote-buttons { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 8px; }
.remote-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.remote-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
#remote-panel button { font-family: monospace; border-radius: 0; min-height: 42px; padding: 7px; white-space: normal; }
#remote-panel button:hover:not(:disabled), #remote-panel button:focus-visible { background: #39452d; color: #ffdc70; }
@media (max-width: 560px) {
  .remote-buttons { grid-template-columns: 1fr; }
  #remote-panel { padding: 6px; }
  #remote-panel button { padding: 5px 2px; font-size: .75rem; overflow-wrap: anywhere; }
}

/* Sketch-based handset: compact round keys, a directional pad, then rockers. */
#remote-panel { padding: 12px; border: 0; border-left: 1px solid #353936; background: #0d0f0e; }
.remote-body {
  max-width: 280px; margin: 0 auto; padding: 16px 12px;
  border: 1px solid #3b3e3c; border-radius: 30px;
  background: linear-gradient(145deg, #292c2a, #191c1a);
  box-shadow: inset 0 1px 0 #50544f, 0 6px 20px #0006;
}
.remote-brand { color: #e8ebe7; font: 900 19px Arial, sans-serif; letter-spacing: .12em; padding: 0 6px 10px; }
.remote-brand > span { color: #ffca28; }
.remote-brand small { font-size: 9px; letter-spacing: .18em; margin-left: 6px; }
.remote-power-row { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.remote-note { color:#9ea69f; font:11px/1.5 Arial, sans-serif; }
#remote-panel button {
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:3px;
  min-width:0; min-height:44px; padding:6px 3px;
  border:1px solid #636861; border-radius:13px;
  color:#f4f6f2; background:linear-gradient(#555b54,#3a403a);
  box-shadow:0 2px 0 #101510; font-family:Arial,sans-serif;
}
#remote-panel button > span { font-size:19px; font-weight:700; line-height:1; }
#remote-panel button > small { color:#d7dcd4; font-size:8px; line-height:1.1; }
#remote-panel button.remote-power { width:52px; height:52px; border-radius:50%; background:#cb393f; border-color:#f16b70; }
#remote-panel button.remote-power > span { font-size:28px; }
.remote-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-bottom:16px; }
#remote-panel .remote-nav button { height:49px; border-radius:50%; }
#remote-panel .remote-nav .remote-small > span { font-size:12px; }
#remote-panel .remote-nav .confirm-key { background:#798174; border-color:#a9b29e; }
#remote-panel .remote-nav .nav-key > span { font-size:24px; }
.remote-rockers { display:grid; grid-template-columns:1fr 1fr; gap:22px; padding:0 16px; margin-bottom:15px; }
.remote-rockers > div { display:grid; gap:4px; text-align:center; }
.remote-rockers > div > span { color:#b8c0b4; font:bold 9px Arial,sans-serif; letter-spacing:.08em; margin-bottom:2px; }
#remote-panel .remote-rockers button { min-height:36px; border-radius:10px; }
#remote-panel .remote-rockers button > small { font-size:7px; }
.remote-numbers { gap:7px; }
#remote-panel .number-key { border-radius:50%; min-height:40px; }
#remote-panel .number-key > small { display:none; }
#remote-panel [data-account] { border-radius:50%; min-height:40px; }
#remote-panel .remote-help { font:10px/1.6 Arial,sans-serif; color:#aeb7a8; text-align:center; margin:12px 0 0; }
#remote-panel button:hover:not(:disabled) { background:#68725d; }
#remote-panel button:focus-visible { outline:3px solid #ffcf40; outline-offset:2px; background:#596b42; box-shadow:0 0 0 5px #ffcf4026; }
#remote-panel button[aria-pressed="true"] { border-color:#bacd98; color:#e7ffc8; }
#remote-panel button:disabled { opacity:.35; box-shadow:none; }
@media (max-width:560px) {
  #remote-panel { padding:5px; }
  .remote-body { padding:12px 6px; border-radius:22px; }
  .remote-nav { gap:4px; }
  .remote-rockers { gap:8px; padding:0 4px; }
  #remote-panel button > small { font-size:7px; }
}

.power-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; background: #090d12;
  background-image: radial-gradient(ellipse at center, #203346 0, #090d12 70%);
  color: #f7e7b9; text-align: center;
}
.power-screen[hidden] { display: none; }
.power-card { display: grid; justify-items: center; gap: 22px; padding: 24px; }
.power-brand { font-size: clamp(30px, 6vw, 68px); font-weight: 900; letter-spacing: -2px; }
.power-brand em { color: #e5ac58; }
.power-card p { color: #bbc8d5; }
.power-card small { color: #a6b6c5; }
#power-on { padding: 18px 36px; border-radius: 40px; font-size: 22px; border: 1px solid #f7d78a; background: #f7d78a; color: #10283d; cursor: pointer; }
#power-on:focus-visible { outline: 3px solid white; outline-offset: 6px; }
.power-screen.warming { pointer-events: none; animation: tube-on 850ms ease-out forwards; }
@keyframes tube-on { 0% { opacity:1; } 35% { opacity: .9; filter: brightness(1.4); } 100% { opacity:0; } }
@media (prefers-reduced-motion: reduce) { .power-screen.warming { animation: none; opacity: 0; } }
.power-screen.warming .power-card { opacity: 0; transition: opacity 150ms; }
.power-screen.warming::after {
  content: ''; position: absolute; left: 10%; right: 10%; top: 50%; height: 2px;
  background: #c4dded; box-shadow: 0 0 18px 4px #7298b9;
  animation: tube-beam 750ms ease-out forwards;
}
@keyframes tube-beam {
  0% { transform: scaleX(.01); opacity: 0; }
  25% { transform: scaleX(.6); opacity: .8; }
  60% { transform: scaleX(1) scaleY(2); opacity: .5; }
  100% { transform: scaleX(1) scaleY(10); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .power-screen.warming::after { display: none; }
  .power-screen.warming .power-card { transition: none; }
}

/* Native cable states: muted diagonal bars versus a locked, torn signal. */
.channel-state {
  position: absolute; inset: 0; isolation: isolate; overflow: hidden;
  display: grid; place-items: center; padding: 16px; text-align: center;
  background: #151a20; color: #f4ecd4; font-family: 'Courier New', monospace;
  contain: layout paint;
}
.signal-art { position: absolute; inset: -12%; z-index: -2; pointer-events: none; }
.channel-state--off-air .signal-art {
  background: repeating-linear-gradient(135deg, #bcbcaf 0 12.5%, #b9af63 12.5% 25%, #6ea7a5 25% 37.5%, #6e9775 37.5% 50%, #987c97 50% 62.5%, #ab7372 62.5% 75%, #5d739a 75% 87.5%, #343b48 87.5% 100%);
}
.channel-state::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(0deg, #0002 0 1px, transparent 1px 4px), radial-gradient(ellipse, transparent 25%, #0007);
}
.signal-card { max-width: 100%; padding: clamp(14px, 3vw, 32px); background: #111923ed; border: 1px solid #ded9bb99; box-shadow: 6px 6px 0 #0004; }
.signal-card h1 { font-size: clamp(1.15rem, 3.5vw, 2.8rem); margin: 12px 0; text-wrap: balance; }
.signal-channel { font-size: clamp(.7rem, 1.4vw, 1rem); letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.signal-detail { font-size: clamp(.75rem, 1.5vw, 1rem); margin: 0; }
.channel-state--reserved .signal-art {
  background: repeating-linear-gradient(0deg, #82837b 0 2px, #303b43 2px 7px, #61675f 7px 9px, #202b39 9px 15px);
  transform: skewX(-12deg); opacity: .65;
  animation: cable-drift 7s linear infinite alternate;
}
.channel-state--reserved .signal-art i {
  position: absolute; inset: 10% -10% 55%;
  /* Abstract silhouettes and displaced chroma suggest a picture behind the lock. */
  background:
    repeating-linear-gradient(0deg, #aaa5 0 1px, transparent 1px 5px, #0b172c88 5px 7px, transparent 7px 11px),
    radial-gradient(ellipse 7% 35% at 62% 33%, #acafa080 0 70%, transparent 74%),
    radial-gradient(ellipse 8% 35% at 66% 33%, #85749780 0 70%, transparent 74%),
    radial-gradient(ellipse 20% 75% at 63% 115%, #161e2a 0 70%, transparent 73%),
    radial-gradient(ellipse 6% 30% at 29% 22%, #b8a99480 0 70%, transparent 74%),
    radial-gradient(ellipse 17% 65% at 30% 103%, #283632 0 70%, transparent 74%),
    linear-gradient(90deg, #27313e 5%, #555e62 22%, #686875 45%, #383c51 65%, #1d2933 90%);
  border-top: 6px solid #c4ba9c55; border-bottom: 10px solid #18182a;
  animation: cable-tear 3.7s steps(9) infinite alternate;
}
.channel-state--reserved .signal-art i:nth-child(2) { inset: 46% -10% 24%; animation-delay: -1.7s; transform: scaleX(-1); }
.channel-state--reserved .signal-art i:nth-child(3) { inset: 78% -10% -10%; animation-delay: -2.8s; }
.channel-state--reserved .signal-card { background: #111821df; border-style: dashed; }
@keyframes cable-drift { to { transform: translateY(5%) skewX(9deg); } }
@keyframes cable-tear { 35% { transform: translateX(12%) skewX(-18deg); } 70% { transform: translateX(-10%) skewX(22deg); } 100% { transform: translateX(5%) skewX(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .channel-state .signal-art, .channel-state .signal-art i { animation: none; }
}
.signal-card button { display: block; margin: 16px auto 0; padding: 10px 14px; min-height: 44px; border: 1px solid #dbd3b3; background: #18232f; color: #f4ecd4; cursor: pointer; font: inherit; font-size: .8rem; }
.signal-paused .signal-art, .signal-paused .signal-art i { animation-play-state: paused; }
