/* ================================================================
   FCTV2 — Base styles
   ================================================================ */

/* ── Theme: Dark (default) ───────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg-dark: #1c1917;
  --bg-darker: #121110;
  --bg-card: #272420;
  --bg-input: #353230;
  --text-primary: #e0ddd8;
  --text-secondary: #9a9590;
  --text-muted: #8a8580;
  --accent: #c0a040;
  --accent-hover: #d4b44e;
  --danger: #d9534f;
  --danger-hover: #c9302c;
  --success: #5cb85c;
  --warning: #f0ad4e;
  --border: #353230;
  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-pill: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-popup: 0 8px 32px rgba(0,0,0,0.5);
  --ring-focus: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);

  /* Micro spacing — pill/badge vertical padding */
  --sp-micro: 2px;

  /* Overlay / surface variants */
  --hover-overlay: rgba(255,255,255,0.05);
  --subtle-overlay: rgba(255,255,255,0.04);
  --faint-overlay: rgba(255,255,255,0.02);
  --badge-overlay: rgba(255,255,255,0.06);
  --active-row: rgba(192, 160, 64, 0.08);

  /* Easing */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Contrast text — for text on solid accent/status backgrounds */
  --text-on-accent: #000;
  --text-on-status: #fff;

  /* Categorical accent colors (admin wayfinding, not theme-adaptive) */
  --accent-blue: #58a6ff;
  --accent-purple: #9b7ed8;

  /* Spacing scale */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 20px;
  --sp-2xl: 24px;
  --sp-3xl: 32px;
  --sp-4xl: 48px;

  /* Type scale — ~1.2 minor-third ratio (1rem = 16px browser default) */
  --text-xs: 0.6875rem;   /* ~11px — micro labels, badges, table headers */
  --text-sm: 0.75rem;     /* ~12px — secondary UI, metadata, code cells */
  --text-base: 0.8125rem; /* ~13px — admin body, nav, inputs, table cells */
  --text-lg: 1rem;        /* ~16px — public body, large buttons */
  --text-xl: 1.125rem;    /* ~18px — logo, sub-display */
  --text-2xl: 1.25rem;    /* ~20px — page titles */
  --text-3xl: 1.75rem;    /* ~28px — stat numbers */
  --text-4xl: 2.25rem;    /* ~36px — display headings (responsive) */
  --text-display: 3rem;   /* ~48px — hero/error display */

  /* Line-heights */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
}

/* ── Theme: Midnight ─────────────────────────────────────────── */
[data-theme="midnight"] {
  --bg-dark: #0d1117;
  --bg-darker: #010409;
  --bg-card: #161b22;
  --bg-input: #21262d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --danger: #f85149;
  --danger-hover: #da3633;
  --success: #3fb950;
  --warning: #d29922;
  --border: #30363d;
  --shadow: 0 2px 8px rgba(1,4,9,0.7);
  --hover-overlay: rgba(136,192,255,0.06);
  --subtle-overlay: rgba(136,192,255,0.04);
  --faint-overlay: rgba(136,192,255,0.02);
  --badge-overlay: rgba(136,192,255,0.07);
  --active-row: rgba(88, 166, 255, 0.08);
}

/* ── Theme: Crimson ──────────────────────────────────────────── */
[data-theme="crimson"] {
  --bg-dark: #1a1015;
  --bg-darker: #110a0e;
  --bg-card: #2a1520;
  --bg-input: #351a28;
  --text-primary: #e8d0d8;
  --text-secondary: #a0808a;
  --text-muted: #8a6878;
  --accent: #e04060;
  --accent-hover: #f05070;
  --danger: #e08040;
  --danger-hover: #cc6e30;
  --success: #50b878;
  --warning: #e0a840;
  --border: #402030;
  --shadow: 0 2px 8px rgba(17,10,14,0.7);
  --hover-overlay: rgba(224,64,96,0.06);
  --subtle-overlay: rgba(224,64,96,0.04);
  --faint-overlay: rgba(224,64,96,0.02);
  --badge-overlay: rgba(224,64,96,0.07);
  --active-row: rgba(224, 64, 96, 0.08);
}

/* ── Theme: Forest ───────────────────────────────────────────── */
[data-theme="forest"] {
  --bg-dark: #0f1a14;
  --bg-darker: #0a120e;
  --bg-card: #152a1e;
  --bg-input: #1a3525;
  --text-primary: #d0e8d8;
  --text-secondary: #80a890;
  --text-muted: #688870;
  --accent: #40c070;
  --accent-hover: #50d080;
  --danger: #d06050;
  --danger-hover: #b84840;
  --success: #80d8a0;
  --warning: #c8a840;
  --border: #203828;
  --shadow: 0 2px 8px rgba(10,18,14,0.7);
  --hover-overlay: rgba(64,192,112,0.06);
  --subtle-overlay: rgba(64,192,112,0.04);
  --faint-overlay: rgba(64,192,112,0.02);
  --badge-overlay: rgba(64,192,112,0.07);
  --active-row: rgba(64, 192, 112, 0.08);
}

/* ── Theme: Hacker ───────────────────────────────────────────── */
[data-theme="hacker"] {
  --bg-dark: #080a08;
  --bg-darker: #030503;
  --bg-card: #0c100c;
  --bg-input: #161a16;
  --text-primary: #33d17a;
  --text-secondary: #28a060;
  --text-muted: #1e7848;
  --accent: #33d17a;
  --accent-hover: #55e094;
  --danger: #d05040;
  --danger-hover: #b83830;
  --success: #33d17a;
  --warning: #c8a830;
  --border: #1a2a1a;
  --shadow: 0 2px 8px rgba(3,5,3,0.8);
  --hover-overlay: rgba(51,209,122,0.06);
  --subtle-overlay: rgba(51,209,122,0.04);
  --faint-overlay: rgba(51,209,122,0.02);
  --badge-overlay: rgba(51,209,122,0.07);
  --active-row: rgba(51, 209, 122, 0.1);
}

/* ── Theme: Vapor ────────────────────────────────────────────── */
[data-theme="vapor"] {
  --bg-dark: #1a0a2e;
  --bg-darker: #0f0520;
  --bg-card: #261040;
  --bg-input: #301850;
  --text-primary: #e0d0f0;
  --text-secondary: #a080c0;
  --text-muted: #8060a0;
  --accent: #ff71ce;
  --accent-hover: #ff99dd;
  --danger: #ff6060;
  --danger-hover: #e04848;
  --success: #60e0a0;
  --warning: #f0c060;
  --border: #3a2060;
  --shadow: 0 2px 8px rgba(15,5,32,0.7);
  --hover-overlay: rgba(255,113,206,0.06);
  --subtle-overlay: rgba(255,113,206,0.04);
  --faint-overlay: rgba(255,113,206,0.02);
  --badge-overlay: rgba(255,113,206,0.07);
  --active-row: rgba(255, 113, 206, 0.08);
}

/* ── Theme: Evangelion (NERV Command Center) ─────────────────── */
[data-theme="evangelion"] {
  --bg-dark: #1a0820;
  --bg-darker: #0d0412;
  --bg-card: #241030;
  --bg-input: #2e1840;
  --text-primary: #e0d8f0;
  --text-secondary: #9080a8;
  --text-muted: #6a5880;
  --accent: #ff6a00;
  --accent-hover: #ff8a30;
  --danger: #e03030;
  --danger-hover: #c02020;
  --success: #33d17a;
  --warning: #ff6a00;
  --border: #3a1850;
  --shadow: 0 2px 12px rgba(255,106,0,0.12), 0 2px 8px rgba(14,5,21,0.8);
  --hover-overlay: rgba(255,106,0,0.08);
  --subtle-overlay: rgba(255,106,0,0.04);
  --faint-overlay: rgba(255,106,0,0.02);
  --badge-overlay: rgba(255,106,0,0.07);
  --active-row: rgba(255, 106, 0, 0.1);
}

/* ── Theme: Synthwave (80s Retrowave) ───────────────────────────── */
[data-theme="synthwave"] {
  --bg-dark: #0d0221;
  --bg-darker: #09011a;
  --bg-card: #150535;
  --bg-input: #1e0c42;
  --text-primary: #f0e0ff;
  --text-secondary: #b090d0;
  --text-muted: #8060a8;
  --accent: #b24dff;
  --accent-hover: #c77dff;
  --danger: #ff1744;
  --danger-hover: #d50000;
  --success: #39ff8e;
  --warning: #ffab40;
  --border: #301060;
  --shadow: 0 2px 12px rgba(178, 77, 255, 0.15);
  --hover-overlay: rgba(178, 77, 255, 0.08);
  --subtle-overlay: rgba(178, 77, 255, 0.04);
  --faint-overlay: rgba(178, 77, 255, 0.02);
  --badge-overlay: rgba(0, 229, 255, 0.1);
  --active-row: rgba(178, 77, 255, 0.1);
  /* Synthwave palette tokens */
  --sw-pink: #ff2975;
  --sw-cyan: #00fff5;
  --sw-blue: #4d8aff;
  --sw-purple: #b24dff;
  --sw-orange: #ff6b35;
  --sw-yellow: #ffd319;
  --sw-grid: rgba(0, 255, 245, 0.2);
  --sw-glow: 0 0 8px rgba(178, 77, 255, 0.5), 0 0 16px rgba(178, 77, 255, 0.2);
  --sw-cyan-glow: 0 0 8px rgba(0, 255, 245, 0.5), 0 0 16px rgba(0, 255, 245, 0.2);
}

/* ── Theme: Twin Peaks (Black Lodge / Red Room) ────────────────
   Lynch's dreamscape — damn fine coffee, cherry pie, red velvet curtains
   over a chevron floor. Reds are velvety, text is warm cream, greens
   come from Douglas firs, golds from coffee and pie.               */
[data-theme="twinpeaks"] {
  --bg-dark: #0e0504;       /* deep red-black, warm undertone */
  --bg-darker: #060201;     /* near-black for bars */
  --bg-card: #1c0a0a;       /* dried cherry filling */
  --bg-input: #2a1110;
  --text-primary: #f4e7d0;  /* warm cream — old paper / pie crust */
  --text-secondary: #c8a878;
  --text-muted: #8a6a4a;
  --accent: #c41e3a;        /* Red Room velvet */
  --accent-hover: #e0324e;
  --danger: #ff4040;
  --danger-hover: #e02020;
  --success: #5a8a3a;       /* Douglas fir */
  --warning: #d4a04a;       /* coffee gold */
  --border: #3a1a14;        /* dark cherry wood */
  --shadow: 0 2px 12px rgba(196,30,58,0.18), 0 2px 8px rgba(6,2,1,0.8);
  --hover-overlay: rgba(196,30,58,0.08);
  --subtle-overlay: rgba(196,30,58,0.04);
  --faint-overlay: rgba(196,30,58,0.02);
  --badge-overlay: rgba(212,160,74,0.1);
  --active-row: rgba(196,30,58,0.1);
  /* Twin Peaks palette tokens */
  --tp-red: #c41e3a;
  --tp-red-deep: #8b0010;
  --tp-cream: #f4e7d0;
  --tp-coffee: #4a2810;
  --tp-gold: #d4a04a;
  --tp-fir: #2c4a2c;
  --tp-chevron-a: #1a0a0a;
  --tp-chevron-b: #f4e7d0;
}

/* ── Theme: Belzona (Industrial polymer repair — red/concrete/steel) ─
   Inspired by the polymer coatings brand. Signature red is the hero,
   industrial concrete grey is the stage, safety yellow is the warning,
   steel is the structure. Heavy-duty, utilitarian, factory-floor. */
[data-theme="belzona"] {
  --bg-dark: #1d1f21;       /* dark industrial concrete */
  --bg-darker: #141517;     /* deeper shadow grey */
  --bg-card: #26282b;       /* steel plate */
  --bg-input: #2f3134;
  --text-primary: #ecebe8;  /* chalk / datasheet white */
  --text-secondary: #a8a59f;
  --text-muted: #7a7770;
  --accent: #004888;        /* Belzona navy blue (logo color) */
  --accent-hover: #1a5fa8;
  --danger: #ff4040;
  --danger-hover: #e02020;
  --success: #4ca357;
  --warning: #f5b800;       /* safety / hi-vis yellow */
  --border: #3a3c3f;        /* brushed steel */
  --shadow: 0 2px 12px rgba(0,72,136,0.18), 0 2px 8px rgba(0,0,0,0.6);
  --hover-overlay: rgba(0,72,136,0.10);
  --subtle-overlay: rgba(0,72,136,0.05);
  --faint-overlay: rgba(0,72,136,0.025);
  --badge-overlay: rgba(245,184,0,0.12);
  --active-row: rgba(0,72,136,0.12);
  /* Belzona palette tokens */
  --bz-red: #004888;
  --bz-red-deep: #00254a;
  --bz-concrete: #3a3a3a;
  --bz-steel: #5a6570;
  --bz-yellow: #f5b800;
  --bz-chalk: #ecebe8;
}

/* ── Theme: Hello Kitty (Sanrio — light pink) ───────────────────── */
/* The only LIGHT theme. Palette built from the Coolors board:
   F4BFC4 rose · FED5DD baby-pink · FFFEFA ivory · EE7974 coral · F46C8C hot-pink.
   Overlays flip from white→black because the background is light. */
