/* ═══════════════════════════════════════════════════════════
   RETRO TV GUIDE — Stylesheet
   Inspired by the classic TV Guide Channel (1988–2004)
═══════════════════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────────────────── */
:root {
    /* Palette */
    --bg-void:       #000011;
    --bg-deep:       #00001e;
    --bg-navy:       #00003a;
    --bg-mid:        #000066;
    --bg-blue:       #0000aa;
    --bg-bright:     #0033cc;
    --bg-selected:   #0044bb;
    --bg-hover:      #002288;
    --ch-num-bg:     #001166;
    --header-bar:    #000088;
    --time-bar:      #000055;
  
    --text-white:    #ffffff;
    --text-yellow:   #ffff44;
    --text-cyan:     #44ddff;
    --text-gray:     #8899bb;
    --text-dim:      #445577;
    --text-red:      #ff3333;
    --text-green:    #00ff88;
    --text-orange:   #ffaa00;
  
    --border-dim:    #002288;
    --border-bright: #0055ff;
    --border-glow:   #0088ff;
  
    --cat-action:   #ff4400;
    --cat-comedy:   #ffaa00;
    --cat-drama:    #aa44ff;
    --cat-movies:   #0088ff;
    --cat-classics: #ff8800;
    --cat-doc:      #00aa44;
    --cat-kids:     #ff44cc;
    --cat-horror:   #cc0000;
    --cat-music:    #00ffaa;
    --cat-general:  #556677;
    --cat-news:     #ff2222;
  
    /* Typography */
    --font-main:    'VT323', monospace;
    --font-accent:  'Orbitron', monospace;
    --font-mono:    'Share Tech Mono', monospace;
  
    /* Sizing */
    --row-h:        52px;
    --ch-col-w:     120px;
    --top-h:        260px;

    /* The time header and every channel row are separate grids, so they must
       share one column definition or the columns drift apart. */
    --sched-cols:   1.05fr 1fr 0.95fr;
    /* Width the listings scrollbar takes, measured by guide.js so the header
       lines up with the rows underneath it. */
    --scrollbar-w:  0px;
  }
  
  /* ── Reset ──────────────────────────────────────────────── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  html, body {
    width: 100%; height: 100%;
    background: var(--bg-void);
    color: var(--text-white);
    font-family: var(--font-main);
    font-size: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    cursor: default;
  }
  
  /* ── CRT Overlay Effects ────────────────────────────────── */
  .crt-scanlines {
    position: fixed; inset: 0; z-index: 9000;
    pointer-events: none;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 10, 0.18) 2px,
      rgba(0, 0, 10, 0.18) 4px
    );
  }
  
  .crt-vignette {
    position: fixed; inset: 0; z-index: 8999;
    pointer-events: none;
    background: radial-gradient(
      ellipse at center,
      transparent 55%,
      rgba(0, 0, 0, 0.55) 100%
    );
  }
  
  /* ── Animations ──────────────────────────────────────────── */
  @keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
  }
  @keyframes blink-text {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
  }
  @keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }
  @keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 6px var(--border-bright), inset 0 0 6px rgba(0,80,255,0.2); }
    50%       { box-shadow: 0 0 18px var(--border-bright), inset 0 0 18px rgba(0,80,255,0.4); }
  }
  @keyframes row-flash {
    0%   { background: var(--bg-selected); }
    50%  { background: var(--bg-bright); }
    100% { background: var(--bg-selected); }
  }
  @keyframes slide-in-right {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
  }
  @keyframes channel-toast-in {
    0%   { transform: scale(0.8) translateY(-20px); opacity: 0; }
    60%  { transform: scale(1.05) translateY(0);    opacity: 1; }
    100% { transform: scale(1)    translateY(0);    opacity: 1; }
  }
  @keyframes toast-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.9) translateY(-10px); }
  }
  @keyframes tv-static {
    0%   { background-position: 0 0; }
    100% { background-position: 100% 100%; }
  }
  
  .blink-dot   { animation: none; }
  .blink-text  { animation: blink-text 1.2s step-end infinite; }
  
  /* ════════════════════════════════════════════════════════════
     GUIDE PAGE LAYOUT
  ════════════════════════════════════════════════════════════ */
  .tv-guide-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    border-left:  2px solid var(--border-dim);
    border-right: 2px solid var(--border-dim);
  }
  
  /* ── Top Bar ──────────────────────────────────────────────── */
  .top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--bg-blue);
    border-bottom: 3px solid var(--border-bright);
    animation: pulse-glow 3s ease-in-out infinite;
  }
  
  .top-bar__logo {
    display: flex; align-items: baseline; gap: 8px;
  }
  .logo-icon { font-size: 1.4rem; }
  .logo-text {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--text-white);
    text-shadow: 0 0 12px var(--border-glow);
  }
  .logo-accent { color: var(--text-cyan); }
  .logo-sub {
    font-family: var(--font-main);
    font-size: 0.75rem;
    color: var(--text-gray);
    letter-spacing: 0.2em;
  }
  
  .top-bar__status {
    display: flex; align-items: center; gap: 6px;
  }
  .live-pulse {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--text-red);
    animation: none;
    box-shadow: 0 0 8px var(--text-red);
  }
  .live-label {
    font-family: var(--font-accent);
    font-size: 0.65rem;
    color: var(--text-red);
    letter-spacing: 0.2em;
    text-shadow: 0 0 8px var(--text-red);
  }
  
  .top-bar__clock {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--text-cyan);
    text-shadow: 0 0 10px var(--text-cyan);
    letter-spacing: 0.12em;
    min-width: 110px;
    text-align: right;
  }
  
  /* ── Stage (info panel + preview) ────────────────────────── */
  .stage {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--bg-deep);
    border-bottom: 3px solid var(--border-bright);
    min-height: var(--top-h);
  }
  
  /* Left info panel */
  .stage__info {
    padding: 18px 20px;
    background: var(--bg-navy);
    border-right: 3px solid var(--border-bright);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
  }
  .stage__info::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
      45deg,
      transparent, transparent 8px,
      rgba(0,50,150,0.06) 8px, rgba(0,50,150,0.06) 9px
    );
    pointer-events: none;
  }
  
  .info-network {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--text-cyan);
    letter-spacing: 0.18em;
    text-shadow: 0 0 10px var(--text-cyan);
    font-weight: 700;
  }
  .info-title {
    font-family: var(--font-main);
    font-size: 1.35rem;
    color: var(--text-yellow);
    text-shadow: 0 0 8px rgba(255,255,68,0.5);
    line-height: 1.2;
    font-style: italic;
    font-weight: bold;
    flex: 1;
  }
  .info-meta {
    display: flex; align-items: center; gap: 10px;
  }
  .info-rating {
    font-family: var(--font-accent);
    font-size: 0.55rem;
    background: var(--text-white);
    color: var(--bg-void);
    padding: 1px 5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    min-width: 24px; text-align: center;
  }
  .info-live-badge {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-red);
    text-shadow: 0 0 8px var(--text-red);
    letter-spacing: 0.1em;
  }
  .info-desc {
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.3;
  }
  .info-chnum {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
  }
  .watch-btn {
    margin-top: auto;
    padding: 10px 16px;
    background: var(--bg-bright);
    border: 2px solid var(--border-glow);
    color: var(--text-white);
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
  }
  .watch-btn:hover:not(:disabled) {
    background: var(--border-glow);
    box-shadow: 0 0 18px var(--border-glow);
  }
  .watch-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-dim);
  }
  
  /* Right: Video preview */
  .stage__preview {
    position: relative;
    background: #000;
  z-index: 9100;
  }
  .preview-frame {
    position: relative;
    width: 100%; height: 100%;
    overflow: hidden;
  }
  .preview-iframe {
    width: 100%; height: 100%;
    border: none;
    display: block;
    pointer-events: none;
  }
  .preview-iframe.hidden { display: none; }
  
  .preview-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-void);
    background-image:
      repeating-linear-gradient(0deg,
        transparent, transparent 3px,
        rgba(0,0,40,0.4) 3px, rgba(0,0,40,0.4) 4px),
      repeating-linear-gradient(90deg,
        transparent, transparent 3px,
        rgba(0,0,40,0.15) 3px, rgba(0,0,40,0.15) 4px);
  }
  .placeholder-tv { text-align: center; }
  .placeholder-icon { font-size: 3rem; margin-bottom: 10px; opacity: 0.3; }
  .placeholder-msg {
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    line-height: 1.6;
    text-align: center;
    animation: blink-text 2s step-end infinite;
  }
  
  /* Channel bug (top-right corner of preview) */
  .channel-bug {
    position: absolute; top: 10px; right: 12px;
    font-family: var(--font-accent);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-white);
    background: rgba(0,0,100,0.75);
    border: 1px solid var(--border-glow);
    padding: 2px 7px;
    letter-spacing: 0.1em;
    text-shadow: 0 0 6px var(--text-cyan);
    opacity: 0.8;
  }
  .live-badge-corner {
    position: absolute; top: 10px; left: 12px;
    font-family: var(--font-accent);
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--text-red);
    background: rgba(0,0,0,0.75);
    border: 1px solid var(--text-red);
    padding: 2px 6px;
    letter-spacing: 0.12em;
    text-shadow: 0 0 8px var(--text-red);
    animation: none;
    display: none; /* shown when channel selected */
  }
  .live-badge-corner.visible { display: block; }
  
  /* ── Time Header Row ─────────────────────────────────────── */
  .time-header-row {
    display: grid;
    grid-template-columns: var(--ch-col-w) 1fr;
    background: var(--header-bar);
    border-bottom: 2px solid var(--border-bright);
  }
  .time-header-now {
    display: flex; align-items: center; justify-content: center;
    padding: 6px 8px;
    background: var(--bg-blue);
    border-right: 2px solid var(--border-bright);
    font-family: var(--font-accent);
    font-size: 0.6rem;
    color: var(--text-cyan);
    letter-spacing: 0.12em;
    text-shadow: 0 0 8px var(--text-cyan);
    font-weight: 700;
  }
  .time-header-slots {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 16px;
  }
  .time-slot {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-white);
    letter-spacing: 0.1em;
    opacity: 0.8;
  }
  .time-slot.right { color: var(--text-gray); font-size: 0.75rem; }
  
  /* ── Channel Grid ─────────────────────────────────────────── */
  .guide-grid-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 300px;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-bright) var(--bg-void);
  }
  .guide-grid-wrap::-webkit-scrollbar { width: 8px; }
  .guide-grid-wrap::-webkit-scrollbar-track { background: var(--bg-void); }
  .guide-grid-wrap::-webkit-scrollbar-thumb {
    background: var(--bg-bright);
    border-radius: 0;
  }
  
  .guide-grid { width: 100%; }
  
  .grid-loading {
    padding: 40px;
    text-align: center;
    font-family: var(--font-main);
    font-size: 1.2rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
  }
  
  /* Each channel row */
  .guide-row {
    display: grid;
    grid-template-columns: var(--ch-col-w) 1fr;
    min-height: var(--row-h);
    border-bottom: 1px solid var(--border-dim);
    cursor: pointer;
    transition: background 0.1s;
    animation: slide-in-right 0.3s ease both;
  }
  .guide-row:nth-child(odd)  { background: var(--bg-deep); }
  .guide-row:nth-child(even) { background: #000025; }
  .guide-row:hover { background: var(--bg-hover); }
  .guide-row.selected {
    background: var(--bg-selected) !important;
    border-left: 4px solid var(--text-cyan);
    animation: row-flash 0.6s ease;
  }
  
  /* Channel number cell */
  .row-ch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    background: var(--ch-num-bg);
    border-right: 2px solid var(--border-bright);
    gap: 2px;
    flex-shrink: 0;
  }
  .row-ch__num {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-white);
    text-shadow: 0 0 8px rgba(255,255,255,0.4);
  }
  .row-ch__name {
    font-family: var(--font-main);
    font-size: 0.7rem;
    color: var(--text-cyan);
    letter-spacing: 0.08em;
    text-align: center;
    line-height: 1.1;
    max-width: 95px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Show info cell */
  .row-show {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    gap: 10px;
    overflow: hidden;
  }
  .row-show__arrow {
    color: var(--text-dim);
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .row-show__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
  }
  .row-show__title {
    font-family: var(--font-main);
    font-size: 1.05rem;
    color: var(--text-yellow);
    text-shadow: 0 0 6px rgba(255,255,68,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .row-show__meta {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
  }
  .row-show__network {
    font-family: var(--font-main);
    font-size: 0.75rem;
    color: var(--text-gray);
    letter-spacing: 0.06em;
  }
  .row-show__badges {
    display: flex; gap: 5px; align-items: center;
  }
  
  /* Category badge */
  .cat-badge {
    font-family: var(--font-accent);
    font-size: 0.42rem;
    font-weight: 700;
    padding: 2px 5px;
    letter-spacing: 0.06em;
    border: 1px solid currentColor;
    border-radius: 1px;
  }
  .cat-ACTION    { color: var(--cat-action);   }
  .cat-COMEDY    { color: var(--cat-comedy);   }
  .cat-DRAMA     { color: var(--cat-drama);    }
  .cat-MOVIES    { color: var(--cat-movies);   }
  .cat-CLASSICS  { color: var(--cat-classics); }
  .cat-DOCUMENTARY { color: var(--cat-doc);   }
  .cat-KIDS      { color: var(--cat-kids);     }
  .cat-HORROR    { color: var(--cat-horror);   }
  .cat-MUSIC     { color: var(--cat-music);    }
  .cat-NEWS      { color: var(--cat-news);     }
  .cat-GENERAL   { color: var(--cat-general);  }
  
  .live-dot {
    font-size: 0.65rem;
    color: var(--text-red);
    animation: none;
  }
  
  /* Right: thumbnail */
  .row-thumb {
    flex-shrink: 0;
    width: 72px; height: 40px;
    object-fit: cover;
    opacity: 0.7;
    border: 1px solid var(--border-dim);
    transition: opacity 0.2s;
  }
  .guide-row:hover .row-thumb   { opacity: 1; }
  .guide-row.selected .row-thumb { opacity: 1; }
  
  /* ── Ticker ───────────────────────────────────────────────── */
  .ticker-bar {
    display: flex;
    align-items: center;
    background: var(--bg-blue);
    border-top: 3px solid var(--border-bright);
    padding: 0 0 0 12px;
    height: 34px;
    overflow: hidden;
    flex-shrink: 0;
  }
  .ticker-label {
    font-family: var(--font-accent);
    font-size: 0.55rem;
    color: var(--text-cyan);
    white-space: nowrap;
    padding-right: 10px;
    border-right: 1px solid var(--border-bright);
    margin-right: 10px;
    letter-spacing: 0.08em;
    font-weight: 700;
  }
  .ticker-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
  }
  .ticker-content {
    display: inline-block;
    white-space: nowrap;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-yellow);
    letter-spacing: 0.06em;
    /* Fallback pace only — guide.js sets the duration from the measured width
       so the crawl speed stays constant no matter how many channels there are. */
    animation: ticker-scroll 240s linear infinite;
    /* content is duplicated in JS so it loops seamlessly */
  }
  
  /* ════════════════════════════════════════════════════════════
     PLAYER PAGE
  ════════════════════════════════════════════════════════════ */
  .player-body {
    margin: 0; padding: 0;
    background: #000;
    overflow: hidden;
    height: 100vh; width: 100vw;
  }
  
  .player-wrap {
    position: relative;
    width: 100vw; height: 100vh;
    background: #000;
    display: grid;
    grid-template-rows: 1fr auto;
  }

  .player-stage {
    position: relative;
    min-height: 0;
    overflow: hidden;
  }
  
  .player-screen {
    position: absolute; inset: 0;
  z-index: 9100;
  }
  .player-screen iframe,
  #yt-player {
    width: 100% !important;
    height: 100% !important;
    display: block;
  }

  #yt-player iframe {
    pointer-events: none;
  }
  
  /* ── HUD Overlay ─────────────────────────────────────────── */
  .player-hud {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 9200;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
  }
  
  .hud-top-left, .hud-top-right {
    pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
  }
  .hud-top-left {
    padding: 12px 16px;
    background: linear-gradient(to bottom, rgba(0,0,20,0.75), transparent);
    width: 100%;
    justify-content: flex-start;
  }
  .hud-top-right {
    position: absolute; top: 0; right: 0;
    padding: 14px 18px;
    flex-direction: column; align-items: flex-end;
    gap: 4px;
  }
  
  .hud-btn {
    font-family: var(--font-accent);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-white);
    background: rgba(0,0,80,0.8);
    border: 1px solid var(--border-glow);
    padding: 6px 12px;
    letter-spacing: 0.1em;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s;
  }
  .hud-btn:hover { background: var(--bg-bright); }
  .back-btn { letter-spacing: 0.12em; }
  
  .hud-channel-badge {
    font-family: var(--font-accent);
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--text-white);
    background: rgba(0,0,100,0.8);
    border: 1px solid var(--border-glow);
    padding: 5px 10px;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px var(--text-cyan);
  }
  
  .hud-live {
    font-family: var(--font-accent);
    font-size: 0.55rem;
    color: var(--text-red);
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--text-red);
    padding: 3px 7px;
    letter-spacing: 0.15em;
    text-shadow: 0 0 8px var(--text-red);
    animation: none;
  }
  .hud-clock {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-cyan);
    text-shadow: 0 0 8px var(--text-cyan);
  }
  
  /* Center toast */
  .hud-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.4s;
  }
  .channel-toast {
    background: rgba(0, 0, 80, 0.9);
    border: 2px solid var(--border-bright);
    padding: 16px 28px;
    text-align: center;
    box-shadow: 0 0 40px rgba(0,80,255,0.5);
    animation: channel-toast-in 0.3s ease both;
  }
  .toast-ch {
    font-family: var(--font-accent);
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-white);
    text-shadow: 0 0 20px var(--text-cyan);
    letter-spacing: 0.2em;
  }
  .toast-name {
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-cyan);
    letter-spacing: 0.1em;
    margin-top: 4px;
  }
  
  /* Bottom show info */
  .hud-bottom {
    padding: 12px 16px 14px;
    background: linear-gradient(to top, rgba(0,0,20,0.85), transparent);
    pointer-events: auto;
  }
  .hud-show-info { margin-bottom: 8px; }
  .hud-network {
    font-family: var(--font-accent);
    font-size: 0.6rem;
    color: var(--text-cyan);
    letter-spacing: 0.18em;
    text-shadow: 0 0 8px var(--text-cyan);
    margin-bottom: 2px;
    font-weight: 700;
  }
  .hud-title {
    font-family: var(--font-main);
    font-size: 1.5rem;
    color: var(--text-yellow);
    text-shadow: 0 0 10px rgba(255,255,68,0.5);
    font-style: italic;
    font-weight: bold;
  }
  .hud-desc {
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 2px;
    max-width: 600px;
  }
  .hud-category {
    display: inline-block;
    margin-top: 4px;
    font-family: var(--font-accent);
    font-size: 0.45rem;
    font-weight: 700;
    padding: 2px 7px;
    border: 1px solid;
    letter-spacing: 0.08em;
  }
  .hud-nav-hints {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
  }
  .hint-sep { color: var(--border-dim); }
  
  /* Channel surf buttons */
  .surf-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 52px; height: 80px;
    background: rgba(0,0,60,0.7);
    border: 1px solid var(--border-bright);
    color: var(--text-white);
    font-size: 1.4rem;
    cursor: pointer;
    pointer-events: auto;
    z-index: 9201;
    transition: background 0.15s, box-shadow 0.15s;
    display: flex; align-items: center; justify-content: center;
  }
  .surf-btn:hover {
    background: var(--bg-bright);
    box-shadow: 0 0 20px var(--border-glow);
  }
  .surf-prev { left: 0; border-left: none; }
  .surf-next { right: 0; border-right: none; }
  
  /* ── Utility ──────────────────────────────────────────────── */
  .hidden { display: none !important; }
  
  /* ── Responsive ───────────────────────────────────────────── */
  @media (max-width: 768px) {
    :root {
      --ch-col-w: 80px;
      --top-h:    auto;
    }
    .stage { grid-template-columns: 1fr; }
    .stage__preview { min-height: 200px; }
    .logo-sub { display: none; }
    .row-thumb { display: none; }
    .hud-desc { display: none; }
    .surf-btn { width: 40px; height: 60px; font-size: 1rem; }
  }

