/* ============================================================
   ANIME GENIUS — Hoja de estilos
   Noche púrpura + acentos neón · botones 3D "empujables"
   ============================================================ */

:root {
  /* Color */
  --bg: #1c1329;
  --bg-deep: #0e0918;
  --panel: #2a1e3d;
  --panel-2: #342550;
  --line: #563e79;
  --ink: #f7f2fa;
  --ink-dim: #c9b8e0;
  --ink-dark: #2a1e3d;
  --pink: #ffa7f0;
  --yellow: #ffce80;
  --coral: #f5cac3;
  --salmon: #f28482;
  --sage: #84a59d;
  --cyan: #76f4fc;
  --magic: linear-gradient(90deg, #76f4fc, #ff42e7, #fdff48, #ff42e7, #76f4fc);

  /* Tipografía */
  --display: "Dela Gothic One", "Arial Black", sans-serif;
  --body: "Manrope", system-ui, -apple-system, sans-serif;

  /* Ritmo */
  --r-lg: 24px;
  --r-pill: 80px;
  --pad: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Fondo estrellado ---------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 68%, var(--pink) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 15%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 40%, var(--cyan) 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 74%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 88%, var(--yellow) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 67% 55%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 45%, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 82% 12%, var(--pink) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 80%, var(--cyan) 50%, transparent 51%);
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad);
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: var(--ink);
}
.brand-mark { width: 36px; height: 36px; }
.brand-name {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--pink);
}

.topnav { display: flex; gap: 8px; }
.navlink {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-dim);
  background: none;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}
.navlink:hover { color: var(--ink); transform: translateY(-1px); }
.navlink[aria-current="page"] {
  color: var(--ink-dark);
  background: var(--yellow);
  border-color: var(--ink-dark);
}

/* ---------- Estructura principal ---------- */
.app {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px var(--pad) 48px;
  display: flex;
  flex-direction: column;
}

.screen { display: flex; flex-direction: column; align-items: center; text-align: center; animation: screenIn 260ms ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Tipografía ---------- */
.display {
  font-family: var(--display);
  line-height: 1.15;
  margin: 0;
}
.display--xl { font-size: clamp(2rem, 8vw, 3.4rem); }
.display--lg { font-size: clamp(1.5rem, 5.5vw, 2.2rem); }
.display--md { font-size: clamp(1.2rem, 4.5vw, 1.6rem); }

.outline-text {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--pink);
  text-stroke: 1.5px var(--pink);
}

.lead { color: var(--ink-dim); max-width: 46ch; margin: 14px auto 0; }
.accent { color: var(--yellow); }

/* ---------- Genio ---------- */
.genie-wrap { position: relative; width: min(240px, 60vw); margin: 8px auto 4px; }
.genie { width: 100%; height: auto; display: block; animation: floaty 3.2s ease-in-out infinite alternate; transform-origin: 50% 90%; }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-10px); } }

.genie .eye { transform-origin: center; animation: blink 4.5s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }

.genie .mood-happy, .genie .mood-think, .genie .mood-sad { display: none; }
.genie-wrap[data-mood="happy"] .mood-happy { display: block; }
.genie-wrap[data-mood="happy"] .mood-idle { display: none; }
.genie-wrap[data-mood="think"] .mood-think { display: block; }
.genie-wrap[data-mood="think"] .mood-idle { display: none; }
.genie-wrap[data-mood="sad"] .mood-sad { display: block; }
.genie-wrap[data-mood="sad"] .mood-idle { display: none; }
.genie-wrap[data-mood="happy"] .genie { animation: floaty 1.4s ease-in-out infinite alternate; }

/* ---------- Botones 3D empujables ---------- */
.push {
  --push-color: var(--pink);
  appearance: none;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--ink-dark);
  background: var(--push-color);
  border: 3px solid var(--ink-dark);
  border-radius: var(--r-pill);
  padding: 14px 28px;
  min-height: 48px;
  cursor: pointer;
  transform: translate(-6px, -6px);
  box-shadow: 6px 6px 0 var(--bg-deep);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, filter 120ms ease-out;
}
.push:hover { transform: translate(-7px, -7px); box-shadow: 7px 7px 0 var(--bg-deep); filter: brightness(1.06); }
.push:active { transform: translate(0, 0); box-shadow: 0 0 0 var(--bg-deep); }
.push:focus-visible, .navlink:focus-visible, .brand:focus-visible, .chip:focus-visible, .card-btn:focus-visible, input:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}
.push--yellow { --push-color: var(--yellow); }
.push--coral { --push-color: var(--coral); }
.push--salmon { --push-color: var(--salmon); }
.push--sage { --push-color: var(--sage); }
.push--ghost {
  --push-color: transparent;
  color: var(--ink);
  border-color: var(--ink-dim);
}
.push--lg { font-size: 1.15rem; padding: 16px 34px; }
.push:disabled { opacity: 0.45; cursor: not-allowed; transform: translate(-6px,-6px); }

/* ---------- Pantalla de inicio ---------- */
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 4px; max-width: 480px; }
.badge {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--ink-dark);
  background: var(--coral);
  border: 2.5px solid var(--ink-dark);
  border-radius: var(--r-pill);
  padding: 5px 13px;
  box-shadow: 0 0 0 2px var(--ink);
}
.badge:nth-child(2n) { background: var(--yellow); transform: rotate(-2deg); }
.badge:nth-child(3n) { background: var(--sage); transform: rotate(2deg); }
.badge:nth-child(4n) { background: var(--pink); transform: rotate(-1deg); }

