/* ==========================================================================
   ITPTSD TV — Full-Screen Cathode-Ray Broadcast & Retro-Futuristic Deck
   ========================================================================== */

:root {
  --amber-glow: #f7b84b;
  --phosphor-green: #7cff9b;
  --chrome-light: #f2ede2;
  --chrome-dark: #5c5850;
  --crt-brightness: 1;
  --crt-contrast: 1.08;
  --vhold-offset: 0%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050607;
  color: #efe9dc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* --------------------------------------------------------------------------
   Auto-hiding Top Chrome ("← Back to Lab")
   -------------------------------------------------------------------------- */
.top-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.top-chrome.is-hidden {
  opacity: 0;
  transform: translateY(-10px);
}

.back-link {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(12, 14, 16, 0.72);
  border: 1px solid rgba(236, 208, 132, 0.35);
  color: #f4e6c3;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.back-link:hover,
.back-link:focus-visible {
  background: rgba(28, 24, 19, 0.92);
  border-color: rgba(236, 208, 132, 0.78);
  transform: translateY(-1px);
  outline: none;
}

.chrome-hints {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(12, 14, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(239, 233, 220, 0.72);
  font-size: 11px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

@media (max-width: 780px) {
  .chrome-hints {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Full-Screen CRT Stage
   -------------------------------------------------------------------------- */
.room-viewport {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(6px, 1vw, 14px);
  padding-bottom: 6px;
  gap: 6px;
  background: radial-gradient(circle at 50% 45%, #14171a 0%, #08090b 65%, #030405 100%);
  overflow: hidden;
}

.tv-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* Edge-to-edge CRT Screen Viewport with curved mask frame */
.crt-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: clamp(18px, 2.6vw, 42px);
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  background: radial-gradient(ellipse 90% 85% at 48% 45%, #161b20 0%, #0b0e11 58%, #040507 100%);
  border: 2px solid rgba(190, 185, 174, 0.22);
  box-shadow:
    inset 0 0 44px rgba(0, 0, 0, 0.96),
    inset 0 12px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 2px rgba(255, 255, 255, 0.14),
    inset 0 -2px 6px rgba(255, 255, 255, 0.05),
    0 0 0 4px #0b0d0f;
  transition: box-shadow 0.55s ease, border-color 0.55s ease;
}

.room-viewport.tv-is-on .crt-viewport {
  border-color: rgba(165, 205, 240, 0.24);
  box-shadow:
    inset 0 0 38px rgba(0, 0, 0, 0.9),
    inset 0 8px 24px rgba(0, 0, 0, 0.76),
    inset 0 1px 2px rgba(255, 255, 255, 0.16),
    inset 0 -2px 6px rgba(175, 215, 255, 0.08),
    0 0 0 4px #0b0d0f,
    0 0 40px rgba(135, 198, 255, 0.14);
}

.crt-beam-wrapper {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.crt-viewport.is-off .crt-beam-wrapper {
  opacity: 0;
  transform: scale(0.02, 0.01);
}

.crt-viewport.is-warming .crt-beam-wrapper {
  opacity: 0.95;
  transform: scale(1, 0.08);
  filter: brightness(2.2);
}

.crt-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: brightness(var(--crt-brightness)) contrast(var(--crt-contrast));
  transform: translateY(var(--vhold-offset));
  will-change: transform, filter;
}

.crt-picture.filter-bw {
  filter: grayscale(1) sepia(0.1) brightness(var(--crt-brightness)) contrast(calc(var(--crt-contrast) * 1.08));
}

.crt-picture.filter-vintage-color {
  filter: saturate(0.86) sepia(0.1) brightness(var(--crt-brightness)) contrast(var(--crt-contrast));
}

.tv-video,
.test-pattern-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #050709;
}

.test-pattern-canvas {
  display: none;
  object-fit: contain;
  background: #16191d;
}

.test-pattern-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: hidden;
  background: #14191c;
}

.test-pattern-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Faint live vertical sync sweep across Channel 11 test pattern */
.broadcast-sync-sweep {
  position: absolute;
  left: 0;
  right: 0;
  top: -22%;
  height: 22%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(247, 238, 212, 0.045) 38%,
    rgba(166, 232, 224, 0.095) 52%,
    rgba(247, 238, 212, 0.03) 68%,
    transparent 100%
  );
  mix-blend-mode: screen;
  animation: broadcastSyncSweep 7.5s linear infinite;
}

@keyframes broadcastSyncSweep {
  0% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(580%);
  }
}

/* Subtle pulsing retro ON AIR badge tucked cleanly in upper-left corner */
.broadcast-on-air-badge {
  position: absolute;
  top: 64px;
  left: 26px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 22, 24, 0.72);
  border: 1px solid rgba(244, 230, 195, 0.36);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 250, 236, 0.14);
  color: #f6ead0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 0 8px rgba(247, 184, 75, 0.35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
}

.on-air-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e95434;
  box-shadow:
    0 0 8px rgba(233, 84, 52, 0.9),
    0 0 14px rgba(233, 84, 52, 0.55);
  animation: onAirPulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes onAirPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.84);
  }
}

