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

body {
  background: #1a1510;
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(60,45,25,0.6) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  font-family: 'Share Tech Mono', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

/* CRT Screen Effects */
.crt-screen {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #0a0a0a;
}

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

.crt-screen::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.5) 100%);
  z-index: 4;
  pointer-events: none;
}

.crt-flicker {
  animation: flicker 0.15s infinite alternate;
}

@keyframes flicker {
  0% { opacity: 0.97; }
  100% { opacity: 1; }
}

.crt-glow {
  filter: contrast(1.1) brightness(1.05);
}

/* Static noise animation */
.static-noise {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2;
  opacity: 0.4;
  animation: static-anim 0.5s steps(10) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' seed='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes static-anim {
  0% { transform: translate(0,0); }
  10% { transform: translate(-5%,-5%); }
  20% { transform: translate(3%,7%); }
  30% { transform: translate(-7%,2%); }
  40% { transform: translate(5%,-3%); }
  50% { transform: translate(-2%,8%); }
  60% { transform: translate(7%,-7%); }
  70% { transform: translate(-4%,4%); }
  80% { transform: translate(6%,-2%); }
  90% { transform: translate(-3%,6%); }
  100% { transform: translate(2%,-4%); }
}

/* Phosphor green tint overlay */
.phosphor-green {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 255, 65, 0.03);
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* VFD Display */
.vfd-display {
  font-family: 'VT323', monospace;
  color: #00ff9d;
  text-shadow: 0 0 8px #00ff9d, 0 0 20px rgba(0,255,157,0.4), 0 0 40px rgba(0,255,157,0.1);
  background: #0a0f0a;
  border: 2px inset #333;
  letter-spacing: 4px;
}

/* Nixie clock */
.nixie-text {
  font-family: 'Orbitron', sans-serif;
  color: #ffaa44;
  text-shadow: 0 0 6px #ff8800, 0 0 15px rgba(255,136,0,0.5), 0 0 30px rgba(255,136,0,0.2);
}

/* Button 3D effect */
.retro-button {
  background: linear-gradient(180deg, #888 0%, #666 40%, #555 60%, #444 100%);
  border: 2px solid #333;
  border-top-color: #999;
  border-left-color: #888;
  border-radius: 6px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all 0.08s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  user-select: none;
}

.retro-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Toggle switch */
.toggle-switch {
  width: 50px;
  height: 26px;
  background: linear-gradient(180deg, #333 0%, #555 50%, #333 100%);
  border-radius: 13px;
  border: 2px solid #222;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.toggle-switch .toggle-handle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ddd 0%, #999 100%);
  position: absolute;
  top: 1px;
  left: 1px;
  transition: left 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}

.toggle-switch.on .toggle-handle {
  left: 25px;
}

/* LED indicator */
.led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.5);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.led-green { background: #004400; }
.led-green.on { background: #00ff00; box-shadow: 0 0 8px #00ff00, 0 0 16px rgba(0,255,0,0.3); }
.led-yellow { background: #444400; }
.led-yellow.on { background: #ffff00; box-shadow: 0 0 8px #ffff00, 0 0 16px rgba(255,255,0,0.3); }
.led-red { background: #440000; }
.led-red.on { background: #ff0000; box-shadow: 0 0 8px #ff0000, 0 0 16px rgba(255,0,0,0.3); animation: led-pulse 1.5s ease-in-out infinite; }
.led-white { background: #333; }
.led-white.on { background: #cccccc; box-shadow: 0 0 4px #ccc; }

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Knob */
.knob-container {
  width: 60px;
  height: 60px;
  cursor: grab;
  user-select: none;
}

.knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #888 0%, #555 30%, #444 70%, #666 100%);
  border: 3px solid #333;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.1);
  position: relative;
}

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

/* Ribbed knob texture */
.knob-ribbed {
  background: repeating-conic-gradient(from 0deg, #666 0deg 10deg, #555 10deg 20deg);
  border: 3px solid #333;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

/* Speaker grille */
.speaker-grille {
  background: #2a2a2a;
  background-image: radial-gradient(circle, #1a1a1a 1.5px, transparent 1.5px);
  background-size: 6px 6px;
  border: 2px inset #333;
  border-radius: 4px;
}

/* Metal texture */
.brushed-metal {
  background: linear-gradient(135deg, #6b6b6b 0%, #808080 25%, #6b6b6b 50%, #757575 75%, #6b6b6b 100%);
  background-image:
    linear-gradient(135deg, #6b6b6b 0%, #808080 25%, #6b6b6b 50%, #757575 75%, #6b6b6b 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

/* Nameplate */
.nameplate {
  background: linear-gradient(180deg, #c9a84c 0%, #a68329 30%, #c9a84c 50%, #a68329 70%, #c9a84c 100%);
  border: 1px solid #8a6914;
  border-radius: 3px;
  padding: 4px 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: #3a2a00;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

/* Housing */
.phone-housing {
  background: linear-gradient(180deg, #737373 0%, #656565 20%, #5a5a5a 80%, #4a4a4a 100%);
  border-radius: 24px;
  border: 3px solid #3a3a3a;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 8px 24px rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.2);
  position: relative;
}

.phone-housing::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Screw heads */
.screw {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #888 0%, #555 50%, #777 100%);
  border: 1px solid #333;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  position: relative;
}

.screw::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 1px;
  background: #333;
  transform: translateY(-50%) rotate(45deg);
}

/* Screen bezel */
.screen-bezel {
  background: linear-gradient(180deg, #2a2a2a 0%, #333 50%, #2a2a2a 100%);
  border: 2px solid #1a1a1a;
  border-radius: 16px;
  padding: 12px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
}

/* VU Meter */
.vu-meter {
  background: linear-gradient(180deg, #f5f0e0 0%, #e8e0c8 100%);
  border: 2px inset #666;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.vu-needle {
  transform-origin: 50% 90%;
  transition: transform 0.1s ease-out;
}

/* On Air indicator */
.on-air {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: #ff0000;
  text-shadow: 0 0 6px #ff0000;
  animation: on-air-blink 1s ease-in-out infinite;
}

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

/* Handset */
.handset {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.handset.lifted {
  transform: translateY(-20px) rotate(-15deg);
}

/* Leather panel */
.leather-panel {
  background: #3d3225;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
  border: 1px solid #2a2018;
}

/* Responsive */
@media (max-width: 768px) {
  .phone-housing {
    border-radius: 16px;
    margin: 8px;
  }
  .screen-bezel {
    padding: 6px;
    border-radius: 10px;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #2a2a2a; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

/* Test pattern */
.test-pattern {
  background: repeating-linear-gradient(
    90deg,
    #fff 0px, #fff 14.28%,
    #ff0 14.28%, #ff0 28.57%,
    #0ff 28.57%, #0ff 42.85%,
    #0f0 42.85%, #0f0 57.14%,
    #f0f 57.14%, #f0f 71.42%,
    #f00 71.42%, #f00 85.71%,
    #00f 85.71%, #00f 100%
  );
}