.hero-cta { display: flex; flex-direction: column; gap: 20px; margin-top: 30px; width: min(340px, 100%); }

/* ---------- Marquesina ---------- */
.marquee {
  overflow: hidden;
  width: 100vw;
  margin: 42px calc(50% - 50vw) 0;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 10px 0;
  user-select: none;
}
.marquee-track {
  display: inline-flex;
  gap: 28px;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--line);
  animation: marquee 26s linear infinite;
}
.marquee-track span { color: var(--ink-dim); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Pantalla de preguntas ---------- */
.qmeta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.meter {
  width: 100%;
  height: 14px;
  border: 2.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg-deep);
  overflow: hidden;
  margin-bottom: 26px;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--magic);
  background-size: 200% 100%;
  animation: magicSlide 2.4s linear infinite;
  transition: width 320ms ease-out;
}
@keyframes magicSlide { from { background-position: 0 0; } to { background-position: -200% 0; } }

.qcard {
  width: 100%;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 5vw, 34px);
  margin-bottom: 26px;
}

.answers { display: flex; flex-direction: column; gap: 18px; width: min(380px, 100%); }
.answers .push { width: 100%; }
.answers .key {
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.72rem;
  opacity: 0.65;
  margin-left: 10px;
}

.qtools { display: flex; gap: 14px; margin-top: 28px; }
.linkish {
  background: none;
  border: 0;
  color: var(--ink-dim);
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
  transition: color 150ms ease-out;
}
.linkish:hover { color: var(--ink); }
.linkish:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Adivinanza / resultado ---------- */
.guess-card {
  width: 100%;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 5vw, 30px);
  animation: bounceIn 420ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.7); }
  60% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

.poster {
  width: min(220px, 62vw);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid var(--ink-dark);
  box-shadow: 8px 8px 0 var(--bg-deep);
  background: var(--panel-2);
}
.poster--placeholder {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 4rem;
  color: var(--pink);
}

.guess-actions { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 24px; }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.meta-pill {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-dark);
  background: var(--coral);
  border: 2px solid var(--ink-dark);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.meta-pill--yellow { background: var(--yellow); }
.meta-pill--sage { background: var(--sage); }

.synopsis { color: var(--ink-dim); font-size: 0.95rem; max-width: 52ch; margin: 12px auto 0; }

/* ---------- Lista de candidatos (derrota) ---------- */
.candidate-list { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.candidate {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 2.5px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  color: var(--ink);
  font-family: var(--body);
  cursor: pointer;
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}
.candidate:hover { border-color: var(--pink); transform: translateX(3px); }
.candidate img, .candidate .thumb-ph {
  width: 52px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--ink-dark);
  background: var(--panel-2);
  flex-shrink: 0;
}
.candidate .thumb-ph { display: grid; place-items: center; font-family: var(--display); color: var(--pink); }
.candidate .c-title { font-weight: 800; }
.candidate .c-sub { font-size: 0.8rem; color: var(--ink-dim); }

/* ---------- Buscador por descripción ---------- */
.searchbox { width: 100%; display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.searchbox input {
  flex: 1 1 220px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-deep);
  border: 3px solid var(--line);
  border-radius: var(--r-pill);
  padding: 13px 22px;
  min-height: 52px;
}
.searchbox input::placeholder { color: var(--ink-dim); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 6px; }
.chip {
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--ink-dim);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 15px;
  min-height: 40px;
  cursor: pointer;
  transition: all 150ms ease-out;
}
.chip:hover { color: var(--ink); border-color: var(--pink); }
.chip[aria-pressed="true"] {
  color: var(--ink-dark);
  background: var(--sage);
  border-color: var(--ink-dark);
}

.results {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card-btn {
  background: var(--panel);
  border: 2.5px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--body);
  text-align: left;
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}
.card-btn:hover { border-color: var(--pink); transform: translateY(-3px); }
.card-btn img, .card-btn .thumb-ph {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--ink-dark);
  background: var(--panel-2);
}
.card-btn .thumb-ph { display: grid; place-items: center; font-family: var(--display); font-size: 2rem; color: var(--pink); }
.card-btn .r-title { display: block; font-weight: 800; font-size: 0.88rem; margin-top: 8px; line-height: 1.3; }
.card-btn .r-sub { display: block; font-size: 0.75rem; color: var(--ink-dim); margin-top: 2px; }

.status-msg { color: var(--ink-dim); font-weight: 700; margin: 30px 0; }

/* ---------- Detalle (modal) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(14, 9, 24, 0.82);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(520px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  animation: bounceIn 320ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

/* ---------- Confeti ---------- */
.confetti {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 14px;
  z-index: 50;
  pointer-events: none;
  border-radius: 2px;
  animation: confettiFall var(--dur, 1.4s) ease-in forwards;
}
@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0.4; }
}

/* ---------- Pie ---------- */
.foot {
  padding: 18px var(--pad) 28px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-dim);
}

/* ---------- Móvil ---------- */
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; justify-content: center; row-gap: 4px; }
  .brand { margin: 0 auto; }
  .topnav { width: 100%; justify-content: center; }
}

/* ---------- Escritorio ---------- */
@media (min-width: 760px) {
  .app { max-width: 720px; }
  .answers { width: min(440px, 100%); }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .genie, .marquee-track, .meter-fill, .genie .eye { animation: none; }
  .screen, .guess-card, .modal { animation: none; }
  .confetti { display: none; }
  .push, .navlink, .chip, .candidate, .card-btn { transition: none; }
}