[data-theme="hellokitty"] {
  --bg-dark: #fff4f7;      /* page background — very light pink cream */
  --bg-darker: #ffeaf0;    /* slightly deeper for header/footer bars */
  --bg-card: #ffffff;      /* cards pop as clean white on pink page */
  --bg-input: #fff8fb;     /* inputs — almost white with pink hint */
  --text-primary: #3a1420;
  --text-secondary: #8a4a60;
  --text-muted: #b07088;
  --accent: #f46c8c;       /* Hello Kitty hot pink */
  --accent-hover: #ff83a3;
  --danger: #ee7974;       /* Kitty's bow coral */
  --danger-hover: #d65e59;
  --success: #5cb85c;
  --warning: #f0ad4e;
  --border: #f4bfc4;       /* soft rose borders */
  --shadow: 0 2px 10px rgba(244, 108, 140, 0.18), 0 1px 4px rgba(58, 20, 32, 0.08);
  --shadow-popup: 0 8px 32px rgba(244, 108, 140, 0.25);
  --ring-focus: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  /* Light theme — overlays darken instead of lighten */
  --hover-overlay: rgba(244, 108, 140, 0.08);
  --subtle-overlay: rgba(244, 108, 140, 0.05);
  --faint-overlay: rgba(244, 108, 140, 0.03);
  --badge-overlay: rgba(244, 108, 140, 0.10);
  --active-row: rgba(244, 108, 140, 0.12);
  /* Text on solid accent — white reads better on pink than black */
  --text-on-accent: #fff;
  --text-on-status: #fff;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 100%;
}

body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Flash messages ───────────────────────────────────────────── */
.flash {
  position: fixed;
  top: var(--sp-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: var(--sp-md) var(--sp-2xl);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  animation: flashIn 0.3s var(--ease-out-quart);
  max-width: min(500px, calc(100vw - 20px));
  text-align: center;
}
.flash-success { background: var(--success); color: var(--text-on-status); border-left: 3px solid rgba(0,0,0,0.25); }
.flash-error { background: var(--danger); color: var(--text-on-status); border-left: 3px solid rgba(0,0,0,0.25); }
.flash-close {
  margin-left: var(--sp-md);
  font-size: var(--text-xl);
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 var(--sp-xs);
  line-height: 1;
  transition: opacity 0.15s var(--ease-out-quart), transform 0.15s var(--ease-out-quart);
}
.flash-close:hover {
  opacity: 0.7;
  transform: scale(1.15);
}
.flash-close:active {
  transform: scale(0.9);
}
@keyframes flashIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes flashOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border: none;
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease-out-quart), color 0.2s, border-color 0.2s, transform 0.15s var(--ease-out-quart), box-shadow 0.2s;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-on-accent);
}
.btn-danger {
  background: var(--danger);
  color: var(--text-on-status);
}
.btn-danger:hover {
  background: var(--danger-hover);
}
.btn-success {
  background: var(--success);
  color: var(--text-on-status);
}
.btn-success:hover {
  filter: brightness(1.1);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.btn-sm { padding: var(--sp-xs) var(--sp-sm); font-size: var(--text-sm); }
.btn-lg { padding: var(--sp-md) var(--sp-2xl); font-size: var(--text-lg); }
.btn-block { display: flex; width: 100%; justify-content: center; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  padding: var(--sp-xs);
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease-out-quart), transform 0.15s var(--ease-out-quart), background 0.2s;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: var(--hover-overlay);
}
.btn-icon:active {
  transform: scale(0.9);
}
.btn-icon.btn-danger { color: var(--danger); }
.btn-icon.btn-danger:hover { color: var(--danger-hover); }

/* ── Form elements ────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-lg);
  flex: 1;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group label {
  display: block;
  margin-bottom: var(--sp-xs);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}
.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.12);
}
.form-row {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

.inline-form {
  display: inline-flex;
  align-items: center;
}

.inline-select {
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--text-sm);
}
.inline-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}

/* ── Public page ──────────────────────────────────────────────── */
.public-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-darker);
}

.site-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-darker);
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--accent) 28%, transparent),
              0 2px 0 0 color-mix(in srgb, var(--accent) 8%, transparent);
  flex-shrink: 0;
  animation: bannerSlideDown 0.5s var(--ease-out-expo);
  transition: max-height 0.45s var(--ease-out-expo),
              padding 0.45s var(--ease-out-expo),
              opacity 0.3s var(--ease-out-quart);
  max-height: 96px;
  overflow: hidden;
}
.banner-img {
  height: 8.8vh;
  max-height: 72px;
  width: auto;
}

/* ── MOTD / Announcement Bar ─────────────────────────────────── */
.motd-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-dark));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: var(--sp-xs) var(--sp-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  animation: bannerSlideDown 0.4s var(--ease-out-expo);
  flex-shrink: 0;
  transition: max-height 0.4s var(--ease-out-expo),
              padding 0.4s var(--ease-out-expo),
              opacity 0.25s var(--ease-out-quart),
              border-bottom-width 0.4s var(--ease-out-expo);
  max-height: 60px;
  overflow: hidden;
}
.motd-text {
  flex: 1;
  text-align: center;
}
.motd-text i {
  color: var(--accent);
  margin-right: var(--sp-xs);
}
.motd-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: 0 var(--sp-xs);
  line-height: 1;
}
.motd-dismiss:hover {
  color: var(--text-primary);
}
.theater .motd-bar {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-bottom-width: 0;
  pointer-events: none;
}

.stream-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;
  animation: streamFadeIn 0.7s 0.2s var(--ease-out-expo) both;
}
.stream-layout.chat-left {
  flex-direction: row-reverse;
}
.stream-layout.chat-left .stream-chat {
  border-left: none;
  border-right: 1px solid var(--border);
}

.stream-player {
  flex: 1;
  background: var(--bg-darker);
  position: relative;
  min-width: 0;
  contain: layout style;
}
.stream-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.stream-chat {
  width: 25%;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-darker);
  overflow: hidden;
  transition: width 0.35s var(--ease-out-expo),
              opacity 0.25s var(--ease-out-quart),
              border-width 0.35s var(--ease-out-expo);
  opacity: 1;
  contain: layout style;
}

/* Ambient offline canvas */
.no-stream-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 1;
}
/* CRT scanline overlay */
.stream-player:has(.no-stream-bg)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}
/* Reduced motion fallback — warm gradient instead of canvas */
@media (prefers-reduced-motion: reduce) {
  .no-stream-bg { display: none; }
  .stream-player:has(.no-stream)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(192,160,64,0.06) 0%, rgba(18,17,16,1) 70%);
    z-index: 0;
  }
}
.no-stream {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: var(--sp-md);
}
/* Staggered reveal */
.no-stream-reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: noStreamReveal 0.7s var(--ease-out-expo) forwards;
}
.no-stream-reveal:nth-child(1) { animation-delay: 0.3s; }
.no-stream-reveal:nth-child(2) { animation-delay: 0.55s; }
.no-stream-reveal:nth-child(3) { animation-delay: 0.75s; }
.no-stream-reveal:nth-child(4) { animation-delay: 0.95s; }
@keyframes noStreamReveal {
  to { opacity: 1; transform: translateY(0); }
}
.no-stream i {
  font-size: var(--text-display);
  color: var(--accent);
  opacity: 0.25;
}
.no-stream-headline {
  font-size: var(--text-lg);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.no-stream-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.no-stream-links {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  padding: var(--sp-sm) var(--sp-lg);
  flex-shrink: 0;
  min-height: 48px;
  gap: var(--sp-md);
  animation: bottomBarSlideUp 0.5s 0.35s var(--ease-out-expo) both;
}
.bottom-bar a,
.bottom-bar button {
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--text-base);
  display: inline-flex;
  align-items: center;
}
/* Normalize icon dimensions so mixed FA glyphs (tower-broadcast, ellipsis, sliders, etc.) sit on the same grid */
.bottom-bar a > .fas,
.bottom-bar a > .fab,
.bottom-bar a > .far,
.bottom-bar button > .fas,
.bottom-bar button > .fab,
.bottom-bar button > .far {
  width: 16px;
  height: 16px;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bottom-bar a:hover,
.bottom-bar button:hover {
  color: var(--accent);
}
.bottom-left {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}
.bottom-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
.bar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
}
/* Section separator — pure rhythm, no visible line */
.bar-divider {
  width: 0;
  height: 20px;
  margin: 0 var(--sp-sm);
  flex-shrink: 0;
}
.now-playing {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0 var(--sp-xs);
  padding: 0 var(--sp-xs);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  min-width: 0;
}
.now-playing .np-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
}

/* Theater mode — smooth banner collapse */
.theater .site-banner {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-bottom-width: 0;
  pointer-events: none;
}

/* Chat hidden — smooth slide */
.chat-hidden .stream-chat {
  width: 0;
  opacity: 0;
  border-left-width: 0;
  pointer-events: none;
}
.chat-hidden .stream-player { flex: 1; }

/* ── Custom page panel ────────────────────────────────────────── */
.stream-custom {
  width: 0;
  flex-shrink: 0;
  border-left: 0 solid var(--border);
  background: var(--bg-darker);
  overflow: hidden;
  transition: width 0.35s var(--ease-out-expo),
              opacity 0.25s var(--ease-out-quart),
              border-width 0.35s var(--ease-out-expo);
  opacity: 0;
  contain: layout style;
}
.stream-custom.active {
  opacity: 1;
  border-left-width: 1px;
}

/* ── Layout picker ────────────────────────────────────────────── */
.layout-picker {
  position: relative;
  display: inline-flex;
}
.layout-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-sm);
  box-shadow: var(--shadow-popup);
  z-index: 100;
  min-width: 220px;
  max-width: calc(100vw - var(--sp-lg) * 2);
  padding: var(--sp-sm) var(--sp-md) var(--sp-md);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.layout-menu.open {
  display: block;
  animation: channelMenuIn 0.25s var(--ease-out-expo);
}
.layout-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-bottom: var(--sp-xs);
  margin-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
}
.layout-reset {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--sp-micro) var(--sp-xs);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s var(--ease-out-quart), background 0.15s var(--ease-out-quart);
}
.layout-reset:hover {
  color: var(--accent);
  background: var(--bg-input);
}

/* Preset buttons */
.layout-presets {
  display: flex;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-sm);
}
.layout-preset {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-xs);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  transition: all 0.15s;
}
.layout-preset:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.layout-preset.active {
  border-color: var(--accent);
  background: rgba(192, 160, 64, 0.08);
  color: var(--accent);
}

/* Preset mini-icons */
.preset-icon {
  display: flex;
  gap: 2px;
  width: 40px;
  height: 24px;
}
.pi-stream {
  flex: 3;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.6;
}
.pi-stream.pi-full { flex: 1; }
.pi-chat {
  flex: 1;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.4;
}
.pi-chat.pi-sm { flex: 0.7; }
.pi-custom {
  flex: 1;
  background: var(--success, #5cb85c);
  border-radius: 2px;
  opacity: 0.4;
}
.preset-label {
  white-space: nowrap;
  line-height: 1;
}

/* Fine-tune sliders */
.layout-fine-tune {
  padding-top: var(--sp-xs);
}
.layout-slider-group {
  margin-bottom: var(--sp-sm);
}
.layout-slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
}
.layout-slider-group label span {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.layout-slider-group input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-input);
  outline: none;
  cursor: pointer;
}
.layout-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.layout-slider-group input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Custom URL section */
.layout-custom-url {
  margin-bottom: var(--sp-sm);
}
.layout-custom-url label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
}
.layout-url-row {
  display: flex;
  gap: var(--sp-xs);
}
.layout-url-input {
  flex: 1;
  min-width: 0;
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-family: inherit;
}
.layout-url-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}
.btn-accent {
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius);
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}
.btn-accent:hover { opacity: 0.85; }
.layout-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--sp-xs);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-xs);
}

/* Layout-menu sections (View toggles, Theme grid) */
.layout-section {
  padding-top: var(--sp-sm);
  margin-top: var(--sp-sm);
  border-top: 1px solid var(--border);
}
.layout-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-xs);
}
.layout-view-toggles {
  display: flex;
  gap: var(--sp-xs);
}
.layout-view-toggles button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s var(--ease-out-quart), border-color 0.15s var(--ease-out-quart), background 0.15s var(--ease-out-quart);
}
.layout-view-toggles button:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
.layout-view-toggles button.active,
.layout-view-toggles button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(192, 160, 64, 0.08);
}

/* ── Theme picker ─────────────────────────────────────────────── */
.theme-picker {
  position: relative;
  display: inline-flex;
}
.theme-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-xs);
  margin-bottom: var(--sp-sm);
  box-shadow: var(--shadow);
  z-index: 100;
  white-space: nowrap;
}
.theme-menu.open {
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: menuSlideUp 0.2s var(--ease-out-expo);
}
@keyframes menuSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.theme-menu button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: var(--sp-xs) var(--sp-md);
  font-size: var(--text-sm);
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}
.theme-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.theme-menu button:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.theme-menu button.active {
  color: var(--accent);
  font-weight: 600;
}

/* Inline variant — lives inside the Layout panel as a 2-col grid, always visible */
.theme-menu.theme-menu-inline {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: auto;
  white-space: normal;
  animation: none;
}
.theme-menu.theme-menu-inline button {
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--text-xs);
}

/* ── Channel picker ───────────────────────────────────────────── */
.channel-picker {
  position: relative;
  display: inline-flex;
}
#btnChannels {
  position: relative;
  padding-right: var(--sp-lg);
}
/* Keep the channel-count badge from colliding with the flipper buttons */
.channel-picker + .channel-flipper {
  margin-left: var(--sp-sm);
}
.channel-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: var(--bg-darker);
  font-size: 0.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg-darker);
}
.channel-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-sm);
  box-shadow: var(--shadow-popup);
  z-index: 100;
  width: min(360px, 90vw);
  overflow: hidden;
}
.channel-menu.open {
  display: flex;
  flex-direction: column;
  animation: channelMenuIn 0.25s var(--ease-out-expo);
}
@keyframes channelMenuIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Channel tabs ─────────────────────────────────────────────── */
.channel-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.channel-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.18s var(--ease-out-quart),
              background-color 0.18s var(--ease-out-quart),
              border-color 0.18s var(--ease-out-quart),
              transform 0.15s var(--ease-out-quart);
  font-family: inherit;
}
.channel-tab:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.channel-tab:active { transform: translateY(1px); }
.channel-tab.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  box-shadow: inset 0 -2px 0 0 var(--accent),
              0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 16px;
  padding: 0 5px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
  transition: color 0.18s var(--ease-out-quart),
              background-color 0.18s var(--ease-out-quart);
}
.channel-tab.active .tab-count {
  color: var(--bg-darker);
  background: var(--accent);
}
.channel-tab:hover:not(.active) .tab-count {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 16%, transparent);
}

