@font-face {
  font-family: "VCR";
  src: local("VCR OSD Mono"), local("VCR OSD Mono Regular");
  font-display: swap;
}

:root {
  --ui: #e7e2d8;
  --ui-shadow: rgba(0, 0, 0, 0.65);
  --glow: rgba(255, 255, 255, 0.12);
  --static: rgba(255, 255, 255, 0.35);
  --tv-width: min(72vw, 980px);
  --tv-height: min(58vh, 600px);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "VCR", "Courier New", monospace;
  background: #0c0c0c;
  color: var(--ui);
  overflow: hidden;
}


#scene {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #0f0b10;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: contrast(1.05) saturate(1.1);
}

#scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 12, 22, 0.7) 0%, rgba(7, 7, 10, 0.9) 100%),
    radial-gradient(circle at 15% 25%, rgba(255, 214, 142, 0.28), transparent 45%),
    radial-gradient(circle at 78% 18%, rgba(142, 188, 255, 0.25), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(255, 120, 96, 0.18), transparent 50%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

#scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
  z-index: 4;
}

#scene.vapor {
  background-image: none;
  background-color: #1a1026;
}

#scene.vapor #room,
#scene.vapor #room-decor,
#scene.vapor #room-blinds,
#scene.vapor #room-bed,
#scene.vapor #room-floor {
  opacity: 0;
}

#scene.vapor #vapor-room {
  display: block;
}

#scene:not(.vapor) #vapor-room {
  display: none !important;
}

#room {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(32, 24, 40, 0.88) 0%, rgba(12, 12, 18, 0.95) 100%);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
}

#room::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 30%),
    radial-gradient(circle at 15% 15%, rgba(255, 230, 160, 0.18), transparent 35%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 2px, transparent 2px, transparent 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 2px, transparent 2px, transparent 20px);
  opacity: 0.5;
  pointer-events: none;
}

#room::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(18, 10, 16, 0) 0%, rgba(18, 10, 16, 0.2) 40%, rgba(8, 6, 10, 0.6) 100%),
    linear-gradient(90deg, rgba(25, 18, 32, 0.7) 0%, rgba(25, 18, 32, 0.2) 30%, rgba(25, 18, 32, 0.6) 60%, rgba(25, 18, 32, 0.8) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 4px, transparent 4px, transparent 12px);
  opacity: 0.6;
  pointer-events: none;
}

#room-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#room-decor::before {
  content: "";
  position: absolute;
  left: 6%;
  top: 10%;
  width: 26%;
  height: 32%;
  background:
    linear-gradient(150deg, rgba(250, 90, 80, 0.8), rgba(120, 40, 40, 0.8)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0px, rgba(255, 255, 255, 0.16) 6px, transparent 6px, transparent 12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  transform: rotate(-3deg);
  opacity: 0.85;
}

#room-decor::after {
  content: "";
  position: absolute;
  right: 8%;
  top: 14%;
  width: 20%;
  height: 26%;
  background:
    linear-gradient(170deg, rgba(100, 160, 255, 0.85), rgba(40, 60, 120, 0.8)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0px, rgba(255, 255, 255, 0.18) 8px, transparent 8px, transparent 14px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  transform: rotate(2deg);
  opacity: 0.8;
}

#room-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  background:
    linear-gradient(180deg, rgba(70, 40, 80, 0.3) 0%, rgba(20, 10, 28, 0.9) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 4px, transparent 4px, transparent 12px);
  opacity: 0.9;
  z-index: 2;
}

#room-bed {
  position: absolute;
  right: 6%;
  bottom: 12%;
  width: 32%;
  height: 22%;
  background:
    linear-gradient(160deg, rgba(40, 20, 60, 0.9), rgba(18, 10, 30, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0px, rgba(255, 255, 255, 0.12) 8px, transparent 8px, transparent 16px);
  border-radius: 10px 10px 6px 6px;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
  opacity: 0.9;
  z-index: 2;
}

#room-blinds {
  position: absolute;
  left: 62%;
  top: 8%;
  width: 26%;
  height: 26%;
  background:
    repeating-linear-gradient(180deg, rgba(240, 230, 220, 0.2) 0px, rgba(240, 230, 220, 0.2) 6px, transparent 6px, transparent 12px);
  opacity: 0.5;
  z-index: 2;
}

#scene.photo::before,
#scene.photo::after,
#scene.photo #room,
#scene.photo #room::before,
#scene.photo #room::after,
#scene.photo #room-decor,
#scene.photo #room-blinds,
#scene.photo #room-bed,
#scene.photo #room-floor {
  display: none !important;
}

#vapor-room {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}

#vapor-room::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(142, 120, 255, 0.5), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(120, 200, 255, 0.35), transparent 50%),
    linear-gradient(180deg, rgba(44, 28, 70, 0.96) 0%, rgba(20, 12, 32, 0.99) 100%);
  filter: saturate(1.2);
}

#vapor-room::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background:
    linear-gradient(180deg, rgba(120, 60, 40, 0.25) 0%, rgba(30, 12, 10, 0.92) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 3px, transparent 3px, transparent 11px);
  box-shadow: inset 0 14px 30px rgba(0, 0, 0, 0.55);
}

