* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --beige-light: #c4b49a;
  --beige-mid: #a89880;
  --beige-dark: #8c7c66;
  --brown-dark: #6a5d4d;
  --panel-dark: #4a4540;
  --panel-darker: #2f2c28;
  --black-warm: #1a1816;
  --cream: #f5edd8;
  --cream-dark: #c4b898;
  --glow-green: #44cc44;
  --patina-color: rgba(45, 65, 55, 0.08);
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  font-family: 'Courier New', monospace;
  padding: 20px;
  position: relative;
}

/* Global Patina Overlay */
.patina-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: 
    url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="4" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.03"/></svg>'),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.01) 2px,
      rgba(0,0,0,0.01) 4px
    );
  mix-blend-mode: multiply;
}

.tv-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: 
    drop-shadow(0 20px 40px rgba(0,0,0,0.4))
    drop-shadow(0 5px 10px rgba(0,0,0,0.2));
}

.tv-body {
  background: 
    url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.06"/></svg>'),
    linear-gradient(145deg, var(--beige-light) 0%, var(--beige-mid) 40%, var(--beige-dark) 100%);
  border-radius: 16px;
  padding: 20px;
  border: 3px solid var(--brown-dark);
  display: flex;
  flex-direction: row;
  gap: 12px;
  position: relative;
}

.tv-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.1) 0%,
    transparent 30%,
    transparent 70%,
    rgba(0,0,0,0.1) 100%
  );
  pointer-events: none;
}

/* Wear marks */
.tv-body::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 15px;
  width: 60px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.screen-section {
  display: flex;
  flex-direction: column;
}

.screen-bezel {
  background: 
    url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.08"/></svg>'),
    linear-gradient(145deg, var(--panel-dark) 0%, var(--panel-darker) 100%);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 
    inset 0 3px 8px rgba(0,0,0,0.6),
    inset 0 -1px 2px rgba(255,255,255,0.05),
    0 2px 4px rgba(0,0,0,0.2);
}

.screen-inner {
  background: #1a1915;
  border-radius: 35px / 30px;
  padding: 12px;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.8),
    inset 0 0 80px rgba(0,0,0,0.4);
  overflow: hidden;
}

.screen {
  width: 640px;
  height: 480px;
  border-radius: 28px / 24px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(145deg, #2a3a2a 0%, #1a2a1a 50%, #0a150a 100%);
  box-shadow: 
    inset 0 0 80px rgba(0,40,0,0.3),
    inset 0 0 20px rgba(0,0,0,0.8);
}

.screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.06) 2px,
      rgba(0,0,0,0.06) 4px
    );
  pointer-events: none;
  z-index: 10;
}

.screen::after {
  content: '';
  position: absolute;
  top: 3%;
  left: 3%;
  width: 35%;
  height: 25%;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 11;
}

.screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

.screen iframe.visible {
  display: block;
  z-index: 5;
}

/* Scale down external content that's designed for larger viewports */
.screen iframe.scaled {
  width: 125%;
  height: 125%;
  transform: scale(0.8);
  transform-origin: top left;
}

#pongCanvas {
  display: none;
  width: 100%;
  height: 100%;
}

/* Placeholder */
.placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #0a1a0a 0%, #051005 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 3;
  color: #3a6a3a;
}

.placeholder.hidden {
  display: none;
}

.placeholder-logo {
  font-size: 80px;
  font-weight: bold;
  font-family: 'Georgia', serif;
  color: #2a4a2a;
  text-shadow: 0 0 20px rgba(50, 100, 50, 0.3);
  line-height: 1;
}

.placeholder-text {
  font-size: 18px;
  letter-spacing: 12px;
  margin-top: 10px;
  color: #3a5a3a;
}

.placeholder-channel {
  margin-top: 30px;
  font-size: 14px;
  color: #4a7a4a;
}