/* ── Channel panels ───────────────────────────────────────────── */
.channel-panel {
  flex: 1;
  min-height: 0;
}
.channel-list {
  height: min(calc(100vh - 120px), 560px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.channel-list::-webkit-scrollbar {
  width: 5px;
}
.channel-list::-webkit-scrollbar-track {
  background: transparent;
}
.channel-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.channel-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: background 0.12s var(--ease-out-quart), color 0.12s var(--ease-out-quart);
  cursor: pointer;
  border: none;
  border-left: 2px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  min-height: 34px;
  min-width: 0;
}
.channel-item.active {
  background: var(--active-row);
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}
.channel-item.channel-offline {
  opacity: 0.55;
}
.channel-item.channel-offline:hover {
  opacity: 0.75;
}
.channel-item.channel-offline .channel-live-dot {
  background: var(--danger, #d9534f);
  box-shadow: 0 0 4px rgba(217, 83, 79, 0.5);
  animation: none;
}
.channel-main-badge {
  font-size: 0.5625rem;
  color: var(--success);
  flex-shrink: 0;
  line-height: 1;
}
.channel-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
  box-shadow: 0 0 4px rgba(92, 184, 92, 0.4);
}
.channel-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-auto-badge {
  color: var(--accent);
  font-size: 0.5625rem;
  flex-shrink: 0;
  opacity: 0.8;
}
.channel-svc-badge {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-darker);
  padding: var(--sp-micro) var(--sp-sm);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  white-space: nowrap;
}
/* Service-colored badges in channel list */
.channel-svc-badge[data-service] {
  --svc-color: var(--text-muted);
  color: var(--svc-color);
  border-left: 2px solid var(--svc-color);
}
.channel-svc-badge[data-service*="twitch"]  { --svc-color: #9146ff; }
.channel-svc-badge[data-service*="kick"]    { --svc-color: #53fc18; }
.channel-svc-badge[data-service*="youtube"] { --svc-color: #e04040; }
.channel-svc-badge[data-service*="rumble"]  { --svc-color: #85c742; }
.channel-svc-badge[data-service*="trovo"]   { --svc-color: #30d870; }
.channel-svc-badge[data-service*="custom"]  { --svc-color: var(--accent); }
.channel-viewers {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-shrink: 0;
}

/* ── Live pulse indicator ─────────────────────────────────────── */
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: livePulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(92, 184, 92, 0.5),
              0 0 14px rgba(92, 184, 92, 0.25),
              0 0 24px rgba(92, 184, 92, 0.1);
  vertical-align: middle;
  flex-shrink: 0;
}
/* Channel list live dots get extra glow ring */
.channel-live-dot {
  box-shadow: 0 0 4px rgba(92, 184, 92, 0.6),
              0 0 10px rgba(92, 184, 92, 0.3);
  animation: livePulse 2s ease-in-out infinite, liveGlow 2s ease-in-out infinite;
}
.channel-item.active .channel-live-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(192, 160, 64, 0.8),
              0 0 16px rgba(192, 160, 64, 0.4);
  animation: livePulse 1.4s ease-in-out infinite, liveGlowAccent 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}
@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(92, 184, 92, 0.6), 0 0 10px rgba(92, 184, 92, 0.3); }
  50% { box-shadow: 0 0 6px rgba(92, 184, 92, 0.8), 0 0 16px rgba(92, 184, 92, 0.4); }
}
@keyframes liveGlowAccent {
  0%, 100% { box-shadow: 0 0 6px rgba(192, 160, 64, 0.8), 0 0 14px rgba(192, 160, 64, 0.4); }
  50% { box-shadow: 0 0 8px rgba(192, 160, 64, 1), 0 0 20px rgba(192, 160, 64, 0.5); }
}

/* ── Channel switch transition — Screen Tear Glitch ───────────── */
.stream-player { position: relative; }
.ch-switch-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}
.ch-switch-overlay.active {
  animation: chGlitchIn 0.5s var(--ease-out-expo) forwards;
}

/* Scanline overlay */
.ch-switch-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.2) 2px,
    rgba(0,0,0,0.2) 4px
  );
  opacity: 0.7;
}

/* Sweeping scanline bar */
.ch-switch-overlay::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent), 0 0 30px rgba(192,160,64,0.3);
  animation: chScanSweep 0.5s linear;
}

/* Individual tear slice — created by JS */
.ch-tear-slice {
  position: absolute;
  left: 0; right: 0;
  background: var(--bg-darker);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  will-change: transform, opacity;
}
.ch-tear-slice.active {
  animation: tearSlice 0.5s var(--ease-out-expo) forwards;
}
/* Alternate slices shift left/right for tear effect */
.ch-tear-slice:nth-child(odd) {
  animation-name: tearSliceLeft;
}

@keyframes chGlitchIn {
  0%   { opacity: 0; }
  8%   { opacity: 0.9; }
  20%  { opacity: 0.7; }
  50%  { opacity: 0.3; }
  100% { opacity: 0; }
}
@keyframes chScanSweep {
  from { top: -4px; }
  to   { top: 100%; }
}
@keyframes tearSlice {
  0%   { opacity: 0.8; transform: translateX(8px) scaleY(1.2); }
  40%  { opacity: 0.5; transform: translateX(-3px) scaleY(1); }
  100% { opacity: 0; transform: translateX(0); }
}
@keyframes tearSliceLeft {
  0%   { opacity: 0.8; transform: translateX(-8px) scaleY(1.2); }
  40%  { opacity: 0.5; transform: translateX(3px) scaleY(1); }
  100% { opacity: 0; transform: translateX(0); }
}

/* Now Playing scramble effect */
.now-playing strong {
  display: inline-block;
  min-width: 2ch;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.now-playing strong.scrambling {
  color: var(--accent);
  opacity: 0.8;
}

/* ── Channel flipper (up/down buttons) ─────────────────────────── */
.channel-flipper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px;
  margin-right: var(--sp-sm);
  position: relative;
}
.channel-flipper::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-pill);
  opacity: 0;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  transition: opacity 0.3s var(--ease-out-quart);
  z-index: -1;
}
.channel-flipper:hover::before {
  opacity: 0.15;
}
.channel-flipper button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  padding: 0 !important;
  font-size: var(--text-sm) !important;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease-out-quart),
              color 0.15s var(--ease-out-quart),
              transform 0.1s var(--ease-out-quart);
}
.channel-flipper button:hover {
  background: var(--hover-overlay);
  color: var(--accent) !important;
}
.channel-flipper button:active {
  transform: scale(0.88);
}
.channel-flipper .flip-divider {
  width: 1px;
  height: var(--sp-lg);
  background: var(--border);
  flex-shrink: 0;
}

/* ── TV static overlay ─────────────────────────────────────────── */
.tv-static-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
}
.tv-static-overlay.active {
  opacity: 1;
  animation: tvStaticFlash 0.42s steps(3) forwards;
}
.tv-static-overlay canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
/* CRT scanlines */
.tv-static-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.25) 2px,
      rgba(0,0,0,0.25) 4px
    );
  mix-blend-mode: multiply;
}
/* Vignette */
.tv-static-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
}
@keyframes tvStaticFlash {
  0%   { opacity: 0.85; filter: brightness(2.2) saturate(0); }
  25%  { opacity: 0.95; filter: brightness(0.4) saturate(0); }
  45%  { opacity: 0.8;  filter: brightness(1.6) saturate(0); }
  75%  { opacity: 0.3;  filter: brightness(1.1) saturate(0.7); }
  100% { opacity: 0;    filter: brightness(1) saturate(1); }
}
@media (prefers-reduced-motion: reduce) {
  .tv-static-overlay.active {
    animation: none;
    opacity: 0;
  }
}

