:root {
  color-scheme: dark;
  --page: #000;
  --cabinet-a: #12130f;
  --cabinet-b: #050604;
  --cabinet-c: #000;
  --edge: #181a17;
  --edge-soft: rgba(255, 255, 255, 0.12);
  --metal-a: #cacaca;
  --metal-b: #6e6e6e;
  --metal-c: #222;
  --screen: #10131a;
  --glass: rgba(95, 105, 124, 0.2);
  --glow: rgba(245, 245, 245, 0.34);
  --trim: rgba(129, 116, 82, 0.42);
  --trim-dark: rgba(24, 24, 22, 0.9);
  --trim-glint: rgba(230, 213, 163, 0.16);
  --future-line: rgba(108, 221, 232, 0.09);
  --panel-brown: #20130d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.055), transparent 30%),
    #000;
}

button {
  font: inherit;
}

.lab {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--page);
}

.stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.tv-shell {
  width: min(95vw, 154vh);
  aspect-ratio: 1.62;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(142px, 15.5%, 238px);
  grid-template-rows: 1fr;
  gap: clamp(10px, 1vw, 18px);
  padding: clamp(12px, 1.25vw, 22px);
  border-radius: clamp(12px, 1.7vw, 28px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 4%, transparent 94%, rgba(255, 255, 255, 0.045)),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.11), transparent 18%),
    radial-gradient(circle at 82% 86%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(145deg, var(--cabinet-a), var(--cabinet-b) 50%, var(--cabinet-c));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 10px #050505,
    0 0 0 11px rgba(255, 255, 255, 0.06),
    0 34px 80px rgba(0, 0, 0, 0.9),
    inset 7px 8px 26px rgba(255, 255, 255, 0.035),
    inset -22px -18px 40px rgba(0, 0, 0, 0.94);
  cursor: pointer;
}

.cabinet-trim,
.tv-shell::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.cabinet-trim {
  inset: clamp(13px, 1.35vw, 23px);
  border: 1px solid var(--trim-dark);
  border-radius: clamp(8px, 1vw, 16px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px var(--trim),
    inset 0 0 10px rgba(255, 255, 255, 0.018);
  opacity: 0.58;
}

.tv-shell::before {
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.12), transparent 1.2%),
    radial-gradient(circle at 67% 24%, rgba(255, 255, 255, 0.08), transparent 1%),
    radial-gradient(circle at 81% 19%, rgba(255, 255, 255, 0.16), transparent 0.8%),
    linear-gradient(90deg, transparent 0 38%, var(--future-line) 38.2%, transparent 38.6% 61%, var(--future-line) 61.2%, transparent 61.6%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035) 0 0.5px, transparent 0.7px 2px);
  opacity: 0.2;
  mix-blend-mode: screen;
}

.tv-screen-stack {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(20px, 2vw, 32px) clamp(10px, 1vw, 16px);
  gap: clamp(3px, 0.45vw, 8px);
  padding: clamp(8px, 0.75vw, 14px);
  border-radius: clamp(4px, 0.8vw, 12px);
  background: #050605;
  box-shadow:
    inset 0 0 0 2px #020202,
    inset 0 0 0 3px rgba(197, 180, 126, 0.07),
    inset -12px -12px 24px rgba(0, 0, 0, 0.9);
}

.tv-screen-bezel {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  padding: clamp(10px, 1.65vw, 30px) clamp(12px, 1.9vw, 36px);
  border-radius: 2.2% / 3%;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, 0.07), transparent 24%),
    linear-gradient(180deg, #090a09 0%, #020302 66%, #080908 100%);
  box-shadow:
    inset 0 0 0 1px rgba(221, 201, 144, 0.12),
    inset 0 0 0 4px rgba(0, 0, 0, 0.94),
    inset 0 22px 34px rgba(255, 255, 255, 0.04),
    inset 0 -30px 54px rgba(0, 0, 0, 0.96),
    0 0 0 1px rgba(255, 255, 255, 0.045);
}

.tv-screen-bezel::before,
.tv-screen-bezel::after {
  content: "";
  position: absolute;
  inset: clamp(8px, 1.55vw, 28px) clamp(10px, 1.7vw, 32px);
  border-radius: 5.8% / 7.5%;
  pointer-events: none;
}

.tv-screen-bezel::before {
  box-shadow:
    inset 0 0 14px 4px rgba(255, 255, 255, 0.04),
    inset 0 0 40px 10px rgba(0, 0, 0, 0.86);
}

.tv-screen-bezel::after {
  display: none;
}

