/* CosplayDex — un dispositivo de bolsillo: carcasa roja, lente azul, LEDs y pantalla LCD con bisel */
:root {
  --carcasa: #d61f36;
  --carcasa-2: #b31429;
  --carcasa-3: #8e0d20;
  --bisel: #24262c;
  --bisel-2: #3a3d45;
  --lcd: #e4edd9;
  --lcd-2: #ccd9bf;
  --lcd-tinta: #1f2a1c;
  --lcd-suave: #5d6b57;
  --lente: #2f9ee8;
  --lente-osc: #0d5d9e;
  --led-rojo: #ff4d5e;
  --led-amarillo: #ffd23f;
  --led-verde: #45e07a;
  --tinta: #17181c;
  --tinta-suave: #5a5d66;
  --blanco: #fbfbf8;
  --rojo: #d61f36;
  --oro: #ffd23f;           /* acento: el LED amarillo */
  --noche: #24262c;         /* compatibilidad con estilos que usan los nombres anteriores */
  --pixel: "Silkscreen", "Courier New", monospace;
  --texto: "Chakra Petch", "Segoe UI", sans-serif;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--texto);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinta);
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .1) 1px, transparent 1.4px) 0 0 / 6px 6px,
    linear-gradient(180deg, var(--carcasa) 0%, var(--carcasa-2) 100%) fixed;
  background-color: var(--carcasa);
  overflow-x: hidden;
}
body > * { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ================================================ tapa: lente, LEDs y título */
.tapa {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 14px;
  color: #fff;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .12) 1px, transparent 1.4px) 0 0 / 6px 6px,
    linear-gradient(180deg, #e3283f, var(--carcasa));
  box-shadow: 0 6px 0 var(--carcasa-3), 0 12px 18px -8px rgba(0, 0, 0, .5);
}
.tapa-fila { display: flex; align-items: center; gap: 12px; }

.tapa-marca.lente, .lente {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 5px solid var(--blanco);
  background: radial-gradient(circle at 34% 30%, #bfe6ff 0 9%, var(--lente) 32%, var(--lente-osc) 100%);
  box-shadow: 0 0 0 3px var(--bisel), 0 4px 10px rgba(0, 0, 0, .35), inset 0 -6px 12px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: transform .15s;
}
.lente::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(120, 220, 255, .55), transparent 60%);
  opacity: 0;
  animation: latido 3.2s ease-in-out infinite;
}
.tapa-marca.lente:active { transform: scale(.92); }
.tapa-marca.lente:focus-visible { outline: 3px solid var(--oro); outline-offset: 4px; }

.leds { display: flex; gap: 7px; align-self: flex-start; margin-top: 4px; }
.led {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid var(--bisel);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .3), 0 0 8px currentColor;
}
.led-rojo { background: var(--led-rojo); color: rgba(255, 77, 94, .7); }
.led-amarillo { background: var(--led-amarillo); color: rgba(255, 210, 63, .6); }
.led-verde { background: var(--led-verde); color: rgba(69, 224, 122, .6); }
.tapa[data-ia="cargando"] .led-verde { animation: parpadeo .8s steps(2) infinite; }

.contador {
  margin-left: auto;
  padding: 6px 10px 5px;
  border-radius: 8px;
  background: var(--lcd);
  border: 3px solid var(--bisel);
  color: var(--lcd-tinta);
  font-family: var(--pixel);
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .18);
}
.contador-num { font-size: 1.45rem; display: inline-block; }
.contador-num.salto { animation: salto .5s cubic-bezier(.2, 1.8, .4, 1); }
.contador-de { font-size: .85rem; color: var(--lcd-suave); }

.tapa-titulos { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 10px; }
.tapa-titulo {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(1.45rem, 7.4vw, 1.9rem);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 3px 3px 0 var(--carcasa-3);
}
.tapa-titulo span { color: var(--oro); }
.tapa-pgd { display: block; height: 30px; width: auto; opacity: .95; }

