:root {
  color-scheme: dark;
  --bg: #000;
  --panel: rgba(6, 6, 8, 0.76);
  --panel-strong: rgba(10, 10, 12, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5efe8;
  --text-dim: rgba(245, 239, 232, 0.66);
  --text-faint: rgba(245, 239, 232, 0.34);
  --red: #ff2b32;
  --blue: #2f56ff;
  --amber: #ffd3a1;
  --signal: #a7ffc2;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 43, 50, 0.08), transparent 22%),
    radial-gradient(circle at 84% 16%, rgba(47, 86, 255, 0.08), transparent 20%),
    #000;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, 0.76) 100%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 2px,
      transparent 5px
    );
  opacity: 0.3;
}

body::after {
  background:
    linear-gradient(90deg, transparent 0 47.8%, rgba(255, 43, 50, 0.18) 47.8% 50%, transparent 50% 100%),
    linear-gradient(180deg, transparent 0 54.6%, rgba(47, 86, 255, 0.16) 54.6% 56.2%, transparent 56.2% 100%);
  mix-blend-mode: screen;
  opacity: 0.38;
}

.void-fog,
.neon-strip {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.void-fog {
  filter: blur(120px);
  opacity: 0.34;
}

.void-fog--left {
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 43, 50, 0.22), transparent 24%),
    radial-gradient(circle at 36% 62%, rgba(255, 255, 255, 0.05), transparent 14%);
}

.void-fog--right {
  background:
    radial-gradient(circle at 82% 14%, rgba(47, 86, 255, 0.2), transparent 20%),
    radial-gradient(circle at 72% 72%, rgba(255, 43, 50, 0.08), transparent 14%);
}

.neon-strip--red {
  background: linear-gradient(90deg, transparent 0 48%, rgba(255, 43, 50, 0.58) 48% 50%, transparent 50% 100%);
  mix-blend-mode: screen;
  opacity: 0.35;
}

.neon-strip--blue {
  background: linear-gradient(180deg, transparent 0 56%, rgba(47, 86, 255, 0.52) 56% 57.8%, transparent 57.8% 100%);
  mix-blend-mode: screen;
  opacity: 0.3;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1600px, calc(100% - 32px));
  margin: 18px auto 30px;
}

.tv-shell {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 10px 0 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.brand-lockup {
  display: grid;
  gap: 10px;
  align-content: start;
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(280px, 440px);
  gap: 24px;
  align-items: end;
}

.eyebrow,
.section-kicker,
.live-pill__label,
.site-network__eyebrow,
.site-network__link,
.volume-control,
.ghost-action,
.section-label,
.search-box,
.hud-row,
.result-summary,
.deck-button {
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-faint);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(4.2rem, 8vw, 6.8rem);
  line-height: 0.84;
  letter-spacing: 0.12em;
  color: #fff4e8;
  text-shadow:
    0 0 22px rgba(255, 43, 50, 0.08),
    0 0 18px rgba(47, 86, 255, 0.08);
}

.brand-copy {
  max-width: 30rem;
  color: var(--text-dim);
  line-height: 1.65;
  font-size: 0.98rem;
}

.topbar-stack {
  display: grid;
  gap: 10px;
}

.live-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 0 18px;
  border: 1px solid rgba(255, 43, 50, 0.16);
  border-radius: 999px;
  background: rgba(13, 4, 6, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 28px rgba(255, 43, 50, 0.08);
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd7db, var(--red) 70%);
  box-shadow:
    0 0 0 6px rgba(255, 43, 50, 0.08),
    0 0 18px rgba(255, 43, 50, 0.3);
}

.live-pill__body {
  display: grid;
  gap: 3px;
}

