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

body {
  background: #000;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Courier New", Courier, monospace;
  overflow: hidden;
}

.crt-frame {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #050505;
  overflow: hidden;
}

/* Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 10;
  animation: flicker 3.5s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 0.95; }
  47% { opacity: 0.85; }
  50% { opacity: 0.92; }
  53% { opacity: 0.8; }
}

/* Soft static noise */
.static-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.07'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9;
  opacity: 0.4;
  animation: noiseMove 0.4s steps(3) infinite;
}

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

/* Slow drifting tracking line */
.tracking-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(0, 255, 255, 0.07);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.15);
  z-index: 11;
  pointer-events: none;
  animation: track 9s linear infinite;
}

@keyframes track {
  0% { top: -5%; opacity: 0; }
  5% { opacity: 0.6; }
  95% { opacity: 0.4; }
  100% { top: 105%; opacity: 0; }
}

.screen-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.title {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  color: #e8e8e8;
  text-shadow: 
    0 0 10px rgba(0, 255, 255, 0.35),
    2px 0 0 rgba(255, 0, 80, 0.35),
    -2px 0 0 rgba(0, 255, 255, 0.35);
  letter-spacing: 5px;
  margin-bottom: 1.8rem;
  animation: titleGlitch 7s infinite;
}

@keyframes titleGlitch {
  0%, 92%, 100% { 
    text-shadow: 
      0 0 10px rgba(0, 255, 255, 0.35),
      2px 0 0 rgba(255, 0, 80, 0.35),
      -2px 0 0 rgba(0, 255, 255, 0.35);
    transform: translate(0);
  }
  93% { 
    text-shadow: 
      -3px 0 0 rgba(255, 0, 80, 0.5),
      3px 0 0 rgba(0, 255, 255, 0.5);
    transform: translate(-2px, 1px);
  }
  94% { 
    text-shadow: 
      3px 0 0 rgba(255, 0, 80, 0.5),
      -3px 0 0 rgba(0, 255, 255, 0.5);
    transform: translate(2px, -1px);
  }
}

.system-message {
  color: #00ff9d;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  margin-bottom: 3.2rem;
  min-height: 1.4em;
  text-shadow: 0 0 6px rgba(0, 255, 157, 0.4);
  opacity: 0.9;
}

.story-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 380px;
}

.story-btn {
  display: block;
  padding: 1rem 1.5rem;
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid #2a2a2a;
  color: #bbb;
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 1px;
  transition: all 0.2s;
  text-align: center;
}

.story-btn:hover {
  border-color: #0ff;
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.2);
  background: rgba(0, 30, 30, 0.5);
}

.story-btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* ========== SynthDark page ========== */
.dark-page {
  justify-content: center;
}

.story-title {
  margin-bottom: 2.5rem;
}

.camera-feed {
  margin-bottom: 2rem;
  text-align: center;
}

.cam-label {
  color: #00ff9d;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.4);
  margin-bottom: 0.4rem;
}

.cam-status {
  color: #666;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.system-line {
  color: #555;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 3rem;
}

.back-btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid #333;
  color: #999;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: #0ff;
  color: #fff;
}

/* ========== SynthDark page (clean version) ========== */
.dark-lab {
  background: 
    radial-gradient(ellipse at 30% 40%, rgba(40, 0, 0, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(0, 20, 30, 0.2) 0%, transparent 45%),
    #050505;
}

.cam-hud {
  position: absolute;
  top: 1.8rem;
  left: 1.8rem;
  z-index: 20;
  text-align: left;
}

.cam-label {
  color: #00ff9d;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.35);
  margin-bottom: 0.3rem;
}

.cam-live {
  color: #ff3333;
  font-size: 0.75rem;
  letter-spacing: 1px;
  opacity: 0.85;
}

.dark-footer {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 20;
}

.dark-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #ddd;
  text-shadow: 
    0 0 8px rgba(0, 255, 255, 0.25),
    1px 0 0 rgba(255, 0, 80, 0.3),
    -1px 0 0 rgba(0, 255, 255, 0.3);
  letter-spacing: 4px;
  margin-bottom: 1.2rem;
}

.back-btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border: 1px solid #333;
  color: #888;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: #0ff;
  color: #fff;
}