/* ── Channel flip — CRT-style squash + directional nudge ───────── */
.flip-slide-up {
  animation: flipSlideUp 0.42s var(--ease-out-expo);
  transform-origin: center center;
}
.flip-slide-down {
  animation: flipSlideDown 0.42s var(--ease-out-expo);
  transform-origin: center center;
}
@keyframes flipSlideUp {
  0%   { opacity: 0.35; transform: translateX(16px) scale(1.01, 0.72); filter: brightness(1.25) blur(1px); }
  40%  { opacity: 0.7;  transform: translateX(4px) scale(1, 0.94); filter: brightness(1.1) blur(0.5px); }
  100% { opacity: 1;    transform: translateX(0) scale(1, 1); filter: brightness(1) blur(0); }
}
@keyframes flipSlideDown {
  0%   { opacity: 0.35; transform: translateX(-16px) scale(1.01, 0.72); filter: brightness(1.25) blur(1px); }
  40%  { opacity: 0.7;  transform: translateX(-4px) scale(1, 0.94); filter: brightness(1.1) blur(0.5px); }
  100% { opacity: 1;    transform: translateX(0) scale(1, 1); filter: brightness(1) blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .flip-slide-up, .flip-slide-down { animation: none; }
}

/* Channel number flash — retro TV tuner readout */
.ch-number-flash {
  position: absolute;
  top: var(--sp-lg);
  right: var(--sp-lg);
  z-index: 25;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent), 0 0 14px rgba(192,160,64,0.6), 0 2px 4px rgba(0,0,0,0.8);
  background: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0.55));
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(192,160,64,0.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.5), inset 0 0 8px rgba(192,160,64,0.08);
  pointer-events: none;
  opacity: 0;
}
.ch-number-flash::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  margin-right: 6px;
  vertical-align: 2px;
  animation: chLedBlink 0.4s steps(2, end) infinite;
}
.ch-number-flash.active {
  animation: chNumberIn 1.2s var(--ease-out-expo) forwards;
}
@keyframes chLedBlink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}
@keyframes chNumberIn {
  0%   { opacity: 0; transform: translateX(12px) scale(1.15); }
  8%   { opacity: 1; transform: translateX(0) scale(1); }
  75%  { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(0) scale(0.98); }
}
@media (prefers-reduced-motion: reduce) {
  .ch-number-flash::before { animation: none; }
  .ch-number-flash.active { animation: chNumberInReduced 0.8s linear forwards; }
  @keyframes chNumberInReduced { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
}

/* Flipper button kick */
.flip-kick {
  animation: flipKick 0.25s var(--ease-out-expo) !important;
}
@keyframes flipKick {
  0%   { transform: scale(0.7); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── Cinematic page boot sequence ──────────────────────────────── */
@keyframes bannerSlideDown {
  0%   { opacity: 0; transform: translateY(-30px) scaleY(0.8); }
  60%  { opacity: 1; transform: translateY(3px) scaleY(1.02); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}
@keyframes bottomBarSlideUp {
  0%   { opacity: 0; transform: translateY(30px); }
  60%  { opacity: 1; transform: translateY(-2px); }
  80%  { transform: translateY(1px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes streamFadeIn {
  0%   { opacity: 0; clip-path: inset(0 0 100% 0); }
  30%  { opacity: 0.4; clip-path: inset(0 0 60% 0); }
  100% { opacity: 1; clip-path: inset(0 0 0% 0); }
}

/* Scanline wipe that overlays the stream during boot */
.stream-layout::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 10%, var(--accent) 50%, transparent 90%);
  box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(192,160,64,0.3);
  z-index: 5;
  pointer-events: none;
  animation: bootScanline 0.8s 0.1s var(--ease-out-expo) both;
}
@keyframes bootScanline {
  0%   { top: 0; opacity: 1; }
  80%  { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

/* ── Bottom bar hover — Spring physics ─────────────────────── */
.bottom-bar a,
.bottom-bar button {
  transition: color 0.2s, transform 0.4s var(--ease-out-expo);
}
.bottom-bar a:hover,
.bottom-bar button:hover {
  transform: translateY(-2px) scale(1.05);
  color: var(--accent);
}
.bottom-bar a:active,
.bottom-bar button:active {
  transform: translateY(1px) scale(0.9);
  transition-duration: 0.1s;
}
/* Exclude channel items & tabs from bottom bar spring physics */
.channel-item,
.channel-item:hover,
.channel-item:active,
.channel-tab,
.channel-tab:hover,
.channel-tab:active {
  transform: none !important;
}
/* Bounce feedback on toggle state changes (applied via JS) */
.bar-bounce {
  animation: barSpringBounce 0.4s var(--ease-out-expo);
}
@keyframes barSpringBounce {
  0%   { transform: scale(0.85); }
  100% { transform: scale(1) translateY(0); }
}

/* Now-playing accent */
.now-playing strong {
  color: var(--accent);
}


/* Compact text labels for bottom bar icons — desktop only */
.bar-label {
  display: none;
  font-size: var(--text-sm);
  margin-left: var(--sp-xs);
  vertical-align: middle;
  letter-spacing: 0.01em;
}
@media (min-width: 1024px) {
  .bar-label { display: inline; }
}

/* ── Autofill override — keep dark inputs when browser autofills ── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--text-primary);
}

/* ── Login page ───────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-darker);
}
.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: var(--sp-lg);
}
.login-banner {
  text-align: center;
  margin-bottom: var(--sp-xl);
}
.login-banner img {
  height: 56px;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2xl);
  animation: loginIn 0.4s var(--ease-out-expo);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-box h2 {
  text-align: center;
  margin-bottom: var(--sp-xl);
  color: var(--accent);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
.login-notice {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}
.login-notice i {
  color: var(--accent);
  margin-right: var(--sp-xs);
}
.login-alt {
  text-align: center;
  margin-top: var(--sp-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.login-alt a {
  color: var(--accent);
  text-decoration: none;
}
.login-alt a:hover {
  text-decoration: underline;
}

/* ── Error page ───────────────────────────────────────────────── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-darker);
}
.error-box {
  text-align: center;
  padding: var(--sp-4xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: loginIn 0.4s var(--ease-out-expo);
  max-width: 560px;
}
.error-box h1 {
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.error-message {
  margin-top: var(--sp-md);
  color: var(--text-primary);
  max-width: 90vw;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.error-actions {
  margin-top: var(--sp-xl);
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Utility ──────────────────────────────────────────────────── */
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-muted { color: var(--text-muted); }

/* Text overflow helpers */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wrap { overflow-wrap: break-word; word-break: break-word; }

/* Visually hidden — accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 700;
  border-radius: 0 0 var(--radius) 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Form hint text */
.form-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  animation: modalBgIn 0.2s var(--ease-out-quart);
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-2xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
  animation: modalIn 0.3s var(--ease-out-expo);
}
@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-content h3 {
  margin-bottom: var(--sp-lg);
  color: var(--accent);
}
.form-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
}

/* ── Responsive ───────────────────────────────────────────────── */

/* Tablet (768–1023px) */
@media (max-width: 1023px) and (min-width: 769px) {
  .stream-chat {
    width: 280px;
  }
  .form-row {
    flex-wrap: wrap;
  }
  .form-row .form-group {
    min-width: 200px;
  }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
  .stream-layout {
    flex-direction: column;
  }
  .stream-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    flex: none;
  }
  .stream-chat {
    flex: 1;
    width: 100%;
    min-height: 200px;
    border-left: none;
    border-top: 1px solid var(--border);
    transition: min-height 0.35s var(--ease-out-expo),
                flex 0.35s var(--ease-out-expo),
                opacity 0.25s var(--ease-out-quart),
                border-top-width 0.35s var(--ease-out-expo);
  }
  .chat-hidden .stream-chat {
    width: 0;
    min-height: 0;
    flex: 0;
    opacity: 0;
    border-top-width: 0;
    pointer-events: none;
  }
  .chat-hidden .stream-player {
    flex: 1;
    padding-bottom: 0;
    height: auto;
  }
  .banner-img {
    height: 32px;
  }
  .site-banner {
    padding: var(--sp-xs) 0;
  }
  /* Hide EVA banner on mobile — saves vertical space */
  .eva-banner {
    display: none !important;
  }
  /* Bottom-right: icon-only on mobile */
  .bottom-right a {
    font-size: 0;
  }
  .bottom-right a i {
    font-size: var(--text-lg);
  }
  .channel-menu {
    left: auto;
    right: 0;
    width: min(320px, 90vw);
  }
  .bottom-bar {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    padding: var(--sp-xs) var(--sp-sm);
    gap: var(--sp-xs);
  }
  .bottom-bar a,
  .bottom-bar button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .now-playing {
    display: none;
  }
  .bar-divider {
    display: none;
  }
  .theme-menu {
    left: auto;
    right: 0;
  }
  .form-row {
    flex-direction: column;
  }
  .form-row .form-group {
    min-width: 0;
  }
  .modal-content {
    margin: var(--sp-lg);
    max-width: calc(100vw - var(--sp-3xl));
  }
  .login-wrapper {
    padding: var(--sp-md);
  }
  .login-box {
    padding: var(--sp-lg);
  }
  .btn-lg {
    width: 100%;
    justify-content: center;
  }
  .error-box h1 {
    font-size: var(--text-4xl);
  }
  .error-box {
    padding: var(--sp-xl);
  }
}

/* Mobile landscape */
@media (max-width: 812px) and (orientation: landscape) {
  .stream-layout {
    flex-direction: row;
  }
  .stream-player {
    padding-bottom: 0;
    height: auto;
    flex: 1;
  }
  .stream-chat {
    width: 260px;
    min-height: 0;
    border-left: 1px solid var(--border);
    border-top: none;
  }
  .site-banner {
    padding: 2px 0;
  }
  .banner-img {
    height: 26px;
  }
  .bottom-bar {
    height: auto;
    min-height: 44px;
  }
  .bottom-bar a,
  .bottom-bar button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Extra small screens (320px) */
@media (max-width: 380px) {
  .login-wrapper {
    padding: var(--sp-sm);
  }
  .login-box {
    padding: var(--sp-md);
  }
  .login-box h2 {
    font-size: var(--text-xl);
  }
  .modal-content {
    margin: var(--sp-sm);
    max-width: calc(100vw - var(--sp-lg));
    padding: var(--sp-lg);
  }
  .bottom-left {
    gap: var(--sp-sm);
  }
  .bottom-right {
    gap: 0;
  }
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Hide purely decorative motion elements */
  .stream-layout::after { display: none; }
  .ch-tear-slice { display: none; }
}

/* ── Focus-visible ring ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Forced colors / high contrast ───────────────────────────── */
@media (forced-colors: active) {
  .btn, .btn-primary, .btn-danger, .btn-ghost {
    border: 1px solid ButtonText;
  }
  .flash { border: 2px solid CanvasText; }
  .role-badge { border: 1px solid CanvasText; }
}

/* ═══════════════════════════════════════════════════════════════
   EVANGELION THEME — NERV Command Center Overrides
   Uses real images from ../themes/evangelion/
   ═══════════════════════════════════════════════════════════════ */

/* ── Full-page background image ────────────────────────────────── */
body[data-theme="evangelion"] {
  background: #0a0512;
  position: relative;
}

/* Background layer: End of Evangelion beach scene */
body[data-theme="evangelion"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,5,18,0.55) 0%, rgba(10,5,18,0.35) 35%, rgba(10,5,18,0.45) 65%, rgba(10,5,18,0.7) 100%),
    url('../themes/evangelion/bg.jpg') center 40% / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* CRT scanline overlay — subtle */
body[data-theme="evangelion"]::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 50;
}

/* Unit-01 watermark on the right side */
[data-theme="evangelion"] .stream-layout::before {
  content: '';
  position: fixed;
  right: -60px;
  bottom: -40px;
  width: 380px;
  height: 700px;
  background: url('../themes/evangelion/unit01.webp') center bottom / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  filter: saturate(0.3) brightness(1.4);
}

/* Ensure all direct content sits above the background layers */
[data-theme="evangelion"] .site-banner,
[data-theme="evangelion"] .stream-layout,
[data-theme="evangelion"] .bottom-bar {
  position: relative;
  z-index: 1;
}

/* ── EVA Banner ────────────────────────────────────────────────── */
.eva-banner {
  display: none;
}

[data-theme="evangelion"] .banner-img {
  display: none !important;
}

[data-theme="evangelion"] .site-banner {
  background: transparent;
  border-bottom: none;
  padding: 0;
  overflow: visible;
  box-shadow: 0 4px 30px rgba(255,106,0,0.1), 0 2px 10px rgba(90,40,160,0.15);
}

/* Mobile: kill EVA banner, restore regular banner */
@media (max-width: 768px) {
  [data-theme="evangelion"] .banner-img {
    display: block !important;
  }
  [data-theme="evangelion"] .site-banner {
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-xs) 0;
    overflow: hidden;
  }
}

[data-theme="evangelion"] .eva-banner {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 12.8vh;
  max-height: 102px;
  min-height: 52px;
  overflow: hidden;
  /* Background: End of Evangelion beach scene */
  background:
    linear-gradient(90deg, rgba(10,5,18,0.5) 0%, rgba(10,5,18,0) 20%, rgba(10,5,18,0) 80%, rgba(10,5,18,0.5) 100%),
    url('../themes/evangelion/bg.jpg') center 38% / cover no-repeat;
  animation: bannerSlideDown 0.6s var(--ease-out-expo) both;
}

/* Vignette overlay — lighter to let the scene show */
[data-theme="evangelion"] .eva-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(10, 5, 18, 0.4) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Animated Hazard Stripes */
.eva-warning-stripe-top, .eva-warning-stripe-bottom {
  position: absolute;
  left: -20px;
  right: -20px;
  height: 3px;
  z-index: 5;
  background: repeating-linear-gradient(
    -45deg,
    #ff6a00 0px,
    #ff6a00 8px,
    #110015 8px,
    #110015 16px
  );
  background-size: 22.62px 22.62px;
  animation: hazardScroll 1.5s linear infinite;
  box-shadow: 0 0 6px rgba(255, 106, 0, 0.3);
}
.eva-warning-stripe-bottom { bottom: 0; animation-direction: reverse; }
.eva-warning-stripe-top { top: 0; }

@keyframes hazardScroll {
  to { background-position: 22.62px 0; }
}

/* Hex grid canvas */
.eva-hex-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
  mix-blend-mode: screen;
}

/* NERV wordmark with Glitch */
.eva-nerv-text {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: clamp(2rem, 5vh, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  text-transform: uppercase;
  color: #ff6a00;
  text-shadow:
    0 0 10px rgba(255,106,0,0.8),
    0 0 30px rgba(255,106,0,0.3),
    0 0 60px rgba(255,106,0,0.15);
  z-index: 2;
  animation: nervPulse 4s ease-in-out infinite;
  position: relative;
  user-select: none;
  transform: scaleY(1.15) scaleX(1.05);
}

.eva-nerv-text::before, .eva-nerv-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.8;
}

.eva-nerv-text::before {
  animation: nervGlitch 3s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: rgba(255, 106, 0, 0.9);
  z-index: -1;
}

.eva-nerv-text::after {
  animation: nervGlitch 3s cubic-bezier(.25, .46, .45, .94) both infinite reverse;
  color: rgba(90, 40, 160, 0.9);
  z-index: -2;
}

@keyframes nervGlitch {
  0% { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  2% { transform: translate(-2px, 1px); clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); }
  4% { transform: translate(2px, -1px); clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%); }
  6% { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  100% { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes nervPulse {
  0%, 100% { opacity: 0.95; text-shadow: 0 0 15px rgba(255, 106, 0, 0.9), 0 0 40px rgba(255, 106, 0, 0.3); }
  50% { opacity: 1; text-shadow: 0 0 25px rgba(255, 106, 0, 1), 0 0 60px rgba(255, 106, 0, 0.5); }
}

/* Tagline */
.eva-tagline {
  position: absolute;
  bottom: 10px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: rgba(90,40,160,0.8);
  text-transform: uppercase;
  z-index: 2;
  user-select: none;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(90,40,160,0.4);
  animation: fadePulse 6s ease-in-out infinite alternate;
}

@keyframes fadePulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Terminal readout bar */
.eva-terminal-bar {
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  height: 18px;
  background: rgba(0,0,0,0.75);
  border-bottom: 1px solid rgba(51,255,102,0.25);
  border-top: 1px solid rgba(51,255,102,0.08);
  overflow: hidden;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.eva-terminal-text {
  display: inline-block;
  white-space: nowrap;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.65rem;
  color: #33ff66;
  font-weight: bold;
  line-height: 18px;
  animation: evaTerminalScroll 40s linear infinite;
  text-shadow: 0 0 6px rgba(51,255,102,0.5);
  will-change: transform;
}

@keyframes evaTerminalScroll {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* Status lights (MAGI indicators) */
.eva-status-lights {
  position: absolute;
  bottom: 10px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 4;
  align-items: center;
  background: rgba(0,0,0,0.6);
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid rgba(90,40,160,0.2);
}

.eva-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.eva-light::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.5;
}

.eva-light-label {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.55rem;
  font-weight: bold;
  color: #ff6a00;
  text-shadow: 0 0 4px rgba(255,106,0,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 4px;
}

/* MAGI flicker animations */
.eva-light.green.melchior {
  background: #33ff66;
  box-shadow: 0 0 6px #33ff66, 0 0 12px rgba(51,255,102,0.4);
  animation: magiFlickerA 7s infinite;
}
.eva-light.green.balthasar {
  background: #33ff66;
  box-shadow: 0 0 6px #33ff66, 0 0 12px rgba(51,255,102,0.4);
  animation: magiFlickerB 11s infinite;
}
.eva-light.orange.casper {
  background: #ffb800;
  box-shadow: 0 0 6px #ffb800, 0 0 12px rgba(255,184,0,0.4);
  animation: magiFlickerC 4s infinite;
}

@keyframes magiFlickerA {
  0%, 96%, 98%, 100% { opacity: 1; }
  97% { opacity: 0.1; }
}
@keyframes magiFlickerB {
  0%, 40%, 42%, 100% { opacity: 1; }
  41% { opacity: 0.1; }
}
@keyframes magiFlickerC {
  0%, 80%, 84%, 100% { opacity: 1; box-shadow: 0 0 6px #ffb800, 0 0 12px rgba(255,184,0,0.4); }
  82% { opacity: 0.4; box-shadow: none; }
}

/* EVA Pilot — now using real Unit-01 image */
.eva-pilot {
  display: none;
}

[data-theme="evangelion"] .eva-pilot {
  display: block;
  position: absolute;
  right: 3%;
  bottom: 0;
  width: clamp(55px, 11vh, 100px);
  height: clamp(70px, 13vh, 130px);
  z-index: 2;
  opacity: 0.85;
  background: url('../themes/evangelion/berserk.webp') center bottom / contain no-repeat;
  pointer-events: none;
  animation: evaPilotBreathe 5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 16px rgba(255,106,0,0.5)) brightness(1.2);
}

@keyframes evaPilotBreathe {
  0% { opacity: 0.7; filter: drop-shadow(0 0 12px rgba(255,106,0,0.4)) brightness(1.1); }
  100% { opacity: 0.9; filter: drop-shadow(0 0 22px rgba(255,106,0,0.6)) brightness(1.3); }
}

@media (max-width: 768px) {
  [data-theme="evangelion"] .eva-pilot {
    right: 2%;
    width: 40px;
    height: 55px;
  }
  [data-theme="evangelion"] .stream-layout::before {
    display: none;
  }
}

/* ── EVA interactive element overrides ─────────────────────────── */

/* Orange glow on bottom bar buttons */
[data-theme="evangelion"] .bottom-bar a:hover,
[data-theme="evangelion"] .bottom-bar button:hover {
  text-shadow: 0 0 8px rgba(255,106,0,0.5);
}

/* Channel item hover with purple glow */
[data-theme="evangelion"] .channel-item:hover {
  background: rgba(90,40,160,0.1);
}

/* Active channel — orange bevel with inset glow */
[data-theme="evangelion"] .channel-item.active {
  box-shadow: inset 3px 0 12px rgba(255,106,0,0.12);
}

/* Service badge with NERV purple treatment */
[data-theme="evangelion"] .channel-svc-badge {
  background: rgba(90,40,160,0.15);
  border: 1px solid rgba(90,40,160,0.25);
  color: rgba(160,120,220,0.8);
}

/* Channel menu border glow */
[data-theme="evangelion"] .channel-menu {
  border-color: rgba(90,40,160,0.3);
  box-shadow: 0 8px 40px rgba(255,106,0,0.08), 0 0 1px rgba(90,40,160,0.5);
  background: rgba(10,5,18,0.95);
}

/* Theme menu border glow */
[data-theme="evangelion"] .theme-menu {
  border-color: rgba(90,40,160,0.3);
  box-shadow: 0 4px 20px rgba(255,106,0,0.08);
  background: rgba(10,5,18,0.95);
}

/* Custom scrollbar — orange on purple */
[data-theme="evangelion"] .channel-list {
  scrollbar-color: rgba(255,106,0,0.35) rgba(90,40,160,0.1);
}
[data-theme="evangelion"] .channel-list::-webkit-scrollbar-thumb {
  background: rgba(255,106,0,0.35);
}
[data-theme="evangelion"] .channel-list::-webkit-scrollbar-track {
  background: rgba(90,40,160,0.1);
}

/* Channel tabs — purple underline */
[data-theme="evangelion"] .channel-tab {
  border-bottom-color: transparent;
}
[data-theme="evangelion"] .channel-tab.active {
  border-bottom-color: #ff6a00;
  text-shadow: 0 0 8px rgba(255,106,0,0.3);
}

/* Channel flipper — NERV glow */
[data-theme="evangelion"] .channel-flipper {
  border-color: rgba(90,40,160,0.3);
  background: rgba(10,5,18,0.85);
}
[data-theme="evangelion"] .channel-flipper::before {
  background: linear-gradient(135deg, rgba(255,106,0,0.2), rgba(90,40,160,0.15) 60%);
}
[data-theme="evangelion"] .channel-flipper button:hover {
  text-shadow: 0 0 6px rgba(255,106,0,0.5);
}

/* Bottom bar — deep NERV purple */
[data-theme="evangelion"] .bottom-bar {
  background: rgba(10,5,18,0.95);
  border-top: 1px solid rgba(90,40,160,0.2);
}

/* Stream boot scanline — orange */
[data-theme="evangelion"] .stream-layout::after {
  background: linear-gradient(90deg, transparent 10%, #ff6a00 50%, transparent 90%);
  box-shadow: 0 0 10px #ff6a00, 0 0 20px rgba(255,106,0,0.3);
}

/* MOTD bar — NERV style */
[data-theme="evangelion"] .motd-bar {
  background: rgba(90,40,160,0.1);
  border-bottom-color: rgba(90,40,160,0.2);
}

/* Layout menu */
[data-theme="evangelion"] .layout-menu {
  border-color: rgba(90,40,160,0.3);
  box-shadow: 0 8px 30px rgba(255,106,0,0.06);
  background: rgba(10,5,18,0.95);
}

/* Live pulse — green for MAGI, orange for active */
[data-theme="evangelion"] .channel-live-dot {
  background: #33ff66;
  box-shadow: 0 0 4px rgba(51,255,102,0.6), 0 0 10px rgba(51,255,102,0.3);
}
[data-theme="evangelion"] .channel-item.active .channel-live-dot {
  background: #ff6a00;
  box-shadow: 0 0 6px rgba(255,106,0,0.8), 0 0 16px rgba(255,106,0,0.4);
}
[data-theme="evangelion"] .channel-item.channel-offline .channel-live-dot {
  background: var(--danger, #d9534f);
  box-shadow: 0 0 4px rgba(217,83,79,0.5);
  animation: none;
}
[data-theme="evangelion"] .live-pulse {
  background: #33ff66;
  box-shadow: 0 0 6px rgba(51,255,102,0.5), 0 0 14px rgba(51,255,102,0.25);
}

/* ── EVA reduced motion overrides ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .eva-nerv-text { animation: none !important; }
  .eva-nerv-text::before, .eva-nerv-text::after { animation: none !important; }
  .eva-terminal-text { animation: none !important; }
  .eva-light { animation: none !important; }
  .eva-hex-canvas { display: none; }
  .eva-warning-stripe-top, .eva-warning-stripe-bottom { animation: none !important; }
  body[data-theme="evangelion"]::after { display: none; }
  [data-theme="evangelion"] .eva-pilot { animation: none !important; }
}
/* ================================================================
   HELLO KITTY THEME — Sanrio pink overrides
   Light pastel theme with a themed banner image.
   ================================================================ */

/* Page background: soft vertical gradient from cream to pink, plus a
   faint pink-dot polka pattern for texture. */
body[data-theme="hellokitty"] {
  background:
    radial-gradient(circle at 20% 15%, rgba(244, 108, 140, 0.08) 0 3px, transparent 4px),
    radial-gradient(circle at 75% 55%, rgba(244, 108, 140, 0.06) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 45% 85%, rgba(244, 108, 140, 0.05) 0 2px, transparent 3px),
    linear-gradient(180deg, #fff4f7 0%, #ffe6ee 55%, #fed5dd 100%);
  background-size: 180px 180px, 240px 240px, 200px 200px, 100% 100%;
  background-attachment: fixed;
  color: var(--text-primary);
}

/* The new Hello Kitty banner is a seamless horizontally-tiling pattern —
   tile it as a background on .site-banner (fills any viewport width with
   no cropping, no stretching) and hide the default <img> so it doesn't
   collide with the tile. */
[data-theme="hellokitty"] .banner-img {
  display: none !important;
}

[data-theme="hellokitty"] .site-banner {
  background-color: #ffc6d6;
  background-image: url('../themes/hellokitty/banner.jpg');
  background-repeat: repeat-x;
  background-position: center center;
  background-size: auto 100%;
  border-bottom: 2px solid #f46c8c;
  box-shadow: 0 2px 0 #ffd4e0, 0 4px 12px rgba(244, 108, 140, 0.15);
  height: 110px;
  padding: 0;
  overflow: hidden;
}

/* Ensure content sits above the fixed background */
[data-theme="hellokitty"] .stream-layout,
[data-theme="hellokitty"] .bottom-bar {
  position: relative;
  z-index: 1;
}

/* Bottom bar — sweeter pink for the theme */
[data-theme="hellokitty"] .bottom-bar {
  background: linear-gradient(180deg, #ffeaf0 0%, #ffd4e0 100%);
  border-top: 1px solid var(--border);
}

/* Text on light background needs stronger weight on dim/muted to stay legible */
[data-theme="hellokitty"] .text-muted,
[data-theme="hellokitty"] .text-secondary {
  font-weight: 500;
}

/* Inputs — clean white on pink page, with pink focus ring */
[data-theme="hellokitty"] input,
[data-theme="hellokitty"] textarea,
[data-theme="hellokitty"] select {
  background: #fff;
  border-color: var(--border);
  color: var(--text-primary);
}
[data-theme="hellokitty"] input:focus,
[data-theme="hellokitty"] textarea:focus,
[data-theme="hellokitty"] select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Reduced motion — kill the background gradient animation if we add one later */
@media (prefers-reduced-motion: reduce) {
  body[data-theme="hellokitty"] { background-attachment: scroll; }
}

/* ═══════════════════════════════════════════════════════════════════
   SYNTHWAVE THEME — 80s Retrowave
   ═══════════════════════════════════════════════════════════════════ */

/* ── Synthwave Banner — hide default ───────────────────────────── */
[data-theme="synthwave"] .banner-img { display: none !important; }
[data-theme="synthwave"] .eva-banner { display: none !important; }

/* ── Synthwave Banner — sun + grid ─────────────────────────────── */
.sw-banner {
  display: none;
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
  contain: layout paint;
  background: linear-gradient(180deg, #05010f 0%, #0d0221 18%, #1a0533 40%, #2d1b69 60%, #6b2fa0 76%, #ff2975 88%, #ff6b35 95%, #ffd319 100%);
}
[data-theme="synthwave"] .sw-banner { display: block; }

/* Star field — lightweight, fewer layers */
.sw-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 40% 22%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 70% 18%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 85% 12%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 60% 28%, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* Distant mountain range silhouette */
.sw-mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  height: 26px;
  background:
    linear-gradient(135deg, transparent 49.5%, #1a0533 50%) 0 0/60px 22px,
    linear-gradient(45deg, transparent 49.5%, #1a0533 50%) 30px 0/60px 22px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

/* Sun — larger, pulsing, with scanline cuts */
.sw-sun {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 100px;
  border-radius: 200px 200px 0 0;
  background: linear-gradient(180deg, #ffd319 0%, #ffaa22 28%, #ff6b35 55%, #ff2975 85%, #b24dff 100%);
  box-shadow: 0 0 80px rgba(255, 107, 53, 0.35);
  /* Horizontal slice lines — thicker toward the bottom like classic synthwave sun */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 38%,
    transparent 40%, transparent 45%, #000 45%, #000 52%,
    transparent 54%, transparent 60%, #000 60%, #000 68%,
    transparent 70%, transparent 78%, #000 78%, #000 88%,
    transparent 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 38%,
    transparent 40%, transparent 45%, #000 45%, #000 52%,
    transparent 54%, transparent 60%, #000 60%, #000 68%,
    transparent 70%, transparent 78%, #000 78%, #000 88%,
    transparent 90%, transparent 100%);
  z-index: 0;
}

/* Palm tree silhouettes flanking the banner */
.sw-palms {
  position: absolute;
  bottom: 44px;
  width: 70px;
  height: 60px;
  pointer-events: none;
  z-index: 1;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
  opacity: 0.85;
}
.sw-palms-left  { left: 4%; }
.sw-palms-right { right: 4%; transform: scaleX(-1); }
.sw-palms::before,
.sw-palms::after {
  content: '';
  position: absolute;
  bottom: 0;
  background: #0a0118;
}
/* Trunk */
.sw-palms::before {
  left: 50%;
  width: 3px;
  height: 52px;
  margin-left: -1.5px;
  background: linear-gradient(180deg, #160528 0%, #0a0118 100%);
  box-shadow: 0 0 4px rgba(255,41,117,0.35);
  transform: skewX(-2deg);
}
/* Fronds — a compact radial cluster using multiple pseudo-element via box-shadow */
.sw-palms::after {
  left: 50%;
  bottom: 48px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #0a0118;
  box-shadow:
    -14px -2px 0 -1px #0a0118,
     14px -2px 0 -1px #0a0118,
    -10px -8px 0 -1px #0a0118,
     10px -8px 0 -1px #0a0118,
    -18px  2px 0 -2px #0a0118,
     18px  2px 0 -2px #0a0118,
     0    -10px 0 -1px #0a0118;
}

/* Horizon glow line — brighter, with chromatic edge */
.sw-horizon-glow {
  position: absolute;
  bottom: 50px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 2%, rgba(255,41,117,0.5) 18%, rgba(255,107,53,0.7) 40%, rgba(255,211,25,0.85) 50%, rgba(255,107,53,0.7) 60%, rgba(255,41,117,0.5) 82%, transparent 98%);
  box-shadow:
    0 0 18px rgba(255, 107, 53, 0.6),
    0 0 36px rgba(255, 41, 117, 0.3),
    0 1px 0 rgba(0, 255, 245, 0.4);
  z-index: 1;
}

/* Perspective grid floor — deeper */
.sw-grid-floor {
  position: absolute;
  bottom: 0;
  left: -20%;
  width: 140%;
  height: 50px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--sw-grid) 0px,
      var(--sw-grid) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      0deg,
      var(--sw-grid) 0px,
      var(--sw-grid) 1px,
      transparent 1px,
      transparent 12px
    );
  transform: perspective(150px) rotateX(45deg);
  transform-origin: center top;
  /* Animation removed — grid scroll triggered constant repaints / GPU load. */
}

@keyframes sw-grid-scroll {
  from { background-position: 0 0; }
  to   { background-position: 0 12px; }
}

/* Title overlay */
.sw-title-wrap {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
}
.sw-title {
  position: relative;
  display: block;
  font-family: 'Arial Black', 'Helvetica Neue', Impact, sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.18em;
  color: #fff;
  line-height: 1;
  /* Chromatic aberration — reduced to 2 offset layers + 1 soft glow */
  text-shadow:
    2px 0 0 rgba(255, 41, 117, 0.85),
    -2px 0 0 rgba(0, 255, 245, 0.85),
    0 3px 0 #b24dff,
    0 5px 14px rgba(255, 41, 117, 0.4);
  /* Transform plate to sit on the grid */
  transform: perspective(400px) rotateX(2deg);
}
/* Title bottom gradient stripe — sunset-through-letters effect */
.sw-title::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 45%, #ffd319 46%, #ff6b35 62%, #ff2975 80%, #b24dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  pointer-events: none;
  letter-spacing: inherit;
}
.sw-subtitle {
  display: inline-flex;
  gap: 0.45em;
  align-items: center;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-top: 10px;
  padding: 3px 10px;
  background: rgba(10, 1, 24, 0.55);
  border: 1px solid rgba(0, 255, 245, 0.25);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(0, 255, 245, 0.15), inset 0 0 8px rgba(255, 41, 117, 0.06);
}
.sw-sub-live {
  color: var(--sw-pink);
  text-shadow: 0 0 6px rgba(255, 41, 117, 0.9), 0 0 12px rgba(255, 41, 117, 0.4);
  animation: sw-blink 1.6s steps(2, end) infinite;
}
.sw-sub-sep { color: rgba(255,255,255,0.35); }
.sw-sub-ch  { color: var(--sw-yellow); text-shadow: 0 0 6px rgba(255, 211, 25, 0.5); }

@keyframes sw-blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.35; }
}

/* VHS tracking line — removed (mix-blend-mode + fullwidth sweep was GPU-heavy) */
.sw-vhs-track { display: none; }

/* ── Synthwave Background ──────────────────────────────────────── */
[data-theme="synthwave"] .public-page {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(178, 77, 255, 0.04) 0%, transparent 60%),
    var(--bg-darker);
}

/* Page-wide scanline overlay removed — was a full-viewport repaint hog. */
body[data-theme="synthwave"]::after { content: none; }

/* ── Synthwave Bottom Bar ──────────────────────────────────────── */
[data-theme="synthwave"] .bottom-bar {
  background: linear-gradient(180deg, rgba(13,2,33,0.95) 0%, rgba(21,5,53,0.98) 100%);
  border-top: 1px solid var(--sw-purple);
  box-shadow: 0 -2px 12px rgba(178, 77, 255, 0.12), 0 -1px 0 rgba(0, 255, 245, 0.06);
}
[data-theme="synthwave"] .bottom-bar a,
[data-theme="synthwave"] .bottom-bar button {
  color: var(--sw-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 245, 0.2);
  transition: color 0.2s, text-shadow 0.2s;
}
[data-theme="synthwave"] .bottom-bar a:hover,
[data-theme="synthwave"] .bottom-bar button:hover {
  color: var(--sw-yellow);
  text-shadow: 0 0 8px rgba(255, 211, 25, 0.4);
}

/* ── Synthwave Channel Menu ────────────────────────────────────── */
[data-theme="synthwave"] .channel-menu {
  background: rgba(13, 2, 33, 0.96);
  border: 1px solid var(--sw-purple);
  box-shadow: 0 4px 24px rgba(178, 77, 255, 0.12), 0 0 1px rgba(0, 255, 245, 0.15), inset 0 0 30px rgba(178, 77, 255, 0.03);
}

[data-theme="synthwave"] .channel-tab {
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}
[data-theme="synthwave"] .channel-tab:hover {
  color: var(--sw-cyan);
}
[data-theme="synthwave"] .channel-tab.active {
  color: var(--sw-cyan);
  border-bottom-color: var(--sw-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 245, 0.4);
}

[data-theme="synthwave"] .channel-item {
  border-left: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
[data-theme="synthwave"] .channel-item:hover {
  background: rgba(178, 77, 255, 0.06);
  border-left-color: rgba(0, 255, 245, 0.3);
}
[data-theme="synthwave"] .channel-item.active {
  background: rgba(178, 77, 255, 0.08);
  border-left-color: var(--sw-cyan);
  box-shadow: inset 3px 0 12px rgba(0, 255, 245, 0.06);
}

/* Service badges — neon colors per platform */
[data-theme="synthwave"] .channel-svc-badge {
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
}
[data-theme="synthwave"] .channel-svc-badge[data-service="twitch"] {
  background: rgba(178, 77, 255, 0.15);
  border: 1px solid rgba(178, 77, 255, 0.3);
  color: var(--sw-purple);
}
[data-theme="synthwave"] .channel-svc-badge[data-service="kick"] {
  background: rgba(57, 255, 142, 0.1);
  border: 1px solid rgba(57, 255, 142, 0.2);
  color: var(--success);
}
[data-theme="synthwave"] .channel-svc-badge[data-service="custom"],
[data-theme="synthwave"] .channel-svc-badge[data-service="customembed"] {
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.25);
  color: var(--sw-orange);
}

/* Live dot — cyan neon default, pink on active */
[data-theme="synthwave"] .channel-live-dot {
  background: var(--sw-cyan);
  box-shadow: 0 0 4px rgba(0, 255, 245, 0.6), 0 0 10px rgba(0, 255, 245, 0.3);
}
[data-theme="synthwave"] .channel-item.active .channel-live-dot {
  background: var(--sw-pink);
  box-shadow: 0 0 6px rgba(255, 41, 117, 0.8), 0 0 14px rgba(255, 41, 117, 0.3);
}
[data-theme="synthwave"] .channel-item.channel-offline .channel-live-dot {
  background: var(--danger, #d9534f);
  box-shadow: 0 0 4px rgba(217,83,79,0.5);
  animation: none;
}

/* ── Synthwave Theme Picker ────────────────────────────────────── */
[data-theme="synthwave"] .theme-menu {
  background: rgba(13, 2, 33, 0.96);
  border: 1px solid var(--sw-purple);
  box-shadow: 0 4px 24px rgba(178, 77, 255, 0.12);
}

[data-theme="synthwave"] .layout-menu {
  background: rgba(13, 2, 33, 0.96);
  border: 1px solid var(--sw-purple);
  box-shadow: 0 8px 30px rgba(178, 77, 255, 0.1);
}

/* ── Synthwave Channel Flipper ─────────────────────────────────── */
[data-theme="synthwave"] .channel-flipper {
  border-color: rgba(178, 77, 255, 0.3);
  background: rgba(13, 2, 33, 0.9);
}
[data-theme="synthwave"] .channel-flipper::before {
  background: linear-gradient(135deg, rgba(178, 77, 255, 0.1), rgba(0, 255, 245, 0.06) 60%);
}
[data-theme="synthwave"] .channel-flipper button {
  color: var(--sw-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 245, 0.25);
}
[data-theme="synthwave"] .channel-flipper button:hover {
  color: var(--sw-yellow);
  text-shadow: 0 0 8px rgba(255, 211, 25, 0.4);
  background: rgba(255, 211, 25, 0.06);
}

/* ── Synthwave Scrollbar ───────────────────────────────────────── */
[data-theme="synthwave"] .channel-list {
  scrollbar-color: rgba(178, 77, 255, 0.35) rgba(178, 77, 255, 0.06);
}
[data-theme="synthwave"] .channel-list::-webkit-scrollbar-thumb {
  background: rgba(178, 77, 255, 0.35);
}
[data-theme="synthwave"] .channel-list::-webkit-scrollbar-thumb:hover {
  background: rgba(178, 77, 255, 0.5);
}
[data-theme="synthwave"] .channel-list::-webkit-scrollbar-track {
  background: rgba(178, 77, 255, 0.06);
}

/* ── Synthwave Stream Border ───────────────────────────────────── */
[data-theme="synthwave"] .stream-layout::after {
  background: linear-gradient(180deg, transparent 10%, var(--sw-purple) 25%, var(--sw-cyan) 50%, var(--sw-purple) 75%, transparent 90%);
  box-shadow: 0 0 8px rgba(0, 255, 245, 0.3), 0 0 16px rgba(178, 77, 255, 0.2);
}

/* ── Synthwave MOTD ────────────────────────────────────────────── */
[data-theme="synthwave"] .motd-bar {
  background: rgba(178, 77, 255, 0.05);
  border-bottom: 1px solid rgba(178, 77, 255, 0.25);
}
[data-theme="synthwave"] .motd-bar .motd-text {
  color: var(--sw-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 245, 0.2);
}

/* ── Synthwave Now Playing ─────────────────────────────────────── */
[data-theme="synthwave"] .now-playing {
  color: var(--text-secondary);
  border-left-color: rgba(178, 77, 255, 0.3);
  border-right-color: rgba(178, 77, 255, 0.3);
}
[data-theme="synthwave"] .now-playing strong {
  color: var(--sw-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 245, 0.3);
}

/* ── Synthwave Live Pulse ──────────────────────────────────────── */
[data-theme="synthwave"] .live-pulse {
  background: var(--sw-cyan);
  box-shadow: 0 0 6px rgba(0, 255, 245, 0.6), 0 0 14px rgba(0, 255, 245, 0.25);
}

/* ── Synthwave Feedback Modal ──────────────────────────────────── */
[data-theme="synthwave"] .feedback-modal {
  background: #150535;
  border: 1px solid var(--sw-purple);
  box-shadow: 0 0 20px rgba(178, 77, 255, 0.15), 0 0 40px rgba(0, 255, 245, 0.04);
}
[data-theme="synthwave"] .feedback-modal .feedback-header {
  border-bottom-color: rgba(178, 77, 255, 0.3);
}
[data-theme="synthwave"] .feedback-modal h2 {
  color: var(--sw-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 245, 0.3);
}
/* Shortcuts & More menus */
[data-theme="synthwave"] .shortcuts-modal {
  background: #150535;
  border: 1px solid var(--sw-purple);
  box-shadow: 0 0 20px rgba(178, 77, 255, 0.15), 0 0 40px rgba(0, 255, 245, 0.04);
}
[data-theme="synthwave"] .shortcuts-header {
  border-bottom-color: rgba(178, 77, 255, 0.3);
}
[data-theme="synthwave"] .shortcuts-header h2 {
  color: var(--sw-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 245, 0.3);
}
[data-theme="synthwave"] .shortcuts-group h3 {
  color: var(--sw-pink);
}
[data-theme="synthwave"] .more-menu-popup {
  background: #150535;
  border: 1px solid var(--sw-purple);
  box-shadow: 0 0 20px rgba(178, 77, 255, 0.15);
}

/* ── Synthwave Login Page ──────────────────────────────────────── */
[data-theme="synthwave"] .login-box {
  border: 1px solid var(--sw-purple);
  background: rgba(21, 5, 53, 0.95);
  box-shadow: 0 0 30px rgba(178, 77, 255, 0.1), 0 0 60px rgba(178, 77, 255, 0.05);
}
[data-theme="synthwave"] .login-box input:focus {
  border-color: var(--sw-cyan);
  box-shadow: 0 0 0 2px rgba(0, 255, 245, 0.15), 0 0 8px rgba(0, 255, 245, 0.1);
}

/* ── Synthwave Reduced Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sw-grid-floor { animation: none !important; }
  body[data-theme="synthwave"]::after { display: none; }
}

/* ── Overlay Performance ───────────────────────────────────────── */
/* Pause heavy theme animations and hide scanlines while modals are open
   to prevent backdrop-filter compositing lag */
body.overlay-open[data-theme="synthwave"] .sw-grid-floor {
  animation-play-state: paused;
}
body.overlay-open[data-theme="synthwave"]::after {
  display: none;
}
body.overlay-open[data-theme="synthwave"] .sw-sun {
  box-shadow: none;
}
body.overlay-open .feedback-overlay,
body.overlay-open .shortcuts-overlay {
  backdrop-filter: none;
}

/* ── Synthwave Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sw-banner { height: 72px; }
  .sw-sun { width: 70px; height: 35px; bottom: 12px; }
  .sw-title { font-size: 1rem; letter-spacing: 0.15em; }
  .sw-subtitle { font-size: 0.4rem; }
  .sw-grid-floor { height: 22px; }
  .sw-horizon-glow { bottom: 24px; }
}

/* ── Feedback Modal ────────────────────────────────────────────── */
.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out-quart), visibility 0.25s;
}
.feedback-overlay.open {
  opacity: 1;
  visibility: visible;
}
.feedback-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popup);
  width: 90%;
  max-width: 440px;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s var(--ease-out-quart);
}
.feedback-overlay.open .feedback-modal {
  transform: translateY(0) scale(1);
}
.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
}
.feedback-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.feedback-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: var(--sp-xs);
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.feedback-close:hover { color: var(--text-primary); }
.feedback-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#feedbackForm {
  padding: var(--sp-lg);
}
.feedback-type-row {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.feedback-type-btn {
  flex: 1;
  cursor: pointer;
}
.feedback-type-btn input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-type-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.15s var(--ease-out-quart);
}
.feedback-type-btn input:checked + span {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb, 192, 160, 64), 0.08);
}
.feedback-type-btn input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#feedbackMessage {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  padding: var(--sp-sm) var(--sp-md);
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s;
}
#feedbackMessage:focus {
  outline: none;
  border-color: var(--accent);
}
#feedbackMessage::placeholder { color: var(--text-muted); }

.feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-md);
}
.feedback-char-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.feedback-status {
  margin-top: var(--sp-sm);
  font-size: var(--text-sm);
  min-height: 1.2em;
}
.feedback-status.success { color: var(--success); }
.feedback-status.error { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .feedback-overlay { transition: none; }
  .feedback-modal { transition: none; }
}
@media (forced-colors: active) {
  .feedback-type-btn input:checked + span { border: 2px solid ButtonText; }
  .feedback-modal { border: 2px solid CanvasText; }
}
/* ── More Menu (bottom bar links popover) ─────────────────────── */
.more-menu {
  position: relative;
}
.more-menu-popup {
  position: absolute;
  bottom: calc(100% + var(--sp-sm));
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popup);
  min-width: 180px;
  padding: var(--sp-xs) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease-out-quart), transform 0.2s var(--ease-out-quart), visibility 0.2s;
  z-index: 800;
}
.more-menu-popup.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.more-menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  /* Reset for <button> variant (Feedback) */
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.more-menu-item:hover {
  background: var(--bg-input);
  color: var(--accent);
  transform: none;
}
.more-menu-item i {
  width: 1.2em;
  text-align: center;
  font-size: var(--text-lg);
}

/* ── Shortcuts Modal ──────────────────────────────────────────── */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out-quart), visibility 0.25s;
}
.shortcuts-overlay.open {
  opacity: 1;
  visibility: visible;
}
.shortcuts-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popup);
  width: 90%;
  max-width: 400px;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s var(--ease-out-quart);
}
.shortcuts-overlay.open .shortcuts-modal {
  transform: translateY(0) scale(1);
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
}
.shortcuts-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.shortcuts-body {
  padding: var(--sp-lg);
}
.shortcuts-group {
  margin-bottom: var(--sp-lg);
}
.shortcuts-group:last-child {
  margin-bottom: 0;
}
.shortcuts-group h3 {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-sm);
}
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-xs) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.shortcut-keys {
  display: flex;
  gap: var(--sp-xs);
}
kbd {
  display: inline-block;
  padding: var(--sp-micro) var(--sp-sm);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--text-xs);
  color: var(--text-primary);
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 1.6em;
  text-align: center;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .more-menu-popup { transition: none; }
  .shortcuts-overlay { transition: none; }
  .shortcuts-modal { transition: none; }
}
@media (forced-colors: active) {
  .shortcuts-modal { border: 2px solid CanvasText; }
  .more-menu-popup { border: 2px solid CanvasText; }
  kbd { border: 1px solid CanvasText; }
}
@media (max-width: 768px) {
  .more-menu-popup {
    right: calc(-1 * var(--sp-sm));
    min-width: 160px;
  }
}