/* ═══════════════════════════════════════════════════════════
   1980s TV Guide Channel Skin
   Final overrides for the guide screen, tuned to the reference image.
═══════════════════════════════════════════════════════════ */
body {
  background:
    radial-gradient(circle at 50% 15%, rgba(25, 45, 120, 0.55), transparent 38%),
    linear-gradient(180deg, #020315 0%, #01010a 55%, #000 100%);
  color: #fff;
  font-family: var(--font-main);
  text-shadow: 1px 1px 0 #000, 0 0 4px rgba(255,255,255,0.25);
}

.tv-guide-wrap {
  /* 100vw includes the scrollbar, which pushes long pages sideways */
  width: 100%;
  min-height: 100vh;
  max-width: none;
  margin: 0;
  border: 5px solid #06115c;
  box-shadow:
    0 0 0 3px #5d7cff,
    0 0 60px rgba(0, 20, 120, 0.8),
    inset 0 0 60px rgba(0,0,0,0.5);
  background: #050922;
}

.top-bar {
  /* min-height, not height: a fixed box clips the logo on small screens */
  min-height: 34px;
  height: auto;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 3px 12px;
  background: linear-gradient(180deg, #1a35c5 0%, #071678 58%, #03083b 100%);
  border-bottom: 3px solid #c7d5ff;
  animation: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35);
}

.logo-text,
.top-bar__clock,
.live-label {
  font-family: var(--font-main);
  letter-spacing: 0.08em;
}

.logo-text {
  font-size: 1.45rem;
  color: #f8fbff;
  white-space: nowrap;
}

.logo-accent,
.top-bar__clock {
  color: #fff34d;
}

.live-label {
  color: #fff;
  font-size: 1rem;
}

.stage {
  grid-template-columns: 38% 62%;
  min-height: 255px;
  background: #050916;
  border-bottom: 5px solid #dfe9ff;
}

.stage__info {
  padding: 18px 22px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.55), transparent 62%),
    linear-gradient(180deg, #162caa 0%, #07145c 55%, #03082d 100%);
  border-right: 5px solid #101946;
  gap: 6px;
}

