/* ============================================
   THE DREAM — tokens
   ============================================ */
:root{
  --void:        #07040f;
  --deep:        #120a24;
  --panel:       #1a1030;
  --purple-shadow: #2c1450;
  --purple-mid:  #5b2a9e;
  --purple-bright: #8b5cf6;
  --magenta:     #d946ef;
  --star:        #e9def7;
  --text:        #f3eefc;
  --text-dim:    #b7a4d9;

  --font-display: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;

  --border: 2px solid #3a2265;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body{
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }

a{ color: inherit; }

::selection{ background: var(--purple-mid); color: var(--text); }

:focus-visible{
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
}

/* ============================================
   INTRO — "ojo" abriéndose, como la cinemática
   ============================================ */
#intro{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  pointer-events: none;
}

.intro-title{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  color: #fff;
  text-shadow: 0 0 12px rgba(255,255,255,.5);
  letter-spacing: 4px;
  margin: 0;
  animation: intro-flicker 1.6s ease-in-out forwards;
}

@keyframes intro-flicker{
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

.eyelid{
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  height: 52%;
  background: #000;
}
.eyelid-top{
  top: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  animation: lid-open-top 1.4s 1s cubic-bezier(.7,0,.3,1) forwards;
}
.eyelid-bottom{
  bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  animation: lid-open-bottom 1.4s 1s cubic-bezier(.7,0,.3,1) forwards;
}
@keyframes lid-open-top{
  to{ transform: translateY(-100%); }
}
@keyframes lid-open-bottom{
  to{ transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce){
  #intro{ display: none; }
}

/* ============================================
   ESTRELLAS DE FONDO
   ============================================ */
#stars{
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% -10%, var(--purple-shadow) 0%, var(--void) 60%);
}

/* ============================================
   OBJETOS FLOTANTES — cofre, bloques, nota, espada
   ============================================ */
#floaters{
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.floater{
  position: absolute;
  image-rendering: pixelated;
  opacity: .4;
  filter: drop-shadow(0 0 10px rgba(139,92,246,.4));
}

.floater-caja    { width: 56px; top: 12%; left: 7%;  animation: drift-a 27s ease-in-out infinite; }
.floater-bloque1 { width: 46px; top: 66%; left: 84%; animation: drift-b 23s ease-in-out infinite; opacity: .35; }
.floater-nota    { width: 34px; top: 28%; left: 72%; animation: drift-c 31s ease-in-out infinite; opacity: .5; }
.floater-espada  { width: 64px; top: 78%; left: 18%; animation: drift-d 25s ease-in-out infinite; }
.floater-bloque2 { width: 40px; top: 8%;  left: 58%; animation: drift-b 29s ease-in-out infinite reverse; opacity: .3; }
.floater-caja2   { width: 36px; top: 52%; left: 42%; animation: drift-a 34s ease-in-out infinite reverse; opacity: .28; }
.floater-nota2   { width: 26px; top: 88%; left: 62%; animation: drift-c 21s ease-in-out infinite reverse; opacity: .38; }

@keyframes drift-a{
  0%,100%{ transform: translate(0,0) rotate(0deg); }
  25%     { transform: translate(28px,-42px) rotate(8deg); }
  50%     { transform: translate(-12px,-72px) rotate(-6deg); }
  75%     { transform: translate(-40px,-18px) rotate(4deg); }
}
@keyframes drift-b{
  0%,100%{ transform: translate(0,0) rotate(0deg); }
  30%     { transform: translate(-36px,26px) rotate(-10deg); }
  60%     { transform: translate(-54px,-16px) rotate(7deg); }
}
@keyframes drift-c{
  0%,100%{ transform: translate(0,0) rotate(0deg) scale(1); }
  50%     { transform: translate(26px,46px) rotate(16deg) scale(1.06); }
}
@keyframes drift-d{
  0%,100%{ transform: translate(0,0) rotate(-8deg); }
  40%     { transform: translate(42px,-32px) rotate(5deg); }
  70%     { transform: translate(10px,22px) rotate(-4deg); }
}

@media (max-width: 700px){
  .floater{ opacity: .25; }
  .floater-caja, .floater-espada{ width: 42px; }
}

/* ============================================
   BANNER DE ANUNCIO
   ============================================ */
.update-banner{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: .7rem 2.4rem .7rem 1rem;
  background: linear-gradient(90deg, var(--purple-mid), var(--magenta));
  box-shadow: 0 4px 20px rgba(217,70,239,.35);
  text-align: center;
}
.update-banner-text{
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
}
.update-banner-text strong{ font-family: var(--font-display); font-size: .68rem; letter-spacing: .5px; margin-right: .3rem; }
.update-banner-btn{
  font-family: var(--font-display);
  font-size: .6rem;
  letter-spacing: 1px;
  color: var(--purple-mid);
  background: #fff;
  border-radius: 5px;
  padding: .5rem .8rem;
  text-decoration: none;
  flex-shrink: 0;
}
.update-banner-btn:hover{ background: var(--star); }
.update-banner-close{
  position: absolute;
  right: .8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: .8;
  line-height: 1;
  padding: .2rem;
}
.update-banner-close:hover{ opacity: 1; }
.update-banner.is-hidden{ display: none; }