/* ── Stream loading overlay (P1 — named loading state) ───────────── */
.stream-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  background:
    radial-gradient(ellipse at center, rgba(192,160,64,0.08), transparent 70%),
    linear-gradient(180deg, #141210 0%, #0a0908 100%);
  color: var(--text-primary);
  padding: var(--sp-lg);
  text-align: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s var(--ease-out-quart);
}
.stream-loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.stream-loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fa-spin 0.9s linear infinite;
}
.stream-loading-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.stream-loading-sub {
  margin: 0;
  font-size: var(--text-base);
  color: var(--accent);
  font-weight: 500;
}
.stream-loading-slow {
  margin: var(--sp-sm) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 360px;
  opacity: 0.75;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text-primary); }

/* ── Live metadata strip upgrade (P1) ───────────────────────────── */
.now-playing .np-label {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--danger, #d9534f);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.now-playing .np-name {
  color: var(--accent);
  font-family: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: 'opsz' 40, 'SOFT' 50;
  font-size: var(--text-lg);
  letter-spacing: 0.005em;
  line-height: 1;
}
.now-playing .np-svc {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.now-playing .np-svc[data-service="kick"] { color: #53fc18; border-color: rgba(83,252,24,0.3); background: rgba(83,252,24,0.08); }
.now-playing .np-svc[data-service="twitch"] { color: #a970ff; border-color: rgba(169,112,255,0.3); background: rgba(169,112,255,0.08); }
.now-playing .np-svc[data-service="youtube"] { color: #ff4040; border-color: rgba(255,64,64,0.3); background: rgba(255,64,64,0.08); }
@media (max-width: 768px) {
  .now-playing .np-label,
  .now-playing .np-svc { display: none; }
}

/* ── Chat wrapper header (P2 — brand-integrate Chatango) ───────── */
.stream-chat { display: flex; flex-direction: column; }
.chat-wrap-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-xs) var(--sp-md);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  min-height: 28px;
}
.chat-wrap-title {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.625rem;
}
.chat-wrap-title i { margin-right: 4px; }
.chat-wrap-hint {
  color: var(--text-muted);
  font-size: 0.625rem;
  font-style: italic;
  letter-spacing: 0.02em;
}
.chat-wrap-body {
  flex: 1;
  min-height: 0;
  position: relative;
}
.chat-wrap-body > script,
.chat-wrap-body > iframe {
  width: 100% !important;
  height: 100% !important;
}
/* Cover the bottom ~26px of the chat iframe where Chatango's footer lives */
.chat-wrap-body::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;  /* disabled by default — many Chatango embeds don't show a footer */
  background: var(--bg-darker);
  pointer-events: none;
}
@media (max-width: 768px) {
  .chat-wrap-hint { display: none; }
}

/* ── Keyboard shortcuts modal (P3) ──────────────────────────────── */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: var(--sp-lg);
}
.shortcuts-overlay.open { display: flex; animation: fadeIn 0.15s var(--ease-out-quart); }
.shortcuts-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popup);
  width: min(420px, 100%);
  overflow: hidden;
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
}
.shortcuts-header h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.shortcuts-header h2 i { color: var(--accent); margin-right: var(--sp-sm); }
.shortcuts-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-base);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.shortcuts-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.shortcuts-list {
  margin: 0;
  padding: var(--sp-md) var(--sp-lg) var(--sp-lg);
  display: grid;
  gap: var(--sp-sm);
}
.shortcuts-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.shortcuts-row dt {
  display: flex;
  gap: 4px;
  min-width: 90px;
  flex-shrink: 0;
}
.shortcuts-row dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.shortcuts-row kbd {
  display: inline-block;
  min-width: 22px;
  padding: 3px 7px;
  font-family: var(--font-mono, 'Consolas', monospace);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  text-align: center;
  line-height: 1;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════
   TWIN PEAKS THEME — Black Lodge / Red Room Overrides
   "I'll see you again in 25 years."
   ═══════════════════════════════════════════════════════════════ */

/* Default: tp-banner hidden outside the theme */
.tp-banner { display: none; }

/* Page body: warm near-black with subtle red vignette */
body[data-theme="twinpeaks"] {
  background: #0e0504;
  position: relative;
}
body[data-theme="twinpeaks"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(196,30,58,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(196,30,58,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(196,30,58,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
/* Subtle film grain — plain overlay (no blend-mode, no per-frame reblend) */
body[data-theme="twinpeaks"]::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96  0 0 0 0 0.91  0 0 0 0 0.82  0 0 0 0.6 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  opacity: 0.04;
  pointer-events: none;
  z-index: 50;
}

[data-theme="twinpeaks"] .site-banner,
[data-theme="twinpeaks"] .stream-layout,
[data-theme="twinpeaks"] .bottom-bar { position: relative; z-index: 1; }

/* Hide normal banner image, show TP banner */
[data-theme="twinpeaks"] .banner-img { display: none !important; }
[data-theme="twinpeaks"] .site-banner {
  background: transparent;
  border-bottom: 1px solid rgba(196,30,58,0.3);
  padding: 0;
  overflow: visible;
  box-shadow: 0 4px 24px rgba(196,30,58,0.18);
}

/* Mobile: kill TP banner, restore normal banner */
@media (max-width: 768px) {
  [data-theme="twinpeaks"] .banner-img { display: block !important; }
  [data-theme="twinpeaks"] .site-banner {
    background: var(--bg-darker);
    padding: var(--sp-xs) 0;
    overflow: hidden;
  }
  [data-theme="twinpeaks"] .tp-banner { display: none !important; }
}

/* The big banner canvas — now hosts the generated forest panorama */
[data-theme="twinpeaks"] .tp-banner {
  display: flex;
  position: relative;
  width: 100%;
  height: 13vh;
  max-height: 120px;
  min-height: 72px;
  overflow: hidden;
  background: #060201;
  align-items: center;
  justify-content: center;
  animation: bannerSlideDown 0.6s var(--ease-out-expo) both;
}

/* Forest panorama — the hero image (static, no ken-burns to save GPU) */
.tp-forest {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("/assets/themes/twinpeaks/forest.png?v=2");
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
  filter: saturate(1.08) contrast(1.05);
}

/* Dark vignette on top + bottom for legibility of title/ticker */
.tp-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,2,1,0.6) 0%, transparent 28%, transparent 62%, rgba(6,2,1,0.85) 100%),
    radial-gradient(ellipse at center, transparent 45%, rgba(6,2,1,0.35) 100%);
}

/* Side curtains — proscenium edge shadows (no blend-mode, opaque multiply-look baked in) */
.tp-curtain {
  position: absolute;
  top: 0; bottom: 0;
  width: 18%;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.55) 0px,
      rgba(50,5,10,0.55) 10px,
      rgba(72,10,18,0.55) 18px,
      rgba(0,0,0,0.6) 28px
    );
}
.tp-curtain-left {
  left: 0;
  -webkit-mask-image: linear-gradient(90deg, black 0%, black 30%, transparent 100%);
          mask-image: linear-gradient(90deg, black 0%, black 30%, transparent 100%);
}
.tp-curtain-right {
  right: 0;
  -webkit-mask-image: linear-gradient(270deg, black 0%, black 30%, transparent 100%);
          mask-image: linear-gradient(270deg, black 0%, black 30%, transparent 100%);
}