.tv-glass {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 5.6% / 7.2%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(73, 75, 65, 0.58), rgba(24, 26, 22, 0.92) 54%, rgba(7, 8, 7, 0.99) 76%),
    var(--screen);
  box-shadow:
    inset 0 0 24px #000,
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(255, 255, 255, 0.14);
}

.tv-glass::before {
  content: "";
  position: absolute;
  inset: -16% -8% auto -8%;
  height: 34%;
  border-radius: 0 0 50% 50%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.16), transparent 70%),
    linear-gradient(90deg, transparent 16%, rgba(255, 255, 255, 0.055), transparent 30% 74%, rgba(255, 255, 255, 0.045), transparent 88%);
  opacity: 0.18;
  filter: blur(8px);
  pointer-events: none;
  z-index: 3;
}

.tv-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 63%, rgba(255, 255, 255, 0.08) 70%, transparent 76%),
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, rgba(0, 0, 0, 0.12) 50%);
  background-size: auto, 100% 4px;
  mix-blend-mode: screen;
  opacity: 0.42;
  pointer-events: none;
  z-index: 3;
}

.splash-static,
.splash-static__video,
.splash-static__scanlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.splash-static {
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(65, 69, 61, 0.32), rgba(6, 7, 6, 0.74) 72%, #010101 100%),
    #050605;
  z-index: 1;
}

.splash-static__video {
  object-fit: cover;
}

.splash-static__texture {
  mix-blend-mode: screen;
  opacity: 0.16;
  filter: grayscale(1) saturate(0) contrast(1.35) brightness(0.56);
}

.splash-static__grain {
  mix-blend-mode: overlay;
  opacity: 0.24;
  filter: grayscale(1) contrast(1.4) brightness(0.62);
}

.splash-static__scanlines {
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 50%, rgba(0, 0, 0, 0.14) 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 34%, rgba(255, 255, 255, 0.014) 68%, transparent);
  background-size: 100% 4px, 6px 100%;
  mix-blend-mode: screen;
  opacity: 0.7;
}

.tv-brand {
  align-self: center;
  justify-self: center;
  color: rgba(222, 225, 214, 0.6);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(11px, 1.2vw, 19px);
  font-weight: 700;
  letter-spacing: 0.38em;
  transform: translateX(0.18em) scaleY(0.8);
  text-shadow:
    0 1px 0 #000,
    0 0 10px rgba(255, 255, 255, 0.11);
}

.control-strip {
  align-self: center;
  justify-self: center;
  width: min(260px, 34%);
  height: clamp(8px, 0.9vw, 14px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.035);
  opacity: 0.48;
}

.control-strip span {
  border-radius: inherit;
  background: linear-gradient(#2b2d29, #080908);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.broadcast {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(244, 244, 241, 0.84);
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 255, 255, 0.18);
}

.broadcast__logo {
  position: absolute;
  top: 11%;
  left: 9%;
  font-size: clamp(11px, 1.1vw, 18px);
}

.broadcast__copy {
  font-size: clamp(18px, 2.1vw, 36px);
}

.broadcast__scan {
  width: 62%;
  height: 1px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.8);
  animation: scan 3.4s linear infinite;
  display: none;
}

.tv-side {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 0.58fr 0.42fr;
  gap: clamp(10px, 0.9vw, 16px);
  padding: clamp(7px, 0.65vw, 12px) 0;
}

.speaker,
.side-controls {
  border-radius: clamp(3px, 0.5vw, 8px);
  background:
    linear-gradient(145deg, #11130f, #050604 64%, #000);
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.018),
    inset 8px 8px 14px rgba(255, 255, 255, 0.012),
    inset -14px -14px 24px rgba(0, 0, 0, 0.92),
    0 8px 22px rgba(0, 0, 0, 0.72);
}

.speaker {
  position: relative;
  overflow: hidden;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028), transparent 12% 88%, rgba(255, 255, 255, 0.018)),
    linear-gradient(145deg, #11130f, #050604 64%, #000);
}

.speaker--left,
.speaker--right {
  min-width: 0;
}

.speaker--right {
  display: none;
}

.speaker::before {
  content: "";
  position: absolute;
  inset: clamp(14px, 1.25vw, 22px);
  border-radius: 2px;
  background:
    radial-gradient(circle, #020202 0 2.5px, transparent 3.1px) 0 0 / 12px 12px,
    radial-gradient(circle, #171a14 0 2.5px, transparent 3.1px) 4px 4px / 12px 12px;
  opacity: 0.68;
}

.speaker::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 48%, rgba(255, 255, 255, 0.08) 49% 52%, transparent 53%);
}