.live-pill__label {
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.live-pill__copy {
  color: var(--text);
  font-size: 0.96rem;
}

.topbar-network.site-network {
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(9, 9, 11, 0.74);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.topbar-network .site-network__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-network .site-network__link {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
}

.topbar-network .site-network__link::after {
  content: none;
}

.topbar-network .site-network__link[aria-current="page"] {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(47, 86, 255, 0.18), rgba(47, 86, 255, 0.05)),
    rgba(14, 18, 31, 0.86);
}

.bezel {
  position: relative;
  display: grid;
  gap: 14px;
}

.screen-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  gap: 18px;
  min-height: 0;
  align-items: stretch;
  transition: grid-template-columns 240ms ease;
}

.screen-stage.is-drawer-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
}

.screen {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 50% 42%, rgba(17, 43, 23, 0.5), rgba(2, 4, 6, 0.98) 74%),
    #010203;
  box-shadow:
    0 0 0 14px rgba(3, 4, 6, 0.98),
    0 0 0 15px rgba(255, 255, 255, 0.04),
    inset 0 0 180px rgba(0, 0, 0, 0.86),
    inset 0 0 42px rgba(255, 255, 255, 0.02),
    0 30px 60px rgba(0, 0, 0, 0.34);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(124deg, rgba(255, 255, 255, 0.05), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.02));
  z-index: 1;
  pointer-events: none;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 24px;
  border: 1px solid rgba(47, 86, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.015),
    inset 0 0 28px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.screen-video,
.screen-canvas,
.boot-panel,
.hud,
.screen-scanlines,
.screen-vignette {
  position: absolute;
  inset: 0;
}

.screen-video,
.screen-canvas {
  width: 100%;
  height: 100%;
}

.screen-video {
  object-fit: cover;
  opacity: 0;
  background: #000;
  filter:
    contrast(1.18)
    brightness(0.78)
    saturate(1.04)
    sepia(0.03);
  transition: opacity 260ms ease;
}

.screen-video.is-visible {
  opacity: 1;
}

.screen-canvas {
  pointer-events: none;
}

.screen-canvas--noise {
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 180ms ease;
}

.screen-canvas--noise.is-visible {
  opacity: 0.68;
}

.boot-panel {
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
  color: var(--signal);
  background:
    radial-gradient(circle at center, rgba(10, 27, 14, 0.88), rgba(3, 6, 5, 0.98) 72%);
  transition: opacity 220ms ease;
}

.boot-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.1;
  pointer-events: none;
}

.boot-panel.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-panel p {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: 0.16em;
}

.boot-panel span {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(168, 255, 191, 0.74);
}

.broadcast-bug {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 6;
  width: clamp(92px, 9vw, 132px);
  opacity: 0.92;
  pointer-events: none;
  filter:
    drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 16px rgba(147, 255, 99, 0.18));
}

.broadcast-bug__image {
  display: block;
  width: 100%;
  height: auto;
}

.hud {
  display: none;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(202, 255, 216, 0.78);
  text-shadow: 0 0 16px rgba(168, 255, 191, 0.14);
}

.hud-row--bottom {
  margin-top: auto;
  margin-bottom: 8px;
  color: rgba(255, 223, 189, 0.86);
}

.screen-scanlines {
  z-index: 4;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.14;
  pointer-events: none;
}

.screen-vignette {
  z-index: 5;
  border-radius: 34px;
  box-shadow:
    inset 0 0 52px rgba(255, 255, 255, 0.02),
    inset 0 0 130px rgba(0, 0, 0, 0.78);
  pointer-events: none;
}

.library-drawer {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, auto) minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(4, 4, 6, 0.88);
  backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 28px 48px rgba(0, 0, 0, 0.3);
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  transform: translateX(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 240ms ease, opacity 240ms ease;
  overflow: hidden;
  z-index: 12;
}

.library-drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 43, 50, 0.06), transparent 26%),
    linear-gradient(90deg, transparent, rgba(47, 86, 255, 0.06), transparent);
  pointer-events: none;
}

.library-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.drawer-head,
.drawer-actions,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-kicker,
.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.drawer-head h2 {
  font-size: 1.2rem;
  letter-spacing: -0.05em;
}