#vapor-room .poster {
  position: absolute;
  top: 10%;
  width: 26%;
  height: 30%;
  background:
    linear-gradient(160deg, rgba(245, 150, 110, 0.9), rgba(120, 50, 60, 0.9)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0px, rgba(255, 255, 255, 0.2) 6px, transparent 6px, transparent 14px);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  filter: saturate(1.1);
}

#vapor-room .poster-left {
  left: 6%;
  transform: rotate(-2deg);
}

#vapor-room .poster-right {
  right: 10%;
  width: 22%;
  height: 26%;
  background:
    linear-gradient(165deg, rgba(90, 140, 255, 0.9), rgba(35, 60, 120, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0px, rgba(255, 255, 255, 0.2) 8px, transparent 8px, transparent 14px);
  transform: rotate(2deg);
}

#vapor-room .poster-wave {
  position: absolute;
  right: 16%;
  top: 16%;
  width: 34%;
  height: 30%;
  background:
    linear-gradient(160deg, rgba(240, 240, 245, 0.9), rgba(160, 175, 200, 0.95));
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

#vapor-room .poster-wave::after {
  content: "";
  position: absolute;
  inset: 8%;
  background:
    radial-gradient(circle at 60% 40%, rgba(40, 90, 160, 0.8), transparent 45%),
    radial-gradient(circle at 40% 60%, rgba(120, 170, 220, 0.85), transparent 48%),
    radial-gradient(circle at 20% 55%, rgba(15, 45, 100, 0.9), transparent 45%);
  opacity: 0.9;
}

#vapor-room .poster-grid {
  position: absolute;
  right: 6%;
  top: 6%;
  width: 18%;
  height: 16%;
  background:
    linear-gradient(180deg, rgba(45, 15, 60, 0.9), rgba(10, 10, 20, 0.95)),
    repeating-linear-gradient(90deg, rgba(120, 70, 180, 0.4) 0px, rgba(120, 70, 180, 0.4) 2px, transparent 2px, transparent 12px),
    repeating-linear-gradient(0deg, rgba(120, 70, 180, 0.35) 0px, rgba(120, 70, 180, 0.35) 2px, transparent 2px, transparent 12px);
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

#vapor-room .corkboard {
  position: absolute;
  left: 26%;
  top: 6%;
  width: 28%;
  height: 18%;
  background:
    linear-gradient(160deg, rgba(160, 120, 80, 0.95), rgba(120, 90, 60, 0.95));
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

#vapor-room .corkboard::after {
  content: "";
  position: absolute;
  left: 72%;
  top: 60%;
  width: 12px;
  height: 12px;
  background: rgba(240, 90, 80, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(240, 90, 80, 0.7);
}

#vapor-room .shelf {
  position: absolute;
  left: 4%;
  top: 8%;
  width: 16%;
  height: 40%;
  background:
    linear-gradient(180deg, rgba(20, 20, 28, 0.95), rgba(8, 8, 10, 0.98));
  border-radius: 6px;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.7);
}

#vapor-room .shelf::after {
  content: "";
  position: absolute;
  left: 20%;
  top: 14%;
  width: 50%;
  height: 18%;
  background:
    linear-gradient(180deg, rgba(255, 90, 80, 0.95), rgba(120, 30, 20, 0.95));
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

#vapor-room .desk {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 14%;
  height: 18%;
  background:
    linear-gradient(180deg, rgba(120, 60, 40, 0.95), rgba(70, 30, 20, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 3px, transparent 3px, transparent 10px);
  border-radius: 8px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.6);
}

#vapor-room .lamp {
  position: absolute;
  right: 34%;
  bottom: 26%;
  width: 10%;
  height: 18%;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 120, 110, 0.9), rgba(120, 20, 20, 0.9)),
    linear-gradient(180deg, rgba(200, 40, 40, 0.8), rgba(80, 10, 10, 0.9));
  border-radius: 50% 50% 10% 10%;
  box-shadow: 0 0 30px rgba(255, 80, 60, 0.4);
}

#vapor-room .monitor {
  position: absolute;
  right: 10%;
  bottom: 26%;
  width: 26%;
  height: 24%;
  background:
    linear-gradient(180deg, rgba(220, 220, 230, 0.9), rgba(130, 130, 140, 0.9));
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

#vapor-room .monitor::after {
  content: "";
  position: absolute;
  inset: 12%;
  background:
    linear-gradient(135deg, rgba(150, 70, 255, 0.9), rgba(70, 200, 255, 0.85));
  border-radius: 6px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
}

#vapor-room .keyboard {
  position: absolute;
  right: 22%;
  bottom: 20%;
  width: 18%;
  height: 5%;
  background:
    linear-gradient(180deg, rgba(200, 190, 190, 0.9), rgba(150, 150, 150, 0.9));
  border-radius: 6px;
}

#vapor-room .console {
  position: absolute;
  left: 36%;
  bottom: 24%;
  width: 14%;
  height: 6%;
  background:
    linear-gradient(180deg, rgba(210, 200, 190, 0.9), rgba(140, 135, 130, 0.95));
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

