/* Pixel-art intro overlay (index.html only). */
.intro-open, .intro-open body { overflow: hidden; }
.intro-skip #intro { display: none; }

#intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a2a1f;
  color: #f2e8cd;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
#intro[hidden] { display: none; }
#intro.intro-leaving { background: transparent; }

/* Faint CRT scanlines */
#intro::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 2px, transparent 2px 4px);
}
#intro.intro-leaving::before { display: none; }

.intro-content {
  position: relative;
  width: min(560px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.intro-content[hidden] { display: none; }

#intro-title {
  font: 400 clamp(.85rem, 3.6vw, 1.15rem)/1.5 "Press Start 2P", var(--font-mono);
  color: #f0b429;
  margin: 0;
  text-shadow: 3px 3px 0 #2a1a10;
  letter-spacing: 1px;
}

#intro-art {
  width: min(264px, 62vw, 34vh);
  aspect-ratio: 44 / 46;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#intro-text {
  min-height: 9.5em;
  font: 400 clamp(1.25rem, 5vw, 1.6rem)/1.25 "VT323", var(--font-mono);
  color: #f2e8cd;
}
#intro-text p { margin: 0 0 .45em; }
#intro-text p:last-child:not(:only-child) { color: #f0b429; }

.intro-cursor {
  display: inline-block;
  width: .5em;
  height: .9em;
  margin-left: 2px;
  vertical-align: -2px;
  background: currentColor;
  animation: intro-blink .6s steps(1) infinite;
}

.intro-btn {
  font: 400 clamp(.75rem, 3.2vw, .9rem)/1 "Press Start 2P", var(--font-mono);
  color: #0a2a1f;
  background: #f0b429;
  border: 0;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #2a1a10, inset -3px -3px 0 #c98a12;
  animation: intro-pulse 1s steps(2) infinite;
}
.intro-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #2a1a10; }
.intro-btn[hidden] { display: none; }

#intro-skip {
  position: fixed;
  top: 12px;
  right: 12px;
  font: 400 .7rem/1 "Press Start 2P", var(--font-mono);
  color: #a8d5b9;
  background: transparent;
  border: 2px solid #4f7f6a;
  padding: 8px 10px;
  cursor: pointer;
  z-index: 1;
}
.intro-leaving #intro-skip { display: none; }

#intro-wipe {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
#intro-wipe[hidden] { display: none; }

/* Replay link on the page */
.intro-replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  margin: 10px 0 0;
  font: 600 .9rem var(--font-body);
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes intro-blink { 50% { opacity: 0; } }
@keyframes intro-pulse { 50% { filter: brightness(1.15); } }

@media (prefers-reduced-motion: reduce) {
  .intro-cursor, .intro-btn { animation: none; }
}