.barra {
  margin-top: 10px;
  height: 12px;
  padding: 2px;
  border-radius: 4px;
  background: var(--bisel);
}
.barra i {
  display: block; height: 100%; width: 0;
  border-radius: 2px;
  /* segmentos tipo batería */
  background: repeating-linear-gradient(90deg, var(--led-verde) 0 8px, transparent 8px 10px);
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}

.estado-ia {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 0 0;
  font-size: .74rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
}
.estado-ia svg { width: 14px; height: 14px; flex: 0 0 auto; }
.estado-ia[data-estado="lista"] { color: #c9ffd9; }
.estado-ia[data-estado="error"] { color: #ffe0a3; }
.estado-ia[data-estado="cargando"] span::after { content: ""; animation: puntos 1.2s steps(4) infinite; }

/* ================================================ selector de series */
.pestanas {
  position: sticky;
  top: var(--alto-tapa, 140px);
  z-index: 9;
  display: flex;
  gap: 8px;
  padding: 14px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .1) 1px, transparent 1.4px) 0 0 / 6px 6px,
    var(--carcasa);
}
.pestanas::-webkit-scrollbar { display: none; }
.pestana {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  font: 700 .86rem var(--texto);
  color: #fff;
  background: var(--bisel);
  border: 0;
  border-radius: 99px;
  box-shadow: 0 3px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: transform .1s, background .2s, color .2s;
}
.pestana small { font-family: var(--pixel); font-size: .68rem; opacity: .75; }
.pestana:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.pestana.activa { background: var(--oro); color: var(--tinta); box-shadow: 0 3px 0 #a07f10; }
.pestana.completa::after { content: "★"; color: var(--oro); }
.pestana.activa.completa::after { color: var(--tinta); }
.pestana:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ================================================ pantalla LCD con bisel */
.paginas {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  align-items: flex-start;
  margin: 2px 12px 0;
  border: 10px solid var(--bisel);
  border-radius: 18px 18px 18px 44px;
  background: var(--lcd);
  box-shadow: inset 0 0 0 2px var(--bisel-2), 0 5px 0 var(--carcasa-3), 0 10px 20px -8px rgba(0, 0, 0, .55);
}
.paginas::-webkit-scrollbar { display: none; }
.cargando { color: var(--lcd-suave); text-align: center; width: 100%; padding: 48px 16px; font-family: var(--pixel); }

.pagina {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 14px 12px 20px;
  /* rejilla de píxeles de la pantalla */
  background:
    linear-gradient(90deg, rgba(31, 42, 28, .05) 1px, transparent 1px) 0 0 / 4px 4px,
    linear-gradient(rgba(31, 42, 28, .05) 1px, transparent 1px) 0 0 / 4px 4px,
    var(--lcd);
  min-height: calc(100dvh - 210px);
}

.pagina-cab {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 0 2px 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--lcd-tinta);
  color: var(--lcd);
}
.pagina-titulo { margin: 0; font-family: var(--pixel); font-weight: 700; font-size: 1rem; line-height: 1.2; text-transform: uppercase; }
.pagina-cuenta { font-family: var(--pixel); font-size: .8rem; white-space: nowrap; }

.sello-completa {
  position: absolute;
  top: 6px; right: 14px;
  padding: 3px 8px;
  font-family: var(--pixel);
  font-size: .8rem;
  color: var(--tinta);
  background: var(--oro);
  border: 2px solid var(--tinta);
  border-radius: 4px;
  transform: rotate(6deg);
  opacity: 0;
  pointer-events: none;
}
.pagina.completa .sello-completa { opacity: 1; animation: sellar .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.pagina.completa .pagina-cuenta { visibility: hidden; }

.rejilla { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }

/* ================================================ entradas */
.cromo {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: transparent;
}
.cromo:focus-visible { outline: 3px solid var(--rojo); outline-offset: 3px; border-radius: 10px; }

.cromo-nro {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--pixel);
  font-size: .72rem;
  line-height: 1.2;
  background: var(--lcd-tinta);
  color: var(--lcd);
}

