/* Rueda: noche azul para el vestíbulo y el menú, contenido claro y el color de cada carrera como acento. Sora como única voz */
:root {
  --bg: #f4f5fb; --sup: #ffffff; --tinta: #141627; --suave: #646a8f; --linea: #e5e7f1;
  --noche: #0e1020; --panel: #141627; --apagado: #8b90b8;
  --acento: var(--carrera, #7d6bff); --acento2: color-mix(in srgb, var(--acento) 13%, #fff);
  --amarillo: #ffd166; --rosa: #ff8fab; --menta: #7be0c3; --azul: #9cc9ff;
  --bien: #177a52; --mal: #c23a3a;
  --font: "Sora", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { display: grid; grid-template-columns: 96px minmax(0, 1fr); background: var(--bg); color: var(--tinta); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: geometricPrecision; font-synthesis: none; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
h1 { font: 700 clamp(32px, 3.6vw, 48px)/1.08 var(--font); letter-spacing: -.03em; text-wrap: balance; }
h2 { font: 600 24px/1.2 var(--font); letter-spacing: -.02em; }
h3 { font-size: 17px; font-weight: 600; }
.sub { color: var(--suave); font-size: 15px; }
.error { color: var(--mal); font-size: 15px; }
.ok { color: var(--bien); font-size: 15px; }

/* Escudo de carrera */
.escudo { position: relative; display: grid; place-items: center; align-content: center; gap: 2%; width: 100%; aspect-ratio: 110 / 124; color: var(--t, #fff); }
.escudo .hx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.escudo .ic { position: relative; width: 40%; height: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.escudo small { position: relative; font-size: 1em; font-weight: 800; letter-spacing: .1em; line-height: 1; }

/* Menú lateral de iconos */
#menu { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0 18px; background: var(--panel); min-height: 0; overflow-y: auto; scrollbar-width: none; }
#menu::-webkit-scrollbar { display: none; }
#marca { flex: none; width: 56px; margin-bottom: 14px; font-size: 9px; transition: transform .5s var(--ease); }
#marca:hover { transform: rotate(-8deg) scale(1.06); }
#enlaces { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.enlace { position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: var(--apagado); transition: background .25s, color .25s, transform .35s var(--ease); }
.enlace svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.enlace:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.enlace.on { background: var(--acento); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--acento) 45%, transparent); }
.enlace span { position: fixed; left: 86px; z-index: 40; padding: 6px 12px; border-radius: 10px; background: var(--tinta); color: #fff; font-size: 14px; white-space: nowrap; opacity: 0; transform: translateX(-6px); pointer-events: none; transition: opacity .2s, transform .3s var(--ease); }
.enlace:hover span, .enlace:focus-visible span { opacity: 1; transform: none; }
#abrirAjustes { margin-top: 6px; }

#vista { min-width: 0; overflow-y: auto; padding: 30px clamp(16px, 3vw, 44px) 110px; overscroll-behavior: contain; }
.pagina { display: grid; gap: 22px; max-width: 1380px; margin: 0 auto; }
.fila { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.entre { justify-content: space-between; }
.boton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--tinta); color: #fff; font-weight: 600; text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s; }
.boton:hover { transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--acento) 35%, transparent); }
.boton:active { transform: scale(.97); }
.boton:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.sec { background: var(--acento2); color: var(--tinta); }
.sec:hover { box-shadow: none; background: color-mix(in srgb, var(--acento) 22%, #fff); }
.entrar { background: linear-gradient(90deg, var(--c, var(--acento)), #7d6bff); color: #fff; }
.tenue { color: var(--suave); font-size: 15px; }
.tenue:hover { color: var(--tinta); }
.campo, select.campo, textarea.campo { min-height: 44px; padding: 8px 14px; border: 1px solid var(--linea); border-radius: 14px; background: var(--sup); min-width: 0; }
textarea.campo { width: 100%; resize: vertical; }
.bloque { position: relative; display: grid; gap: 10px; padding: 26px; border-radius: 24px; background: var(--sup); min-width: 0; box-shadow: 0 10px 30px rgba(20, 22, 39, .05); transition: transform .45s var(--ease), box-shadow .3s; }
.bloque:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(20, 22, 39, .09); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.lista { display: grid; gap: 2px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 11px 2px; border-bottom: 1px solid var(--linea); text-align: left; min-width: 0; }
.item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
button.item:hover { color: var(--acento); }
.cifra { font: 600 54px/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.vacio { padding: 30px 0; color: var(--suave); }

/* Hoy */
.cab-hoy { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.cab-hoy .sub::first-letter { text-transform: uppercase; }
.buscador { display: flex; align-items: center; gap: 10px; width: min(340px, 100%); padding: 13px 20px; border-radius: 14px; background: var(--sup); color: var(--apagado); text-align: left; box-shadow: 0 6px 20px rgba(20, 22, 39, .05); transition: box-shadow .25s; }
.buscador:hover { box-shadow: 0 0 0 2px var(--acento); }
.buscador svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tablero-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(200px, auto); gap: 20px; }
.celda-f { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 26px; border-radius: 24px; background: var(--sup); text-align: left; min-width: 0; box-shadow: 0 10px 30px rgba(20, 22, 39, .06); transition: transform .45s var(--ease), box-shadow .3s; }
.celda-f:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20, 22, 39, .1); }
.grande { grid-column: span 2; grid-row: span 2; background: var(--panel); color: #fff; background-image: radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--acento) 30%, transparent), transparent 70%); }
.grande h2 { font-size: clamp(34px, 3.6vw, 52px); font-weight: 300; line-height: 1.08; letter-spacing: -.03em; }
.grande h2 b { font-weight: 700; color: color-mix(in srgb, var(--acento) 70%, #fff); }
.grande .boton { background: #fff; color: var(--tinta); }
.grande .sec { background: rgba(255, 255, 255, .12); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpis b { display: block; font-size: clamp(28px, 2.8vw, 40px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpis span { color: var(--apagado); font-size: 15px; }
.herr { align-items: flex-start; }
.herr-esc { width: 64px; font-size: 10px; transition: transform .5s var(--ease); }
.herr:hover .herr-esc { transform: rotate(-8deg) scale(1.06); }
.claude { background: var(--acento); color: #fff; }
.claude p { font-size: 18px; opacity: .92; }
.dias { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.dias i { flex: 1; min-height: 4px; border-radius: 9px 9px 3px 3px; background: var(--acento); transform-origin: 50% 100%; animation: crece .8s var(--ease) both; }
@keyframes crece { from { transform: scaleY(0); } }

/* Animaciones del inicio: solo transform y opacity, y las que se repiten son pocas y lentas */
.tablero-f .celda-f { position: relative; }
.celda-f::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .2), transparent 60%); opacity: 0; transition: opacity .3s; }
/* Sin girar la tarjeta: el texto se mantiene nítido; solo sube un poco y la luz sigue al puntero */
.celda-f.inclina { transform: translateY(-4px); }
.celda-f.inclina::after { opacity: 1; }
.titulo-anim .pal { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .1em; margin-bottom: -.1em; margin-right: .26em; }
.titulo-anim .pal > span { display: inline-block; animation: palabra 1s var(--ease) both; animation-delay: calc(var(--k) * 110ms + 150ms); }
@keyframes palabra { from { transform: translate3d(0, 110%, 0) rotate(5deg); } }
.grande { overflow: clip; isolation: isolate; }
.grande .decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora { position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; background: radial-gradient(32% 38% at 30% 30%, color-mix(in srgb, var(--acento) 42%, transparent), transparent 70%), radial-gradient(28% 34% at 74% 72%, rgba(125, 107, 255, .32), transparent 70%); animation: deriva 16s ease-in-out infinite alternate; will-change: transform; }
@keyframes deriva { to { transform: translate3d(7%, -6%, 0) rotate(10deg) scale(1.1); } }
.hexf { position: absolute; fill: none; stroke: color-mix(in srgb, var(--acento) 60%, transparent); stroke-width: 3; opacity: .55; animation: flotar 10s ease-in-out infinite alternate; }
.hexf polygon { stroke-dasharray: 1; stroke-dashoffset: 1; animation: traza 1.6s cubic-bezier(.65, 0, .35, 1) .5s forwards; }
.hexf.h0 { right: 6%; top: 9%; width: 120px; }
.hexf.h1 { right: 24%; top: 44%; width: 58px; animation-duration: 12s; animation-delay: -4s; }
.hexf.h1 polygon { animation-delay: .8s; }
.hexf.h2 { right: 5%; bottom: 10%; width: 82px; animation-duration: 14s; animation-delay: -7s; }
.hexf.h2 polygon { animation-delay: 1.1s; }
.hexf.h3 { right: 34%; top: 7%; width: 38px; animation-duration: 9s; }
.hexf.h3 polygon { animation-delay: 1.4s; }
@keyframes flotar { to { transform: translate3d(-16px, -24px, 0) rotate(20deg); } }
.grande h2 .linea { display: block; animation: linea .9s var(--ease) both; animation-delay: .25s; }
.grande h2 .linea + .linea { animation-delay: .4s; }
@keyframes linea { from { opacity: 0; transform: translate3d(0, 34px, 0); } }
.kpis > div { animation: linea .8s var(--ease) both; }
.kpis > div:nth-child(1) { animation-delay: .55s; }
.kpis > div:nth-child(2) { animation-delay: .65s; }
.kpis > div:nth-child(3) { animation-delay: .75s; }
.reloj-f { position: relative; display: grid; place-items: center; width: min(170px, 100%); aspect-ratio: 1; align-self: center; }
.reloj-f > span { position: absolute; inset: 0; }
.reloj-f .cifra { font-size: 40px; }
.anillo-f { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.anillo-f circle { fill: none; stroke: var(--acento); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: var(--avance, 0); transition: stroke-dashoffset 1s linear; animation: anilloEntra 1.6s var(--ease) .5s backwards; }
@keyframes anilloEntra { from { stroke-dashoffset: 1; } }
.dibuja .hx polygon, .dibuja .ic path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: traza 1.2s cubic-bezier(.65, 0, .35, 1) .6s forwards; }
.dibuja .ic path { animation-delay: 1.2s; }
.dibuja small { animation: sigla .6s var(--ease) 1.8s both; }
.dias i { animation-delay: calc(var(--k) * 80ms + 500ms); }
.claude { position: relative; overflow: clip; isolation: isolate; }
.claude > * { position: relative; }
.burbujas { position: absolute !important; inset: 0; z-index: -1; pointer-events: none; }
.burbujas::before, .burbujas::after { content: ""; position: absolute; width: 220px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .28), transparent); animation: deriva 9s ease-in-out infinite alternate; }
.burbujas::before { right: -60px; top: -80px; }
.burbujas::after { left: -70px; bottom: -110px; animation-duration: 12s; animation-direction: alternate-reverse; }
.escribe::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: text-bottom; background: currentColor; animation: parpadeo 1s steps(1) infinite; }
@keyframes parpadeo { 50% { opacity: 0; } }
#enlaces .enlace { animation: icono .6s var(--ease) both; animation-delay: calc(var(--k) * 55ms + 200ms); }
@keyframes icono { from { opacity: 0; transform: translate3d(-14px, 0, 0) scale(.8); } }
#marca .escudo { animation: sigla .8s var(--ease) both; }

/* Notas */
.notas { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.titulo { width: 100%; border: 0; background: none; outline: 0; font: 700 36px/1.1 var(--font); letter-spacing: -.03em; }
.editor { min-height: 52vh; outline: 0; font-size: 17px; line-height: 1.75; }
.editor:empty::before { content: "Escribe. Usa # para títulos y - para listas."; color: var(--suave); }
.editor h2 { margin: 16px 0 4px; }
.nota-item.on { color: var(--acento); font-weight: 600; }

/* Vestíbulo: la rueda de escudos sobre noche azul */
#lobby { position: fixed; inset: 0; z-index: 30; overflow: hidden; color: #fff; background: radial-gradient(55% 50% at 50% 52%, color-mix(in srgb, var(--c, #7d6bff) 22%, #1d2150), var(--noche) 75%); transition: background .8s ease; clip-path: circle(150% at 50% 50%); animation: lobEntra .9s var(--ease) both; }
#lobby[hidden] { display: none; }
#lobby.sale { animation: lobSale .9s var(--ease) forwards; }
@keyframes lobSale { to { clip-path: circle(0% at 50% 50%); } }
@keyframes lobEntra { from { clip-path: circle(0% at 50% 50%); } }
#lobby .lob-panal { position: absolute; inset: 0; }
.lob-cab { position: absolute; left: clamp(20px, 5vw, 70px); top: clamp(24px, 7vh, 70px); z-index: 120; display: grid; gap: 10px; max-width: 360px; pointer-events: none; }
.lob-marca { font-size: 15px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--apagado); }
.lob-cab h1 { font-size: clamp(40px, 5vw, 66px); font-weight: 300; line-height: 1.04; }
.lob-cab h1 b { font-weight: 700; }
.lob-cab p { color: #9aa0c8; font-size: 17px; }
.lob-info { position: absolute; right: clamp(20px, 5vw, 70px); bottom: clamp(24px, 7vh, 70px); z-index: 120; display: grid; justify-items: end; gap: 4px; text-align: right; }
.lob-nombre { font-size: clamp(28px, 3.4vw, 46px); font-weight: 700; letter-spacing: -.03em; }
.lob-nombre.cambia, .lob-nombre.cambia + .lob-area { animation: sube .6s var(--ease) both; }
.lob-area { color: #9aa0c8; font-size: 17px; }
.lob-info .boton { margin-top: 18px; min-height: 54px; padding: 0 36px; font-size: 17px; }

/* Panal de abeja: cada celda se dibuja sola, contorno, luego icono y al final la sigla */
.panal { position: relative; }
.panal-fondo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.panal-fondo polygon { fill: rgba(125, 107, 255, .04); stroke: rgba(165, 175, 255, .2); stroke-width: 1.2; stroke-linejoin: round; opacity: 0; transform-box: fill-box; transform-origin: center; animation: brota 1.3s var(--ease) var(--d) forwards; }
.listo .panal-fondo polygon { animation: none; opacity: var(--op); }
@keyframes brota { from { opacity: 0; transform: scale(.55); } to { opacity: var(--op); transform: none; } }
.alveolo { position: absolute; z-index: 1; padding: 0; transition: transform .45s var(--ease), filter .45s ease; }
.alveolo .escudo { pointer-events: none; animation: brotar .9s var(--ease) both; animation-delay: calc(var(--i) * 130ms + 100ms); }
@keyframes brotar { from { opacity: 0; transform: scale(.55); } }
/* Destello del color de la carrera al terminar de dibujarse, y luego un brillo suave que recorre el panal */
.alveolo::before { content: ""; position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 60%, transparent), transparent); opacity: 0; pointer-events: none; animation: destello 1.3s ease-out forwards, respira 7s ease-in-out infinite; animation-delay: calc(var(--i) * 130ms + 1.7s), calc(var(--i) * 450ms + 4.2s); }
@keyframes destello { 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes respira { 0%, 100% { opacity: 0; } 50% { opacity: .5; } }
.alveolo .hx polygon { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; transition: fill .4s ease; animation: traza 1.2s cubic-bezier(.65, 0, .35, 1) forwards, rellena .7s ease forwards; animation-delay: calc(var(--i) * 130ms + 200ms), calc(var(--i) * 130ms + 1200ms); }
.alveolo .ic path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: traza 1.1s ease-in-out forwards; animation-delay: calc(var(--i) * 130ms + 850ms); }
.alveolo small { opacity: 0; animation: sigla .6s var(--ease) forwards; animation-delay: calc(var(--i) * 130ms + 1500ms); }
@keyframes traza { to { stroke-dashoffset: 0; } }
@keyframes rellena { to { fill-opacity: 1; } }
@keyframes sigla { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
button.alveolo:hover { z-index: 2; transform: translateY(-4px) scale(1.04); }
.alveolo.on { z-index: 3; transform: scale(1.1); filter: drop-shadow(0 0 22px color-mix(in srgb, var(--c) 60%, transparent)); }
.alveolo.on .hx polygon { fill: color-mix(in srgb, var(--c) 30%, #141836); }
.flecha { width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 28px; line-height: 1; transition: background .2s, transform .25s var(--ease); }
.flecha:hover { background: rgba(255, 255, 255, .2); transform: scale(1.06); }
body.en-lobby { overflow: hidden; }

/* Herramientas de cada carrera */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dato { display: grid; gap: 6px; font-weight: 500; }
.destacado { background: var(--acento2); align-content: start; }
.resultados { display: grid; gap: 14px; }
.resultado { display: grid; gap: 2px; }
.resultado b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.plantilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plantilla .bloque:hover { transform: none; }
.sistemas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sistema { padding: 16px; border-radius: 18px; background: var(--sup); text-align: left; font-weight: 600; transition: transform .3s var(--ease), background .2s; }
.sistema:hover { transform: translateY(-3px); }
.sistema.on { background: var(--acento2); }
.sistema.marcado { box-shadow: inset 4px 0 0 var(--acento); }
.cuenta-t { display: grid; grid-template-columns: 1fr 1fr; border-top: 3px solid var(--tinta); }
.lado { display: grid; align-content: start; gap: 6px; padding: 12px; }
.lado + .lado { border-left: 3px solid var(--tinta); }
.mov { display: flex; justify-content: space-between; gap: 8px; font-size: 18px; }
.mov .quitar { opacity: .6; }
.total { font-weight: 700; padding-top: 6px; border-top: 1px solid var(--linea); }
.saldo { font-size: 22px; font-weight: 700; color: var(--acento); }

/* Tablero de notas */
.cinta { display: flex; justify-content: space-around; height: 72px; margin-bottom: -6px; overflow: hidden; border-radius: 22px; background: var(--panel); }
.cinta i { width: 96px; height: 96px; margin-top: -54px; transform: rotate(45deg); border-radius: 8px; animation: cuelga .9s var(--ease) both; }
.cinta i:nth-child(1) { background: var(--menta); }
.cinta i:nth-child(2) { background: var(--rosa); animation-delay: 80ms; }
.cinta i:nth-child(3) { background: var(--azul); animation-delay: 160ms; }
.cinta i:nth-child(4) { background: var(--amarillo); animation-delay: 240ms; }
@keyframes cuelga { from { transform: rotate(45deg) translate(-34px, -34px); } }
.seccion-n { display: grid; gap: 12px; }
.seccion-n h2 { padding: 7px 14px; border-radius: 12px; background: var(--sup); font-size: 18px; }
.columnas-n { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col-n { display: grid; gap: 9px; padding: 13px; border-radius: 22px; min-height: 170px; transition: transform .3s var(--ease), box-shadow .25s; }
.col-n.azul { background: #dcecff; } .col-n.amarilla { background: #fff1c9; } .col-n.menta { background: #d6f5ea; } .col-n.rosa { background: #ffe0e8; }
.col-n.sobre { transform: scale(1.015); box-shadow: 0 0 0 3px var(--acento); }
.cuerpo-n { display: grid; gap: 8px; }
.nota-c { display: grid; gap: 7px; padding: 12px 14px; border-radius: 16px; background: var(--sup); cursor: grab; min-width: 0; box-shadow: 0 3px 10px rgba(20, 22, 39, .07); transition: transform .3s var(--ease), box-shadow .25s, opacity .2s; }
.nota-c:hover { transform: translateY(-2px) rotate(-.4deg); box-shadow: 0 8px 18px rgba(20, 22, 39, .13); }
.nota-c.arrastra { opacity: .45; }
.nota-t { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.nota-t:hover { color: var(--acento); }
.nota-p { color: var(--suave); font-size: 15px; overflow-wrap: anywhere; }
.nota-p:empty { display: none; }
.tareas-n { display: grid; gap: 3px; }
.tarea-n { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 7px; font-size: 15px; overflow-wrap: anywhere; }
.tarea-n input { margin-top: 4px; accent-color: var(--acento); }
.tarea-n.hecha span { color: var(--suave); text-decoration: line-through; }
.quitar { color: var(--suave); line-height: 1.3; opacity: 0; transition: opacity .15s; }
.tarea-n:hover .quitar, .quitar:focus-visible { opacity: 1; }
.nuevo-n { width: 100%; padding: 6px 10px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .6); font-size: 15px; outline-offset: 1px; }

/* Quiz */
.avance { height: 9px; border-radius: 9px; background: var(--acento2); overflow: hidden; }
.avance i { display: block; height: 100%; border-radius: 9px; background: var(--acento); transition: width .5s var(--ease); }
.enunciado { font-size: clamp(22px, 2.4vw, 30px); overflow-wrap: anywhere; }
.opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opcion { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 20px; background: var(--sup); text-align: left; font-size: 17px; overflow-wrap: anywhere; min-width: 0; box-shadow: 0 4px 14px rgba(20, 22, 39, .06); transition: transform .3s var(--ease), background .2s; }
.opcion b { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--acento2); color: var(--tinta); }
.opcion:not(:disabled):hover { transform: translateY(-3px); background: var(--acento2); }
.opcion:disabled { cursor: default; color: var(--tinta); }
.opcion.bien { background: var(--menta); animation: acierto .5s var(--ease); }
.opcion.mal { background: var(--rosa); animation: fallo .4s ease; }
@keyframes acierto { 40% { transform: scale(1.03); } }
@keyframes fallo { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Libros */
.pregunta { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--linea); }
.cita { padding: 10px 14px; border-radius: 14px; background: var(--acento2); font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }

/* Lector tipo libro */
.lector { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; background: radial-gradient(60% 60% at 50% 50%, #1d2150, var(--noche) 78%); animation: lecEntra .5s var(--ease) both; }
.lector.sale { animation: lecSale .4s ease forwards; }
@keyframes lecEntra { from { opacity: 0; transform: scale(1.03); } }
@keyframes lecSale { to { opacity: 0; transform: scale(1.02); } }
body.leyendo #abrirPanel { opacity: 0; pointer-events: none; }
.lec-cab { display: flex; align-items: center; gap: 16px; padding: 16px max(16px, env(safe-area-inset-left)) 8px; }
.lec-cerrar { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-weight: 600; transition: background .2s; }
.lec-cerrar:hover { background: rgba(255, 255, 255, .2); }
.lec-titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lec-cuenta { color: #9aa0c8; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mesa { display: grid; place-items: center; min-height: 0; }
.libro { position: relative; width: calc(var(--w) * 2); height: var(--h); perspective: 2800px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .5)); }
.libro.sencillo { width: var(--w); }
.hoja, .giro { position: absolute; top: 0; width: var(--w); height: var(--h); }
.hoja { overflow: hidden; background: #fbf8f1; }
.hoja.izq { left: 0; border-radius: 6px 0 0 6px; }
.hoja.der { left: var(--w); border-radius: 0 6px 6px 0; }
.sencillo .hoja.izq { display: none; }
.sencillo .hoja.der, .sencillo .giro.der { left: 0; }
.hoja.vacia { background: transparent; }
/* Sombra del lomo y la que proyecta la hoja al levantarse */
.hoja::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.hoja.izq::after { background: linear-gradient(270deg, rgba(0, 0, 0, .16), transparent 9%); }
.hoja.der::after { background: linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 9%), linear-gradient(90deg, rgba(0, 0, 0, calc(var(--luz, 0) * .35)), transparent 60%); }
.hoja.vacia::after { display: none; }
.lomo { position: absolute; left: calc(var(--w) - 1px); top: 0; width: 2px; height: 100%; z-index: 4; background: rgba(0, 0, 0, .18); }
.sencillo .lomo { display: none; }
.giro { z-index: 5; transform-style: preserve-3d; will-change: transform; }
.giro[hidden] { display: none; }
.giro.der { left: var(--w); transform-origin: 0 50%; }
.giro.izq { left: 0; transform-origin: 100% 50%; }
.cara { position: absolute; inset: 0; overflow: hidden; background: #fbf8f1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cara.dorso { transform: rotateY(180deg); }
.cara::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--luz, 0); }
.giro.der .frente::after, .giro.izq .dorso::after { background: linear-gradient(90deg, rgba(0, 0, 0, .22), transparent 25%, rgba(255, 255, 255, .25) 70%, rgba(0, 0, 0, .12)); }
.giro.der .dorso::after, .giro.izq .frente::after { background: linear-gradient(270deg, rgba(0, 0, 0, .22), transparent 25%, rgba(255, 255, 255, .25) 70%, rgba(0, 0, 0, .12)); }
.hoja canvas, .cara canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Con el PDF original la hoja es blanca, como el papel del documento */
.libro.pdf .hoja:not(.vacia), .libro.pdf .cara { background: #fff; }
.texto-pag { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; padding: 8% 9% 5%; color: #2a2620; font: 400 clamp(11px, calc(var(--h) / 48), 16px)/1.6 "Literata", Georgia, serif; }
.texto-pag p { overflow: hidden; white-space: pre-line; text-align: justify; hyphens: auto; }
.texto-pag small { justify-self: center; padding-top: 8px; color: #8a8174; font-size: 12px; }
.lec-pie { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); }
.lec-pie .flecha:disabled { opacity: .3; cursor: default; }
.lec-barra { width: min(420px, 55vw); accent-color: #7d6bff; }

/* Horario */
.tabla { overflow-x: auto; }
.horario { display: grid; grid-template-columns: 44px repeat(6, minmax(92px, 1fr)); position: relative; min-width: 640px; }
.dia { height: 28px; font-size: 14px; color: var(--suave); text-align: center; }
.hora { height: 44px; font-size: 13px; color: var(--suave); }
.celda { height: 44px; border-top: 1px solid var(--linea); border-left: 1px solid var(--linea); }
.clase { position: absolute; padding: 5px 9px; border-radius: 12px; background: var(--acento2); box-shadow: inset 3px 0 0 var(--acento); font-size: 14px; line-height: 1.25; overflow: hidden; text-align: left; font-weight: 500; transition: transform .25s var(--ease); }
.clase:hover { transform: scale(1.02); }

/* Repaso */
.tarjeta { display: grid; gap: 14px; min-height: 240px; align-content: center; padding: 32px; border-radius: 26px; background: var(--panel); color: #fff; background-image: radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--acento) 32%, transparent), transparent 70%); }
.tarjeta .sub { color: var(--apagado); }
.tarjeta .boton { background: #fff; color: var(--tinta); }
.tarjeta .sec { background: rgba(255, 255, 255, .12); color: #fff; }
.tarjeta .cita { background: rgba(255, 255, 255, .1); }

/* Odontograma */
.arcada { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; min-width: 620px; }
.diente { display: grid; gap: 3px; justify-items: center; padding: 6px 0; border-radius: 12px; transition: background .2s, transform .35s var(--ease); }
.diente:hover { background: var(--acento2); transform: translateY(-4px); }
.diente.on { background: var(--amarillo); }
.diente svg { width: 24px; height: 32px; fill: #fff; stroke: currentColor; stroke-width: 1.4; shape-rendering: geometricPrecision; }
.diente span { font-size: 13px; font-variant-numeric: tabular-nums; }
.diente.marcado span { color: var(--acento); font-weight: 700; }

/* Ficha de cada pieza dental */
.detalle-d { gap: 12px; }
.detalle-d > * { animation: linea .5s var(--ease) both; }
.detalle-d > :nth-child(2) { animation-delay: .04s; } .detalle-d > :nth-child(3) { animation-delay: .08s; } .detalle-d > :nth-child(4) { animation-delay: .12s; }
.detalle-d > :nth-child(5) { animation-delay: .16s; } .detalle-d > :nth-child(6) { animation-delay: .2s; } .detalle-d > :nth-child(n+7) { animation-delay: .24s; }
.detalle-d h3 { margin-top: 6px; color: var(--suave); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.chip-d { padding: 5px 12px; border-radius: 999px; background: var(--acento2); color: var(--tinta); font-size: 14px; font-weight: 600; }
.crono-d { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.crono-d.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dato-d { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--bg); box-shadow: inset 3px 0 0 var(--acento); }
.dato-d span { color: var(--suave); font-size: 13px; }
.dato-d b { font-size: 17px; font-weight: 600; line-height: 1.3; }
.rasgos-d { display: grid; gap: 8px; padding: 0; list-style: none; }
.rasgos-d li { position: relative; padding-left: 22px; line-height: 1.5; }
.rasgos-d li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 9px; height: 10px; background: var(--acento); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }

/* Curiosidades: tarjetas con borde de luz del color de la carrera */
.curio-dest { position: relative; display: grid; gap: 14px; padding: clamp(24px, 4vw, 40px); border-radius: 28px; background: var(--panel); color: #fff; overflow: clip; isolation: isolate; }
.curio-dest::before { content: ""; position: absolute; inset: -40%; z-index: -1; background: radial-gradient(35% 35% at 30% 30%, color-mix(in srgb, var(--acento) 45%, transparent), transparent 70%), radial-gradient(30% 30% at 75% 75%, rgba(125, 107, 255, .35), transparent 70%); animation: deriva 14s ease-in-out infinite alternate; }
.curio-dest .tema { color: color-mix(in srgb, var(--acento) 55%, #fff); }
.curio-dest h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 700; letter-spacing: -.03em; }
.curio-dest p { max-width: 60ch; color: #c9cdf0; font-size: 18px; }
.curio-dest .boton { justify-self: start; background: #fff; color: var(--tinta); }
.curio-dest.cambia > * { animation: linea .6s var(--ease) both; }
.curios { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.curio { position: relative; display: grid; align-content: start; gap: 10px; padding: 24px; border-radius: 22px; background: var(--sup); text-align: left; box-shadow: 0 10px 30px rgba(20, 22, 39, .06); transition: transform .4s var(--ease), box-shadow .3s; }
.curio::before { content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; background: linear-gradient(140deg, var(--acento), transparent 45%, transparent 60%, rgba(125, 107, 255, .8)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; transition: opacity .3s; pointer-events: none; }
.curio:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(20, 22, 39, .12); }
.curio:hover::before { opacity: 1; }
.curio .num { position: absolute; right: 18px; top: 14px; color: var(--linea); font-size: 40px; font-weight: 800; line-height: 1; }
.tema { color: var(--acento); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.curio h3 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; padding-right: 40px; }
.curio p { color: var(--suave); font-size: 15px; line-height: 1.55; }
.curio .mas { color: var(--acento); font-size: 14px; font-weight: 600; }
.curio:not(.abierta) p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.curio.abierta .mas { display: none; }

/* Historia: línea de personajes con su retrato */
.linea-h { position: relative; display: grid; gap: 22px; padding-left: 28px; }
.linea-h::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: linear-gradient(var(--acento), rgba(125, 107, 255, .3)); }
.persona { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px; border-radius: 24px; background: var(--sup); box-shadow: 0 10px 30px rgba(20, 22, 39, .06); }
.persona::before { content: ""; position: absolute; left: -26px; top: 34px; width: 14px; height: 16px; background: var(--acento); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.retrato { width: 132px; aspect-ratio: 4 / 5; border-radius: 18px; overflow: clip; background: var(--panel); display: grid; place-items: center; color: #fff; font-size: 40px; font-weight: 700; }
.retrato img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: saturate(.9); transition: transform .6s var(--ease); }
.persona:hover .retrato img { transform: scale(1.05); }
.persona h3 { font-size: 24px; letter-spacing: -.02em; }
.persona .fechas { color: var(--suave); font-size: 14px; }
.persona .por { margin: 6px 0 8px; padding: 10px 14px; border-radius: 12px; background: var(--acento2); font-weight: 600; }
.persona .bio { color: var(--suave); line-height: 1.6; }
.persona:not(.abierta) .bio { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.persona .acciones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 14px; }
.persona .acciones a, .persona .acciones button { color: var(--acento); font-weight: 600; }

/* Análisis */
.barras { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; align-items: end; height: 150px; }
.barra { display: grid; align-content: end; gap: 4px; height: 100%; text-align: center; font-size: 12px; color: var(--suave); min-width: 0; }
.barra i { display: block; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--acento); transform-origin: 50% 100%; animation: crece .8s var(--ease) both; }

/* Claude */
#abrirPanel { position: fixed; right: 24px; bottom: 24px; z-index: 5; padding: 13px 22px; border-radius: 999px; background: var(--tinta); color: #fff; font-weight: 600; box-shadow: 0 12px 30px rgba(20, 22, 39, .3); transition: transform .3s var(--ease), opacity .2s; }
#abrirPanel:hover { transform: translateY(-3px); }
.con-panel #abrirPanel { opacity: 0; pointer-events: none; }
#panel { position: fixed; inset: 10px 10px 10px auto; z-index: 6; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(440px, calc(100vw - 20px)); border-radius: 26px; background: var(--sup); box-shadow: 0 20px 60px rgba(20, 22, 39, .26); transform: translate3d(106%, 0, 0); visibility: hidden; overflow: hidden; transition: transform .45s var(--ease), visibility 0s .45s; }
.con-panel #panel { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.pcab { display: grid; gap: 8px; padding: 18px; border-bottom: 1px solid var(--linea); }
#charla { display: grid; align-content: start; gap: 14px; overflow-y: auto; padding: 18px; overscroll-behavior: contain; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.yo { justify-self: end; max-width: 85%; padding: 8px 13px; border-radius: 16px; background: var(--acento2); }
.pie { display: grid; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.voz { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--acento2); color: var(--tinta); transition: background .2s, color .2s; }
.voz svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.voz.oyendo { background: var(--acento); color: #fff; }
.voz.oyendo::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--acento); opacity: .5; animation: oye 1.2s ease-out infinite; }
@keyframes oye { to { transform: scale(1.7); opacity: 0; } }
.pensando { display: inline-flex; gap: 5px; padding: 6px 2px; }
.pensando i { width: 8px; height: 8px; border-radius: 50%; background: var(--acento); animation: punto 1.1s ease-in-out infinite; }
.pensando i:nth-child(2) { animation-delay: .15s; }
.pensando i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 80%, 100% { opacity: .3; transform: translate3d(0, 0, 0); } 40% { opacity: 1; transform: translate3d(0, -5px, 0); } }
.chip { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--acento2); font-size: 14px; color: var(--tinta); transition: background .2s; }
.chip:hover { background: color-mix(in srgb, var(--acento) 22%, #fff); }

dialog { margin: auto; width: min(460px, calc(100vw - 32px)); padding: 26px; border: 0; border-radius: 24px; background: var(--sup); color: var(--tinta); }
dialog::backdrop { background: rgba(14, 16, 32, .5); }

/* Entradas */
.sube { animation: sube .7s var(--ease) both; animation-delay: var(--r, 0ms); }
@keyframes sube { from { opacity: 0; transform: translate3d(0, 22px, 0); } }
#intro { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--noche); pointer-events: none; animation: telon .9s var(--ease) .95s forwards; }
#intro > span:only-child { font: 300 clamp(90px, 20vw, 210px)/1 var(--font); color: #fff; letter-spacing: -.05em; animation: nombre 1.3s var(--ease) both; }
@keyframes nombre { from { opacity: 0; transform: scale(.82); } }
@keyframes telon { to { transform: translate3d(0, -100%, 0); visibility: hidden; } }

/* Portada */
body.portada { display: block; padding: 0; overflow-x: hidden; overflow-y: auto; height: auto; min-height: 100%; }
html:has(body.portada) { overflow-y: auto; height: auto; scroll-behavior: smooth; }
.marca { font: 700 22px/1 var(--font); letter-spacing: -.02em; }
.barra-p { position: fixed; inset: 14px clamp(14px, 3vw, 34px) auto; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 24px; border-radius: 999px; background: rgba(20, 22, 39, .72); color: #fff; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.barra-p .sec { background: rgba(255, 255, 255, .12); color: #fff; }
.portada main { position: relative; z-index: 1; display: grid; gap: 16px; padding: 92px clamp(14px, 3vw, 34px) 18px; }
.escena { display: grid; align-content: center; justify-items: start; gap: 16px; min-height: 74vh; padding: clamp(28px, 6vw, 76px); border-radius: 32px; background: var(--sup); box-shadow: 0 10px 30px rgba(20, 22, 39, .05); }
.escena > * { max-width: min(760px, 100%); opacity: 0; transform: translate3d(0, 30px, 0); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.escena.vista > * { opacity: 1; transform: none; }
.escena h1 { font-size: clamp(44px, 6.4vw, 92px); font-weight: 300; line-height: 1.02; letter-spacing: -.04em; }
.escena h1 b { font-weight: 700; }
.escena h2 { font-size: clamp(36px, 5vw, 72px); font-weight: 600; line-height: 1.04; letter-spacing: -.04em; }
.lema { max-width: 46ch; font-size: clamp(17px, 1.6vw, 21px); color: var(--suave); }
.escena .boton { min-height: 54px; padding: 0 30px; font-size: 17px; }
.heroe { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; min-height: 88vh; overflow: hidden; background: radial-gradient(50% 60% at 75% 50%, #262a66, var(--noche) 75%); color: #fff; }
.heroe-txt { display: grid; justify-items: start; gap: 18px; }
.heroe .sub { color: #9aa0c8; letter-spacing: .2em; text-transform: uppercase; font-size: 14px; }
.heroe .lema { color: #b5badb; }
.panal-p { width: 100%; aspect-ratio: 1.1; }
.heroe { position: relative; isolation: isolate; }
.heroe .decor { position: absolute; inset: 0; z-index: -1; max-width: none; overflow: clip; border-radius: inherit; pointer-events: none; }
.heroe > * { opacity: 1; transform: none; transition: none; }
/* Video de intro a pantalla completa */
.intro-video { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--noche); transition: opacity .8s ease; }
.intro-video[hidden] { display: none; }
.intro-video.fuera { opacity: 0; pointer-events: none; }
.intro-video video { width: 100%; height: 100%; object-fit: cover; }
.saltar { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.saltar:hover { background: rgba(255, 255, 255, .22); }
.saltar.sonar-intro { right: auto; left: max(16px, env(safe-area-inset-left)); }
.saltar[hidden] { display: none; }
.sonido-p { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; transition: background .2s; }
.sonido-p:hover { background: rgba(255, 255, 255, .22); }
.sonido-p svg, .sonido-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.heroe-txt.esperando { visibility: hidden; }
.heroe-txt.esperando > * { animation: none; }
.heroe-txt > * { animation: linea 1s var(--ease) both; }
.heroe-txt > :nth-child(2) { animation-delay: .12s; }
.heroe-txt > :nth-child(3) { animation-delay: .24s; }
.heroe-txt > :nth-child(4) { animation-delay: .36s; }

/* Demostraciones animadas de la portada: solo corren cuando su sección está a la vista */
.escena.con-demo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 70px); }
.txt { display: grid; justify-items: start; gap: 16px; }
.demo { width: 100%; }
.escena:not(.activa) .demo, .escena:not(.activa) .demo *, .escena:not(.activa) .aurora { animation-play-state: paused !important; }
.demo-cita { display: grid; gap: 14px; padding: 26px; border-radius: 22px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.demo-cita > * { animation: linea .8s var(--ease) both; }
.demo-cita .dq { font-size: 20px; font-weight: 600; animation-delay: .2s; }
.demo-cita blockquote { padding: 14px 18px; border-left: 3px solid #7d6bff; border-radius: 0 12px 12px 0; background: rgba(125, 107, 255, .12); color: #dfe2ff; font-size: 17px; animation-delay: .5s; }
.demo-cita mark { position: relative; color: inherit; background: none; }
.demo-cita mark::before { content: ""; position: absolute; inset: 0 -3px; z-index: -1; border-radius: 4px; background: rgba(255, 209, 102, .45); transform: scaleX(0); transform-origin: left; animation: subraya .8s var(--ease) 1.3s forwards; }
@keyframes subraya { to { transform: scaleX(1); } }
.demo-cita .dp { color: #9aa0c8; font-size: 14px; animation-delay: .8s; }
.demo-cita .dp b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 4px; border-radius: 50%; background: #2fc6a0; color: #0e1020; font-size: 13px; animation: salta .6s var(--ease) 1.9s both; }
@keyframes salta { from { transform: scale(0); } 60% { transform: scale(1.25); } }
.demo-cinta { display: grid; gap: 16px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.cinta-p { display: flex; gap: 14px; width: max-content; animation: cinta 110s linear infinite; }
.cinta-p.atras { animation-direction: reverse; animation-duration: 130s; }
@keyframes cinta { to { transform: translate3d(-50%, 0, 0); } }
.ficha-p { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.ficha-p .escudo { width: 44px; font-size: 5px; }
.ficha-p em { font-style: normal; font-weight: 600; font-size: 15px; }
.demo-repaso { display: grid; gap: 18px; justify-items: center; }
/* Tarjeta de repaso: la pregunta se desvanece y entra la respuesta, sin giros 3D que deformen el texto */
.volteo { position: relative; width: min(360px, 100%); aspect-ratio: 1.6; border-radius: 22px; background: var(--panel); box-shadow: 0 20px 40px rgba(20, 22, 39, .25); overflow: clip; }
.volteo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, #7d6bff, #2fc6a0); opacity: 0; animation: fondoResp 8s ease-in-out infinite; }
.lado-f { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 24px; color: #fff; text-align: center; font-size: 19px; font-weight: 600; animation: pregunta 8s ease-in-out infinite; }
.lado-f.dorso { font-size: 30px; animation-name: respuesta; }
.lado-f small { font-size: 14px; font-weight: 400; opacity: .9; }
@keyframes pregunta { 0%, 38% { opacity: 1; transform: none; } 46%, 92% { opacity: 0; transform: translate3d(0, -14px, 0); } 100% { opacity: 1; transform: none; } }
@keyframes respuesta { 0%, 42% { opacity: 0; transform: translate3d(0, 14px, 0); } 50%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translate3d(0, 14px, 0); } }
@keyframes fondoResp { 0%, 40% { opacity: 0; } 48%, 90% { opacity: 1; } 98%, 100% { opacity: 0; } }
.barras-p { display: flex; align-items: flex-end; gap: 8px; height: 70px; }
.barras-p i { width: 22px; border-radius: 7px 7px 3px 3px; background: #7d6bff; transform-origin: 50% 100%; animation: crece 1s var(--ease) both; }
.barras-p i:nth-child(1) { height: 30%; animation-delay: .2s; } .barras-p i:nth-child(2) { height: 55%; animation-delay: .3s; }
.barras-p i:nth-child(3) { height: 40%; animation-delay: .4s; } .barras-p i:nth-child(4) { height: 75%; animation-delay: .5s; }
.barras-p i:nth-child(5) { height: 60%; animation-delay: .6s; } .barras-p i:nth-child(6) { height: 90%; animation-delay: .7s; }
.barras-p i:nth-child(7) { height: 100%; animation-delay: .8s; background: #2fc6a0; }
.panal-p .panal-fondo { -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent); }
.escena:nth-child(2) { background: var(--panel); color: #fff; }
.escena:nth-child(2) .lema { color: #b5badb; }
.escena:nth-child(5) { justify-items: center; min-height: 86vh; background: radial-gradient(60% 60% at 50% 40%, #262a66, var(--noche) 80%); }
.caja { display: grid; gap: 14px; width: min(460px, 100%); padding: 28px; border-radius: 26px; background: var(--sup); color: var(--tinta); justify-items: start; }
.caja .boton { justify-content: center; }
.caja h2 { font-size: 36px; }
.caja .bloque { width: 100%; background: var(--acento2); box-shadow: none; }
.formulario { display: grid; gap: 10px; width: 100%; }
.formulario .campo { width: 100%; min-height: 48px; }
.pie-p { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 16px clamp(14px, 3vw, 34px) 28px; color: var(--suave); font-size: 15px; }
.pie-p a { color: var(--tinta); }
.texto-legal { position: relative; display: grid; gap: 14px; max-width: 680px; margin: 0 auto; padding: 48px 18px; }
.texto-legal h1 { font-size: clamp(38px, 7vw, 60px); }
.texto-legal h2 { margin-top: 12px; }
.texto-legal a { color: var(--tinta); }

@media (max-width: 1000px) {
  .tablero-f { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grande { grid-row: span 1; min-height: 300px; }
  .heroe { grid-template-columns: minmax(0, 1fr); }
  .panal-p { max-width: 560px; justify-self: center; }
  .escena.con-demo { grid-template-columns: minmax(0, 1fr); }
  .crono-d { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  #menu { grid-row: 2; flex-direction: row; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); overflow-x: auto; overflow-y: hidden; gap: 6px; }
  #marca { width: 40px; margin: 0 6px 0 0; font-size: 7px; }
  #enlaces { flex-direction: row; gap: 4px; }
  .enlace { width: 46px; height: 46px; border-radius: 14px; }
  .enlace span { display: none; }
  #abrirAjustes { margin: 0; }
  #vista { padding: 20px 16px 96px; }
  .tablero-f, .notas, .opciones, .calc, .plantilla { grid-template-columns: minmax(0, 1fr); }
  .grande { grid-column: span 1; }
  .crono-d.dos { grid-template-columns: minmax(0, 1fr); }
  .persona { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .retrato { width: 84px; border-radius: 14px; font-size: 28px; }
  .persona h3 { font-size: 20px; }
  .linea-h { padding-left: 22px; }
  .persona::before { left: -20px; }
  .columnas-n { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cifra { font-size: 44px; }
  .escena { min-height: 70vh; border-radius: 26px; }
  #abrirPanel { right: 14px; bottom: 84px; }
  .lob-cab { left: 20px; right: 20px; top: 22px; }
  .lob-cab h1 { font-size: 40px; }
  .lob-cab p { display: none; }
  .lob-info { left: 16px; right: 16px; bottom: 24px; justify-items: center; text-align: center; }
}