.ghost-action {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.drawer-search {
  display: grid;
  gap: 10px;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.search-box input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.68);
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: rgba(47, 86, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(47, 86, 255, 0.08);
}

.search-box input::placeholder {
  color: rgba(245, 239, 232, 0.26);
}

.drawer-actions {
  justify-content: flex-start;
}

.result-summary {
  min-height: 1.2em;
  color: var(--text-faint);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.drawer-section {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.channel-list,
.search-results {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.channel-list {
  max-height: 32vh;
}

.search-results {
  align-content: start;
}

.channel-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
  width: 10px;
}

.channel-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.channel-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
  border: 2px solid rgba(10, 10, 12, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47, 86, 255, 0.54), rgba(255, 43, 50, 0.42));
}

.channel-button,
.search-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(8, 8, 11, 0.84);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.channel-button::before,
.search-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 43, 50, 0.3), transparent 34%, transparent 66%, rgba(47, 86, 255, 0.3));
}

.channel-button strong,
.search-card strong {
  display: block;
  font-size: 0.94rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channel-button span,
.search-card span,
.search-card em {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  font-style: normal;
}

.channel-button.is-active,
.search-card:hover,
.search-card:focus-visible,
.channel-button:hover,
.channel-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  outline: none;
}

.channel-button.is-active {
  background:
    linear-gradient(180deg, rgba(47, 86, 255, 0.12), rgba(47, 86, 255, 0.03)),
    rgba(7, 10, 18, 0.9);
}

.search-empty {
  padding: 18px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-faint);
  text-align: center;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.deck {
  display: grid;
}

.control-rack {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(5, 5, 7, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.deck-button {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    rgba(10, 10, 12, 0.92);
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.deck-button:hover,
.deck-button:focus-visible,
.ghost-action:hover,
.ghost-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  outline: none;
}

.deck-button--toggle,
#random-button {
  background:
    linear-gradient(180deg, rgba(47, 86, 255, 0.16), rgba(47, 86, 255, 0.04)),
    rgba(8, 10, 18, 0.94);
}

#next-button {
  background:
    linear-gradient(180deg, rgba(255, 43, 50, 0.14), rgba(255, 43, 50, 0.04)),
    rgba(12, 8, 10, 0.94);
}

.deck-button--mini {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.66rem;
}

.volume-control {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
}

.volume-control span {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.volume-control input {
  width: 100%;
  accent-color: var(--amber);
}

.tv-base {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 12px;
  align-items: center;
  width: min(70%, 780px);
  height: 16px;
  margin: 8px auto 0;
  padding: 0 18px;
}

.tv-base span {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 43, 50, 0.36), rgba(47, 86, 255, 0.34));
  opacity: 0.9;
}

.screen:fullscreen,
.screen:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.screen:fullscreen .screen-video,
.screen:-webkit-full-screen .screen-video {
  object-fit: contain;
}

.screen:fullscreen .screen-vignette,
.screen:fullscreen .screen-scanlines,
.screen:-webkit-full-screen .screen-vignette,
.screen:-webkit-full-screen .screen-scanlines {
  border-radius: 0;
}

.screen:fullscreen::backdrop,
.screen:-webkit-full-screen::backdrop {
  background: #000;
}

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

  .brand-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-network .site-network__links {
    justify-content: flex-start;
  }

  .controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    width: min(100%, calc(100% - 20px));
    margin: 10px auto 20px;
  }

  .screen-stage,
  .screen-stage.is-drawer-open {
    grid-template-columns: 1fr;
  }

  .library-drawer {
    position: absolute;
    top: 14px;
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
    max-height: none;
    transform: translateX(calc(100% + 18px));
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: clamp(3.6rem, 22vw, 5rem);
  }

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

  .control-rack {
    padding: 14px;
    border-radius: 18px;
  }

  .screen {
    border-radius: 24px;
  }

  .broadcast-bug {
    top: 14px;
    right: 14px;
    width: clamp(78px, 18vw, 108px);
  }
}
