/* ─────────────────────────────────────────────────────────────────────────
   FHTV | Live Surfing — styles.css
   Default theme: cyberpunk   /   Alt theme: pc98 (toggled via data-theme)
   ───────────────────────────────────────────────────────────────────────── */

/* ── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg:           #02070b;
  --panel:        rgba(2, 15, 22, 0.86);
  --panel-strong: rgba(3, 20, 30, 0.94);
  --line:         rgba(36, 201, 255, 0.48);
  --line-soft:    rgba(36, 201, 255, 0.2);
  --cyan:         #3bdcff;
  --cyan-soft:    #80ecff;
  --blue:         #1c8ac8;
  --green:        #43f09d;
  --red:          #ff3b2f;
  --orange:       #ff8e3d;
  --muted:        #7aaec2;
  --text:         #d6f5ff;
  --dim:          #75a9ba;
  --shadow:       0 0 26px rgba(19, 191, 246, 0.13);
  --mono:         "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius:       4px;
  --tile-radius:  4px;
}

/* ── PC-98 THEME OVERRIDES ─────────────────────────────────────────────── */
/*
   Palette reference: phosphor CRT amber + forest green.
   Think NEC PC-98 monitor glow — warm, desaturated, never harsh.
*/
[data-theme="pc98"] {
  --bg:           #06040a;
  --panel:        rgba(8, 5, 2, 0.97);
  --panel-strong: rgba(12, 8, 3, 0.99);
  --line:         rgba(168, 112, 20, 0.7);
  --line-soft:    rgba(168, 112, 20, 0.28);
  --cyan:         #AA7700;   /* muted amber — primary accent */
  --cyan-soft:    #C99030;   /* lighter amber for hover / soft text */
  --blue:         #2A5E2A;   /* dark forest green */
  --green:        #4AAA4A;   /* medium phosphor green */
  --red:          #AA2200;   /* brick red, not neon */
  --orange:       #AA5500;   /* burnt amber-orange */
  --muted:        #6B5530;   /* muted warm brown */
  --text:         #C8B890;   /* warm cream — easy on the eyes */
  --dim:          #4A3820;   /* dark amber for secondary labels */
  --shadow:       none;
  --radius:       0px;
  --tile-radius:  0px;
}

/* ── RESET & BASE ──────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 132, 177, 0.18), transparent 30rem),
    linear-gradient(180deg, #041018 0%, #010407 58%, #000 100%);
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: 0;
  transition: background 0.35s ease, color 0.2s ease;
}

[data-theme="pc98"] body {
  background: #000;
}

/* CRT scanline overlay */
body::after {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.028) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: screen;
  opacity: 0.3;
}

/* Background art */
body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background: url("assets/fhtvbigpush.png") center / cover no-repeat;
  filter: saturate(0.95) contrast(1.1);
  opacity: 0.07;
}

[data-theme="pc98"] body::before {
  opacity: 0.04;
  filter: saturate(0) contrast(1.2);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1, h2, p {
  margin: 0;
}

/* ── GRID NOISE OVERLAY ────────────────────────────────────────────────── */
.site-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(90deg, transparent 0 98%, rgba(72, 214, 255, 0.2) 98% 100%),
    linear-gradient(0deg, transparent 0 96%, rgba(72, 214, 255, 0.12) 96% 100%);
  background-size: 80px 80px;
}

[data-theme="pc98"] .site-noise {
  opacity: 0.06;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 215, 0, 0.04) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(0, 255, 0, 0.04) 0 1px, transparent 1px 8px);
  background-size: 16px 16px;
}

/* ── APP SHELL ─────────────────────────────────────────────────────────── */
/*
   Border lives on the element itself (not a fixed ::before) so it scrolls
   correctly and actually clips content at the edges.
   margin: 10px keeps the frame inset from the viewport on all sides.
*/
.app-shell {
  display: grid;
  min-height: calc(100vh - 20px);  /* full viewport minus top + bottom margin */
  margin: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 18px rgba(41, 215, 255, 0.14), var(--shadow);
  border-radius: var(--radius);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, border-radius 0.3s ease;
}