/* ============================================
   TOPBAR
   ============================================ */
.topbar{
  position: fixed;
  top: var(--banner-h, 0px); left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.2rem;
  background: linear-gradient(to bottom, rgba(7,4,15,.9), transparent);
  transition: top .2s ease;
}
.topbar-icon{
  width: 28px; height: 28px;
  image-rendering: pixelated;
  border-radius: 4px;
}
.topbar-name{
  font-family: var(--font-display);
  font-size: .65rem;
  letter-spacing: 2px;
  color: var(--text-dim);
}

/* ============================================
   HERO
   ============================================ */
.hero{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.hero-title{
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11vw, 6.5rem);
  line-height: 1.15;
  letter-spacing: 4px;
  margin: 0 0 1.5rem;
  color: var(--text);
  text-shadow:
    0 0 12px var(--purple-bright),
    0 0 32px var(--purple-mid),
    0 0 60px var(--purple-shadow);
}

.hero-tagline{
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: var(--text-dim);
  max-width: 34rem;
  margin: 0 0 4rem;
}

.scroll-cue{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--star);
}
.scroll-cue-label{
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: 4px;
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(217,70,239,.6);
}
.scroll-cue-arrow{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle, var(--purple-bright) 0%, var(--purple-mid) 70%, transparent 100%);
  box-shadow: 0 0 30px rgba(139,92,246,.7), 0 0 60px rgba(217,70,239,.35);
  animation: bob 1.4s ease-in-out infinite;
}
.scroll-cue-arrow svg{
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.scroll-cue:hover .scroll-cue-arrow{
  box-shadow: 0 0 40px rgba(139,92,246,.9), 0 0 80px rgba(217,70,239,.5);
}

@keyframes bob{
  0%, 100%{ transform: translateY(0) scale(1); }
  50%{ transform: translateY(14px) scale(1.08); }
}

/* ============================================
   SECCIONES GENERALES
   ============================================ */
.section{
  max-width: 56rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  text-align: center;
}

.eyebrow{
  font-family: var(--font-display);
  font-size: .6rem;
  letter-spacing: 3px;
  color: var(--magenta);
  margin: 0 0 1rem;
}

.section-title{
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  letter-spacing: 1px;
  margin: 0 0 1.5rem;
  color: var(--text);
}

.section-text{
  font-size: 1.35rem;
  color: var(--text-dim);
  max-width: 42rem;
  margin: 0 auto 2.5rem;
}

/* ============================================
   CRT FRAME (video)
   ============================================ */
.crt-frame{
  border: var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--purple-shadow), 0 20px 60px -20px rgba(139,92,246,.35);
  margin: 0 auto;
  max-width: 46rem;
}
.crt-frame video{
  width: 100%;
  display: block;
  border-radius: 4px;
  background: #000;
}
.crt-frame--small{
  max-width: 32rem;
  margin-top: 2.5rem;
}

/* ============================================
   GALERÍA
   ============================================ */
.gallery{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 1rem;
}
.gallery-item{
  margin: 0;
  border: var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}
.gallery-item img{
  image-rendering: pixelated;
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}
.gallery-item figcaption{
  font-size: 1.05rem;
  color: var(--text-dim);
  padding: .6rem .5rem;
  border-top: var(--border);
}

@media (max-width: 700px){
  .gallery{ grid-template-columns: 1fr; }
}

/* ============================================
   DESCARGA
   ============================================ */
.download-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  text-align: left;
}

