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

body {
  background: #0a0806;
  font-family: 'IBM Plex Mono', monospace;
  color: #ddd;
  overflow-x: hidden;
  min-height: 100vh;
}

@keyframes scanline-move {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
  92% { opacity: 0.97; }
}

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

@keyframes warm-up {
  0% { clip-path: circle(1% at 50% 50%); filter: brightness(3); }
  40% { clip-path: circle(5% at 50% 50%); filter: brightness(2); }
  70% { clip-path: ellipse(50% 3% at 50% 50%); filter: brightness(1.5); }
  100% { clip-path: ellipse(100% 100% at 50% 50%); filter: brightness(1); }
}

@keyframes shutdown {
  0% { clip-path: ellipse(100% 100% at 50% 50%); filter: brightness(1); }
  50% { clip-path: ellipse(50% 1% at 50% 50%); filter: brightness(2); }
  100% { clip-path: circle(0% at 50% 50%); filter: brightness(3); }
}

@keyframes channel-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes vhs-tracking {
  0% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@keyframes dust-float {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translate(200px, -100px) rotate(360deg); opacity: 0; }
}

@keyframes degauss {
  0% { filter: hue-rotate(0deg) saturate(1); }
  20% { filter: hue-rotate(90deg) saturate(3); }
  40% { filter: hue-rotate(180deg) saturate(2); }
  60% { filter: hue-rotate(270deg) saturate(3); }
  80% { filter: hue-rotate(360deg) saturate(2); }
  100% { filter: hue-rotate(0deg) saturate(1); }
}

@keyframes antenna-wobble {
  0%, 100% { transform: rotate(var(--antenna-angle, -30deg)); }
  25% { transform: rotate(calc(var(--antenna-angle, -30deg) + 3deg)); }
  75% { transform: rotate(calc(var(--antenna-angle, -30deg) - 3deg)); }
}

@keyframes volume-fade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes guide-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.crt-screen-container {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.crt-screen-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
  pointer-events: none;
  z-index: 5;
}

.crt-screen-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: 6;
}

.scanline-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    transparent 50%,
    rgba(0, 255, 0, 0.02) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 7;
}

.moving-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 8;
  animation: scanline-move 8s linear infinite;
}

.phosphor-glow {
  position: absolute;
  inset: -10px;
  border-radius: 30px;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 60px rgba(0, 255, 0, 0.1),
              inset 0 0 120px rgba(0, 255, 0, 0.05);
}

.wood-grain {
  background: linear-gradient(
    90deg,
    #3d2812 0%, #4a3015 5%, #3a2710 10%,
    #4d3218 15%, #3b2811 20%, #4a3015 25%,
    #3d2812 30%, #4e3319 35%, #3a2710 40%,
    #4a3015 45%, #3d2812 50%, #4b3116 55%,
    #3a2710 60%, #4d3218 65%, #3b2811 70%,
    #4a3015 75%, #3d2812 80%, #4e3319 85%,
    #3a2710 90%, #4a3015 95%, #3d2812 100%
  );
}

.knob-control {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #999, #444, #222);
  border: 3px solid #1a1a1a;
  cursor: grab;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255,255,255,0.2);
  transition: transform 0.1s;
  user-select: none;
}

.knob-control::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 14px;
  background: #111;
  border-radius: 2px;
}

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

.power-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #cc3333, #881111);
  border: 3px solid #1a1a1a;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6);
  transition: all 0.3s;
}

.power-btn.on {
  background: radial-gradient(circle at 40% 40%, #33cc33, #118811);
  box-shadow: 0 0 15px rgba(51, 204, 51, 0.5), 0 3px 8px rgba(0,0,0,0.6);
}

.channel-led {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: #ff6600;
  background: #0a0a0a;
  padding: 4px 12px;
  border-radius: 4px;
  border: 2px solid #333;
  text-shadow: 0 0 8px rgba(255, 102, 0, 0.6);
  text-align: center;
  min-width: 52px;
}

.remote-btn {
  background: #4a4a4a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #ddd;
  font-family: 'VT323', monospace;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  transition: all 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  user-select: none;
}

.remote-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 2px rgba(0,0,0,0.4);
}

.remote-btn:hover {
  background: #5a5a5a;
}

.guide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 40, 0.95);
  z-index: 20;
  font-family: 'VT323', monospace;
  overflow-y: auto;
  border-radius: 20px;
}

.guide-header {
  background: linear-gradient(90deg, #000066, #0000aa, #000066);
  padding: 10px 16px;
  color: #fff;
  font-size: 20px;
  border-bottom: 2px solid #3333ff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.guide-row {
  display: flex;
  padding: 6px 12px;
  border-bottom: 1px solid #111155;
  cursor: pointer;
  transition: background 0.15s;
  align-items: center;
}

.guide-row:hover {
  background: rgba(0, 0, 150, 0.5);
}

.guide-row.active {
  background: rgba(50, 50, 200, 0.4);
}

.upload-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-panel {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 2px solid #444;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  font-family: 'VT323', monospace;
}

.vu-meter {
  height: 20px;
  background: #111;
  border: 1px solid #333;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.vu-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
  transition: width 0.3s;
  border-radius: 3px;
}

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  background: rgba(100, 100, 255, 0.3);
  border: 1px solid rgba(100, 100, 255, 0.5);
  margin: 2px;
}

.static-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.video-player {
  position: absolute;
  inset: 0;
  z-index: 2;
  object-fit: contain;
  width: 100%;
  height: 100%;
  background: #000;
}

.lower-third {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  z-index: 10;
  font-family: 'VT323', monospace;
  pointer-events: none;
}

.lower-third-bg {
  background: linear-gradient(90deg, rgba(0,0,100,0.8), rgba(0,0,100,0.6), transparent);
  padding: 6px 14px;
  border-left: 3px solid #ff6600;
}

.channel-flash-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 15;
  font-family: 'VT323', monospace;
  font-size: 48px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
  pointer-events: none;
}

.volume-indicator {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 15;
  pointer-events: none;
}

.dust-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
}

.antenna-container {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
}

.antenna-rod {
  width: 4px;
  height: 70px;
  background: linear-gradient(to top, #888, #ccc);
  border-radius: 2px;
  transform-origin: bottom center;
  cursor: pointer;
  transition: transform 0.5s ease;
  position: relative;
}

.antenna-rod::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -2px;
  width: 8px;
  height: 8px;
  background: #ddd;
  border-radius: 50%;
}

.speaker-grille {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
}

.speaker-line {
  height: 2px;
  background: #555;
  border-radius: 1px;
}

@media (max-width: 900px) {
  .tv-main-layout {
    flex-direction: column !important;
  }
  .remote-panel {
    position: relative !important;
    margin-top: 16px;
  }
}