/* ================================================================
   LXMUN · credits.css
   Easter egg credits overlay — 8-bit CRT aesthetic, full-window scroll
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ── Overlay base ── */
.credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: hidden;
}

.credits-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

/* Top/bottom fade masks for scroll in/out */
.credits-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.9) 0%,
    transparent 14%,
    transparent 86%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

/* ── Canvas (static + particles) ── */
#credits-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── CRT scanlines ── */
.credits-scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
}

/* ── CRT vignette ── */
.credits-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

/* ── Full-window scrolling content ── */
.credits-scroll {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  font-family: 'Press Start 2P', monospace;
  color: #00ff41;
  transform: translateY(100vh);
  animation: none;
  will-change: transform;
}

.credits-scroll.is-scrolling {
  animation: creditsScroll 63s linear forwards;
}

@keyframes creditsScroll {
  0%   { transform: translateY(100vh); }
  100% { transform: translateY(-100%); }
}

/* ── Intro block ── */
.credits-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50vh 2rem 12vh;
  text-align: center;
}

/* ── Credits typography ── */
.credits-logo {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #ffe600;
  text-shadow: 0 0 12px #ffe600, 0 0 30px rgba(255, 230, 0, 0.5);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
  animation: pixelFlicker 4s infinite;
}

.credits-tagline {
  font-size: clamp(0.5rem, 1.2vw, 0.75rem);
  color: #00cfff;
  text-shadow: 0 0 6px #00cfff;
  letter-spacing: 0.1em;
  margin-bottom: 3rem;
  line-height: 2.2;
}

.credits-divider {
  color: #00ff41;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  margin: 2rem 0;
  opacity: 0.6;
}

/* ── Two-column section ── */
.credits-section {
  display: flex;
  align-items: center;
  gap: 6vw;
  padding: 6vh 8vw;
  min-height: 65vh;
}

/* Even sections: image on right, text on left */
.credits-section.is-flipped {
  flex-direction: row-reverse;
}

.credits-section__img-col {
  flex: 0 0 42%;
}

.credits-section__photo {
  width: 100%;
  height: 52vh;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(0, 255, 65, 0.25);
  box-shadow:
    0 0 16px rgba(0, 255, 65, 0.18),
    0 0 40px rgba(0, 255, 65, 0.07);
  filter: grayscale(1) brightness(0.82);
}

.credits-section__text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.credits-section__heading {
  font-size: clamp(0.8rem, 2vw, 1.3rem);
  color: #00cfff;
  text-shadow: 0 0 8px #00cfff;
  letter-spacing: 0.12em;
  margin-bottom: 2rem;
}

.credits-name {
  display: block;
  font-size: clamp(0.7rem, 1.6vw, 1.2rem);
  color: #00ff41;
  line-height: 2.8;
  letter-spacing: 0.06em;
}

.credits-name--highlight {
  color: #ffe600;
  text-shadow: 0 0 6px rgba(255, 230, 0, 0.5);
}

/* ── Outro block ── */
.credits-outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8vh 4rem 35vh;
  text-align: center;
}

.credits-easter {
  max-width: 600px;
  font-size: clamp(0.5 rem, 0.9vw, 0.9rem);
  color: #555;
  line-height: 2.8;
  letter-spacing: 0.08em;
  margin: 0 auto;
}

.credits-easter span {
  color: #00ff41;
  opacity: 0.6;
}

/* ── Outro 16:9 banner image ── */
.credits-outro__banner {
  width: min(80vw, 960px);
  margin: 3rem auto 0;
}

.credits-outro__img {
  width: 75%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(0, 255, 65, 0.25);
  box-shadow:
    0 0 16px rgba(0, 255, 65, 0.18),
    0 0 40px rgba(0, 255, 65, 0.07);
  filter: grayscale(1) brightness(0.82);
  transform: translateX(20%)
}

.credits-fin {
  font-size: clamp(0.5rem, 1.5vw, 0.7rem);
  color: #ffe600;
  text-shadow: 0 0 10px #ffe600;
  margin-top: 4rem;
  letter-spacing: 0.2em;
  animation: pixelFlicker 2s infinite;
}

/* ── Close button ── */
.credits-close {
  position: absolute;
  bottom: 1.8rem;
  right: 2rem;
  z-index: 10;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.28rem, 0.9vw, 0.38rem);
  color: #00ff41;
  background: transparent;
  border: 1px solid rgba(0, 255, 65, 0.4);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s ease 1.6s, color 0.2s, border-color 0.2s;
}

.credits-overlay.is-active .credits-close {
  opacity: 1;
}

.credits-close:hover {
  color: #ffe600;
  border-color: #ffe600;
  text-shadow: 0 0 6px #ffe600;
}

/* ── Pixel flicker ── */
@keyframes pixelFlicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.7; }
  97%            { opacity: 1; }
  98%            { opacity: 0.5; }
  99%            { opacity: 1; }
}

/* ── Mute toggle button ── */
.credits-mute {
  position: absolute;
  bottom: 1.8rem;
  left: 2rem;
  z-index: 10;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.28rem, 0.9vw, 0.38rem);
  color: #00ff41;
  background: transparent;
  border: 1px solid rgba(0, 255, 65, 0.4);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s ease 1.6s, color 0.2s, border-color 0.2s;
}

.credits-overlay.is-active .credits-mute {
  opacity: 1;
}

.credits-mute:hover {
  color: #ffe600;
  border-color: #ffe600;
  text-shadow: 0 0 6px #ffe600;
}

/* ── BGM end message ── */
.credits-end-msg {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.65rem, 2vw, 1.05rem);
  color: #ffe600;
  text-shadow: 0 0 12px #ffe600, 0 0 30px rgba(255, 230, 0, 0.45);
  text-align: center;
  line-height: 3;
  letter-spacing: 0.12em;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
  animation: none;
}

.credits-end-msg.is-visible {
  opacity: 1;
  animation: pixelFlicker 3s infinite 2s;
}

/* ── Click hint on hero title ── */
.hero__title {
  cursor: default;
  user-select: none;
}