.app-shell::before {
  display: none;  /* no longer needed */
}

[data-theme="pc98"] .app-shell {
  border: 2px solid var(--line);
  box-shadow: none;
}

/* ── MAIN DECK ─────────────────────────────────────────────────────────── */
.main-deck {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

/* ── PANELS (shared) ───────────────────────────────────────────────────── */
.top-bar,
.panel {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(3, 17, 26, 0.92), rgba(1, 8, 12, 0.84));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  transition: border-color 0.3s ease, background 0.3s ease;
}

[data-theme="pc98"] .top-bar,
[data-theme="pc98"] .panel {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

/* ── STATUS UTILITIES ──────────────────────────────────────────────────── */
.ok     { color: var(--green)  !important; }
.danger { color: var(--red)    !important; }
.warn   { color: var(--orange) !important; }

/* ── TOP BAR ───────────────────────────────────────────────────────────── */
.top-bar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  min-height: 64px;
  padding: 8px 14px;
  gap: 16px;
  border-left: 2px solid var(--line);
}

[data-theme="pc98"] .top-bar {
  border-left: 2px solid var(--line);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 {
  color: var(--cyan);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: uppercase;
  transition: color 0.3s;
}

[data-theme="pc98"] h1 {
  text-shadow: 0 0 6px rgba(168, 112, 20, 0.45);
}

h2 {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tiny-glyph {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1px solid var(--green);
  border-radius: 2px;
  flex-shrink: 0;
}

.tiny-glyph::before,
.tiny-glyph::after {
  position: absolute;
  content: "";
  background: var(--green);
}

.tiny-glyph::before {
  top: -3px;
  left: 2px;
  width: 5px;
  height: 3px;
}

.tiny-glyph::after {
  left: 2px;
  bottom: 2px;
  width: 5px;
  height: 1px;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--cyan);
  font-size: 11px;
  text-transform: uppercase;
}

.status-strip strong {
  color: var(--green);
  font-weight: 500;
}

.window-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── BUTTONS ───────────────────────────────────────────────────────────── */
.icon-button,
.top-nav-button {
  display: inline-grid;
  place-items: center;
  height: 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.icon-button {
  width: 24px;
}

.top-nav-button {
  min-width: max-content;
  padding: 0 9px;
  border-color: rgba(41, 213, 255, 0.28);
  color: var(--cyan-soft);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

[data-theme="pc98"] .top-nav-button {
  border-color: var(--line-soft);
  border-radius: 0;
}

.icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover,
.icon-button:focus-visible,
.top-nav-button:hover,
.top-nav-button:focus-visible {
  outline: none;
  border-color: var(--line);
  background: rgba(55, 200, 255, 0.1);
  box-shadow: 0 0 12px rgba(55, 200, 255, 0.14);
}

[data-theme="pc98"] .icon-button:hover,
[data-theme="pc98"] .icon-button:focus-visible,
[data-theme="pc98"] .top-nav-button:hover,
[data-theme="pc98"] .top-nav-button:focus-visible {
  background: rgba(255, 215, 0, 0.12);
  box-shadow: none;
}

/* ── THEME TOGGLE ──────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(0, 15, 25, 0.7);
  color: var(--dim);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  outline: none;
  border-color: var(--line);
  box-shadow: 0 0 10px rgba(59, 220, 255, 0.2);
}

[data-theme="pc98"] .theme-toggle {
  border-radius: 0;
  border: 2px solid var(--line);
  background: #000;
}

[data-theme="pc98"] .theme-toggle:hover,
[data-theme="pc98"] .theme-toggle:focus-visible {
  box-shadow: none;
  background: rgba(255, 215, 0, 0.06);
}

.tg-opt {
  padding: 0 9px;
  line-height: 24px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.tg-opt.is-active {
  color: var(--bg);
  background: var(--cyan);
}

[data-theme="pc98"] .tg-opt.is-active {
  color: #0A0800;
  background: var(--cyan-soft);
}

.tg-sep {
  color: var(--line-soft);
  font-size: 9px;
}

/* ── PANEL HEADER ──────────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line-soft);
}

[data-theme="pc98"] .panel-header {
  background: #1A1000;   /* very dark amber — classic PC-98 title bar */
  border-bottom: 2px solid var(--cyan);
}

[data-theme="pc98"] .panel-header h2,
[data-theme="pc98"] .panel-header span,
[data-theme="pc98"] .panel-header strong {
  color: var(--cyan-soft) !important;
}

[data-theme="pc98"] .panel-header .icon-button {
  color: var(--cyan);
  border-color: rgba(168, 112, 20, 0.4);
}

[data-theme="pc98"] .panel-header .icon-button:hover {
  background: rgba(168, 112, 20, 0.15);
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-button {
  width: 22px;
  height: 22px;
}

/* ── LIVE DOT ──────────────────────────────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: live-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.online-count,
.chat-count {
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
}

/* ── CONTENT GRID ──────────────────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 10px;
  align-items: start;
}

.primary-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

/* ── CHANNEL GRID ──────────────────────────────────────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

/* ── CHANNEL TILE ──────────────────────────────────────────────────────── */
.channel-tile {
  position: relative;
  border: 1px solid rgba(41, 213, 255, 0.3);
  border-radius: var(--tile-radius);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #010810;
}

.channel-tile:hover,
.channel-tile:focus-visible {
  border-color: rgba(59, 220, 255, 0.75);
  box-shadow:
    inset 0 0 0 1px rgba(59, 220, 255, 0.18),
    0 0 22px rgba(59, 220, 255, 0.14);
}

.channel-tile.is-selected {
  border-color: var(--cyan);
  box-shadow:
    inset 0 0 0 1px rgba(59, 220, 255, 0.3),
    0 0 28px rgba(59, 220, 255, 0.2);
}

[data-theme="pc98"] .channel-tile {
  border: 2px solid var(--line-soft);
  border-radius: 0;
}

[data-theme="pc98"] .channel-tile:hover,
[data-theme="pc98"] .channel-tile:focus-visible {
  border-color: var(--cyan);
  box-shadow: none;
}

[data-theme="pc98"] .channel-tile.is-selected {
  border-color: var(--green);
  box-shadow: none;
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

/* ── CHANNEL FEED (the "screen" area) ─────────────────────────────────── */
.channel-feed {
  position: relative;
  aspect-ratio: 16 / 10;
  isolation: isolate;
  overflow: hidden;
}

/* Scanline + vignette base layer */
.channel-feed::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 60, 34, 0.1), transparent 12%, transparent 88%, rgba(55, 210, 255, 0.08)),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(255, 255, 255, 0.04) 8px 9px);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Bottom gradient for overlay legibility */
.channel-feed::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.52) 0%,
    transparent 28%,
    transparent 55%,
    rgba(0, 0, 0, 0.72) 100%
  );
  pointer-events: none;
}

