/* css/intro.css — Intro screen styles (gate, boot, escalation, title, prompt) */

:root {
  --green: #ffd100;
  --green-dim: #b39300;
  --green-deep: #7a6400;
  --amber-tint: rgba(255.0, 209, 0, 0.04);
}

/* ============================================================
   CRT WRAPPER (intro only — game has its own #crt-overlay)
   ============================================================ */
.crt-intro {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #021002 0%, #000 75%);
  overflow: hidden;
  perspective: 1000px;
  z-index: 200;
}

.crt-intro .crt__content {
  position: absolute;
  inset: 0;
  padding: clamp(20px, 4vw, 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: subtleFlicker 4s infinite;
  z-index: 2;
}

.crt-intro .crt__scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.35) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: multiply;
}

.crt-intro .crt__beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(
    to bottom,
    rgba(255.0, 209, 0, 0) 0%,
    rgba(255.0, 209, 0, 0.045) 50%,
    rgba(255.0, 209, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 6;
  animation: scanBeam 8s linear infinite;
}

.crt-intro .crt__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.65) 100%),
    radial-gradient(ellipse at center, transparent 75%, rgba(0,0,0,0.4) 100%);
}

.crt-intro .crt__noise {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.06;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 1  0 0 0 0 0  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: noiseShift 0.18s steps(4) infinite;
}

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

@keyframes scanBeam {
  0%   { transform: translateY(-220px); }
  100% { transform: translateY(110vh); }
}

@keyframes subtleFlicker {
  0%, 100% { opacity: 1; }
  8%       { opacity: 0.92; }
  9%       { opacity: 1; }
  42%      { opacity: 0.96; }
  43%      { opacity: 1; }
  78%      { opacity: 0.93; }
  79%      { opacity: 1; }
}

