/* ===== Test de personalidad RPG · Arbika ===== */
:root {
  --fondo: #0e0b1f;
  --fondo-2: #15112d;
  --panel: #1b1638;
  --panel-2: #241d4a;
  --borde: #322a66;
  --texto: #f1edff;
  --muted: #a9a2cf;
  --oro: #ffcf4a;
  --morado: #8b6cff;
  --rosa: #ff7ab6;
  --verde: #4ade80;
  --rojo: #ff6b6b;
  --radio: 16px;
  --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  --fuente-titulo: 'Russo One', 'Nunito', system-ui, sans-serif;
  --acento: #8b6cff; /* se reemplaza por el color del personaje en el resultado */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 108, 255, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 122, 182, .12), transparent 60%),
    var(--fondo);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--oro); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.contenedor { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.seccion { margin-top: 56px; }
.titulo-sec { font-family: var(--fuente-titulo); font-size: 1.7rem; color: var(--oro); }

/* ---------- Barra superior ---------- */
.barra {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 760px; margin: 0 auto; padding: 14px 16px;
}
.marca { font-family: var(--fuente-titulo); font-weight: 700; color: var(--texto); text-decoration: none; letter-spacing: .06em; }
.marca span { color: var(--muted); font-weight: 500; letter-spacing: 0; }
.barra-link { font-size: .9rem; color: var(--muted); text-decoration: none; }
.barra-link:hover { color: var(--oro); }

/* ---------- Paneles y botones ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--fondo-2));
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 20px;
  box-shadow: var(--sombra);
}
.panel h3 { font-size: 1.05rem; }
.panel p:last-child { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 800; cursor: pointer;
  border: 0; border-radius: 12px; padding: 14px 22px;
  color: #1a1300; background: linear-gradient(180deg, #ffe07a, var(--oro));
  box-shadow: 0 4px 0 #b88a10, 0 8px 20px rgba(255, 207, 74, .25);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b88a10; }
.btn-sec {
  color: var(--texto); background: var(--panel-2);
  box-shadow: 0 4px 0 #120e28; border: 1px solid var(--borde);
}
.btn-sec:active { box-shadow: 0 1px 0 #120e28; }
.btn-chico { padding: 10px 14px; font-size: .95rem; }
.btn-bloque { width: 100%; }
.btn:focus-visible, .opcion:focus-visible, .chip:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--oro); outline-offset: 2px;
}

/* ---------- Inicio ---------- */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 {
  font-family: var(--fuente-titulo); font-size: clamp(2.1rem, 8vw, 3.4rem);
  background: linear-gradient(90deg, var(--oro), var(--rosa), var(--morado));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .3em;
}
.hero .sub { font-size: 1.1rem; color: var(--muted); max-width: 560px; margin: 0 auto 1.2em; }
.desfile { font-size: 2rem; display: flex; gap: .35em; justify-content: center; flex-wrap: wrap; margin: 10px 0 20px; }
.desfile span { display: inline-block; animation: flotar 3s ease-in-out infinite; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.datos-rapidos { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: .4em;
  background: var(--panel-2); border: 1px solid var(--borde);
  padding: 6px 12px; border-radius: 999px; font-size: .9rem; font-weight: 700;
}
.form-inicio { text-align: left; display: grid; gap: 16px; }
.campo label, .campo .etiqueta { display: block; font-weight: 800; margin-bottom: 6px; }
.campo input {
  width: 100%; font: inherit; color: var(--texto);
  background: var(--fondo); border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 10px 16px; border-radius: 999px;
  background: var(--fondo); color: var(--texto); border: 1px solid var(--borde);
}
.chip[aria-pressed="true"] { background: var(--morado); border-color: var(--morado); color: #fff; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Capítulo ---------- */
.capitulo { text-align: center; padding: 40px 20px; }
.capitulo .icono-grande { font-size: 4.5rem; display: block; margin-bottom: 10px; animation: aparecer .6s ease; }
.capitulo h2 { font-family: var(--fuente-titulo); font-size: clamp(1.6rem, 6vw, 2.3rem); color: var(--oro); }
.capitulo p { font-size: 1.1rem; color: var(--muted); max-width: 520px; margin: 0 auto 1.6em; }
@keyframes aparecer { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }

/* ---------- HUD y pregunta ---------- */
.hud { display: grid; gap: 8px; margin: 8px 0 18px; }
.hud-fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9rem; }
.hud-acto { font-family: var(--fuente-titulo); color: var(--oro); }
.hud-nivel { font-weight: 800; color: var(--muted); }
.barra-xp {
  height: 14px; border-radius: 999px; background: var(--fondo);
  border: 1px solid var(--borde); overflow: hidden; position: relative;
}
.barra-xp > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--morado), var(--rosa), var(--oro));
  transition: width .4s ease;
}
.tarjeta-pregunta { animation: entrar .35s ease; }
@keyframes entrar { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.num-pregunta { font-family: var(--fuente-titulo); color: var(--morado); font-size: .95rem; letter-spacing: .05em; }
.pregunta { font-size: clamp(1.25rem, 4.8vw, 1.6rem); font-weight: 800; margin: 6px 0 18px; }
[data-enfoque]:focus { outline: none; }
.opciones { display: grid; gap: 10px; }
.opcion {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  font: inherit; font-size: 1.02rem; font-weight: 600; color: var(--texto); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.opcion:hover { border-color: var(--morado); transform: translateY(-2px); }
.opcion .tecla {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--fondo); border: 1px solid var(--borde); font-weight: 800; font-size: .9rem; color: var(--oro);
}
.opcion.elegida { border-color: var(--oro); background: #3a2f12; }
.opcion-ninguna { background: transparent; border-style: dashed; color: var(--muted); font-size: .95rem; padding: 10px 16px; }
.opcion-ninguna small { font-weight: 700; opacity: .8; }
.opcion-ninguna:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.opcion-ninguna:disabled:hover { border-color: var(--borde); transform: none; }
.opcion.previa { border-color: var(--oro); }
.pie-pregunta { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }
.ayuda-teclas { font-size: .85rem; color: var(--muted); }

.xp-flotante {
  position: fixed; pointer-events: none; z-index: 50;
  font-family: var(--fuente-titulo); font-weight: 700; color: var(--oro); font-size: 1.2rem;
  text-shadow: 0 2px 0 #000; animation: subir .8s ease forwards;
}
@keyframes subir { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-50px); } }