/* ── SCAN OVERLAY ──────────────────────────────────────────────────────── */
.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent 16% 84%, rgba(59, 220, 255, 0.1)),
    repeating-linear-gradient(90deg, rgba(255, 65, 40, 0.06) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  opacity: 0.28;
  animation: scanlines-drift 8s linear infinite;
}

@keyframes scanlines-drift {
  0%   { background-position: 0 0,    0 0; }
  100% { background-position: 0 80px, 0 0; }
}

[data-theme="pc98"] .scan-overlay {
  background:
    repeating-linear-gradient(0deg, rgba(0, 255, 0, 0.06) 0 1px, transparent 1px 4px);
  opacity: 0.4;
  mix-blend-mode: screen;
  animation: none;
}

/* ── CHANNEL OVERLAY (text / UI on top of feed) ────────────────────────── */
.channel-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none; /* children opt back in */
}

.channel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
}

.channel-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 6px 8px;
  gap: 6px;
}

.channel-id {
  font-size: 10px;
  color: rgba(214, 245, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.live-badge.ok   { color: var(--green); }
.live-badge.warn { color: var(--orange); }

.channel-name {
  font-size: 11px;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.channel-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: all;
  flex-shrink: 0;
}

/* Webcam toggle button inside channel tile */
.cam-button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(59, 220, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(0, 12, 20, 0.7);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.cam-button svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cam-button:hover,
.cam-button:focus-visible {
  outline: none;
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(59, 220, 255, 0.12);
  box-shadow: 0 0 8px rgba(59, 220, 255, 0.2);
}

.cam-button.is-active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 59, 47, 0.15);
  box-shadow: 0 0 8px rgba(255, 59, 47, 0.25);
}

[data-theme="pc98"] .cam-button {
  border-radius: 0;
  border-color: var(--line-soft);
}

[data-theme="pc98"] .cam-button.is-active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(74, 170, 74, 0.14);
  box-shadow: none;
}