/* sin registrar: retrato en silueta dentro de un visor, con la incógnita en la cabeza */
.cromo-vacio {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  border-radius: 10px;
  border: 2px solid var(--lcd-tinta);
  background: radial-gradient(circle at 50% 38%, #e3ecd7 0%, var(--lcd-2) 72%);
  overflow: hidden;
  box-shadow: inset 0 0 0 3px var(--lcd);
  transition: transform .15s, filter .2s;
}
/* líneas de la pantalla */
.cromo-vacio::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(31, 42, 28, .055) 0 1px, transparent 1px 3px);
}
/* esquinas de visor: "por escanear" */
.cromo-vacio::before {
  content: "";
  position: absolute;
  inset: 34px 8px 50px;
  pointer-events: none;
  border: 2px solid rgba(31, 42, 28, .35);
  border-radius: 6px;
  -webkit-mask: linear-gradient(#000 0 0) top left / 16px 16px no-repeat, linear-gradient(#000 0 0) top right / 16px 16px no-repeat,
                linear-gradient(#000 0 0) bottom left / 16px 16px no-repeat, linear-gradient(#000 0 0) bottom right / 16px 16px no-repeat;
          mask: linear-gradient(#000 0 0) top left / 16px 16px no-repeat, linear-gradient(#000 0 0) top right / 16px 16px no-repeat,
                linear-gradient(#000 0 0) bottom left / 16px 16px no-repeat, linear-gradient(#000 0 0) bottom right / 16px 16px no-repeat;
}
.cromo:active .cromo-vacio { transform: scale(.97); filter: brightness(.95); }

.cromo-silueta {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  padding: 44px 22% 16px;
}
.cromo-q { fill: var(--lcd-tinta); fill-opacity: .78; }
.cromo-q-sombra { fill: rgba(31, 42, 28, .18); }

.cromo-cam {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--lcd-tinta);
  color: var(--lcd);
}
.cromo-cam svg { width: 15px; height: 15px; }

.cromo-placa {
  position: relative;
  z-index: 1;
  padding: 6px 9px 7px;
  background: var(--lcd-tinta);
  color: var(--lcd);
}
.cromo-placa b { display: block; font-size: .86rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.cromo-placa small { display: block; margin-top: 2px; font-family: var(--pixel); font-size: .56rem; letter-spacing: .04em; text-transform: uppercase; color: rgba(228, 237, 217, .62); }
.cromo-pegado .cromo-placa small { color: var(--led-verde); }

/* registrado: foto con marco */
.cromo-pegado {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  border-radius: 10px;
  border: 2px solid var(--lcd-tinta);
  background: var(--lcd-tinta);
  overflow: hidden;
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .55);
}
.cromo-pegado img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: 50% 75%; display: block; background: var(--lcd-2); }
.cromo-ok {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--led-verde);
  border: 2px solid var(--lcd-tinta);
}
.cromo-ok svg { width: 13px; height: 13px; }
.cromo-pegado .cromo-placa { background: var(--lcd-tinta); }
.cromo.recien-pegado .cromo-pegado { animation: registrar .7s cubic-bezier(.2, 1.4, .4, 1) both; }

/* destello de escaneo al registrar */
.holo {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, rgba(69, 224, 122, .55) 50%, transparent 60%);
  background-size: 100% 260%;
  opacity: 0;
}
.cromo.recien-pegado .holo { animation: barrido-unico 1s .25s ease-out both; }

.pagina-editor { display: block; width: 96px; margin: 22px auto 0; opacity: .85; }
.pagina-editor img { display: block; width: 100%; height: auto; }

/* ================================================ parte baja del dispositivo */
.instruccion {
  margin-top: 0;
  padding: 14px 22px 4px;
  font-size: .86rem;
  color: rgba(255, 255, 255, .9);
  text-align: center;
}