.stage__info::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08), transparent 12%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(0,0,0,0.14) 5px 7px);
}

.info-network {
  color: #fff;
  font-size: 1.25rem;
  font-family: var(--font-main);
  letter-spacing: 0.03em;
  text-shadow: 2px 2px 0 #000;
}

.info-title {
  color: #fff34d;
  font-size: 2rem;
  line-height: 0.95;
  font-style: normal;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000, 0 0 5px rgba(255,243,77,0.45);
}

.info-desc {
  color: #e4e9ff;
  font-size: 1.2rem;
  line-height: 1.05;
}

.info-live-badge,
.info-chnum {
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.info-rating {
  background: #f7ecbd;
  border: 2px solid #221a00;
  color: #161100;
  min-width: 42px;
}

.watch-btn {
  background: linear-gradient(180deg, #f4f0cd, #b9a85e);
  border: 3px outset #fff7aa;
  color: #091350;
  font-family: var(--font-main);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-shadow: none;
}

.stage__preview,
.preview-placeholder {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08), transparent 35%),
    radial-gradient(circle at 55% 40%, rgba(180,190,220,0.28), transparent 30%),
    linear-gradient(135deg, #0d0d13, #242736 48%, #08090e);
}

.preview-frame {
  border-left: 3px solid #000;
  background-position: center;
  background-size: cover;
}

.preview-iframe {
  filter: saturate(0.88) contrast(1.05);
}

.placeholder-icon {
  display: none;
}

.placeholder-msg {
  color: #e8eaff;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-shadow: 2px 2px 0 #000;
}

.channel-bug {
  top: auto;
  right: auto;
  left: 14px;
  bottom: 12px;
  background: rgba(0,0,0,0.72);
  border: 2px solid rgba(255,255,255,0.65);
  font-family: var(--font-main);
  font-size: 1rem;
}

.time-header-row {
  grid-template-columns: 112px 1fr;
  background: #081060;
  border-top: 2px solid #7f97ff;
  border-bottom: 4px solid #dbe4ff;
  /* The rows below sit inside a scroll container; match the space its
     scrollbar takes so the columns stay flush with the times. */
  padding-right: var(--scrollbar-w);
}

.time-header-now,
.time-header-slots {
  padding: 0;
}

.time-header-now {
  min-height: 42px;
  background: linear-gradient(180deg, #2441d1, #07136e);
  border-right: 4px solid #dbe4ff;
  color: #fff34d;
  font-size: 1.55rem;
  font-family: var(--font-main);
}

.time-header-slots {
  display: grid;
  grid-template-columns: var(--sched-cols);
}

.time-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-right: 4px solid #dbe4ff;
  background: linear-gradient(180deg, #2540cf, #07146f);
  color: #fff34d;
  font-family: var(--font-main);
  font-size: 1.55rem;
  letter-spacing: 0.03em;
  text-shadow: 2px 2px 0 #000;
}

.guide-grid-wrap {
  min-height: 330px;
  background: #050509;
  /* Always reserve the gutter, so the header offset never changes as the
     lineup grows past one screen. */
  scrollbar-gutter: stable;
}

.guide-row {
  grid-template-columns: 112px 1fr;
  min-height: 74px;
  border-bottom: 4px solid #e1e8ff;
  animation: none;
}

.guide-row:nth-child(odd),
.guide-row:nth-child(even) {
  background: transparent;
}

.guide-row.selected {
  border-left: none;
  background: transparent !important;
  animation: none;
}

.row-ch {
  background: linear-gradient(180deg, #1e248a, #070b41);
  border-right: 4px solid #e1e8ff;
  color: #fff34d;
  gap: 0;
}

.row-ch__num {
  color: #fff34d;
  font-size: 1.75rem;
  line-height: 0.9;
  font-family: var(--font-main);
}

.row-ch__name {
  color: #fff34d;
  font-size: 1.15rem;
  line-height: 0.9;
  max-width: 92px;
}

.row-schedule {
  display: grid;
  grid-template-columns: var(--sched-cols);
}

.program-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 6px 16px 5px 20px;
  border-right: 4px solid #e1e8ff;
  background: linear-gradient(180deg, #91424b 0%, #64272d 58%, #42151b 100%);
  overflow: hidden;
}

.guide-row:nth-child(3n + 1) .program-cell {
  background: linear-gradient(180deg, #2aa8c7 0%, #157c9e 55%, #0a536e 100%);
}

.guide-row:nth-child(3n + 2) .program-cell {
  background: linear-gradient(180deg, #94474e 0%, #68272e 55%, #43151c 100%);
}

.guide-row:nth-child(3n + 3) .program-cell {
  background: linear-gradient(180deg, #c68059 0%, #8a4b2f 55%, #5c2a19 100%);
}

/* The highlight rides on the cell edge, where it merges with the white grid
   lines. Insetting it any further draws a second box inside the first. */
.guide-row.selected .program-cell--now {
  box-shadow: inset 0 0 0 4px #fff;
}

.program-title {
  color: #fff;
  font-size: 1.6rem;
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 2px 2px 0 #000;
}

.program-desc,
.program-meta {
  color: #f8e7d0;
  font-size: 0.95rem;
  line-height: 1;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-show__arrow {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 1.1rem;
  text-shadow: 2px 2px 0 #000;
}

.row-show__arrow--right {
  left: auto;
  right: 5px;
}

.cat-badge {
  background: #f7ecbd;
  color: #111 !important;
  border: 2px solid rgba(0,0,0,0.7);
  font-family: var(--font-main);
  font-size: 0.85rem;
  line-height: 0.85;
  padding: 1px 5px;
}

.live-dot {
  color: #fff34d;
  font-size: 0.95rem;
}

.ticker-bar {
  height: 42px;
  background: linear-gradient(180deg, #07156e, #030936);
  border-top: 5px solid #dbe4ff;
}

.ticker-label,
.ticker-content {
  font-family: var(--font-main);
  font-size: 1.15rem;
}

.ticker-label {
  color: #fff;
}

.ticker-content {
  color: #fff34d;
}

/* ── Tablet: drop the third listings column ─────────────── */
@media (max-width: 1024px) {
  :root { --sched-cols: 1.05fr 1fr; }

  .stage { grid-template-columns: 300px 1fr; }
  .time-slot:nth-child(3),
  .program-cell:nth-child(3) { display: none; }
  .program-title { font-size: 1.45rem; }
  .info-title { font-size: 1.6rem; }
}

/* ── Phone: one column, and let the whole page scroll ───── */
@media (max-width: 768px) {
  :root { --sched-cols: 1fr; }

  .tv-guide-wrap { width: 100%; min-height: 0; border-width: 2px; }
  .stage { grid-template-columns: 1fr; }
  .stage__preview { min-height: 210px; }
  .stage__info { padding: 12px 14px; }

  .time-header-row,
  .guide-row { grid-template-columns: 76px 1fr; }
  .time-slot:nth-child(n + 2),
  .program-cell:nth-child(n + 2) { display: none; }
  .program-title { font-size: 1.35rem; }

  /* Nested scrolling inside a 100vh shell leaves a cramped window on a phone,
     so the listings grow and the page itself scrolls instead. */
  .guide-grid-wrap {
    overflow: visible;
    min-height: 0;
    scrollbar-gutter: auto;
  }

  /* With the page scrolling, keep the times pinned over the listings */
  .time-header-row {
    position: sticky;
    top: 0;
    z-index: 60;
    padding-right: 0;
  }
}

/* ── Narrow phone: stop the top bar from clipping ────────── */
@media (max-width: 600px) {
  .top-bar {
    gap: 8px;
    padding: 3px 10px;
  }
  .logo-text { font-size: 1.15rem; }
  .top-bar__clock { font-size: 1.05rem; min-width: 0; }
  .live-label { display: none; }

  .time-header-row,
  .guide-row { grid-template-columns: 62px 1fr; }
  .row-ch__num { font-size: 1.4rem; }
  .row-ch__name { font-size: 0.8rem; }
  .program-cell { padding: 5px 10px 4px 12px; }
  .program-title { font-size: 1.2rem; }
  .info-title { font-size: 1.35rem; }
  .band-row { letter-spacing: 0.1em; }
  .band-row__range { font-size: 0.85rem; }
  .watch-btn { padding: 8px 12px; }
}

/* ── Very narrow phones (320–380px) ─────────────────────── */
@media (max-width: 380px) {
  .top-bar { padding: 3px 8px; }
  .logo-text { font-size: 1rem; letter-spacing: 0.1em; }
  .top-bar__clock { font-size: 0.95rem; }
}

/* ═══════════════════════════════════════════════════════════
   SPONSOR SLATES — guide cells, never over the video
═══════════════════════════════════════════════════════════ */
.ad-slot { display: block; }
.ad-slot:empty,
.ad-slot.hidden { display: none; }

.ad-slot--guide {
  border-bottom: 5px solid #dbe4ff;
  background: #050509;
}

.ad-slate {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2441d1 0%, #0a1470 55%, #050a3a 100%);
  overflow: hidden;
}

.ad-slate--teal   { background: linear-gradient(180deg, #2aa8c7 0%, #157c9e 55%, #0a536e 100%); }
.ad-slate--maroon { background: linear-gradient(180deg, #94474e 0%, #68272e 55%, #43151c 100%); }
.ad-slate--amber  { background: linear-gradient(180deg, #c68059 0%, #8a4b2f 55%, #5c2a19 100%); }
.ad-slate--blue   { background: linear-gradient(180deg, #2441d1 0%, #0a1470 55%, #050a3a 100%); }

.ad-slate__rail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1px 12px 2px;
  background: linear-gradient(180deg, #101b6b, #05082f);
  border-bottom: 3px solid #dbe4ff;
}

.ad-slate__label {
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: #fff34d;
  letter-spacing: 0.22em;
  text-shadow: 2px 2px 0 #000;
}

.ad-slate__disclosure {
  margin-left: auto;
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: #cdd7ff;
  letter-spacing: 0.12em;
}

.ad-slate__rail:not(:has(.ad-slate__disclosure))::after {
  content: '● SPONSOR MESSAGE';
  margin-left: auto;
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: #cdd7ff;
  letter-spacing: 0.14em;
}

.ad-slate__body {
  display: grid;
  grid-template-columns: 232px 1fr;
  align-items: stretch;
  gap: 16px;
  padding: 10px 18px 12px;
  color: inherit;
  text-decoration: none;
}

.ad-slate--text .ad-slate__body { grid-template-columns: 1fr; }
.ad-slate__body:hover .ad-slate__cta { background: #fff7aa; color: #091350; }

.ad-slate__media {
  position: relative;
  background: #000;
  border: 3px solid #e1e8ff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slate__img,
.ad-slate__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-slate__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.ad-slate__tagline {
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: #cdd7ff;
  letter-spacing: 0.16em;
}

.ad-slate__sponsor {
  font-family: var(--font-main);
  font-size: 1.45rem;
  color: #fff34d;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
}

.ad-slate__headline {
  font-family: var(--font-main);
  font-size: 1.75rem;
  line-height: 0.92;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
}

.ad-slate__subhead {
  font-family: var(--font-main);
  font-size: 1.1rem;
  color: #f8e7d0;
}

.ad-slate__cta {
  align-self: flex-start;
  margin-top: 6px;
  padding: 1px 10px 2px;
  background: linear-gradient(180deg, #f4f0cd, #b9a85e);
  border: 3px outset #fff7aa;
  color: #091350;
  font-family: var(--font-main);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.ad-slate__close {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 24px;
  height: 22px;
  background: rgba(0,0,0,0.55);
  border: 2px solid #cdd7ff;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 2;
}

.ad-slot--rail {
  position: relative;
  border-top: 5px solid #dbe4ff;
  background: #050509;
  max-height: 30vh;
}

.ad-slot--rail .ad-slate__body {
  grid-template-columns: 200px 1fr;
  min-height: 84px;
  max-height: 22vh;
}

.ad-slot--rail .ad-slate__headline { font-size: 1.5rem; }

@media (max-width: 768px) {
  .ad-slate__body,
  .ad-slot--rail .ad-slate__body { grid-template-columns: 104px 1fr; }
  .ad-slate__subhead { display: none; }
  .ad-slate__disclosure { display: none; }
}

@media (max-height: 460px) {
  .ad-slot--rail { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   CHANNEL BANDS, LISTINGS DETAIL, NUMERIC TUNE-IN
═══════════════════════════════════════════════════════════ */
.band-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px 3px;
  background: linear-gradient(180deg, #101b6b, #05082f);
  border-top: 3px solid #4864e0;
  border-bottom: 2px solid #02051c;
  font-family: var(--font-main);
  letter-spacing: 0.2em;
}

.band-row__name {
  color: #fff34d;
  font-size: 1.05rem;
  text-shadow: 2px 2px 0 #000;
}

.band-row__range {
  margin-left: auto;
  color: #9fc4ff;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.band-row__link {
  font-family: var(--font-main);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text-cyan);
  text-decoration: none;
  padding: 0 2px;
}

.band-row__link:hover { color: #fff; text-decoration: underline; }

.program-rating {
  padding: 0 4px;
  border: 2px solid #4864e0;
  color: #cdd7ff;
  font-family: var(--font-main);
  font-size: 0.8rem;
  line-height: 1.1;
  letter-spacing: 0.06em;
}

.time-slot--now {
  background: #0a1550;
  color: #fff34d;
}

.tune-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 26px 14px;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(3, 8, 40, 0.92);
  border: 4px solid #dbe4ff;
  box-shadow: 0 0 40px rgba(0, 40, 200, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.tune-overlay.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tune-overlay__ch {
  font-family: var(--font-main);
  font-size: 3.2rem;
  line-height: 1;
  color: #fff34d;
  letter-spacing: 0.1em;
  text-shadow: 3px 3px 0 #000;
}

.tune-overlay__note {
  font-family: var(--font-main);
  font-size: 1.1rem;
  color: #ff8f8f;
  letter-spacing: 0.18em;
}

/* ═══════════════════════════════════════════════════════════
   GUIDE FOOTER LINKS
═══════════════════════════════════════════════════════════ */
.guide-legal {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px 5px;
  background: #03071f;
  border-top: 3px solid #16276f;
  font-family: var(--font-main);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.guide-legal a {
  color: #9fc4ff;
  text-decoration: none;
}

.guide-legal a:hover { color: #fff34d; }

.guide-legal__sep { color: #2a4bd0; font-size: 0.65rem; }

.guide-legal__note {
  margin-left: auto;
  color: #556699;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

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

/* ═══════════════════════════════════════════════════════════
   AUDIENCE BADGES — how busy a channel is
═══════════════════════════════════════════════════════════ */
.top-badge {
  font-family: var(--font-accent);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  color: #1a1000;
  background: #fff34d;
  border: 1px solid #6b5a00;
}

.watching-count {
  font-family: var(--font-main);
  font-size: 0.9rem;
  line-height: 1;
  color: #d7e2ff;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 0 #000;
}

.hud-viewers {
  font-family: var(--font-accent);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #d7e2ff;
  background: rgba(0, 0, 60, 0.7);
  border: 1px solid var(--border-dim);
  padding: 3px 7px;
}

/* ═══════════════════════════════════════════════════════════
   BAND PAGES + CAMPAIGN REPORT
═══════════════════════════════════════════════════════════ */
.band-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.band-chip {
  font-family: var(--font-accent);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 7px 11px;
  color: #cfe0ff;
  background: rgba(8, 16, 96, 0.85);
  border: 1px solid var(--border-dim);
  text-decoration: none;
}

.band-chip:hover { background: var(--bg-bright); color: #fff; }

.band-chip--on {
  color: #1a1000;
  background: #fff34d;
  border-color: #fff34d;
}

.band-table th[scope='row'] { white-space: nowrap; }

.band-now,
.band-slot {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: var(--text-cyan);
  margin-top: 4px;
}

.band-slot { margin: 0 0 3px; }

.report-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 26px;
}

.report-stat {
  padding: 14px 16px;
  background: rgba(8, 16, 96, 0.75);
  border: 2px solid var(--border-dim);
}

.report-stat__num {
  font-family: var(--font-mono);
  font-size: 2rem;
  line-height: 1;
  color: #fff34d;
  text-shadow: 0 0 12px rgba(255, 243, 77, 0.4);
}

.report-stat__label {
  margin-top: 6px;
  font-family: var(--font-accent);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: var(--text-gray);
}

.report-table td { font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════
   PLAYER ON PHONES AND TABLETS
═══════════════════════════════════════════════════════════ */
/* Mobile browsers count the address bar in 100vh, which pushes the sponsor rail
   off screen and crops the picture. dvh tracks the space actually visible. */
@supports (height: 100dvh) {
  .player-body,
  .player-wrap { height: 100dvh; }
}

.player-body,
.player-wrap { width: 100%; }

.sound-btn {
  background: rgba(120, 8, 8, 0.9);
  border-color: var(--text-yellow);
  color: var(--text-yellow);
  text-shadow: 0 0 8px rgba(255, 243, 77, 0.6);
}

@media (max-width: 1024px) {
  .hud-desc { display: none; }
  .hud-title { font-size: 1.3rem; }
}

@media (max-width: 768px) {
  /* Keyboard hints mean nothing on a touch screen */
  .hud-nav-hints { display: none; }

  .hud-top-left  { padding: 8px 10px; }
  .hud-top-right { padding: 8px 10px; gap: 6px; }
  .hud-bottom    { padding: 8px 10px 10px; }
  .hud-title     { font-size: 1.15rem; }
  .hud-clock     { display: none; }

  /* Comfortable tap targets */
  .hud-btn { padding: 9px 14px; font-size: 0.66rem; }
  .surf-btn { width: 46px; height: 72px; }
}

/* A touch device with no Fullscreen API still gets a maximised picture. */
body.pseudo-fullscreen {
  overflow: hidden;
}

body.pseudo-fullscreen .player-wrap {
  position: fixed;
  inset: 0;
  z-index: 9400;
  grid-template-rows: 1fr;
}

body.pseudo-fullscreen .ad-slot--rail,
body.pseudo-fullscreen .hud-nav-hints,
body.pseudo-fullscreen .hud-show-info { display: none; }

/* ═══════════════════════════════════════════════════════════
   STATIC PAGES — rate card, privacy, terms, off-air
═══════════════════════════════════════════════════════════ */
.static-page .page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Background lives here, not on the content column, or a wide monitor shows
     bare space either side of the text. */
  background:
    radial-gradient(circle at 50% 0%, rgba(25, 45, 120, 0.45), transparent 55%),
    linear-gradient(180deg, #061040 0%, #04092a 60%, #02040f 100%);
}

.static-page .top-bar__logo .logo-text {
  text-decoration: none;
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding: 26px clamp(18px, 4vw, 48px) 46px;
}

.page-main--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: none;
  gap: 14px;
}

.page-title {
  font-family: var(--font-main);
  font-size: 2.4rem;
  line-height: 0.95;
  color: #fff34d;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 12px;
}

.page-h2 {
  font-family: var(--font-main);
  font-size: 1.5rem;
  color: #9fc4ff;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
  margin: 26px 0 8px;
  padding-bottom: 3px;
  border-bottom: 3px solid #16276f;
}

.page-lede,
.page-main p {
  font-family: var(--font-main);
  font-size: 1.2rem;
  line-height: 1.25;
  color: #e6ecff;
  max-width: 74ch;
  margin-bottom: 10px;
}

.page-lede { color: #fff; }

.page-list {
  list-style: none;
  max-width: 74ch;
  margin: 6px 0 12px;
}

.page-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 5px;
  font-size: 1.15rem;
  line-height: 1.2;
  color: #e6ecff;
}

.page-list li::before {
  content: '●';
  position: absolute;
  left: 2px;
  color: #fff34d;
  font-size: 0.85rem;
}

.page-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 10px 0 4px;
}

.page-card {
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, #14268f 0%, #071048 60%, #04081f 100%);
  border: 3px solid #4864e0;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.22);
}

.page-card__slug {
  display: inline-block;
  margin-bottom: 6px;
  padding: 0 8px 2px;
  background: #fff34d;
  color: #091350;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

.page-card p,
.page-card .page-list li { font-size: 1.1rem; }

.page-table {
  width: 100%;
  max-width: 900px;
  border-collapse: collapse;
  margin: 6px 0 10px;
  font-size: 1.1rem;
}

.page-table th,
.page-table td {
  padding: 5px 12px;
  text-align: left;
  vertical-align: top;
  border: 2px solid #16276f;
  line-height: 1.2;
}

.page-table th {
  width: 190px;
  background: #0a1550;
  color: #fff34d;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: normal;
}

.page-table td { background: rgba(4, 10, 45, 0.7); color: #e6ecff; }

.page-kbd {
  padding: 0 5px;
  background: #0a1550;
  border: 2px solid #4864e0;
  color: #9fe8ff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.page-link,
.page-footer a {
  color: #9fe8ff;
  text-decoration: none;
  border-bottom: 2px solid #2a4bd0;
}

.page-link:hover,
.page-footer a:hover {
  color: #fff34d;
  border-bottom-color: #fff34d;
}

.page-note {
  margin-top: 14px;
  font-size: 1.05rem !important;
  color: #8fa2d8 !important;
}

.page-dim { color: #8fa2d8; }

.page-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: linear-gradient(180deg, #07156e, #030936);
  border-top: 5px solid #dbe4ff;
  font-family: var(--font-main);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.page-footer__sep   { color: #fff34d; font-size: 0.7rem; }
.page-footer__spacer { flex: 1; }
.page-footer__dim   { color: #8fa2d8; }

/* ── Off-air (404) ──────────────────────────────────────── */
.offair-bars {
  display: flex;
  width: min(560px, 80vw);
  height: 130px;
  border: 4px solid #dbe4ff;
  overflow: hidden;
}

.offair-bars span { flex: 1; }
.offair-bars span:nth-child(1) { background: #c0c0c0; }
.offair-bars span:nth-child(2) { background: #c0c000; }
.offair-bars span:nth-child(3) { background: #00c0c0; }
.offair-bars span:nth-child(4) { background: #00c000; }
.offair-bars span:nth-child(5) { background: #c000c0; }
.offair-bars span:nth-child(6) { background: #c00000; }
.offair-bars span:nth-child(7) { background: #0000c0; }

.offair-code {
  font-family: var(--font-main);
  font-size: 4.5rem;
  line-height: 1;
  color: #fff34d;
  letter-spacing: 0.1em;
  text-shadow: 4px 4px 0 #000;
  animation: blink-text 2.2s steps(1) infinite;
}

.offair-btn {
  display: inline-block;
  margin-top: 6px;
  text-decoration: none;
}

@media (max-width: 768px) {
  .page-main { padding: 18px 16px 30px; }
  .page-title { font-size: 1.9rem; }
  .page-table th { width: auto; }
  .page-table,
  .page-table tbody,
  .page-table tr,
  .page-table th,
  .page-table td { display: block; width: 100%; }
  .page-table tr { margin-bottom: 8px; }
  .page-footer { flex-wrap: wrap; }
  .page-footer__spacer { display: none; }
}