/* Viewer count pill */
.viewer-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--cyan-soft);
  text-transform: uppercase;
  white-space: nowrap;
}

.viewer-pill i {
  display: block;
  width: 2px;
  background: var(--green);
}

.viewer-pill i:nth-child(1) { height: 4px; }
.viewer-pill i:nth-child(2) { height: 6px; }
.viewer-pill i:nth-child(3) { height: 9px; }
.viewer-pill i:nth-child(4) { height: 12px; }

.viewer-pill.muted i { background: var(--muted); }
.viewer-pill.muted { color: var(--muted); }

/* ── WEBCAM PiP ─────────────────────────────────────────────────────────── */
.webcam-pip {
  position: absolute;
  bottom: 32px;
  left: 8px;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 59, 47, 0.7);
  border-radius: var(--radius);
  background: rgba(10, 0, 0, 0.82);
  color: var(--red);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 59, 47, 0.3);
}

.webcam-pip.is-visible {
  display: flex;
}

[data-theme="pc98"] .webcam-pip {
  border: 2px solid var(--green);
  border-radius: 0;
  color: var(--green);
  background: rgba(0, 20, 0, 0.92);
  box-shadow: none;
}

.cam-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: cam-blink 0.9s ease-in-out infinite;
}

[data-theme="pc98"] .cam-dot {
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}

@keyframes cam-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ── NETWORK BAR ───────────────────────────────────────────────────────── */
.network-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 14px;
  gap: 12px;
  overflow: hidden;
}

.network-dl {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  flex: 1;
  overflow: hidden;
}

.network-dl > div {
  display: flex;
  flex-direction: column;
  padding: 0 14px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
  flex-shrink: 0;
}

.network-dl > div:first-child {
  padding-left: 0;
}

.network-dl > div:last-child {
  border-right: none;
}

