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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', 'Courier', monospace;
  background: #000;
  color: #0f0;
  user-select: none;
  -webkit-user-select: none;
}

.warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: flicker 0.3s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
}

.warning-content {
  max-width: 600px;
  padding: 40px;
  background: rgba(20, 0, 0, 0.95);
  border: 2px solid #f00;
  box-shadow: 0 0 40px #f00, inset 0 0 40px rgba(255, 0, 0, 0.1);
  text-align: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.warning-content h2 {
  color: #f00;
  font-size: 32px;
  margin-bottom: 20px;
  text-shadow: 0 0 10px #f00;
  animation: glitch-text 1s infinite;
}

@keyframes glitch-text {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

.warning-content p {
  color: #ff6666;
  margin-bottom: 15px;
  font-size: 16px;
  line-height: 1.6;
}

.warning-btn {
  margin-top: 20px;
  padding: 15px 40px;
  background: #f00;
  color: #fff;
  border: none;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 20px #f00;
  transition: all 0.3s;
}

.warning-btn:hover {
  background: #ff3333;
  box-shadow: 0 0 30px #f00;
  transform: scale(1.05);
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 0, 0.03) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 255, 0, 0.03) 3px
  );
  z-index: 100;
  opacity: 0.3;
  animation: scanline-move 8s linear infinite;
}

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

.title {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(18px, 4vw, 28px);
  font-weight: bold;
  color: #0f0;
  text-shadow: 0 0 20px #0f0, 0 0 40px #0f0;
  z-index: 50;
  letter-spacing: 4px;
  animation: title-glitch 6s infinite;
}

@keyframes title-glitch {
  0%, 90%, 100% { transform: translateX(-50%) skew(0deg); opacity: 1; }
  91% { transform: translateX(-52%) skew(-5deg); opacity: 0.8; }
  92% { transform: translateX(-48%) skew(5deg); opacity: 0.9; }
  93% { transform: translateX(-50%) skew(0deg); opacity: 1; }
}

#container {
  position: relative;
  width: 100%;
  height: 100%;
}

#videoElement {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 1;
}

#canvasOutput {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 10;
}

#scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 3px
  );
  pointer-events: none;
  z-index: 11;
  opacity: 0.5;
}

.info-panel {
  position: fixed;
  padding: 15px;
  background: rgba(0, 20, 0, 0.85);
  border: 1px solid #0f0;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3), inset 0 0 20px rgba(0, 255, 0, 0.1);
  z-index: 40;
  font-size: 14px;
  backdrop-filter: blur(5px);
}

#neuralInfo {
  top: 60px;
  left: 20px;
  min-width: 200px;
}

.info-label {
  color: #0f0;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 2px;
  text-shadow: 0 0 5px #0f0;
}

#statusText {
  color: #0f0;
  margin-bottom: 15px;
  font-size: 16px;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 49%, 100% { opacity: 1; }
  50%, 99% { opacity: 0.5; }
}

.info-metrics {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #0f0;
}

.info-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

#infoBox {
  top: 60px;
  right: 20px;
  max-width: 280px;
  text-align: right;
}

.citation {
  font-size: 11px;
  line-height: 1.6;
  color: #0f0;
  opacity: 0.8;
}

.citation em {
  color: #0f0;
  font-style: italic;
}

.controls-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 20, 0, 0.9);
  padding: 20px;
  border: 1px solid #0f0;
  border-radius: 5px;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.4), inset 0 0 20px rgba(0, 255, 0, 0.1);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 95%;
  backdrop-filter: blur(10px);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.control-group label {
  font-size: 11px;
  font-weight: bold;
  color: #0f0;
  letter-spacing: 1px;
  text-shadow: 0 0 5px #0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-group label span {
  color: #0ff;
  font-weight: normal;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, #001100 0%, #003300 100%);
  outline: none;
  border: 1px solid #0f0;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2), inset 0 0 5px rgba(0, 0, 0, 0.5);
}

input[type="range"]:hover {
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4), inset 0 0 5px rgba(0, 0, 0, 0.5);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #0f0;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 10px #0f0, inset 0 0 5px #000;
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #0ff;
  box-shadow: 0 0 15px #0ff, inset 0 0 5px #000;
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #0f0;
  cursor: pointer;
  border: none;
  border-radius: 50%;
  box-shadow: 0 0 10px #0f0, inset 0 0 5px #000;
  transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #0ff;
  box-shadow: 0 0 15px #0ff, inset 0 0 5px #000;
  transform: scale(1.2);
}

select {
  width: 100%;
  padding: 8px;
  background: #001100;
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2), inset 0 0 5px rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
}

select:hover, select:focus {
  background: #002200;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4), inset 0 0 5px rgba(0, 0, 0, 0.5);
  outline: none;
}

.button-group {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.control-btn {
  padding: 12px 20px;
  background: #001100;
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
  transition: all 0.2s;
  letter-spacing: 2px;
}

.control-btn:hover {
  background: #002200;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
  transform: translateY(-2px);
}

.control-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

@media (max-width: 768px) {
  .title {
    font-size: 16px;
    letter-spacing: 2px;
  }

  .info-panel {
    font-size: 10px;
    padding: 10px;
  }

  #neuralInfo, #infoBox {
    top: 45px;
    max-width: 45%;
  }

  #neuralInfo {
    left: 10px;
  }

  #infoBox {
    right: 10px;
  }

  .controls-panel {
    bottom: 10px;
    padding: 15px;
    gap: 10px;
  }

  .control-group {
    min-width: 140px;
  }

  .control-group label {
    font-size: 9px;
  }

  select {
    padding: 6px;
    font-size: 10px;
  }

  .control-btn {
    padding: 10px 15px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .control-group {
    min-width: 100%;
  }
}