.crt-viewport.mode-test-pattern .tv-video {
  display: none;
}

.crt-viewport.mode-test-pattern .test-pattern-canvas {
  display: block;
}

.crt-viewport.mode-test-pattern.has-test-pattern-image .test-pattern-canvas {
  display: none;
}

.crt-viewport.mode-test-pattern.has-test-pattern-image .test-pattern-stage {
  display: block;
}

/* Horizontal sync blanking bar when V-Hold rolls */
.vhold-sync-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  height: 12%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, #000 50%, rgba(0, 0, 0, 0.95) 100%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.14);
  opacity: 0;
  pointer-events: none;
}

.crt-picture.is-rolling .vhold-sync-bar {
  opacity: 1;
}

/* Animated static snow canvas */
.static-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 0.16s ease;
}

.static-canvas.is-visible {
  opacity: 0.9;
}

/* Electron-beam power-on / power-off flash */
.crt-power-beam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 16;
}

.crt-power-beam.anim-off {
  animation: crtCollapse 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.crt-power-beam.anim-on {
  animation: crtWarmup 0.68s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes crtCollapse {
  0% {
    opacity: 0.95;
    background: radial-gradient(ellipse 100% 2.8% at 50% 50%, #ffffff 0%, rgba(190, 235, 255, 0.9) 45%, transparent 72%);
  }
  45% {
    opacity: 1;
    background: radial-gradient(ellipse 24% 1.6% at 50% 50%, #ffffff 0%, rgba(210, 245, 255, 0.85) 40%, transparent 75%);
  }
  75% {
    opacity: 0.9;
    background: radial-gradient(circle 1.2% at 50% 50%, #ffffff 0%, rgba(180, 230, 255, 0.6) 55%, transparent 100%);
  }
  100% {
    opacity: 0;
    background: radial-gradient(circle 0.4% at 50% 50%, #ffffff 0%, transparent 100%);
  }
}

@keyframes crtWarmup {
  0% {
    opacity: 0;
    background: radial-gradient(circle 0.8% at 50% 50%, #ffffff 0%, transparent 100%);
  }
  30% {
    opacity: 0.95;
    background: radial-gradient(ellipse 92% 2.2% at 50% 50%, #ffffff 0%, rgba(190, 235, 255, 0.8) 55%, transparent 80%);
  }
  70% {
    opacity: 0.52;
    background: radial-gradient(ellipse 100% 70% at 50% 50%, rgba(215, 242, 255, 0.42) 0%, transparent 85%);
  }
  100% {
    opacity: 0;
    background: transparent;
  }
}

/* Scanlines & Phosphor Aperture Grille */
.crt-scanlines {
  position: absolute;
  inset: 0;
  z-index: 17;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.21) 0px,
      rgba(0, 0, 0, 0.21) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.025) 0px,
      rgba(0, 255, 0, 0.025) 1px,
      rgba(0, 120, 255, 0.025) 2px,
      transparent 3px
    );
}

/* Curved CRT edge falloff & recessed mask shadow */
.crt-vignette {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(
      ellipse 86% 84% at 50% 49%,
      transparent 58%,
      rgba(0, 0, 0, 0.26) 81%,
      rgba(0, 0, 0, 0.68) 96%,
      rgba(0, 0, 0, 0.9) 100%
    );
  box-shadow:
    inset 0 14px 28px rgba(0, 0, 0, 0.5),
    inset 0 -12px 24px rgba(0, 0, 0, 0.44),
    inset 12px 0 24px rgba(0, 0, 0, 0.36),
    inset -12px 0 24px rgba(0, 0, 0, 0.36);
}

/* Realistic, subdued curved CRT glass reflection (never washes out video) */
.crt-glare {
  position: absolute;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(
      ellipse 60% 26% at 26% 10%,
      rgba(255, 250, 240, 0.1) 0%,
      rgba(255, 250, 240, 0.04) 45%,
      transparent 76%
    ),
    linear-gradient(
      128deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.012) 24%,
      transparent 44%,
      rgba(0, 0, 0, 0.07) 78%,
      rgba(0, 0, 0, 0.16) 100%
    ),
    radial-gradient(
      ellipse 44% 18% at 78% 90%,
      rgba(205, 226, 255, 0.04) 0%,
      transparent 72%
    );
  box-shadow:
    inset 0 1px 1px rgba(255, 252, 245, 0.14),
    inset 0 -1px 2px rgba(255, 255, 255, 0.05);
}

/* Retro Phosphor OSD */
.crt-osd {
  position: absolute;
  top: 64px;
  right: 28px;
  z-index: 25;
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(5, 16, 8, 0.76);
  border: 1px solid rgba(124, 255, 155, 0.38);
  color: var(--phosphor-green);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: right;
  text-shadow: 0 0 8px rgba(124, 255, 155, 0.7);
  backdrop-filter: blur(4px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.crt-osd.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.osd-top {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.osd-call {
  color: #e9ff9b;
  font-size: clamp(12px, 1.2vw, 16px);
}

.osd-title {
  margin-top: 3px;
  font-size: clamp(12px, 1.15vw, 15px);
  color: #d6ffe0;
  max-width: min(46vw, 420px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osd-sub {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(124, 255, 155, 0.78);
}

/* Autoplay / Unmute Prompt */
.crt-autoplay-prompt {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 28;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(247, 184, 75, 0.8);
  background: rgba(12, 10, 8, 0.88);
  color: #fbe6b2;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.2s ease;
}

.crt-autoplay-prompt:hover {
  background: rgba(34, 24, 15, 0.95);
  transform: translate(-50%, -50%) scale(1.03);
}

.crt-autoplay-prompt[hidden] {
  display: none;
}

.prompt-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f7b84b;
  box-shadow: 0 0 10px #f7b84b;
  animation: pulseDot 1.3s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Voice-O-Matic Absurd Response Banner (Top-Center Phosphor HUD)
   -------------------------------------------------------------------------- */
.voice-reply-banner {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 26;
  max-width: min(84vw, 620px);
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(18, 12, 5, 0.84);
  border: 1px solid rgba(247, 184, 75, 0.58);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.68), inset 0 0 18px rgba(247, 184, 75, 0.1);
  color: #ffe3a3;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: center;
  text-shadow: 0 0 8px rgba(247, 184, 75, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-reply-banner.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.voice-reply-heard {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255, 227, 163, 0.72);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.voice-reply-quip {
  font-size: clamp(13px, 1.35vw, 17px);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff0c4;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Live Knob Adjustment Toast
   -------------------------------------------------------------------------- */
.knob-toast {
  position: absolute;
  left: 50%;
  bottom: 176px;
  transform: translateX(-50%) translateY(8px);
  z-index: 48;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(12, 14, 16, 0.9);
  border: 1px solid rgba(236, 208, 132, 0.55);
  color: #f8e7ba;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, bottom 0.3s ease;
}

.knob-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.room-viewport.dock-collapsed .knob-toast {
  bottom: 54px;
}

/* --------------------------------------------------------------------------
   Retro-Futuristic Floating Instrument Dock
   -------------------------------------------------------------------------- */
.control-dock {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 24px);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.control-dock.is-collapsed {
  transform: translateX(-50%) translateY(calc(100% - 28px));
}

.dock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 4px;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(212, 198, 168, 0.38);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(44, 47, 50, 0.94) 0%, rgba(24, 26, 28, 0.96) 100%);
  color: #ecd084;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.dock-toggle:hover {
  color: #fff2c6;
  border-color: rgba(236, 208, 132, 0.72);
}

.dock-chevron {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.control-dock.is-collapsed .dock-chevron {
  transform: rotate(180deg);
}

.dock-chassis {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px clamp(14px, 2vw, 22px) 10px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(44, 47, 51, 0.92) 0%, rgba(22, 24, 27, 0.95) 55%, rgba(12, 14, 16, 0.97) 100%);
  border: 1.5px solid rgba(224, 218, 204, 0.38);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.78),
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    inset 0 -2px 6px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dock-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5vw, 18px);
}

/* Retro-Futuristic Voice-O-Matic Bar */
.voice-deck {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px 5px 11px;
  border-radius: 12px;
  background: linear-gradient(180deg, #0d0f11 0%, #171a1d 100%);
  border: 1px solid rgba(212, 198, 168, 0.28);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.82);
}

.voice-badge {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #f0c975;
  white-space: nowrap;
  padding-right: 4px;
  border-right: 1px solid rgba(236, 208, 132, 0.28);
}

.voice-input {
  flex: 1;
  min-width: 140px;
  background: transparent;
  border: none;
  outline: none;
  color: #ffe8b0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.03em;
  user-select: text;
  -webkit-user-select: text;
}

.voice-input::placeholder {
  color: rgba(235, 218, 178, 0.44);
}

.voice-mic-btn,
.voice-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(224, 214, 192, 0.35);
  background: linear-gradient(180deg, #2e3236 0%, #191b1e 100%);
  color: #f5e6c0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.voice-mic-btn:hover,
.voice-send-btn:hover {
  border-color: rgba(247, 184, 75, 0.78);
  background: linear-gradient(180deg, #3c4045 0%, #222529 100%);
}

.voice-mic-btn:active,
.voice-send-btn:active {
  transform: translateY(1px);
}

.voice-send-btn {
  border-color: rgba(247, 184, 75, 0.55);
  color: #ffd882;
}

.mic-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6c2d20;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.voice-mic-btn.is-listening {
  border-color: #ff5b3b;
  color: #ffd2c7;
  background: linear-gradient(180deg, #4b1d15 0%, #2a0f0a 100%);
}

.voice-mic-btn.is-listening .mic-led {
  background: #ff4f2e;
  box-shadow: 0 0 8px #ff4f2e, 0 0 14px rgba(255, 79, 46, 0.8);
  animation: pulseDot 0.9s infinite ease-in-out;
}

.dock-divider {
  width: 1px;
  height: 54px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(236, 208, 132, 0.45) 50%,
    transparent 100%
  );
  flex-shrink: 0;
}

.knob-cluster {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.3vw, 16px);
}

/* Backlit VHF Channel Readout */
.channel-readout {
  width: 92px;
  height: 52px;
  padding: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #0d0f10 0%, #202326 100%);
  border: 1.5px solid rgba(196, 190, 178, 0.55);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.readout-glass {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: radial-gradient(circle at 50% 50%, #1b1710 0%, #0b0907 100%);
  color: rgba(247, 184, 75, 0.26);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  transition: background 0.35s ease, color 0.35s ease, text-shadow 0.35s ease;
}

.room-viewport.tv-is-on .readout-glass {
  background: radial-gradient(circle at 50% 50%, #52350f 0%, #241505 100%);
  color: #ffd782;
  text-shadow: 0 0 12px rgba(255, 195, 77, 0.9);
}

.readout-band {
  font-size: 10px;
  letter-spacing: 0.14em;
  opacity: 0.85;
}

.readout-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Tactile 3D Rotary Knobs */
.tv-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  outline: none;
  touch-action: none;
  flex-shrink: 0;
}

.tv-control:active {
  cursor: grabbing;
}

.tv-control:focus-visible .knob-bezel,
.tv-control:focus-visible .power-rocker {
  box-shadow: 0 0 0 2px #f7b84b, 0 6px 14px rgba(0, 0, 0, 0.75);
}

.knob-bezel {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 4px;
  background: radial-gradient(circle at 28% 22%, #f7f1e4 0%, #9b9487 48%, #2f2c27 100%);
  box-shadow:
    3px 7px 14px rgba(0, 0, 0, 0.85),
    0 2px 3px rgba(0, 0, 0, 0.7),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.65),
    inset 0 -2px 4px rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
}

.knob-channel .knob-bezel {
  width: 58px;
  height: 58px;
  padding: 5px;
  background: radial-gradient(circle at 28% 22%, #fffaf0 0%, #a59e90 46%, #252320 100%);
  box-shadow:
    4px 9px 18px rgba(0, 0, 0, 0.88),
    0 2px 4px rgba(0, 0, 0, 0.72),
    inset 0 2px 2px rgba(255, 255, 255, 0.7),
    inset 0 -2px 5px rgba(0, 0, 0, 0.6);
}

.knob-cap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0.07) 0deg 6deg,
      rgba(0, 0, 0, 0.28) 6deg 12deg
    ),
    radial-gradient(circle at 35% 30%, #433f3b 0%, #1d1b19 65%, #0c0b0a 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.24),
    inset 0 -3px 6px rgba(0, 0, 0, 0.78),
    0 2px 5px rgba(0, 0, 0, 0.7);
  transform: rotate(0deg);
  transition: transform 0.06s linear;
}

.knob-channel .knob-cap {
  transition: transform 0.14s cubic-bezier(0.22, 1.25, 0.36, 1);
}

.knob-pointer {
  position: absolute;
  left: 50%;
  top: 7%;
  width: 11%;
  height: 36%;
  transform: translateX(-50%);
  border-radius: 99px;
  background: linear-gradient(180deg, #fff5d6 0%, #d4ac54 100%);
  box-shadow: 0 0 5px rgba(247, 184, 75, 0.75);
}

.knob-center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5efe0 0%, #9e9789 65%, #4d4841 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.control-label {
  margin-top: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #dfd4ad;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* Power Toggle Switch + Jewel Pilot Lamp */
.power-control {
  background: none;
  border: none;
  padding: 0 4px;
  cursor: pointer;
}

.pilot-lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-bottom: 7px;
  background: radial-gradient(circle at 35% 35%, #5b2618 0%, #2a0f08 100%);
  border: 1px solid #968c7d;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.room-viewport.tv-is-on .pilot-lamp {
  background: radial-gradient(circle at 35% 35%, #fff0b3 0%, #ff6a26 55%, #b52100 100%);
  box-shadow: 0 0 10px #ff6a26, 0 0 20px rgba(255, 110, 40, 0.7);
}

.power-rocker {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0f1012 0%, #2a2c2f 100%);
  border: 1.5px solid #a8a194;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.85), 0 3px 8px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  padding: 2px;
}

.power-nub {
  width: 20px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #efeae0 0%, #8f897c 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  transform: translateX(0px);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.power-control[aria-pressed="true"] .power-nub {
  transform: translateX(21px);
  background: linear-gradient(180deg, #ffe299 0%, #c88d2c 100%);
}

/* Responsive compact dock on smaller screens */
@media (max-width: 720px) {
  .dock-chassis {
    padding: 8px 10px 8px;
  }

  .dock-controls-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
  }

  .voice-badge {
    display: none;
  }

  .dock-divider {
    display: none;
  }

  .knob-bezel {
    width: 42px;
    height: 42px;
  }

  .knob-channel .knob-bezel {
    width: 48px;
    height: 48px;
  }

  .channel-readout {
    width: 78px;
    height: 44px;
  }

  .readout-num {
    font-size: 22px;
  }
}

/* --------------------------------------------------------------------------
   Normal-View Compact Embed Footer ("Put ITPTSD TV on Your Site")
   -------------------------------------------------------------------------- */
.embed-footer {
  position: relative;
  z-index: 55;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 4px;
}

.embed-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(236, 208, 132, 0.3);
  background: rgba(16, 18, 20, 0.85);
  color: #e6d5ad;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.embed-toggle-btn:hover,
.embed-toggle-btn:focus-visible {
  border-color: rgba(247, 184, 75, 0.75);
  background: rgba(28, 26, 22, 0.96);
  color: #fff0c4;
  outline: none;
}

.embed-toggle-icon {
  color: var(--amber-glow);
  font-weight: 800;
}

.embed-toggle-chevron {
  display: inline-block;
  font-size: 11px;
  transition: transform 0.2s ease;
}

.embed-toggle-btn[aria-expanded="true"] .embed-toggle-chevron {
  transform: rotate(180deg);
}

.embed-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 900px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12, 14, 16, 0.94);
  border: 1px solid rgba(236, 208, 132, 0.34);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

.embed-panel[hidden] {
  display: none;
}

.embed-code-preview {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #070809;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #bfeec9;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow-x: auto;
  user-select: all;
  -webkit-user-select: all;
}

.embed-copy-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(247, 184, 75, 0.65);
  background: linear-gradient(180deg, #3a3020 0%, #231c12 100%);
  color: #ffe3a3;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.embed-copy-btn:hover,
.embed-copy-btn:focus-visible {
  background: linear-gradient(180deg, #4f4027 0%, #2e2416 100%);
  border-color: #f7b84b;
  color: #fff4d1;
  outline: none;
}

.embed-copy-btn:active {
  transform: translateY(1px);
}

.embed-copy-btn.is-copied {
  border-color: rgba(124, 255, 155, 0.8);
  background: linear-gradient(180deg, #1b3c25 0%, #102617 100%);
  color: #9effb4;
}

@media (max-width: 680px) {
  .embed-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .embed-copy-btn {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Iframe Embed Mode (?embed=1)
   -------------------------------------------------------------------------- */
.embed-corner-badge {
  display: none;
}

html.is-embed .top-chrome,
html.is-embed .embed-footer {
  display: none !important;
}

html.is-embed .room-viewport {
  padding: 0;
  gap: 0;
  background: #050607;
}

html.is-embed .crt-viewport {
  border-radius: 12px;
  border-width: 1px;
  box-shadow:
    inset 0 0 38px rgba(0, 0, 0, 0.92),
    inset 0 8px 24px rgba(0, 0, 0, 0.78);
}

html.is-embed .crt-osd {
  top: 16px;
  right: 16px;
}

html.is-embed .broadcast-on-air-badge {
  top: 52px;
  left: 16px;
}

html.is-embed .embed-corner-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10, 12, 14, 0.78);
  border: 1px solid rgba(236, 208, 132, 0.42);
  color: #f4e6c3;
  text-decoration: none;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html.is-embed .embed-corner-badge:hover,
html.is-embed .embed-corner-badge:focus-visible {
  background: rgba(28, 24, 19, 0.95);
  border-color: rgba(247, 184, 75, 0.85);
  color: #fff2cc;
  outline: none;
}

.embed-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-glow);
  box-shadow: 0 0 8px rgba(247, 184, 75, 0.85);
}