.network-dl dt,
.network-dl dd {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-dl dt { color: var(--muted); }
.network-dl dd { color: var(--dim); margin-top: 1px; }
.network-dl dd.ok { color: var(--green); }

/* ── SYS READOUT / EQUALIZER ───────────────────────────────────────────── */
.sys-readout {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sys-readout.compact {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.equalizer {
  display: inline-grid;
  align-items: end;
  grid-auto-flow: column;
  gap: 2px;
}

.equalizer i {
  display: block;
  width: 2px;
  background: rgba(59, 220, 255, 0.55);
  transform-origin: bottom;
  animation: equalize 1.4s ease-in-out infinite;
}

.equalizer i:nth-child(1)  { height: 10px; animation-delay: 0.0s; }
.equalizer i:nth-child(2)  { height: 20px; animation-delay: 0.1s; }
.equalizer i:nth-child(3)  { height: 14px; animation-delay: 0.2s; }
.equalizer i:nth-child(4)  { height: 28px; animation-delay: 0.05s; }
.equalizer i:nth-child(5)  { height: 16px; animation-delay: 0.3s; }
.equalizer i:nth-child(6)  { height: 24px; animation-delay: 0.15s; }
.equalizer i:nth-child(7)  { height: 12px; animation-delay: 0.25s; }
.equalizer i:nth-child(8)  { height: 30px; animation-delay: 0.08s; }
.equalizer i:nth-child(9)  { height: 18px; animation-delay: 0.35s; }
.equalizer i:nth-child(10) { height: 22px; animation-delay: 0.18s; }
.equalizer i:nth-child(11) { height: 8px;  animation-delay: 0.28s; }
.equalizer i:nth-child(12) { height: 26px; animation-delay: 0.12s; }

@keyframes equalize {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.3); }
}

[data-theme="pc98"] .equalizer i {
  background: var(--green);
  /* keep the animation — phosphor bars should breathe */
}

[data-theme="pc98"] .mini-bars i {
  background: var(--cyan);  /* amber bars on the uplink indicator */
}

/* ── MINI BARS ─────────────────────────────────────────────────────────── */
.mini-bars {
  display: inline-grid;
  align-items: end;
  grid-auto-flow: column;
  gap: 3px;
}

.mini-bars i {
  display: block;
  width: 2px;
  background: var(--green);
  transform-origin: bottom;
  animation: bar-bounce 1.1s ease-in-out infinite;
}

.mini-bars i:nth-child(1) { height: 4px;  animation-duration: 1.05s; animation-delay: 0.00s; }
.mini-bars i:nth-child(2) { height: 7px;  animation-duration: 0.85s; animation-delay: 0.18s; }
.mini-bars i:nth-child(3) { height: 10px; animation-duration: 1.20s; animation-delay: 0.08s; }
.mini-bars i:nth-child(4) { height: 14px; animation-duration: 0.95s; animation-delay: 0.28s; }

@keyframes bar-bounce {
  0%, 100% { transform: scaleY(1);    opacity: 1; }
  50%       { transform: scaleY(0.3); opacity: 0.6; }
}

/* ── CHAT COLUMN ───────────────────────────────────────────────────────── */
.chat-column {
  min-width: 0;
}

.chat-panel {
  display: flex;
  flex-direction: column;
}

.chat-log {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 420px;
  max-height: 600px;
  overflow-y: auto;
  padding: 12px 14px;
  scrollbar-color: rgba(59, 220, 255, 0.4) transparent;
  scrollbar-width: thin;
}

.chat-log p {
  color: #c5d7de;
  font-size: 11px;
  line-height: 1.4;
}

.chat-log strong {
  color: var(--orange);
  font-weight: 500;
}

[data-theme="pc98"] .chat-log strong {
  color: var(--cyan);
}

.chat-form {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line-soft);
}

.chat-form input {
  width: 100%;
  height: 26px;
  border: 1px solid rgba(41, 213, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(0, 8, 13, 0.8);
  color: var(--cyan-soft);
  padding: 0 9px;
  font-size: 11px;
}

.chat-form input::placeholder {
  color: var(--dim);
  opacity: 0.7;
}

.chat-form input:focus {
  outline: 1px solid rgba(59, 220, 255, 0.65);
  border-color: transparent;
}

[data-theme="pc98"] .chat-form input {
  border: 2px solid var(--line-soft);
  border-radius: 0;
  background: #000;
  color: var(--cyan-soft);
}

[data-theme="pc98"] .chat-form input:focus {
  outline: 2px solid var(--cyan);
  border-color: transparent;
}

/* ── HELLFLIX ───────────────────────────────────────────────────────────── */
.hellflix-panel {
  overflow: hidden;
}

.hellflix-brand {
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 16px rgba(255, 59, 47, 0.5);
}

[data-theme="pc98"] .hellflix-brand {
  color: var(--cyan-soft);
  text-shadow: none;
}

.hellflix-sub {
  color: var(--dim);
  font-size: 11px;
  font-weight: 400;
}

[data-theme="pc98"] .hellflix-sub {
  color: var(--muted);
}

.hellflix-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 12px 14px;
  scrollbar-color: rgba(255, 59, 47, 0.45) transparent;
  scrollbar-width: thin;
}