.placeholder-loading {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: #3a6a3a;
  border-radius: 50%;
  animation: loadingPulse 1.2s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.no-signal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: none;
  background: #111;
}

.no-signal.visible {
  display: block;
}

/* Static noise for no-signal */
.no-signal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="1" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.7"/></svg>');
  animation: no-signal-static 0.08s infinite steps(4);
  opacity: 0.6;
}

.no-signal::after {
  content: 'NO SIGNAL';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #888;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 4px;
  text-shadow:
    0 0 10px rgba(255,255,255,0.3),
    2px 2px 0 #000;
  animation: no-signal-flicker 0.5s infinite;
  z-index: 1;
}

@keyframes no-signal-static {
  0% { transform: translate(0, 0) scale(1.1); }
  25% { transform: translate(-3px, 2px) scale(1.1); }
  50% { transform: translate(2px, -2px) scale(1.1); }
  75% { transform: translate(-1px, -1px) scale(1.1); }
  100% { transform: translate(1px, 1px) scale(1.1); }
}

@keyframes no-signal-flicker {
  0%, 100% { opacity: 0.9; }
  10% { opacity: 0.7; }
  20% { opacity: 0.95; }
  50% { opacity: 0.85; }
  80% { opacity: 0.75; }
}

.static-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.15s;
}

.static-overlay.active {
  animation: static 0.05s infinite;
  opacity: 1;
  background: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="1" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.6"/></svg>');
}

@keyframes static {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
}

/* Control Panel */
.control-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  width: 160px;
  background: 
    url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.1"/></svg>'),
    linear-gradient(145deg, var(--panel-dark) 0%, var(--panel-darker) 100%);
  border-radius: 8px;
  box-shadow: 
    inset 0 2px 6px rgba(0,0,0,0.4),
    inset 0 -1px 2px rgba(255,255,255,0.03);
}

.knob-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
}