.controles {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 30px 4px;
}
.cruceta {
  position: relative; width: 66px; height: 66px;
  background:
    linear-gradient(var(--bisel), var(--bisel)) center / 22px 66px no-repeat,
    linear-gradient(var(--bisel), var(--bisel)) center / 66px 22px no-repeat;
  filter: drop-shadow(0 3px 0 #000);
}
.cruceta::after { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--bisel-2); }
.botones-redondos { display: flex; gap: 14px; }
.boton-redondo { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 3px 0 #000, inset 0 -3px 4px rgba(0, 0, 0, .3); }
.boton-redondo.azul { background: var(--lente); }
.boton-redondo.amarillo { background: var(--oro); }
.altavoz { display: grid; gap: 5px; }
.altavoz i { display: block; width: 46px; height: 4px; border-radius: 2px; background: var(--carcasa-3); }

.pie-marca {
  margin-top: 14px;
  padding: 18px 20px calc(30px + var(--seguro-abajo));
  text-align: center;
  color: rgba(255, 255, 255, .8);
  background: var(--carcasa-3);
  border-radius: 22px 22px 0 0;
}
.pie-marca-sobre { margin: 0 0 8px; font-family: var(--pixel); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--oro); }
.pie-marca-logo { display: inline-block; }
.pie-marca-logo img { display: block; width: 160px; height: auto; margin: 0 auto; }
.pie-marca-texto { margin: 12px 0 16px; font-size: .85rem; }

/* enlaces a la web y al linktree */
.enlaces-marca { display: flex; gap: 10px; flex-wrap: wrap; }
.enlace-marca {
  flex: 1 1 140px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--bisel);
  box-shadow: 0 3px 0 #000;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
}
.enlace-marca::after { content: "↗"; color: var(--oro); }
.enlace-marca:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.enlace-marca:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }

/* ================================================ botones de goma */
.boton {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
  padding: 12px 16px;
  font: 700 1rem var(--texto);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  transition: transform .1s, box-shadow .1s;
}
.boton svg { width: 22px; height: 22px; }
.boton:active { transform: translateY(3px); }
.boton:focus-within, .boton:focus-visible { outline: 3px solid var(--lente); outline-offset: 2px; }
.boton-principal { background: var(--bisel); color: #fff; box-shadow: 0 4px 0 #000; }
.boton-principal:active { box-shadow: 0 1px 0 #000; }
.boton-sec { background: var(--lcd-2); color: var(--lcd-tinta); box-shadow: 0 4px 0 #94a487; }
.boton-sec:active { box-shadow: 0 1px 0 #94a487; }
.boton-peligro { background: #fff; color: var(--rojo); box-shadow: 0 4px 0 #c9c9c2, inset 0 0 0 2px var(--rojo); }
.boton-peligro.confirmar { background: var(--rojo); color: #fff; box-shadow: 0 4px 0 var(--carcasa-3); }
.boton-oro { width: 100%; background: var(--oro); color: var(--tinta); box-shadow: 0 4px 0 #a07f10; }
.boton-oro:active { box-shadow: 0 1px 0 #a07f10; }
.boton:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; transform: none; }
.boton-compartir { width: 100%; background: var(--lente); color: #fff; box-shadow: 0 4px 0 var(--lente-osc); }
.boton-compartir:active { box-shadow: 0 1px 0 var(--lente-osc); }

/* ================================================ hoja inferior: ficha de la entrada */
.hoja {
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 12px 16px calc(20px + var(--seguro-abajo));
  border: 0;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .1) 1px, transparent 1.4px) 0 0 / 6px 6px,
    var(--carcasa);
  color: var(--tinta);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -4px 0 var(--carcasa-3);
}
.hoja[open] { animation: subir .35s cubic-bezier(.2, .9, .25, 1); }
.hoja::backdrop { background: rgba(10, 10, 14, .62); backdrop-filter: blur(3px); }
.hoja-asa { width: 44px; height: 5px; margin: 0 auto 10px; border-radius: 99px; background: rgba(0, 0, 0, .3); }
.hoja-cerrar {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--bisel);
  color: #fff;
  box-shadow: 0 3px 0 #000;
  cursor: pointer;
}
.hoja-cerrar svg { width: 18px; height: 18px; }

.hoja-cab {
  display: flex; align-items: center; gap: 12px;
  margin: 0 50px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--lcd-tinta);
  color: var(--lcd);
  border: 3px solid var(--bisel);
}
.hoja-num {
  flex: 0 0 auto;
  font-family: var(--pixel);
  font-size: 1rem;
  color: var(--tinta);
  background: var(--oro);
  border-radius: 6px;
  padding: 5px 7px;
}
.hoja-anime { margin: 0; font-family: var(--pixel); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--lcd-2); }
.hoja-nombre { margin: 0; font-weight: 700; font-size: 1.35rem; line-height: 1.1; overflow-wrap: anywhere; }

.modo {
  padding: 14px;
  border-radius: 14px;
  background: var(--lcd);
  border: 6px solid var(--bisel);
}
.modo[hidden] { display: none; }

.hoja-desc { margin: 0 0 10px; font-weight: 700; color: var(--lcd-tinta); }
.hoja-ayuda { margin: 0 0 16px; color: var(--lcd-suave); font-size: .92rem; }
.hoja-botones { display: grid; gap: 10px; }
.hoja-botones.fila { grid-template-columns: 1fr 1fr; }

.hoja-foto {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--lcd-tinta);
  margin-bottom: 12px;
}
.hoja-foto[hidden] { display: none; }
.hoja-foto img { width: 100%; height: 100%; object-fit: contain; display: block; }

.escaner { position: absolute; inset: 0; pointer-events: none; }
.escaneando .escaner {
  background: linear-gradient(180deg, transparent 0 46%, rgba(69, 224, 122, .85) 50%, transparent 54%);
  background-size: 100% 240%;
  animation: barrido 1.2s linear infinite;
  mix-blend-mode: screen;
}
.escaneando::after {
  content: ""; position: absolute; inset: 10px;
  border: 2px solid var(--led-verde);
  border-radius: 8px;
  -webkit-mask: linear-gradient(#000 0 0) top left / 26px 26px no-repeat, linear-gradient(#000 0 0) top right / 26px 26px no-repeat,
                linear-gradient(#000 0 0) bottom left / 26px 26px no-repeat, linear-gradient(#000 0 0) bottom right / 26px 26px no-repeat;
          mask: linear-gradient(#000 0 0) top left / 26px 26px no-repeat, linear-gradient(#000 0 0) top right / 26px 26px no-repeat,
                linear-gradient(#000 0 0) bottom left / 26px 26px no-repeat, linear-gradient(#000 0 0) bottom right / 26px 26px no-repeat;
}
.validando-texto { margin: 0; font-family: var(--pixel); font-size: .85rem; text-align: center; color: var(--lcd-tinta); }
.validando-texto b { font-family: var(--texto); }
.puntos::after { content: ""; animation: puntos 1.2s steps(4) infinite; }

.rechazada img { filter: grayscale(.8) brightness(.7); }
.sello-no {
  position: absolute; top: 50%; left: 50%;
  font-family: var(--pixel);
  font-size: 2.4rem;
  color: #fff;
  background: var(--rojo);
  border: 4px solid #fff;
  border-radius: 10px;
  padding: 2px 14px;
  transform: translate(-50%, -50%) rotate(-10deg);
  animation: sellar-centro .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.error-titulo { margin: 0 0 4px; font-family: var(--pixel); font-size: 1rem; color: var(--rojo); }
.error-detalle { margin: 0 0 14px; color: var(--lcd-suave); }
.error-detalle b { color: var(--lcd-tinta); }

.cromo-grande {
  position: relative;
  width: min(80%, 320px);
  aspect-ratio: 3 / 4;
  margin: 0 auto 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 4px solid var(--lcd-tinta);
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .6);
}
.cromo-grande img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cromo-grande .holo { opacity: .6; animation: barrido 2.6s ease-in-out infinite; }
.ver-meta { margin: 0 0 14px; font-family: var(--pixel); font-size: .72rem; color: var(--lcd-suave); }

/* ================================================ aviso flotante */
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--seguro-abajo));
  z-index: 30;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 12px;
  font-family: var(--pixel);
  font-size: .85rem;
  color: var(--lcd-tinta);
  background: var(--lcd);
  border: 4px solid var(--bisel);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  transition: transform .35s cubic-bezier(.2, .9, .25, 1), visibility 0s .35s;
  pointer-events: none;
  text-align: center;
}
.aviso.visible { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

/* ================================================ pantallas completas: splash, bienvenida, final */
.splash, .bienvenida, .final {
  position: fixed; inset: 0;
  max-width: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 18px calc(26px + var(--seguro-abajo));
  color: #fff;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .12) 1px, transparent 1.4px) 0 0 / 6px 6px,
    linear-gradient(180deg, #e3283f, var(--carcasa-2));
  animation: aparecer .3s both;
}
.splash { z-index: 45; }
.bienvenida { z-index: 35; }
.final { z-index: 40; display: grid; place-items: center; }
.splash[hidden], .bienvenida[hidden], .final[hidden] { display: none; }

.splash-caja, .bienvenida-caja { max-width: 420px; margin: 0 auto; }
.dispositivo-cab { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dispositivo-cab .lente { width: 64px; height: 64px; cursor: default; }

.pantalla-intro {
  padding: 18px 16px 16px;
  border-radius: 16px 16px 16px 40px;
  border: 10px solid var(--bisel);
  background: var(--lcd);
  color: var(--lcd-tinta);
  text-align: center;
  box-shadow: 0 5px 0 var(--carcasa-3);
  margin-bottom: 16px;
}
.splash-logo { display: block; width: min(64%, 230px); height: auto; margin: 0 auto; animation: entrar-logo .6s .05s cubic-bezier(.2, 1.3, .4, 1) both; }
.splash-presenta { margin: 12px 0 2px; font-family: var(--pixel); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lcd-suave); }
.splash-app { font-size: clamp(1.4rem, 7.6vw, 2rem); color: var(--lcd-tinta); text-shadow: 3px 3px 0 rgba(31, 42, 28, .18); }
.splash-app span { color: var(--rojo); }
.splash-sub { margin: 8px auto 0; max-width: 30ch; font-weight: 700; color: var(--lcd-suave); }

.splash-info {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bisel);
  box-shadow: 0 4px 0 #000;
}
.splash-info h2 { margin: 0 0 8px; font-family: var(--pixel); font-weight: 700; font-size: .95rem; color: var(--oro); }
.splash-info p { margin: 0 0 10px; color: rgba(255, 255, 255, .85); font-size: .92rem; }
.splash-info b { color: #fff; }
.splash-info ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.splash-info li { position: relative; padding-left: 20px; font-size: .88rem; color: rgba(255, 255, 255, .8); }
.splash-info li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; background: var(--led-verde); }
.splash .boton-oro { margin-bottom: 12px; }

.aceptar-terminos {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--carcasa-3);
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.aceptar-terminos input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--led-verde); cursor: pointer; }
.aceptar-terminos a { color: var(--oro); text-underline-offset: 3px; }
.aceptar-terminos:focus-within { outline: 3px solid var(--oro); outline-offset: 2px; }

.bienvenida-logo { display: block; width: 120px; height: auto; margin: 0 auto 10px; }
.bienvenida-titulo { font-size: clamp(1.4rem, 7.6vw, 2rem); margin: 4px 0 0; }
.bienvenida .tapa-sobre { margin: 0; font-family: var(--pixel); font-size: .72rem; color: var(--lcd-suave); text-transform: uppercase; }
.bienvenida-puntos { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.bienvenida-puntos li { position: relative; padding-left: 26px; color: rgba(255, 255, 255, .88); font-size: .95rem; }
.bienvenida-puntos li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 12px; height: 12px; background: var(--oro); box-shadow: 2px 2px 0 var(--carcasa-3); }
.bienvenida-puntos b { color: #fff; }
.bienvenida-nota { margin: 12px 0 0; font-size: .82rem; color: rgba(255, 255, 255, .78); text-align: center; }
.bienvenida-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bisel); color: #ffd6a0; font-weight: 700; font-size: .88rem; }
.bienvenida-error[hidden], #bienvenida-progreso[hidden], #bienvenida-inicio[hidden] { display: none; }
.barra-grande { height: 18px; margin-top: 0; }

.final-caja { width: 100%; max-width: 360px; text-align: center; }
.final-sfx { margin: 0; font-family: var(--pixel); font-size: 3.2rem; color: var(--oro); line-height: 1; text-shadow: 4px 4px 0 var(--carcasa-3); animation: salto .8s cubic-bezier(.2, 1.8, .4, 1) both; }
.final-caja h2 { font-family: var(--pixel); font-size: 1.5rem; margin: 12px 0 6px; }
.final-caja > p { margin: 0 0 18px; color: rgba(255, 255, 255, .88); }
.final-marca { margin: 0 0 18px; padding: 16px; border-radius: 14px; background: var(--bisel); box-shadow: 0 4px 0 #000; }
.final-marca img { display: block; width: 140px; height: auto; margin: 6px auto 10px; }
.final-caja .final-marca p { margin: 0 0 12px; font-size: .88rem; color: rgba(255, 255, 255, .85); }
.final-caja .final-marca p:first-child { margin: 0; font-family: var(--pixel); font-size: .7rem; color: var(--oro); text-transform: uppercase; }
.final-caja > .boton { width: 100%; }

/* ================================================ términos */
.terminos { display: flex; flex-direction: column; overflow: hidden; }
.terminos:not([open]) { display: none; }
.terminos-titulo { margin: 0 50px 10px 0; font-family: var(--pixel); font-weight: 700; font-size: 1.05rem; line-height: 1.25; color: #fff; }
.terminos-texto {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 8px;
  border-radius: 12px;
  border: 6px solid var(--bisel);
  background: var(--lcd);
  font-size: .9rem;
  color: var(--lcd-tinta);
}
.terminos-texto h3 { margin: 16px 0 6px; font-size: .98rem; font-weight: 700; }
.terminos-texto p, .terminos-texto ul { margin: 0 0 8px; color: #33402f; }
.terminos-texto ul { padding-left: 20px; }
.terminos-texto li { margin-bottom: 6px; }
.terminos-texto a { color: var(--carcasa-2); }
.terminos-fecha { font-size: .78rem; color: var(--lcd-suave) !important; }
.terminos-sub { margin: 22px 0 0; padding-top: 14px; border-top: 2px dashed rgba(31, 42, 28, .25); font-family: var(--pixel); font-weight: 700; font-size: .95rem; }
.terminos-botones { flex: 0 0 auto; padding-top: 12px; }

/* ================================================ animaciones */
@keyframes latido { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
@keyframes parpadeo { 50% { opacity: .25; } }
@keyframes salto { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes registrar {
  0% { opacity: 0; transform: scale(.85); filter: brightness(2.2) saturate(0); }
  60% { opacity: 1; transform: scale(1.03); filter: brightness(1.2); }
  100% { transform: none; filter: none; }
}
@keyframes barrido-unico { 0% { opacity: 1; background-position: 0 120%; } 100% { opacity: 0; background-position: 0 -20%; } }
@keyframes barrido { from { background-position: 0 120%; } to { background-position: 0 -20%; } }
@keyframes sellar { from { opacity: 0; transform: rotate(6deg) scale(2.2); } }
@keyframes sellar-centro { from { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg) scale(2.2); } }
@keyframes subir { from { transform: translateY(100%); } }
@keyframes puntos { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes aparecer { from { opacity: 0; } }
@keyframes entrar-logo { from { opacity: 0; transform: translateY(10px) scale(.9); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 350px) {
  .tapa-titulo { font-size: 1.3rem; }
  .contador-num { font-size: 1.2rem; }
  .rejilla { gap: 10px 8px; }
  .lente { width: 46px; height: 46px; }
}
.compartir-titulo { margin: 0 0 8px; font-family: var(--pixel); font-size: .72rem; text-transform: uppercase; color: var(--lcd-suave); }
.compartir-botones { margin-bottom: 10px; }