[data-theme="pc98"] .hellflix-track {
  scrollbar-color: var(--cyan) transparent;
}

/* ── VOD CARD ───────────────────────────────────────────────────────────── */
.vod-card {
  flex: 0 0 148px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(41, 213, 255, 0.22);
  border-radius: var(--tile-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  background: rgba(2, 10, 16, 0.85);
  text-decoration: none;
  color: inherit;
}

.vod-card:hover,
.vod-card:focus-visible {
  outline: none;
  border-color: rgba(255, 59, 47, 0.65);
  box-shadow: 0 0 18px rgba(255, 59, 47, 0.15);
  transform: translateY(-3px) scale(1.03);
}

[data-theme="pc98"] .vod-card {
  border: 2px solid var(--line-soft);
  border-radius: 0;
  background: #000;
}

[data-theme="pc98"] .vod-card:hover,
[data-theme="pc98"] .vod-card:focus-visible {
  border-color: var(--cyan);
  box-shadow: none;
  transform: none;
}

.vod-thumb {
  height: 100px;
  position: relative;
  overflow: hidden;
}

.vod-thumb::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    repeating-linear-gradient(0deg, rgba(214, 245, 255, 0.1) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 59, 47, 0.12) 0 2px, transparent 2px 17px),
    repeating-radial-gradient(circle at 48% 52%, rgba(214, 245, 255, 0.6) 0 1px, transparent 1px 4px),
    linear-gradient(120deg, rgba(59, 220, 255, 0.15), rgba(0, 5, 9, 0.88) 48%, rgba(255, 59, 47, 0.14));
  background-size: auto, auto, 7px 7px, cover;
}

.vod-thumb::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.6));
}

.vod-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
}

.vod-title {
  font-size: 10px;
  color: var(--cyan-soft);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vod-badge {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
}

.vod-badge.ok   { color: var(--green); }
.vod-badge.warn { color: var(--orange); }

[data-theme="pc98"] .vod-title { color: var(--text); }
[data-theme="pc98"] .vod-badge { color: var(--muted); }

/* ── MEDIA BACKGROUNDS ─────────────────────────────────────────────────── */
.media {
  background-color: #050d13;
  background-image:
    linear-gradient(120deg, rgba(1, 10, 16, 0.1), rgba(12, 61, 85, 0.4)),
    url("assets/fhtvbigpush.png");
  background-repeat: no-repeat;
  background-size: cover, 1536px 1024px;
  background-position: center, var(--asset-pos, center);
}

.media-storm    { --asset-pos: -195px -132px; }
.media-beach    { --asset-pos: -216px -442px; }
.media-hellball { --asset-pos: -438px -442px; }
.media-static   { --asset-pos: -662px -442px; }
.media-weather  { --asset-pos: -886px -442px; }
.media-apartment{ --asset-pos: -214px -560px; }
.media-screen   { --asset-pos: -438px -560px; }
.media-audio    { --asset-pos: -660px -560px; }
.media-ghost    { --asset-pos: -886px -560px; }
.media-night    { --asset-pos: -214px -680px; }
.media-vhs      { --asset-pos: -438px -680px; }
.media-dead     { --asset-pos: -886px -680px; }
.media-skull    { --asset-pos: -214px -856px; }
.media-ship     { --asset-pos: -394px -856px; }
.media-crt      { --asset-pos: -580px -856px; }
.media-bars     { --asset-pos: -752px -856px; }
.media-skull-blue { --asset-pos: -940px -856px; }

.media-static {
  background-image:
    repeating-radial-gradient(circle at 45% 50%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1px 3px),
    linear-gradient(120deg, rgba(20, 31, 40, 0.55), rgba(5, 10, 17, 0.8)),
    url("assets/fhtvbigpush.png");
}

.media-audio {
  background-image:
    linear-gradient(90deg,
      transparent 0 21%, rgba(65, 99, 255, 0.65) 21% 24%,
      transparent 24% 34%, rgba(68, 123, 255, 0.7) 34% 38%,
      transparent 38% 47%, rgba(63, 99, 255, 0.8) 47% 52%,
      transparent 52% 63%, rgba(69, 128, 255, 0.75) 63% 67%,
      transparent 67% 100%),
    radial-gradient(circle at 50% 50%, rgba(41, 71, 200, 0.5), rgba(4, 8, 16, 0.96)),
    url("assets/fhtvbigpush.png");
}

.media-skull,
.media-skull-blue {
  background-image:
    radial-gradient(circle at 50% 43%, rgba(224, 240, 246, 0.72) 0 13%, transparent 14%),
    radial-gradient(circle at 44% 42%, #02070b 0 3%, transparent 4%),
    radial-gradient(circle at 56% 42%, #02070b 0 3%, transparent 4%),
    linear-gradient(180deg, transparent 55%, rgba(224, 240, 246, 0.45) 56% 58%, transparent 59%),
    url("assets/fhtvbigpush.png");
}

.media-bars {
  background-image:
    linear-gradient(90deg,
      #d8d33e 0 16%, #46b86c 16% 32%, #34a9bc 32% 48%,
      #b447ad 48% 64%, #d62f3f 64% 80%, #e3dfca 80%),
    url("assets/fhtvbigpush.png");
}

/* ── CHANNEL TILE TUNE-IN PULSE ────────────────────────────────────────── */
@keyframes tune-in {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.025); box-shadow: 0 0 32px rgba(59, 220, 255, 0.28); }
  100% { transform: scale(1); }
}

[data-theme="pc98"] .channel-tile.is-tuning {
  animation: tune-in-pc98 0.28s ease-out forwards;
}

@keyframes tune-in-pc98 {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.025); box-shadow: 0 0 0 2px var(--green); }
  100% { transform: scale(1); }
}