/* Drifting fog — static overlay (animation removed) */
.tp-fog {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.75;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(244,231,208,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 40%, rgba(244,231,208,0.06) 0%, transparent 50%);
}

/* Generated owl — perched top-right (static, no blink) */
[data-theme="twinpeaks"] .tp-owl {
  position: absolute;
  top: 2%;
  right: 2%;
  height: 96%;
  width: auto;
  z-index: 4;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.7));
  transform-origin: center center;
}

/* Title block */
.tp-title-wrap {
  position: relative;
  z-index: 5;
  text-align: center;
  user-select: none;
  padding: 6px 28px 14px;
  background: radial-gradient(ellipse at center, rgba(6,2,1,0.55) 0%, transparent 78%);
}
.tp-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(1.6rem, 4.5vh, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  color: #f4e7d0;
  text-shadow:
    0 0 6px rgba(244,231,208,0.5),
    0 0 16px rgba(196,30,58,0.7),
    0 0 32px rgba(196,30,58,0.4);
  position: relative;
  display: inline-block;
}
.tp-title::before,
.tp-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  pointer-events: none;
}
.tp-title::before {
  color: rgba(196,30,58,0.55);
  transform: translate3d(-1.5px, 0, 0);
  text-shadow: none;
}
.tp-title::after {
  color: rgba(212,160,74,0.28);
  transform: translate3d(1.5px, 0, 0);
  text-shadow: none;
}

.tp-tagline {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: clamp(0.625rem, 1.5vh, 0.8125rem);
  letter-spacing: 0.18em;
  color: #d4a04a;
  margin-top: 6px;
  opacity: 0.85;
  text-shadow: 0 0 4px rgba(212,160,74,0.3);
}

/* Bottom ticker */
.tp-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: rgba(6,2,1,0.92);
  border-top: 1px solid rgba(212,160,74,0.22);
  overflow: hidden;
  z-index: 6;
  display: flex;
  align-items: center;
}
.tp-ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-family: 'Georgia', serif;
  font-size: 0.6875rem;
  font-style: italic;
  letter-spacing: 0.18em;
  color: #c8a878;
  line-height: 1;
  animation: tpTickerScroll 60s linear infinite;
  will-change: transform;
}
@keyframes tpTickerScroll {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ── TP interactive overrides ──────────────────────────────────── */

[data-theme="twinpeaks"] .bottom-bar a:hover,
[data-theme="twinpeaks"] .bottom-bar button:hover {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(196,30,58,0.55);
}

[data-theme="twinpeaks"] .np-label {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(196,30,58,0.45);
}
[data-theme="twinpeaks"] .live-pulse {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

[data-theme="twinpeaks"] .channel-item:hover {
  background: rgba(196,30,58,0.1);
}
[data-theme="twinpeaks"] .channel-item.active {
  background: rgba(196,30,58,0.15);
  box-shadow: inset 3px 0 14px rgba(196,30,58,0.28);
}
[data-theme="twinpeaks"] .channel-menu,
[data-theme="twinpeaks"] .theme-menu,
[data-theme="twinpeaks"] .more-menu-popup,
[data-theme="twinpeaks"] .layout-menu,
[data-theme="twinpeaks"] .shortcuts-modal {
  background: rgba(14,5,4,0.97);
  border-color: rgba(196,30,58,0.35);
  box-shadow: 0 8px 40px rgba(196,30,58,0.18), 0 0 1px rgba(212,160,74,0.3);
}
[data-theme="twinpeaks"] .channel-tab.active {
  border-bottom-color: var(--accent);
  text-shadow: 0 0 6px rgba(196,30,58,0.4);
}
[data-theme="twinpeaks"] .channel-svc-badge {
  background: rgba(212,160,74,0.1);
  border: 1px solid rgba(212,160,74,0.28);
  color: var(--tp-gold);
}
[data-theme="twinpeaks"] .channel-list {
  scrollbar-color: rgba(196,30,58,0.4) rgba(26,10,10,0.6);
}
[data-theme="twinpeaks"] .channel-list::-webkit-scrollbar-thumb { background: rgba(196,30,58,0.4); }
[data-theme="twinpeaks"] .channel-list::-webkit-scrollbar-track { background: rgba(26,10,10,0.6); }

[data-theme="twinpeaks"] .chat-wrap-header {
  background: linear-gradient(180deg, rgba(28,10,10,1), rgba(14,5,4,1));
  border-bottom-color: rgba(196,30,58,0.3);
}
[data-theme="twinpeaks"] .chat-wrap-title { color: var(--accent); }

[data-theme="twinpeaks"] .channel-flipper {
  background: rgba(14,5,4,0.88);
  border-color: rgba(196,30,58,0.3);
}

/* Now-playing platform chip picks up gold trim on TP */
[data-theme="twinpeaks"] .np-svc {
  border-color: rgba(212,160,74,0.3);
  background: rgba(212,160,74,0.08);
}

/* Reduced motion: kill the heavy animations */
@media (prefers-reduced-motion: reduce) {
  .tp-title,
  .tp-title::before,
  .tp-title::after,
  .tp-forest,
  [data-theme="twinpeaks"] .tp-fog,
  .tp-owl,
  .tp-ticker-text { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   BELZONA THEME — Industrial Polymer Repair
   Red epoxy + concrete + hi-vis yellow + steel.
   ═══════════════════════════════════════════════════════════════ */

/* Default: bz-banner hidden outside the theme */
.bz-banner { display: none; }

/* Page body: warm dark industrial concrete w/ subtle steel-plate grain */
body[data-theme="belzona"] {
  background: #141517;
  position: relative;
}
body[data-theme="belzona"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,72,136,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(90,101,112,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(245,184,0,0.04) 0%, transparent 40%);
}
/* Film grain / concrete noise — plain overlay (no blend-mode) */
body[data-theme="belzona"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.9  0 0 0 0 0.87  0 0 0 0.7 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

[data-theme="belzona"] .site-banner,
[data-theme="belzona"] .stream-layout,
[data-theme="belzona"] .bottom-bar { position: relative; z-index: 1; }

/* Hide default banner image, show Belzona banner */
[data-theme="belzona"] .banner-img { display: none !important; }
[data-theme="belzona"] .site-banner {
  background: #0e0f11;
  border-bottom: 1px solid rgba(0,72,136,0.35);
  padding: 0;
  overflow: visible;
  box-shadow:
    0 2px 0 rgba(245,184,0,0.45),
    0 4px 24px rgba(0,72,136,0.18);
}

/* Mobile: kill the big banner canvas, restore a slim header */
@media (max-width: 768px) {
  [data-theme="belzona"] .banner-img { display: block !important; }
  [data-theme="belzona"] .site-banner {
    background: var(--bg-darker);
    padding: var(--sp-xs) 0;
    overflow: hidden;
    box-shadow: 0 2px 0 rgba(245,184,0,0.35);
  }
  [data-theme="belzona"] .bz-banner { display: none !important; }
}

/* ── The big banner canvas ─────────────────────────────────────── */
[data-theme="belzona"] .bz-banner {
  display: flex;
  position: relative;
  width: 100%;
  height: 13vh;
  max-height: 120px;
  min-height: 72px;
  overflow: hidden;
  background: #0e0f11;
  align-items: center;
  justify-content: center;
  animation: bannerSlideDown 0.6s var(--ease-out-expo) both;
}

/* Hero pipe photograph — static background (no ken-burns) */
.bz-pipe {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("/assets/themes/belzona/pipe.png?v=1");
  background-size: cover;
  background-position: center 45%;
  background-repeat: no-repeat;
  filter: saturate(1.05) contrast(1.08) brightness(0.82);
}

/* When a video clip is injected into the embedded CRT monitor, we no longer
   need any full-bleed-video adjustments on .bz-pipe — the monitor lives in
   its own bezel and doesn't disturb the pipe photo or the blueprint grid. */

/* Embedded CRT surveillance monitor — frames the Belzona clip in a small
   bezeled tube so the (portrait, low-res) clip isn't stretched into a
   blurry strip across the whole banner. */
.bz-monitor {
  position: absolute;
  top: 4px;
  right: clamp(56px, 6vw, 80px);
  bottom: 24px;
  aspect-ratio: 16 / 11;
  z-index: 5;
  padding: 4px 5px 14px;
  background:
    linear-gradient(180deg, #2e2e30 0%, #18181a 50%, #0a0a0b 100%);
  border: 1px solid #000;
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    0 1px 0 rgba(245,184,0,0.22),
    0 5px 18px rgba(0,0,0,0.6);
}
@media (max-width: 1023px) {
  .bz-monitor { display: none; }
}
.bz-monitor-screen {
  position: relative;
  width: 100%;
  height: calc(100% - 8px);
  overflow: hidden;
  background: #000;
  border-radius: 3px;
  box-shadow:
    inset 0 0 14px rgba(0,0,0,0.85),
    inset 0 0 0 1px rgba(245,184,0,0.14);
}
.bz-monitor-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  pointer-events: none;
  filter: saturate(0.82) contrast(1.20) brightness(0.92) sepia(0.10);
}
/* Scanlines */
.bz-monitor-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.32) 0,
    rgba(0,0,0,0.32) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}
/* Vignette + faint glare + flicker */
.bz-monitor-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.7) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 8%, transparent 92%, rgba(0,0,0,0.4) 100%);
  animation: bzCrtFlicker 5s steps(2, end) infinite;
}
@keyframes bzCrtFlicker {
  0%, 96%, 100% { opacity: 1; }
  97%           { opacity: 0.85; }
  98%           { opacity: 1; }
  99%           { opacity: 0.92; }
}

