/* ==========================================================================
   PIXEL NEO-RETRO INTRO ANIMATION
   Universo Homebrew - Interactive Boot & Arcade Intro
   ========================================================================== */

#pixel-intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #05070c;
  z-index: 999990;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  font-family: var(--font-pixel, 'Press Start 2P', monospace);
  color: #ffffff;
  user-select: none;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* CRT Screen Turn On Animation */
#pixel-intro-overlay.crt-starting {
  animation: introCrtTurnOn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes introCrtTurnOn {
  0% {
    transform: scale(1, 0.002) scaleX(0);
    filter: brightness(30);
    opacity: 1;
  }
  35% {
    transform: scale(1, 0.005) scaleX(1);
    filter: brightness(20);
    opacity: 1;
  }
  70% {
    transform: scale(1, 1.05) scaleX(1);
    filter: brightness(2);
    opacity: 1;
  }
  100% {
    transform: scale(1, 1) scaleX(1);
    filter: brightness(1);
    opacity: 1;
  }
}

/* Exit CRT Turn Off Animation */
#pixel-intro-overlay.crt-closing {
  animation: introCrtTurnOff 0.7s ease-in forwards;
  pointer-events: none;
}

@keyframes introCrtTurnOff {
  0% {
    transform: scale(1, 1);
    filter: brightness(1);
    opacity: 1;
  }
  40% {
    transform: scale(1, 0.005);
    filter: brightness(15);
    opacity: 0.9;
  }
  100% {
    transform: scale(0, 0);
    filter: brightness(30);
    opacity: 0;
  }
}

/* Canvas background for animated synthwave grid & pixel stars */
#intro-pixel-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* CRT Scanline & Vignette Overlay inside Intro */
.intro-crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%),
    radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.85) 100%);
  background-size: 100% 4px, 100% 100%;
}

.intro-crt-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 243, 255, 0.03);
  opacity: 0.8;
  animation: introFlicker 0.15s infinite;
}

@keyframes introFlicker {
  0% { opacity: 0.03; }
  50% { opacity: 0.07; }
  100% { opacity: 0.04; }
}

