:root {
  --bg: #060a06;
  --bg-panel: #0a120a;
  --green: #39ff6a;
  --green-dim: #1e8f3e;
  --green-faint: #0f4d21;
  --amber: #c9a227;
  --font-mono: 'Share Tech Mono', monospace;
  --font-display: 'VT323', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 4vw;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(57, 255, 106, 0.05), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(57, 255, 106, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: flicker 6.5s infinite;
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 0.6; }
  97% { opacity: 0.85; }
  98% { opacity: 0.5; }
}

.terminal {
  position: relative;
  z-index: 3;
  width: min(760px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--green-faint);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(57, 255, 106, 0.05),
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(57, 255, 106, 0.06);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--green-faint);
  background: linear-gradient(to bottom, #0d160d, #0a120a);
  border-radius: 6px 6px 0 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.7;
}
.dot-red { background: #7a2a2a; }
.dot-yellow { background: #7a6a2a; }
.dot-green { background: #2a7a3a; }

.chrome-title {
  margin-left: 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--green-dim);
}

.terminal-body {
  padding: clamp(20px, 4vw, 44px);
  min-height: 360px;
}

.type-target {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(16px, 2.4vw, 20px);
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 6px rgba(57, 255, 106, 0.55), 0 0 14px rgba(57, 255, 106, 0.25);
  color: var(--green);
}

.cursor {
  display: inline-block;
  color: var(--green);
  font-family: var(--font-mono);
  animation: blink 0.9s steps(1) infinite;
  text-shadow: 0 0 8px rgba(57, 255, 106, 0.7);
  vertical-align: text-bottom;
}

.cursor.hidden {
  display: none;
}

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

.audio-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--green-faint);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.audio-block.visible {
  opacity: 1;
  transform: translateY(0);
}

.audio-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--green-dim);
  margin-bottom: 12px;
}

audio {
  width: 100%;
  filter: sepia(1) hue-rotate(65deg) saturate(4) brightness(0.9);
  border-radius: 4px;
}

.audio-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--green-faint);
  letter-spacing: 0.04em;
}

.audio-hint.done {
  color: var(--amber);
}

.reveal-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--green-faint);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s ease, transform 1.1s ease;
  text-align: center;
}

.reveal-block.visible {
  opacity: 1;
  transform: translateY(0);
}

.agent-photo {
  max-width: 240px;
  width: 60%;
  border: 1px solid var(--green-dim);
  filter: grayscale(0.35) contrast(1.05) brightness(0.95) sepia(0.15) hue-rotate(65deg);
  box-shadow: 0 0 30px rgba(57, 255, 106, 0.15);
  margin-bottom: 20px;
}

#finalLine {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.03em;
  text-align: center;
  display: block;
}

@media (max-width: 520px) {
  .terminal-body {
    padding: 20px;
  }
}