/* ---------- Pantalla de carga ---------- */
.carga { text-align: center; padding: 60px 20px; }
.carga .icono-grande { font-size: 4rem; display: inline-block; animation: girar 1.2s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.carga .barra-xp { max-width: 360px; margin: 20px auto; }
.carga .barra-xp > i { transition: width 2.2s ease; }
.tip { color: var(--muted); font-style: italic; min-height: 3em; }

/* ---------- Resultado ---------- */
.banner-compartido {
  background: var(--panel-2); border: 1px dashed var(--oro); border-radius: 12px;
  padding: 14px 16px; margin: 8px 0 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.heroe {
  text-align: center; position: relative; overflow: hidden;
  border-color: var(--acento);
  background:
    radial-gradient(500px 260px at 50% 0%, color-mix(in srgb, var(--acento) 35%, transparent), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--fondo-2));
}
.heroe .antetitulo { font-family: var(--fuente-titulo); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .9rem; }
.heroe .avatar {
  font-size: 6rem; line-height: 1; display: inline-grid; place-items: center;
  width: 150px; height: 150px; margin: 14px auto 10px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acento) 40%, transparent), transparent 70%);
  border: 2px solid var(--acento); animation: aparecer .7s ease;
}
.heroe h1 { font-family: var(--fuente-titulo); font-size: clamp(2rem, 8vw, 2.9rem); margin-bottom: .15em; color: var(--texto); }
.heroe .lema { color: var(--muted); font-size: 1.1rem; margin-bottom: 14px; }
.heroe .frase { font-style: italic; font-size: 1.1rem; margin: 10px 0 14px; }
.insignias { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.insignia { background: var(--fondo); border: 1px solid var(--borde); border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: .9rem; }
.insignia b { color: var(--oro); }
.desc { font-size: 1.05rem; text-align: left; }

.bloque { margin-top: 16px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.mini h3 { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.mini .grande { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.mini p { margin: 0; }

.radar-caja { display: grid; place-items: center; margin: 6px 0 10px; }
.radar-caja svg { width: 100%; max-width: 380px; height: auto; }
.grupo-stats { margin-top: 18px; }
.grupo-stats h3 { font-family: var(--fuente-titulo); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.grupo-stats h3::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.stat { display: grid; grid-template-columns: minmax(118px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 7px 0; }
.stat-nombre { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-barra { height: 12px; background: var(--fondo); border-radius: 999px; border: 1px solid var(--borde); overflow: hidden; }
.stat-barra > i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 999px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.stat-valor { font-weight: 800; font-size: 1rem; white-space: nowrap; min-width: 82px; text-align: right; }
.rango { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 6px; font-size: .8rem; color: #120d2a; background: var(--muted); }
.rango-S { background: var(--oro); } .rango-A { background: var(--verde); } .rango-B { background: #5ec8ff; }
.rango-C { background: #c4b5fd; } .rango-D { background: #fda4af; } .rango-E { background: #9ca3af; }
.stat-desc { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); margin-top: -4px; }

.pasivas { display: grid; gap: 10px; }
.pasiva { display: flex; gap: 12px; align-items: flex-start; }
.pasiva .ico { font-size: 1.6rem; line-height: 1; }
.pasiva .tit { font-weight: 800; }

.multiclase { display: grid; gap: 10px; }
.mc { display: flex; align-items: center; gap: 12px; background: var(--fondo); border: 1px solid var(--borde); border-radius: 12px; padding: 10px 14px; }
.mc .ico { font-size: 2rem; }
.mc .nom { font-weight: 800; }
.mc .pct { margin-left: auto; font-weight: 800; font-size: 1.1rem; color: var(--oro); }

.compartir { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.compartir .btn { width: 100%; }
.compartir .ancho { grid-column: 1 / -1; }
.aviso-copiado { text-align: center; color: var(--verde); font-weight: 800; min-height: 1.5em; margin-top: 8px; }

/* ---------- Galería ---------- */
.galeria { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.pj { background: var(--panel); border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; }
.pj summary {
  list-style: none; cursor: pointer; padding: 14px; text-align: center; display: grid; gap: 4px;
  border-top: 3px solid var(--c);
}
.pj summary::-webkit-details-marker { display: none; }
.pj .ico { font-size: 2.2rem; }
.pj .nom { font-weight: 800; font-size: .95rem; }
.pj .lem { font-size: .8rem; color: var(--muted); }
.pj[open] { grid-column: 1 / -1; }
.pj[open] .det { padding: 0 16px 16px; }
.pj .det p { margin: 0 0 .6em; font-size: .95rem; }

/* ---------- FAQ y pie ---------- */
.info-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .info-grid { grid-template-columns: repeat(3, 1fr); } }
.faq { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; }
.faq p { color: var(--muted); }
.pie { text-align: center; padding: 48px 16px 36px; font-size: .95rem; }

/* ---------- Confeti ---------- */
.confeti { position: fixed; top: -40px; z-index: 40; pointer-events: none; font-size: 1.4rem; animation: caer linear forwards; }
@keyframes caer { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Russo One sólo tiene un grosor: evitar negritas sintéticas */
.hero h1, .titulo-sec, .capitulo h2, .heroe h1, .hud-acto, .num-pregunta, .antetitulo, .grupo-stats h3, .marca { font-weight: 400; }

/* ---------- Enlaces a las páginas de personaje ---------- */
.enlace-pj { color: var(--oro); font-weight: 800; text-decoration: none; }
.enlace-pj:hover { text-decoration: underline; }

/* Galería estática: cada tarjeta lleva a la página del personaje */
.pj-enlace {
  display: grid; gap: 4px; text-align: center; align-content: start; padding: 14px; min-width: 0;
  background: var(--panel); border: 1px solid var(--borde); border-top: 3px solid var(--c); border-radius: 14px;
  color: var(--texto); text-decoration: none; transition: transform .12s ease, border-color .12s ease;
}
.pj-enlace:hover { transform: translateY(-3px); border-color: var(--c); }
.pj-enlace .ico { font-size: 2.2rem; }
.pj-enlace .nom { font-weight: 800; font-size: .95rem; }
.pj-enlace .lem { font-size: .8rem; color: var(--muted); }
.pj-enlace[aria-current="page"] { outline: 2px solid var(--c); outline-offset: 2px; }

/* ---------- Página de un personaje ---------- */
.migas { font-size: .85rem; color: var(--muted); margin: 6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.migas a { color: var(--muted); }
.migas a:hover { color: var(--oro); }
.tambien { color: var(--muted); font-weight: 700; margin-top: -4px; }
.cta-test { text-align: center; display: grid; gap: 12px; justify-items: center; }
.cta-test p { color: var(--muted); max-width: 30em; }
.rasgos { display: grid; gap: 10px; }
.rasgo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rasgo .ico { font-size: 1.6rem; }
.rasgo .tit { font-weight: 800; }
.rasgo .muted { font-size: .9rem; }
.nivel { font-size: .8rem; font-weight: 800; padding: .25em .7em; border-radius: 999px; white-space: nowrap; }
.nivel-alto { background: rgba(74, 222, 128, .15); color: #86efac; }
.nivel-bajo { background: rgba(255, 107, 107, .15); color: #fca5a5; }
.mini .h3 { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