.channel-tile.is-tuning {
  animation: tune-in 0.28s ease-out forwards;
}

/* ── COLLAPSIBLE PANELS ────────────────────────────────────────────────── */
.panel.is-collapsed > :not(.panel-header) {
  display: none;
}

.panel-button[data-panel-toggle] svg {
  transition: transform 0.22s ease;
}

.panel.is-collapsed .panel-button[data-panel-toggle] svg {
  transform: rotate(180deg);
}

/* ── TOAST ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: min(400px, calc(100vw - 40px));
  padding: 9px 12px;
  border: 1px solid rgba(59, 220, 255, 0.55);
  border-radius: var(--radius);
  background: rgba(2, 12, 18, 0.97);
  color: var(--cyan-soft);
  box-shadow: 0 0 20px rgba(59, 220, 255, 0.16);
  font-size: 11px;
  text-transform: uppercase;
  transform: translateY(130%);
  transition: transform 180ms ease;
  letter-spacing: 0.02em;
}

.toast.is-visible {
  transform: translateY(0);
}

[data-theme="pc98"] .toast {
  border: 2px solid var(--cyan);
  border-radius: 0;
  background: #000;
  color: var(--cyan);
  box-shadow: none;
}

/* ── ACCESSIBILITY ─────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .chat-column {
    order: -1;
  }

  .chat-log {
    min-height: 200px;
    max-height: 240px;
  }

  .channel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 6px;
  }

  .top-bar {
    grid-template-columns: 1fr auto;
    min-height: auto;
    gap: 10px;
    flex-wrap: wrap;
  }

  .status-strip {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 10px;
  }

  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .network-dl > div:nth-child(n+3) {
    display: none;
  }
}

@media (max-width: 540px) {
  .channel-grid {
    grid-template-columns: 1fr;
  }

  .window-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  .hellflix-track {
    gap: 8px;
  }

  .vod-card {
    flex-basis: 120px;
  }
}