/* Intro Header Controls (Top Bar) */
.intro-header-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.intro-badge-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.intro-badge {
  font-family: var(--font-arcade, 'Silkscreen', monospace);
  font-size: 0.75rem;
  color: var(--neon-cyan, #00f3ff);
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--neon-cyan, #00f3ff);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
  letter-spacing: 1px;
}

.intro-badge.pink {
  color: var(--neon-pink, #ff007f);
  background: rgba(255, 0, 127, 0.1);
  border-color: var(--neon-pink, #ff007f);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.intro-btn-action {
  font-family: var(--font-pixel, 'Press Start 2P', monospace);
  font-size: 0.7rem;
  padding: 0.5rem 0.9rem;
  background: rgba(14, 18, 30, 0.9);
  color: var(--text-main, #e2e8f0);
  border: 2px solid var(--neon-cyan, #00f3ff);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
  transition: all 0.2s ease;
}

.intro-btn-action:hover {
  background: var(--neon-cyan, #00f3ff);
  color: #05070c;
  box-shadow: 0 0 18px var(--neon-cyan, #00f3ff);
  transform: translateY(-2px);
}

.intro-btn-action.btn-skip {
  border-color: var(--neon-pink, #ff007f);
  color: var(--neon-pink, #ff007f);
}

.intro-btn-action.btn-skip:hover {
  background: var(--neon-pink, #ff007f);
  color: #ffffff;
  box-shadow: 0 0 18px var(--neon-pink, #ff007f);
}

/* Center Content Section */
.intro-main-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 900px;
  padding: 0 1.5rem;
}

/* Pixel Art Icon Container */
.intro-pixel-art-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 1.5rem;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 0 20px var(--neon-cyan, #00f3ff));
  animation: introFloatIcon 3s ease-in-out infinite alternate;
}

@keyframes introFloatIcon {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-12px) rotate(2deg); }
}

/* SVG Pixel Cartridge Icon */
.intro-pixel-art-icon svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Hero Title - Neo Retro Pixel Glitch */
.intro-hero-title {
  font-size: clamp(1.6rem, 4.5vw, 3.2rem);
  line-height: 1.25;
  letter-spacing: 2px;
  margin-bottom: 0.8rem;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 
    3px 3px 0 var(--neon-pink, #ff007f),
    -3px -3px 0 var(--neon-cyan, #00f3ff),
    0 0 25px rgba(0, 243, 255, 0.7);
  animation: introTitleGlow 2s ease-in-out infinite alternate;
}

@keyframes introTitleGlow {
  0% {
    text-shadow: 
      3px 3px 0 var(--neon-pink, #ff007f),
      -3px -3px 0 var(--neon-cyan, #00f3ff),
      0 0 20px rgba(0, 243, 255, 0.6);
  }
  100% {
    text-shadow: 
      4px 4px 0 var(--neon-pink, #ff007f),
      -4px -4px 0 var(--neon-cyan, #00f3ff),
      0 0 35px rgba(255, 0, 127, 0.8),
      0 0 50px rgba(0, 243, 255, 0.9);
  }
}

/* Subtitle Tagline */
.intro-tagline {
  font-family: var(--font-arcade, 'Silkscreen', monospace);
  font-size: clamp(0.75rem, 1.8vw, 1.1rem);
  color: var(--neon-amber, #ffb700);
  text-shadow: 0 0 10px rgba(255, 183, 0, 0.5);
  margin-bottom: 2rem;
  letter-spacing: 1.5px;
}

/* Terminal Console Box */
.intro-terminal-box {
  width: 100%;
  max-width: 580px;
  background: rgba(7, 9, 14, 0.85);
  border: 2px solid rgba(0, 243, 255, 0.4);
  border-radius: 6px;
  padding: 0.8rem 1.2rem;
  margin-bottom: 2rem;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.15), inset 0 0 15px rgba(0, 0, 0, 0.8);
  text-align: left;
  font-family: var(--font-retro-num, 'VT323', monospace);
  font-size: 1.2rem;
  color: var(--neon-green, #39ff14);
  min-height: 70px;
}

.intro-terminal-line {
  line-height: 1.35;
  margin-bottom: 0.2rem;
  overflow: hidden;
  white-space: nowrap;
}

.intro-terminal-line .cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background-color: var(--neon-green, #39ff14);
  margin-left: 4px;
  animation: introBlink 0.6s steps(2, start) infinite;
}

@keyframes introBlink {
  to { visibility: hidden; }
}

/* Start Button - Arcade Insert Coin */
.intro-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-pixel, 'Press Start 2P', monospace);
  font-size: clamp(0.85rem, 1.8vw, 1.15rem);
  padding: 1.1rem 2.2rem;
  background: linear-gradient(135deg, #ff007f 0%, #9d00ff 100%);
  color: #ffffff;
  border: 3px solid #ffffff;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 
    0 0 25px rgba(255, 0, 127, 0.6),
    0 6px 0 #610061;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.15s ease;
  animation: introPulseStart 1.5s ease-in-out infinite;
}

.intro-start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 0 35px rgba(255, 0, 127, 0.9),
    0 9px 0 #610061;
  background: linear-gradient(135deg, #ff1a8c 0%, #b01aff 100%);
}

.intro-start-btn:active {
  transform: translateY(3px);
  box-shadow: 
    0 0 15px rgba(255, 0, 127, 0.6),
    0 2px 0 #610061;
}

@keyframes introPulseStart {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

/* Bottom Progress Footer */
.intro-footer-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.intro-progress-container {
  width: 100%;
  max-width: 420px;
  height: 14px;
  background: rgba(14, 18, 30, 0.8);
  border: 2px solid var(--neon-cyan, #00f3ff);
  border-radius: 4px;
  padding: 2px;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
  overflow: hidden;
}

.intro-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan, #00f3ff), var(--neon-pink, #ff007f));
  border-radius: 2px;
  box-shadow: 0 0 12px var(--neon-cyan, #00f3ff);
  transition: width 0.1s linear;
}

.intro-footer-text {
  font-family: var(--font-arcade, 'Silkscreen', monospace);
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 1px;
}