/* REC badge top-left of the screen */
.bz-monitor-rec {
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.5625rem;
  font-weight: bold;
  letter-spacing: 0.18em;
  color: #ecebe8;
  text-shadow: 0 1px 0 rgba(0,0,0,0.8);
  pointer-events: none;
  user-select: none;
}
.bz-rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3030;
  box-shadow: 0 0 5px rgba(255,48,48,0.85);
  animation: bzRecBlink 1.4s ease-in-out infinite;
}
@keyframes bzRecBlink {
  0%, 100% { opacity: 1; }
  55%      { opacity: 0.15; }
}

/* Live timecode top-right */
.bz-monitor-tc {
  position: absolute;
  top: 4px;
  right: 5px;
  z-index: 4;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  color: rgba(245,184,0,0.92);
  text-shadow: 0 1px 0 rgba(0,0,0,0.85);
  pointer-events: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

/* VHS tracking roll-bar — bright band drifts down every ~12s */
.bz-monitor-roll {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255,255,255,0.12) 45%,
    rgba(255,255,255,0.22) 50%,
    rgba(255,255,255,0.12) 55%,
    transparent 100%
  );
  background-size: 100% 18px;
  background-repeat: no-repeat;
  background-position: 0 -20px;
  mix-blend-mode: screen;
  animation: bzRollBar 11s linear infinite;
}
@keyframes bzRollBar {
  0%, 88%        { background-position: 0 -20px; }
  88.01%, 100%   { background-position: 0 calc(100% + 20px); }
}
.bz-monitor-bezel-label {
  position: absolute;
  bottom: 1px;
  right: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: rgba(245,184,0,0.75);
  text-transform: uppercase;
  line-height: 12px;
  pointer-events: none;
  user-select: none;
}
.bz-monitor-led {
  position: absolute;
  bottom: 3px;
  left: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ca357;
  box-shadow: 0 0 6px rgba(76,163,87,0.8), inset 0 0 1px rgba(0,0,0,0.4);
  animation: bzLedPulse 2.4s ease-in-out infinite;
}
@keyframes bzLedPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* Blueprint-style technical grid overlay (no mask, no blend-mode) */
.bz-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(90deg, rgba(245,184,0,0.55) 1px, transparent 1px),
    linear-gradient(0deg, rgba(245,184,0,0.45) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
}

/* Legibility scrim — top-bottom darkening */
.bz-scanline {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,15,17,0.55) 0%, transparent 26%, transparent 68%, rgba(14,15,17,0.85) 100%),
    radial-gradient(ellipse at center, transparent 40%, rgba(14,15,17,0.45) 100%);
}

/* Hexagonal corner rivets — smaller, tighter, with a real metallic feel */
.bz-hex-left,
.bz-hex-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 30px;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.22) 0%, transparent 50%),
    linear-gradient(155deg, #1a2a44 0%, #0a1524 55%, #03080f 100%);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  border: 0;
  box-shadow:
    inset 0 0 0 1px rgba(245,184,0,0.45),
    0 1px 2px rgba(0,0,0,0.6);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}
.bz-hex-left::before,
.bz-hex-right::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5b800 0%, #8a6200 70%, #2a1e00 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), inset 0 0 2px rgba(0,0,0,0.6);
}
.bz-hex-left  { left: 14px; }
.bz-hex-right { right: 14px; }

/* Hazard stripes hugging the very edges — caution-tape */
.bz-hazard {
  position: absolute;
  top: 0; bottom: 20px;
  width: 8px;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    #f5b800 0,
    #f5b800 10px,
    #141517 10px,
    #141517 20px
  );
  opacity: 0.85;
}
.bz-hazard-left  { left: 0;  -webkit-mask-image: linear-gradient(180deg, black, transparent); mask-image: linear-gradient(180deg, black, transparent); }
.bz-hazard-right { right: 0; -webkit-mask-image: linear-gradient(180deg, black, transparent); mask-image: linear-gradient(180deg, black, transparent); }

/* Title block — ruggerd uppercase wordmark over the hero */
.bz-title-wrap {
  position: relative;
  z-index: 6;
  text-align: center;
  user-select: none;
  padding: 6px 32px 22px;
  background: radial-gradient(ellipse at center, rgba(14,15,17,0.6) 0%, transparent 72%);
}
.bz-kicker {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: clamp(0.5rem, 1.2vh, 0.6875rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #f5b800;
  opacity: 0.9;
  margin-bottom: 4px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.8);
}
.bz-title {
  font-family: 'Arial Black', 'Helvetica Neue', Impact, sans-serif;
  font-size: clamp(1.5rem, 4.6vh, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ecebe8;
  position: relative;
  display: inline-block;
  line-height: 1;
  text-shadow:
    0 1px 0 #00254a,
    0 2px 0 #001833,
    0 3px 0 #000f22,
    0 4px 0 #000814,
    0 6px 18px rgba(0,72,136,0.7),
    0 0 24px rgba(0,72,136,0.45);
  animation: bzTitleSettle 0.8s var(--ease-out-expo) both;
}
@keyframes bzTitleSettle {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.bz-title::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(245,184,0,0.35);
  pointer-events: none;
}
.bz-reg {
  font-size: 0.35em;
  vertical-align: super;
  color: #f5b800;
  margin-left: 0.15em;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 rgba(0,0,0,0.8);
}
.bz-sub {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
  flex-wrap: nowrap;
}
.bz-chip {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: clamp(0.5rem, 1.1vh, 0.625rem);
  letter-spacing: 0.18em;
  padding: 2px 8px;
  border: 1px solid rgba(245,184,0,0.5);
  color: #ecebe8;
  background: rgba(20,21,23,0.78);
  text-transform: uppercase;
  line-height: 1.4;
}
.bz-chip-hot {
  color: #141517;
  background: #f5b800;
  border-color: #f5b800;
  font-weight: bold;
}

/* Bottom ticker — datasheet feed */
.bz-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: #0a0b0c;
  border-top: 1px solid #f5b800;
  overflow: hidden;
  z-index: 7;
  display: flex;
  align-items: center;
}
.bz-ticker::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 42px;
  background: #f5b800;
  z-index: 1;
  clip-path: polygon(0 0, 100% 0, 70% 100%, 0 100%);
}
.bz-ticker::after {
  content: "REC";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Consolas', monospace;
  font-size: 0.625rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: #141517;
  z-index: 2;
}
.bz-ticker-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 50px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: #ecebe8;
  line-height: 1;
  text-transform: uppercase;
}
.bz-t-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ca357;
  box-shadow: 0 0 6px #4ca357;
  vertical-align: middle;
  margin-right: 8px;
}
.bz-t-sep {
  display: inline-block;
  width: 14px;
  text-align: center;
  color: #f5b800;
  font-weight: bold;
  margin: 0 6px;
  opacity: 0.65;
}
.bz-t-sep::before { content: "\25C6"; }
@keyframes bzTickerScroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ── BZ interactive overrides ──────────────────────────────────── */
[data-theme="belzona"] .bottom-bar a:hover,
[data-theme="belzona"] .bottom-bar button:hover {
  color: var(--bz-yellow);
  text-shadow: 0 0 8px rgba(245,184,0,0.45);
}
[data-theme="belzona"] .np-label {
  color: var(--bz-yellow);
  text-shadow: 0 0 4px rgba(245,184,0,0.4);
}
[data-theme="belzona"] .live-pulse {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
[data-theme="belzona"] .channel-item:hover {
  background: rgba(0,72,136,0.1);
}
[data-theme="belzona"] .channel-item.active {
  background: rgba(0,72,136,0.15);
  box-shadow: inset 3px 0 14px rgba(0,72,136,0.28);
  border-left: 3px solid var(--bz-yellow);
}
[data-theme="belzona"] .channel-menu,
[data-theme="belzona"] .theme-menu,
[data-theme="belzona"] .more-menu-popup,
[data-theme="belzona"] .layout-menu,
[data-theme="belzona"] .shortcuts-modal {
  background: rgba(14,15,17,0.97);
  border-color: rgba(0,72,136,0.4);
  box-shadow:
    0 8px 40px rgba(0,72,136,0.22),
    0 0 0 1px rgba(245,184,0,0.15);
}
[data-theme="belzona"] .channel-tab.active {
  border-bottom-color: var(--bz-yellow);
  text-shadow: 0 0 6px rgba(245,184,0,0.4);
}
[data-theme="belzona"] .channel-svc-badge {
  background: rgba(245,184,0,0.12);
  border: 1px solid rgba(245,184,0,0.4);
  color: var(--bz-yellow);
  font-family: 'Consolas', monospace;
}
[data-theme="belzona"] .channel-list {
  scrollbar-color: rgba(0,72,136,0.45) rgba(26,27,29,0.6);
}
[data-theme="belzona"] .channel-list::-webkit-scrollbar-thumb { background: rgba(0,72,136,0.45); }
[data-theme="belzona"] .channel-list::-webkit-scrollbar-track { background: rgba(26,27,29,0.6); }
[data-theme="belzona"] .chat-wrap-header {
  background: linear-gradient(180deg, rgba(38,40,43,1), rgba(14,15,17,1));
  border-bottom: 1px solid rgba(245,184,0,0.4);
}
[data-theme="belzona"] .chat-wrap-title {
  color: var(--bz-yellow);
  font-family: 'Consolas', monospace;
  letter-spacing: 0.15em;
}
[data-theme="belzona"] .channel-flipper {
  background: rgba(14,15,17,0.92);
  border-color: rgba(0,72,136,0.35);
}
[data-theme="belzona"] .np-svc {
  border-color: rgba(245,184,0,0.4);
  background: rgba(245,184,0,0.08);
  color: var(--bz-yellow);
}

/* Reduced motion: kill the heavy animations */
@media (prefers-reduced-motion: reduce) {
  .bz-pipe,
  .bz-title,
  .bz-t-dot,
  .bz-ticker-text,
  .bz-monitor-screen::after,
  .bz-monitor-led,
  .bz-rec-dot,
  .bz-monitor-roll { animation: none !important; }
  .bz-monitor-roll { display: none !important; }
}