.side-controls {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: center;
  justify-items: center;
  gap: clamp(10px, 1vw, 16px);
  padding: clamp(14px, 1.3vw, 22px);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 7px),
    linear-gradient(145deg, #10120f, #030403 72%);
}

.side-dial {
  position: relative;
  width: min(82px, 58%);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #1c1f1c 0 28%, transparent 29%),
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.28) 0 3deg, transparent 3deg 18deg),
    radial-gradient(circle, transparent 0 56%, rgba(255, 255, 255, 0.12) 57% 60%, #050505 61%),
    conic-gradient(from 20deg, #020202, #5e625b, #171917, #030303, #8b9084, #020202);
  box-shadow:
    inset -8px 8px 14px rgba(0, 0, 0, 0.78),
    inset 4px -4px 8px rgba(255, 255, 255, 0.13),
    0 9px 18px rgba(0, 0, 0, 0.75);
}

.side-dial::before {
  content: "";
  position: absolute;
  left: 48%;
  top: 18%;
  width: 4%;
  height: 28%;
  border-radius: 999px;
  background: #0b1620;
}

.mini-knobs {
  width: 88%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 0.7vw, 12px);
}

.mini-knobs button {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.54), transparent 16%),
    conic-gradient(from 20deg, #030303, #747871, #1a1d1a, #050505, #9ca194, #030303);
  box-shadow:
    inset -4px 4px 7px rgba(0, 0, 0, 0.72),
    inset 2px -2px 4px rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.72);
}

.vent-lines {
  width: 88%;
  display: grid;
  gap: 5px;
}

.vent-lines span {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tv-foot {
  position: absolute;
  bottom: -42px;
  width: clamp(22px, 2.5vw, 36px);
  height: clamp(44px, 5vw, 70px);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #030303, #d4d0c6 42%, #262626 54%, #000);
  box-shadow:
    0 12px 18px rgba(0, 0, 0, 0.72),
    inset -4px 0 5px rgba(0, 0, 0, 0.7);
  z-index: -1;
}

.tv-foot--left {
  left: 12%;
}

.tv-foot--right {
  right: 12%;
}

.lab-controls {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 10;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.76);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.lab-controls button {
  min-width: 56px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.lab-controls button:hover,
.lab-controls button.is-active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.lab[data-tone="black"] {
  --cabinet-a: #090a08;
  --cabinet-b: #010101;
  --edge: #111;
  --glass: rgba(98, 112, 130, 0.14);
  --glow: rgba(255, 255, 255, 0.24);
}

.lab[data-tone="soft"] {
  --cabinet-a: #171a17;
  --cabinet-b: #090b09;
  --cabinet-c: #050607;
  --screen: #151924;
  --glow: rgba(205, 215, 224, 0.44);
}

.lab[data-fit="wide"] .tv-shell {
  width: min(98vw, 168vh);
}

.lab.is-on .broadcast__copy {
  opacity: 0;
}

.lab.is-on .broadcast__logo {
  color: #fced65;
}

.lab.is-on .broadcast {
  background:
    radial-gradient(circle at 72% 38%, rgba(7, 86, 176, 0.22), transparent 24%),
    linear-gradient(180deg, #14236a 0 26%, #005da8 26% 42%, #1a6c36 42% 58%, #5c3494 58% 76%, #1a1c35 76%);
  animation: boot 0.6s steps(3) both;
}

@keyframes scan {
  0% {
    transform: translateY(-26vh);
    opacity: 0;
  }
  12%,
  86% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(26vh);
    opacity: 0;
  }
}

@keyframes boot {
  0% {
    filter: brightness(3) contrast(2);
    transform: scale(1, 0.04);
  }
  60% {
    filter: brightness(1.8) contrast(1.4);
    transform: scale(1, 1.04);
  }
  100% {
    filter: none;
    transform: scale(1);
  }
}

@media (max-width: 780px) {
  .lab {
    padding: 14px;
  }

  .tv-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 210px;
    aspect-ratio: 0.84;
    width: min(94vw, 92vh);
  }

  .tv-side {
    grid-template-columns: 1fr 0.6fr 1fr;
    grid-template-rows: 1fr;
    gap: clamp(6px, 1.3vw, 10px);
    padding: 0 clamp(10px, 2.4vw, 20px);
  }

  .speaker--right {
    display: block;
  }

  .lab-controls {
    bottom: 8px;
  }
}