#vapor-room .gamepad {
  position: absolute;
  left: 48%;
  bottom: 20%;
  width: 8%;
  height: 4%;
  background:
    linear-gradient(180deg, rgba(200, 200, 200, 0.9), rgba(120, 120, 120, 0.9));
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

#vapor-room .vhs-stack {
  position: absolute;
  left: 32%;
  bottom: 30%;
  width: 10%;
  height: 6%;
  background:
    linear-gradient(180deg, rgba(30, 30, 35, 0.9), rgba(10, 10, 14, 0.95));
  border-radius: 3px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
}

#vapor-room .chair {
  position: absolute;
  right: 6%;
  bottom: 4%;
  width: 18%;
  height: 22%;
  background:
    linear-gradient(150deg, rgba(255, 90, 190, 0.6), rgba(120, 40, 120, 0.8));
  border-radius: 22px 22px 10px 10px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4);
}

#vapor-room .trinkets {
  position: absolute;
  left: 18%;
  bottom: 23%;
  width: 18%;
  height: 8%;
  background:
    linear-gradient(180deg, rgba(110, 110, 120, 0.8), rgba(60, 60, 70, 0.9));
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

#tv-shell {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tv-width);
  height: var(--tv-height);
  transform: translate(-50%, -50%);
  border-radius: 26px;
  background: linear-gradient(160deg, #2f2f36, #0c0c10 60%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    inset 0 2px 2px rgba(255, 255, 255, 0.08),
    inset 0 -8px 20px rgba(0, 0, 0, 0.6);
  padding: clamp(14px, 2.4vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
  gap: clamp(12px, 2vw, 24px);
  z-index: 3;
}

#tv-top-bevel {
  position: absolute;
  left: 6%;
  top: 4%;
  width: 88%;
  height: 12%;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0.7;
}

#tv-shell::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

#tv-screen {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  isolation: isolate;
  box-shadow:
    inset 0 0 0 10px rgba(0, 0, 0, 0.65),
    inset 0 0 80px rgba(0, 0, 0, 0.75),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

#tv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.6;
  pointer-events: none;
}

#tv-screen::before {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 24px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

#power-off {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.95) 45%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%);
  opacity: 0;
  pointer-events: none;
}

#yt-player {
  width: 100%;
  height: 100%;
  background: #000;
}

#yt-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

#static {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.35'/></svg>");
  mix-blend-mode: screen;
  opacity: 0;
  animation: noise 0.2s steps(2) infinite;
  pointer-events: none;
}

#scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.25;
  pointer-events: none;
}

.tv-off #yt-player,
.tv-off #channel-ui,
.tv-off #scanlines {
  opacity: 0;
}

.tv-off #power-off {
  opacity: 1;
}

#channel-ui {
  display: none;
}

#tv-controls {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: space-between;
  padding: clamp(8px, 1.4vw, 16px);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(26, 26, 32, 0.95), rgba(10, 10, 12, 0.95));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(0, 0, 0, 0.6),
    inset 0 -6px 12px rgba(0, 0, 0, 0.5);
}

#channel-display {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
  margin-top: 8px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 0, 0, 0.22), rgba(40, 0, 0, 0.85)),
    linear-gradient(180deg, rgba(40, 0, 0, 0.9), rgba(10, 0, 0, 0.98));
  box-shadow:
    inset 0 0 12px rgba(255, 0, 0, 0.4),
    inset 0 0 26px rgba(0, 0, 0, 0.9),
    0 6px 16px rgba(0, 0, 0, 0.45);
}

#channel-number {
  font-family: "VCR", "Courier New", monospace;
  font-size: 20px;
  letter-spacing: 0.18em;
  color: #ff3b30;
  text-shadow:
    0 0 8px rgba(255, 60, 50, 0.9),
    0 0 16px rgba(255, 30, 30, 0.75),
    0 0 24px rgba(255, 0, 0, 0.65);
}

#knobs {
  display: grid;
  gap: 12px;
}

#tv-controls button {
  font-family: "VCR", "Courier New", monospace;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), rgba(15, 15, 15, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ui);
  padding: 12px 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    inset 0 -3px 6px rgba(0, 0, 0, 0.7),
    0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.2s ease;
}

#power-toggle {
  border-color: rgba(255, 130, 110, 0.6);
  color: #ffd2c8;
}

#tv-controls button:hover {
  transform: translateY(-1px);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(20, 20, 20, 0.9));
}

#tv-controls button:active {
  transform: translateY(1px);
}

#speaker {
  height: 100%;
  min-height: 140px;
  border-radius: 12px;
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.65) 30%, rgba(0, 0, 0, 0.2) 35%),
    radial-gradient(circle, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0.2) 35%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
}

#label {
  margin-top: 10px;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.55);
}

.switching #static {
  opacity: 0.9;
}

.switching #yt-player {
  opacity: 0;
}

@keyframes noise {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 120px 120px;
  }
}

@media (max-width: 720px) {
  #tv-shell {
    width: min(92vw, 760px);
    height: min(70vh, 560px);
    grid-template-columns: minmax(0, 1fr) minmax(110px, 160px);
  }
}