.download-card{
  border: var(--border);
  border-radius: 10px;
  background: linear-gradient(160deg, var(--panel), var(--deep));
  padding: 2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.download-card-icon{ color: var(--purple-bright); margin-bottom: .4rem; }

.download-card h3{
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0;
  letter-spacing: 1px;
}

.download-meta{
  color: var(--text-dim);
  font-size: 1.15rem;
  margin: 0 0 .6rem;
}

.download-note{
  color: var(--text-dim);
  font-size: 1.1rem;
  margin: .4rem 0 0;
}
.download-note code{
  background: var(--void);
  padding: .1rem .4rem;
  border-radius: 4px;
  border: 1px solid var(--purple-shadow);
}

@media (max-width: 700px){
  .download-grid{ grid-template-columns: 1fr; }
}

/* ============================================
   BOTONES
   ============================================ */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: .75rem;
  letter-spacing: 1px;
  text-decoration: none;
  padding: 1rem 1.2rem;
  border-radius: 6px;
  border: 2px solid var(--purple-bright);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-primary{
  background: var(--purple-mid);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(139,92,246,0);
}
.btn-primary:hover{
  background: var(--purple-bright);
  box-shadow: 0 0 24px rgba(139,92,246,.55);
  transform: translateY(-2px);
}
.btn-primary:active{ transform: translateY(0); }

/* ============================================
   TABS (instalación)
   ============================================ */
.tabs{
  display: inline-flex;
  gap: .5rem;
  margin-bottom: 2rem;
  border: var(--border);
  border-radius: 8px;
  padding: 4px;
  background: var(--deep);
}
.tab{
  font-family: var(--font-display);
  font-size: .65rem;
  letter-spacing: 1px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 5px;
  padding: .7rem 1.1rem;
  cursor: pointer;
}
.tab[aria-selected="true"]{
  background: var(--purple-mid);
  color: #fff;
}

.tab-panel{ text-align: left; }

.steps{
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.steps li{
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num{
  font-family: var(--font-display);
  font-size: .75rem;
  color: var(--magenta);
  flex-shrink: 0;
  padding-top: .15rem;
}
.step-body p{
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-dim);
}
.step-body strong{ color: var(--text); }

.steps-todo{
  border: 1px dashed var(--purple-shadow);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.install-video-label{
  font-family: var(--font-display);
  font-size: .65rem;
  letter-spacing: 1px;
  color: var(--magenta);
  margin: 2rem 0 1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer{
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  border-top: var(--border);
  margin-top: 3rem;
}
.footer-icon{
  width: 44px; height: 44px;
  margin: 0 auto 1rem;
  image-rendering: pixelated;
  border-radius: 8px;
}
.footer-title{
  font-family: var(--font-display);
  font-size: .9rem;
  letter-spacing: 2px;
  margin: 0 0 .6rem;
}
.footer-credit{
  color: var(--text-dim);
  font-size: 1.2rem;
  margin: 0 0 1.5rem;
}
.footer-links{
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  padding: 0;
  margin: 0 0 2rem;
  flex-wrap: wrap;
}
.footer-links a{
  text-decoration: none;
  color: var(--purple-bright);
  font-size: 1.15rem;
  border-bottom: 1px solid transparent;
}
.footer-links a:hover{ border-bottom-color: var(--purple-bright); }

.footer-copy{
  color: #6b5a8f;
  font-size: 1rem;
  margin: 0;
}

/* ============================================
   CAPTION DEL TRÁILER
   ============================================ */
.trailer-caption{
  max-width: 38rem;
  margin: 1.6rem auto 0;
  color: var(--text-dim);
  font-size: 1.2rem;
  line-height: 1.6;
}
.trailer-caption strong{ color: var(--magenta); }

/* ============================================
   PERSONAJES — tarjetas individuales, carrusel
   ============================================ */
.char-row{
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: .5rem .25rem 1.4rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.char-row::-webkit-scrollbar{ height: 8px; }
.char-row::-webkit-scrollbar-track{ background: var(--deep); border-radius: 4px; }
.char-row::-webkit-scrollbar-thumb{ background: var(--purple-mid); border-radius: 4px; }

.char-slot{
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  background: linear-gradient(160deg, var(--panel), var(--deep));
  border: var(--border);
  border-radius: 12px;
  padding: 1.1rem .8rem 1rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.char-slot:hover{
  border-color: var(--purple-bright);
  transform: translateY(-4px);
  box-shadow: 0 16px 34px -18px rgba(139,92,246,.6);
}

@media (min-width: 760px){
  .char-slot{ width: 190px; padding: 1.4rem 1rem 1.2rem; }
}

.char-portrait{
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, var(--purple-shadow) 0%, transparent 72%);
  border-radius: 8px;
  overflow: hidden;
}
.char-portrait img{
  width: 92%;
  height: 92%;
  object-fit: contain;
  image-rendering: pixelated;
}

.char-slot[data-locked="true"] .char-portrait img{
  filter: grayscale(60%) brightness(.6) saturate(75%);
}
.char-lock{
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.15rem;
  filter: drop-shadow(0 0 4px rgba(0,0,0,.8));
}

.char-name{
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-align: center;
}
.char-slot[data-locked="false"] .char-name{ color: var(--star); }

/* ============================================
   NOTIFICACIONES
   ============================================ */
.notify-section .btn{ font-size: .85rem; padding: 1.1rem 1.6rem; }

/* ============================================
   TOAST
   ============================================ */
.toast{
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 20px);
  background: var(--panel);
  border: var(--border);
  border-radius: 8px;
  padding: .9rem 1.4rem;
  color: var(--text);
  font-size: 1.1rem;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.toast.is-visible{
  opacity: 1;
  transform: translate(-50%, 0);
}