/* Glitch transition */
.crt-intro.glitch .crt__content {
  animation: bigGlitch 0.45s steps(3) 1;
}
@keyframes bigGlitch {
  0%   { transform: translate(0, 0); filter: none; }
  20%  { transform: translate(-6px, 2px); filter: hue-rotate(15deg); }
  40%  { transform: translate(5px, -3px); filter: contrast(1.4) brightness(1.3); }
  60%  { transform: translate(-3px, 4px); filter: hue-rotate(-20deg); }
  80%  { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   GATE SCREEN
   ============================================================ */
.gate {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  color: var(--green);
  text-shadow:
    0 0 4px var(--green),
    0 0 14px rgba(255.0, 209, 0, 0.55),
    0 0 30px rgba(255.0, 209, 0, 0.25);
}

.gate__head {
  font-size: clamp(12px, 1.2vw, 16px);
  line-height: 1.6;
  opacity: 0.9;
  margin: 0 0 clamp(24px, 6vh, 64px);
  white-space: pre-wrap;
  text-align: left;
  display: inline-block;
  font-family: "Courier New", Courier, ui-monospace, monospace;
}

.gate__cta {
  font-size: clamp(18px, 2.6vw, 36px);
  letter-spacing: 0.2em;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  padding: 0.6em 0.8em;
  display: inline-block;
  white-space: nowrap;
  animation: gatePulse 1.4s ease-in-out infinite;
  transition: transform 0.12s ease, color 0.12s ease;
}
.gate__cta:hover { color: #ffd16b; transform: scale(1.02); }
.gate__cta:active { transform: scale(0.98); }
.gate__bracket { opacity: 0.7; margin: 0 0.2em; }

@keyframes gatePulse {
  0%, 100% {
    text-shadow:
      0 0 4px var(--green),
      0 0 12px rgba(255.0, 209, 0, 0.5),
      0 0 28px rgba(255.0, 209, 0, 0.2);
  }
  50% {
    text-shadow:
      0 0 6px #fff,
      0 0 18px var(--green),
      0 0 48px rgba(255.0, 209, 0, 0.8),
      0 0 90px rgba(255.0, 209, 0, 0.4);
  }
}

.gate__sub {
  font-size: clamp(11px, 1vw, 14px);
  opacity: 0.6;
  margin: clamp(28px, 6vh, 64px) 0 0;
  letter-spacing: 2px;
  white-space: pre-wrap;
  font-family: "Courier New", Courier, ui-monospace, monospace;
}

/* ============================================================
   SCREEN: INTRO TERMINAL
   ============================================================ */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  color: var(--green);
  text-shadow:
    0 0 1px #fff8,
    0 0 4px var(--green),
    0 0 14px rgba(255.0, 209, 0, 0.55),
    0 0 30px rgba(255.0, 209, 0, 0.25);
}

.screen--intro {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  font-size: clamp(13px, 1.4vw, 18px);
  line-height: 1.5;
  padding-top: 2vh;
}

.terminal {
  white-space: pre-wrap;
  word-break: break-word;
}

.boot {
  opacity: 0.85;
  font-size: 0.9em;
  margin-bottom: clamp(8px, 1.6vh, 22px);
  min-height: 8em;
}
.boot .ok   { color: #ffd15c; }
.boot .warn { color: #ffe680; text-shadow: 0 0 6px rgba(255,230,128,0.5); }
.boot .dim  { opacity: 0.55; }

/* ============================================================
   ESCALATION (DEFCON status — no SVG map, just the status row)
   ============================================================ */
.escalation {
  margin: clamp(6px, 1vh, 14px) 0 clamp(10px, 2vh, 20px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.escalation.show {
  opacity: 1;
  transform: translateY(0);
}

.defcon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(11px, 1.15vw, 15px);
  letter-spacing: 2px;
  margin-bottom: 8px;
  white-space: nowrap;
  flex-wrap: wrap;
}
.defcon-tag { opacity: 0.75; }
.defcon-bars {
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
  color: var(--green);
}
.defcon-level {
  display: inline-block;
  min-width: 1.2em;
  text-align: center;
  font-weight: 700;
  padding: 1px 8px;
  border: 1px solid var(--green-dim);
  color: var(--green);
}
.defcon-msg {
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 4px var(--green), 0 0 12px rgba(255.0, 209, 0, 0.6);
}

/* DEFCON severity colors */
.defcon-row[data-level="5"] .defcon-level,
.defcon-row[data-level="5"] .defcon-msg { color: #ffd15c; }
.defcon-row[data-level="4"] .defcon-level,
.defcon-row[data-level="4"] .defcon-msg { color: #ffd140; text-shadow: 0 0 6px rgba(255.0, 209, 64, 0.7); }
.defcon-row[data-level="3"] .defcon-level,
.defcon-row[data-level="3"] .defcon-msg { color: #ffe680; text-shadow: 0 0 8px rgba(255,230,128,0.8); }
.defcon-row[data-level="2"] .defcon-level,
.defcon-row[data-level="2"] .defcon-msg { color: #ffb060; text-shadow: 0 0 8px rgba(255,176,96,0.8); }
.defcon-row[data-level="1"] .defcon-level,
.defcon-row[data-level="1"] .defcon-msg {
  color: #ff5050;
  text-shadow: 0 0 6px #ff5050, 0 0 18px rgba(255,80,80,0.7), 0 0 38px rgba(255,40,40,0.5);
  animation: defconCrit 0.7s steps(2) infinite;
}
.defcon-row[data-level="1"] .defcon-level { border-color: #ff5050; }

@keyframes defconCrit {
  50% { opacity: 0.55; }
}

/* ============================================================
   TITLE
   ============================================================ */
.title-wrap {
  margin: clamp(6px, 1.5vh, 20px) 0 clamp(6px, 1.4vh, 18px);
  display: flex;
  justify-content: center;
}

.title {
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  font-size: clamp(26px, 5.4vw, 70px);
  letter-spacing: clamp(2px, 0.5vw, 8px);
  line-height: 1.05;
  white-space: nowrap;
  text-align: center;
  text-shadow:
    0 0 4px #fff,
    0 0 10px var(--green),
    0 0 24px rgba(255.0, 209, 0, 0.7),
    0 0 60px rgba(255.0, 209, 0, 0.35);
}
.title .line2 {
  display: block;
  font-size: 0.78em;
  letter-spacing: clamp(2px, 0.55vw, 9px);
}

/* ============================================================
   PROMPT BLOCK
   ============================================================ */
.prompt-block {
  margin-top: clamp(8px, 1.6vh, 22px);
  font-size: clamp(14px, 1.6vw, 22px);
  letter-spacing: 1px;
}
.prompt-block .q {
  font-size: clamp(16px, 2.2vw, 32px);
  letter-spacing: 2px;
  font-weight: 700;
  margin-top: 0.6em;
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 18px rgba(255.0, 209, 0, 0.6);
  vertical-align: -0.12em;
  margin-left: 0.12em;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================================
   START BUTTON
   ============================================================ */
.start-row {
  margin-top: clamp(14px, 2.6vh, 36px);
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.start-row.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.start-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(16px, 2vw, 26px);
  letter-spacing: 0.4em;
  padding: 0.85em 2.2em 0.85em 2.4em;
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow:
    0 0 4px var(--green),
    0 0 14px rgba(255.0, 209, 0, 0.7);
  box-shadow:
    0 0 0 0 rgba(255.0, 209, 0, 0.0),
    inset 0 0 12px rgba(255.0, 209, 0, 0.15);
  animation: pulseGlow 1.6s ease-in-out infinite;
  transition: transform 0.12s ease, color 0.12s ease, background 0.12s ease;
  position: relative;
}
.start-btn::before {
  content: "> ";
  margin-right: 0.25em;
  opacity: 0.9;
}
.start-btn:hover {
  background: rgba(255.0, 209, 0, 0.08);
  color: #ffd16b;
}
.start-btn:active {
  transform: scale(0.98);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow:
      0 0 4px rgba(255.0, 209, 0, 0.4),
      0 0 18px rgba(255.0, 209, 0, 0.35),
      0 0 40px rgba(255.0, 209, 0, 0.0),
      inset 0 0 10px rgba(255.0, 209, 0, 0.12);
    border-color: var(--green-dim);
  }
  50% {
    box-shadow:
      0 0 10px rgba(255.0, 209, 0, 0.85),
      0 0 36px rgba(255.0, 209, 0, 0.6),
      0 0 80px rgba(255.0, 209, 0, 0.25),
      inset 0 0 18px rgba(255.0, 209, 0, 0.25);
    border-color: #ffd136;
  }
}

/* ============================================================
   CORNER TAGS
   ============================================================ */
.corner-tag {
  position: fixed;
  z-index: 225;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--green-dim);
  opacity: 0.55;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(255.0, 209, 0, 0.4);
  font-family: "Courier New", Courier, ui-monospace, monospace;
}
.corner-tag.tl { top: 14px; left: 18px; }
.corner-tag.tr { top: 14px; right: 18px; text-align: right; }
.corner-tag.bl { bottom: 14px; left: 18px; }

/* ============================================================
   AUDIO TOGGLE
   ============================================================ */
.audio-toggle {
  position: fixed;
  bottom: 16px;
  right: 18px;
  z-index: 250;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--green-dim);
  background: transparent;
  border: 1px solid var(--green-deep);
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0.65;
  text-shadow: 0 0 6px rgba(255.0, 209, 0, 0.5);
}
.audio-toggle:hover {
  opacity: 1;
  color: var(--green);
  border-color: var(--green);
}
.audio-toggle.hidden-gate { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .corner-tag.tr { display: none; }
}