/* Chunky Channel Dial */
.channel-dial {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: 
    radial-gradient(ellipse at 30% 30%, #3a3632 0%, #1a1815 70%);
  box-shadow: 
    0 6px 16px rgba(0,0,0,0.7),
    0 2px 4px rgba(0,0,0,0.4),
    inset 0 2px 2px rgba(255,255,255,0.05),
    inset 0 -2px 4px rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.dial-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #0f0e0c;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.6),
    0 1px 1px rgba(255,255,255,0.05);
}

.dial-detents {
  position: absolute;
  width: 100%;
  height: 100%;
}

.dial-detent {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 6px;
  background: #2a2520;
  transform-origin: 50% 59px;
  border-radius: 1px;
}

.channel-numbers {
  position: absolute;
  width: 100%;
  height: 100%;
  font-family: 'Arial', sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #9a8a70;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.channel-number {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
  transition: color 0.2s, text-shadow 0.2s, opacity 0.2s;
  opacity: 0.7;
  letter-spacing: -0.5px;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 3px rgba(0,0,0,0.3),
    1px 0 0 rgba(0,0,0,0.15),
    -1px 0 0 rgba(0,0,0,0.1);
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.channel-number.active {
  color: #e8dcc8;
  opacity: 0.95;
  text-shadow:
    0 0 4px rgba(220, 210, 190, 0.4),
    0 1px 2px rgba(0,0,0,0.8),
    1px 0 0 rgba(0,0,0,0.2);
}

/* Chunky Knob */
.knob {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  z-index: 5;
  background: 
    radial-gradient(ellipse at 35% 25%, #4a4440 0%, #2a2725 40%, #1a1816 80%);
  box-shadow: 
    0 6px 16px rgba(0,0,0,0.7),
    0 2px 4px rgba(0,0,0,0.5),
    inset 0 3px 4px rgba(255,255,255,0.1),
    inset 0 -4px 8px rgba(0,0,0,0.5);
  transition: transform 0.08s ease;
}

.knob::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-radius: 50%;
  background: 
    radial-gradient(ellipse at 40% 30%, #353230 0%, #1f1d1a 100%);
  box-shadow: 
    inset 0 3px 6px rgba(0,0,0,0.5),
    inset 0 -2px 4px rgba(255,255,255,0.03);
}

.knob-grip {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    #2a2826 0deg 12deg,
    #1f1d1b 12deg 24deg
  );
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.knob:hover {
  box-shadow: 
    0 8px 20px rgba(0,0,0,0.8),
    0 3px 6px rgba(0,0,0,0.5),
    inset 0 3px 4px rgba(255,255,255,0.12),
    inset 0 -4px 8px rgba(0,0,0,0.5);
}

.knob:active {
  transform: scale(0.97);
}

/* Left hover - show CCW rotation hint */
.knob.hover-left {
  cursor: w-resize;
}
.knob.hover-left::after {
  content: '';
  position: absolute;
  top: 6px;
  left: -6px;
  width: 32px;
  height: 28px;
  /* Fat delta arrow pointing left with slight curve - plenith brown */
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 32"><path d="M38 4 Q32 16 38 28 L6 16 Z" fill="%23a89880"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px rgba(168, 152, 128, 0.8));
  z-index: 10;
  pointer-events: none;
}

/* Right hover - show CW rotation hint */
.knob.hover-right {
  cursor: e-resize;
}
.knob.hover-right::after {
  content: '';
  position: absolute;
  top: 6px;
  right: -6px;
  width: 32px;
  height: 28px;
  /* Fat delta arrow pointing right with slight curve - plenith brown */
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 32"><path d="M2 4 Q8 16 2 28 L34 16 Z" fill="%23a89880"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px rgba(168, 152, 128, 0.8));
  z-index: 10;
  pointer-events: none;
}

.knob-pointer {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 24px;
  background:
    url('data:image/svg+xml,<svg viewBox="0 0 20 40" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.15"/></svg>'),
    linear-gradient(
      to bottom,
      var(--cream) 0%,
      #d8ccb0 30%,
      #c8bca0 60%,
      var(--cream-dark) 100%
    );
  border-radius: 4px 4px 3px 3px;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.4),
    inset 0 -1px 2px rgba(0,0,0,0.25),
    inset 1px 0 1px rgba(0,0,0,0.1),
    inset -1px 0 1px rgba(0,0,0,0.1);
  z-index: 6;
}

/* Brand Section */
.brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 5px;
}

.speaker-grille {
  width: 125px;
  height: 50px;
  background: var(--black-warm);
  border-radius: 4px;
  padding: 6px 8px;
  box-shadow: 
    inset 0 3px 6px rgba(0,0,0,0.6),
    inset 0 -1px 1px rgba(255,255,255,0.03);
  overflow: hidden;
}

.speaker-holes {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
}

.speaker-hole {
  background: #0f0e0c;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.8);
}

/* Rocker Switch */
.rocker-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

.rocker-housing {
  background: linear-gradient(145deg, #151310, #0a0908);
  padding: 5px;
  border-radius: 8px;
  box-shadow: 
    inset 0 3px 6px rgba(0,0,0,0.7),
    0 1px 2px rgba(255,255,255,0.03);
}

.rocker-switch {
  position: relative;
  width: 48px;
  height: 28px;
  background: linear-gradient(145deg, #0a0a09, #151412);
  border-radius: 5px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.rocker-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  width: 22px;
  height: 22px;
  background: linear-gradient(145deg, #3a3835, #252320);
  border-radius: 4px;
  transition: all 0.15s ease;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.08);
}

.rocker-switch.on::before {
  left: 3px;
}

.rocker-switch.off::before {
  left: 23px;
}

.rocker-glow {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1a1816;
  transition: all 0.3s ease;
  z-index: 2;
}

.rocker-switch.on .rocker-glow {
  background: var(--glow-green);
  box-shadow: 
    0 0 6px var(--glow-green),
    0 0 12px var(--glow-green),
    0 0 18px rgba(68, 204, 68, 0.4),
    inset 0 0 3px rgba(255,255,255,0.4);
}

.rocker-switch.off .rocker-glow {
  left: 31px;
  background: #2a1a1a;
  box-shadow: none;
}

.power-label {
  font-size: 9px;
  color: #7a6a55;
  letter-spacing: 1px;
  font-family: 'Arial', sans-serif;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.brand-plate {
  background: 
    linear-gradient(145deg, #1f1d1a, #0f0e0c);
  padding: 5px 14px;
  border-radius: 3px;
  box-shadow: 
    inset 0 1px 3px rgba(0,0,0,0.5),
    0 1px 1px rgba(255,255,255,0.03);
}

.brand-name {
  color: #b0a080;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  font-family: 'Arial Black', 'Arial', sans-serif;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.brand-name:hover {
  color: #d0c0a0;
}

.tv-stand {
  width: 180px;
  height: 22px;
  background: 
    linear-gradient(to bottom, #1a1816, #0f0e0d);
  border-radius: 0 0 8px 8px;
  margin-top: -4px;
  box-shadow: 
    0 5px 15px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.02);
}

/* CRT Power-off Animation */
.screen.off {
  background: #000 !important;
}

.screen.off::before,
.screen.off::after {
  display: none;
}

.screen.off iframe,
.screen.off #pongCanvas,
.screen.off .placeholder,
.screen.off .no-signal {
  display: none !important;
}

/* CRT Power-off overlay - the collapsing line/dot effect */
.crt-poweroff-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 200;
  pointer-events: none;
  display: none;
}

.crt-poweroff-overlay.active {
  display: block;
}

/* The glowing line/dot */
.crt-poweroff-overlay::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  width: 0;
  height: 0;
  opacity: 0;
}

/* Power-off animation - 1950s CRT style
   Vertical deflection dies first → horizontal line
   Then horizontal deflection dies → shrinks to bright dot
   Phosphor afterglow lingers briefly */
.crt-poweroff-overlay.powering-off::after {
  animation: crt-collapse 1s ease-out forwards;
}

@keyframes crt-collapse {
  /* Full screen, content visible */
  0% {
    width: 100%;
    height: 100%;
    opacity: 1;
    border-radius: 0;
    background: linear-gradient(to bottom,
      rgba(200,200,200,0.3) 0%,
      rgba(255,255,255,0.9) 45%,
      rgba(255,255,255,1) 50%,
      rgba(255,255,255,0.9) 55%,
      rgba(200,200,200,0.3) 100%);
    box-shadow: none;
    filter: brightness(1);
  }
  /* Vertical collapse - becomes bright horizontal line */
  20% {
    width: 100%;
    height: 6px;
    opacity: 1;
    border-radius: 3px;
    background: #fff;
    box-shadow:
      0 0 15px 8px rgba(255, 255, 255, 0.9),
      0 0 30px 15px rgba(200, 220, 255, 0.5);
    filter: brightness(1.3);
  }
  /* Hold the line briefly */
  35% {
    width: 100%;
    height: 4px;
    opacity: 1;
    border-radius: 2px;
    background: #fff;
    box-shadow:
      0 0 12px 6px rgba(255, 255, 255, 0.8),
      0 0 25px 12px rgba(200, 220, 255, 0.4);
    filter: brightness(1.2);
  }
  /* Horizontal collapse to dot - gets very bright */
  55% {
    width: 16px;
    height: 16px;
    opacity: 1;
    border-radius: 50%;
    background: #fff;
    box-shadow:
      0 0 25px 15px rgba(255, 255, 255, 1),
      0 0 50px 25px rgba(200, 220, 255, 0.7),
      0 0 80px 40px rgba(150, 180, 255, 0.3);
    filter: brightness(1.5);
  }
  /* Dot shrinks, phosphor glow persists */
  75% {
    width: 8px;
    height: 8px;
    opacity: 1;
    border-radius: 50%;
    background: #fff;
    box-shadow:
      0 0 20px 12px rgba(255, 255, 255, 0.8),
      0 0 40px 20px rgba(200, 220, 255, 0.5);
    filter: brightness(1.2);
  }
  /* Phosphor afterglow fading */
  90% {
    width: 4px;
    height: 4px;
    opacity: 0.7;
    border-radius: 50%;
    background: rgba(200, 220, 255, 0.9);
    box-shadow:
      0 0 15px 8px rgba(200, 220, 255, 0.5),
      0 0 30px 15px rgba(150, 180, 255, 0.3);
    filter: brightness(1);
  }
  /* Final fade */
  100% {
    width: 2px;
    height: 2px;
    opacity: 0;
    border-radius: 50%;
    background: rgba(150, 180, 255, 0.5);
    box-shadow: 0 0 10px 5px rgba(150, 180, 255, 0.2);
    filter: brightness(0.8);
  }
}

/* Power-on animation - reverse of power-off */
.crt-poweroff-overlay.powering-on::after {
  animation: crt-expand 0.6s ease-out forwards;
}

@keyframes crt-expand {
  /* Start as small bright dot */
  0% {
    width: 4px;
    height: 4px;
    opacity: 1;
    border-radius: 50%;
    background: #fff;
    box-shadow:
      0 0 20px 12px rgba(255, 255, 255, 0.9),
      0 0 40px 20px rgba(200, 220, 255, 0.5);
    filter: brightness(1.3);
  }
  /* Expand to horizontal line */
  40% {
    width: 100%;
    height: 4px;
    opacity: 1;
    border-radius: 2px;
    background: #fff;
    box-shadow:
      0 0 15px 8px rgba(255, 255, 255, 0.8),
      0 0 30px 15px rgba(200, 220, 255, 0.4);
    filter: brightness(1.2);
  }
  /* Expand to full screen */
  100% {
    width: 100%;
    height: 100%;
    opacity: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    filter: brightness(1);
  }
}

.instructions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #555;
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Responsive - Phone Mode */
@media (max-width: 700px) {
  body {
    padding: 0;
    align-items: flex-start;
    padding-top: 5px;
  }

  .tv-container {
    width: 100%;
  }

  .tv-body {
    flex-direction: column;
    padding: 5px;
    gap: 5px;
    width: 100%;
  }

  .screen-section {
    width: 100%;
  }

  .screen-bezel {
    padding: 4px;
    width: 100%;
  }

  .screen-inner {
    padding: 3px;
  }

  .screen {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .control-panel {
    width: 100%;
    flex-direction: row;
    padding: 12px 15px;
    justify-content: space-around;
    align-items: center;
  }

  .knob-section {
    padding: 5px;
  }

  .channel-dial {
    width: 105px;
    height: 105px;
  }

  .channel-numbers {
    font-size: 9px;
  }

  .knob {
    width: 65px;
    height: 65px;
  }

  .knob-pointer {
    height: 18px;
    width: 6px;
    top: 6px;
  }

  .knob-grip {
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
  }

  .brand-section {
    gap: 10px;
    padding: 0;
  }

  .speaker-grille {
    width: 100px;
    height: 40px;
  }

  .brand-name {
    font-size: 13px;
    letter-spacing: 2px;
  }

  .tv-stand {
    width: 140px;
    height: 18px;
  }

  .instructions {
    font-size: 10px;
    bottom: 10px;
  }

  .placeholder-logo {
    font-size: 50px;
  }

  .placeholder-text {
    font-size: 14px;
    letter-spacing: 8px;
  }
}

@media (max-width: 400px) {
  .screen {
    max-width: 100%;
  }

  .channel-dial {
    width: 90px;
    height: 90px;
  }

  .channel-numbers {
    font-size: 8px;
  }

  .knob {
    width: 55px;
    height: 55px;
  }

  .knob-pointer {
    height: 15px;
    width: 5px;
    top: 5px;
  }

  .speaker-grille {
    width: 80px;
    height: 32px;
  }

  .brand-name {
    font-size: 11px;
  }
}

/* ===========================================
   PADDLE BOX CONTROLLER - 1970s Aesthetic
   Cross between Commodore and Apple II
   =========================================== */

.paddle-box {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  filter:
    drop-shadow(0 15px 30px rgba(0,0,0,0.5))
    drop-shadow(0 5px 10px rgba(0,0,0,0.3));
  display: none;
}

.paddle-box.visible {
  display: block;
}

.paddle-box.dragging {
  transform: none;
  user-select: none;
}

.paddle-box-top {
  cursor: grab;
}

.paddle-box-top:active,
.paddle-box.dragging .paddle-box-top {
  cursor: grabbing;
}

.paddle-box-body {
  background:
    url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>'),
    linear-gradient(175deg, #d4c4a8 0%, #c4b498 30%, #b4a488 60%, #a49478 100%);
  border-radius: 12px;
  padding: 12px 16px;
  border: 3px solid #8a7a68;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 420px;
  position: relative;
}

/* Plastic sheen overlay */
.paddle-box-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 10px;
  background: linear-gradient(
    160deg,
    rgba(255,255,255,0.15) 0%,
    transparent 25%,
    transparent 75%,
    rgba(0,0,0,0.08) 100%
  );
  pointer-events: none;
}

/* Wear/scuff marks */
.paddle-box-body::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 20px;
  width: 80px;
  height: 30px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ===== TOP PANEL - Readouts ===== */
.paddle-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background:
    linear-gradient(145deg, #2a2825, #1a1815);
  border-radius: 6px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.6),
    inset 0 -1px 2px rgba(255,255,255,0.03),
    0 1px 2px rgba(255,255,255,0.05);
}

.readout-panel {
  display: flex;
  gap: 16px;
}

.readout-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* 7-Segment LED Display Style */
.led-display {
  display: flex;
  gap: 2px;
  background: #0a0a08;
  padding: 4px 6px;
  border-radius: 3px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.8),
    0 1px 1px rgba(255,255,255,0.03);
}

.led-display.three-digit {
  padding: 4px 5px;
}

.led-digit {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: bold;
  color: #ff3322;
  text-shadow:
    0 0 8px rgba(255, 50, 30, 0.8),
    0 0 15px rgba(255, 50, 30, 0.4);
  min-width: 12px;
  text-align: center;
  letter-spacing: -1px;
}

/* Dim unlit segments effect */
.led-digit::before {
  content: '8';
  position: absolute;
  color: rgba(60, 20, 15, 0.3);
  text-shadow: none;
}

.readout-label {
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  color: #8a7a68;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* Status Indicator Lights */
.status-lights {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.indicator-row {
  display: flex;
  gap: 12px;
}

.indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.indicator-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1210;
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.8),
    0 1px 1px rgba(255,255,255,0.03);
  border: 1px solid #0a0808;
}

.indicator-led.on {
  background: radial-gradient(circle at 30% 30%, #66ff66 0%, #22cc22 50%, #119911 100%);
  box-shadow:
    0 0 6px rgba(68, 204, 68, 0.8),
    0 0 12px rgba(68, 204, 68, 0.4),
    inset 0 -2px 4px rgba(0,0,0,0.3);
}

.indicator-led.on.red {
  background: radial-gradient(circle at 30% 30%, #ff6666 0%, #cc2222 50%, #991111 100%);
  box-shadow:
    0 0 6px rgba(204, 68, 68, 0.8),
    0 0 12px rgba(204, 68, 68, 0.4),
    inset 0 -2px 4px rgba(0,0,0,0.3);
}

.indicator-led.on.amber {
  background: radial-gradient(circle at 30% 30%, #ffcc66 0%, #cc9922 50%, #996611 100%);
  box-shadow:
    0 0 6px rgba(204, 153, 68, 0.8),
    0 0 12px rgba(204, 153, 68, 0.4),
    inset 0 -2px 4px rgba(0,0,0,0.3);
}

/* Blinking animation for activity indicators */
.indicator-led.blink {
  animation: led-blink 0.15s ease-in-out;
}

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.indicator-label {
  font-family: 'Arial', sans-serif;
  font-size: 7px;
  color: #7a6a58;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* ===== MIDDLE PANEL - Paddles & VU ===== */
.paddle-box-middle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  background:
    url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.08"/></svg>'),
    linear-gradient(145deg, #3a3632, #2a2825);
  border-radius: 6px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.5),
    inset 0 -1px 2px rgba(255,255,255,0.02);
}

.paddle-section {
  display: flex;
  gap: 24px;
}

.paddle-housing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.paddle-unit {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Paddle Wheel - Rotary Encoder Style */
.paddle-wheel {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 35% 30%, #4a4642 0%, #2a2826 50%, #1a1816 90%);
  box-shadow:
    0 4px 10px rgba(0,0,0,0.6),
    0 2px 4px rgba(0,0,0,0.4),
    inset 0 2px 3px rgba(255,255,255,0.08),
    inset 0 -3px 6px rgba(0,0,0,0.4);
  position: relative;
  cursor: grab;
  transition: transform 0.05s;
}

.paddle-wheel:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.paddle-grip {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    #3a3836 0deg 15deg,
    #2a2826 15deg 30deg
  );
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.paddle-marker {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 14px;
  background: linear-gradient(
    to bottom,
    #e8dcc8 0%,
    #d0c4b0 50%,
    #b8ac98 100%
  );
  border-radius: 3px;
  box-shadow:
    0 2px 3px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.5);
}

/* Fire Button */
.fire-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(145deg, #1a1816, #0f0e0c);
  padding: 3px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.6),
    0 1px 2px rgba(255,255,255,0.03);
  cursor: pointer;
}

.button-cap {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background:
    linear-gradient(145deg, #cc3322 0%, #aa2211 50%, #881100 100%);
  box-shadow:
    0 3px 6px rgba(0,0,0,0.5),
    inset 0 2px 3px rgba(255,255,255,0.2),
    inset 0 -2px 4px rgba(0,0,0,0.3);
  transition: all 0.08s;
}

.fire-button:hover .button-cap {
  background:
    linear-gradient(145deg, #dd4433 0%, #bb3322 50%, #992211 100%);
}

.fire-button:active .button-cap {
  transform: translateY(2px);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.5),
    inset 0 2px 3px rgba(255,255,255,0.15),
    inset 0 -1px 2px rgba(0,0,0,0.3);
}

.paddle-label {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  font-weight: bold;
  color: #9a8a78;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* VU Meter */
.vu-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vu-meter {
  background: #0a0908;
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.8),
    0 1px 2px rgba(255,255,255,0.03);
  width: 120px;
}

.vu-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 4px;
}

.vu-scale span {
  font-family: 'Arial', sans-serif;
  font-size: 7px;
  color: #6a5a48;
}

.vu-bar-container {
  height: 8px;
  background: linear-gradient(to right,
    #1a3a1a 0%,
    #1a3a1a 60%,
    #3a3a1a 60%,
    #3a3a1a 80%,
    #3a1a1a 80%,
    #3a1a1a 100%
  );
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.vu-bar {
  height: 100%;
  width: 45%;
  background: linear-gradient(to right,
    #22cc22 0%,
    #44ee44 50%,
    #66ff66 60%,
    #cccc22 75%,
    #ffcc22 85%,
    #ff4422 95%
  );
  border-radius: 2px;
  box-shadow:
    0 0 6px rgba(68, 204, 68, 0.5),
    0 0 12px rgba(68, 204, 68, 0.2);
  transition: width 0.1s ease-out;
}

.vu-label {
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  color: #8a7a68;
  letter-spacing: 1px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* ===== BOTTOM PANEL - Ports & Brand ===== */
.paddle-box-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
}

.port-section {
  display: flex;
  gap: 12px;
}

.port-jack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.jack-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #0a0808 0%, #1a1614 100%);
  border: 2px solid #3a3632;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.8),
    0 1px 1px rgba(255,255,255,0.05);
}

.port-label {
  font-family: 'Arial', sans-serif;
  font-size: 7px;
  color: #6a5a48;
  letter-spacing: 0.5px;
}

/* Brand Plate */
.paddle-brand {
  display: flex;
  justify-content: center;
}

.paddle-brand-plate {
  background:
    linear-gradient(145deg, #c0b090 0%, #a09070 100%);
  padding: 4px 14px;
  border-radius: 2px;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.3),
    inset 0 -1px 2px rgba(0,0,0,0.2),
    0 1px 3px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.paddle-brand-text {
  font-family: 'Arial Black', 'Arial', sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #4a3a28;
  letter-spacing: 3px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.paddle-model {
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  color: #5a4a38;
  letter-spacing: 2px;
}

/* Mode Selector */
.mode-switch-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mode-label {
  font-family: 'Arial', sans-serif;
  font-size: 7px;
  color: #6a5a48;
  letter-spacing: 1px;
}

.mode-selector {
  display: flex;
  background: #1a1816;
  border-radius: 3px;
  padding: 2px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.6),
    0 1px 1px rgba(255,255,255,0.03);
}

.mode-option {
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  font-weight: bold;
  color: #5a5048;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.mode-option:hover {
  color: #8a7a68;
}

.mode-option.active {
  background: linear-gradient(145deg, #3a6a3a 0%, #2a5a2a 100%);
  color: #aaffaa;
  text-shadow: 0 0 6px rgba(68, 204, 68, 0.5);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    inset 0 1px 1px rgba(255,255,255,0.1);
}

/* Player Selector (MP mode) */
.player-selector {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.player-selector.hidden {
  display: none;
}

.player-option {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  font-weight: bold;
  color: #5a5048;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 3px;
  background: #1a1816;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.6),
    0 1px 1px rgba(255,255,255,0.03);
  transition: all 0.15s;
}

.player-option:hover {
  color: #8a7a68;
}

.player-option.active {
  background: linear-gradient(145deg, #3a5a8a 0%, #2a4a7a 100%);
  color: #aaddff;
  text-shadow: 0 0 6px rgba(68, 150, 220, 0.5);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    inset 0 1px 1px rgba(255,255,255,0.1);
}

/* Popout Button */
.popout-btn {
  background: linear-gradient(145deg, #3a3632, #2a2825);
  border: 2px solid #4a4540;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.05);
  transition: all 0.15s;
}

.popout-btn:hover {
  background: linear-gradient(145deg, #4a4642, #3a3835);
  box-shadow:
    0 3px 6px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.08);
}

.popout-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.03);
}

.popout-icon {
  font-size: 14px;
  color: #9a8a78;
  line-height: 1;
}

.popout-btn:hover .popout-icon {
  color: #baa898;
}

/* Cable Connector - hidden for now */
.cable-connector {
  display: none;
}

.cable-svg {
  width: 100%;
  height: 100%;
}

.cable-path {
  stroke: #2a2825;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* ===== Responsive - Hide paddle box on small screens ===== */
@media (max-width: 700px) {
  .paddle-box {
    display: none;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .paddle-box-body {
    min-width: 360px;
    padding: 10px 12px;
    gap: 8px;
  }

  .paddle-section {
    gap: 16px;
  }

  .paddle-wheel {
    width: 42px;
    height: 42px;
  }

  .fire-button {
    width: 28px;
    height: 28px;
  }

  .vu-meter {
    width: 100px;
  }
}
