/* Animaciones de entrada de las páginas de libro (dragón / libro del Mortusermo). */
#intro { position: fixed; inset: 0; z-index: 200; overflow: hidden; cursor: pointer; background: radial-gradient(ellipse at 50% 55%, rgba(28,9,13,.95), rgba(4,2,3,.98) 78%); animation: introIn .45s ease-out both; }
#intro.out { animation: introOut .6s ease-in forwards; pointer-events: none; }
@keyframes introIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes introOut { to { opacity: 0; } }
#intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#intro .skip { position: absolute; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(0,0,0,.35); color: #d9cdb8; border: 1px solid rgba(201,164,92,.5); border-radius: 999px; padding: .45rem 1.1rem; font: 600 .78rem/1 var(--sans, sans-serif); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; opacity: .85; }
#intro .skip:hover { color: #fff; border-color: #e0c486; }
.intro-cover-hidden { opacity: 0 !important; filter: blur(8px) !important; transform: scale(.94) !important; }
.intro-cover-reveal { transition: opacity .8s ease, filter .8s ease, transform .8s ease; }
.intro-cover-glow { animation: coverGlow 1.4s ease-out; }
@keyframes coverGlow { 0% { box-shadow: 0 0 0 rgba(201,164,92,0); } 30% { box-shadow: 0 0 60px 18px rgba(224,196,134,.75), 0 0 120px 40px rgba(194,57,79,.55); } 100% { box-shadow: 0 24px 50px rgba(0,0,0,.5); } }

/* --- dragón (óleo gótico, canvas) --- */
#intro canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#intro .dragon { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
#intro .dragon canvas.dg { position: relative; width: 100%; height: 100%; display: block; filter: brightness(1.45) contrast(1.08) saturate(1.1); }
#intro .dragon .aura { position: absolute; inset: -12% -8%; background: radial-gradient(closest-side, rgba(160,28,48,.38), rgba(110,16,34,.16) 55%, rgba(0,0,0,0) 80%); filter: blur(10px); pointer-events: none; }
.dragon-title { position: absolute; left: 0; right: 0; top: 12%; text-align: center; font-family: var(--display, serif); letter-spacing: .5em; text-transform: uppercase; color: #e0c486; font-size: clamp(.8rem, 2.4vw, 1.1rem); opacity: 0; animation: fadeUp 1.1s .5s ease-out forwards, fadeOutT .6s 3.2s forwards; text-shadow: 0 0 18px rgba(194,57,79,.9); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: .95; transform: none; } }
@keyframes fadeOutT { to { opacity: 0; } }

/* --- libro del Mortusermo --- */
#intro .fog { position: absolute; inset: -20%; pointer-events: none; }
#intro .fog i { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(190,185,190,.28), rgba(190,185,190,0) 70%); filter: blur(24px); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(-6%, 0, 0) scale(1); } to { transform: translate3d(8%, -4%, 0) scale(1.15); } }
#intro .fog.low i { animation-duration: 7s; }
#intro .fog.fade { animation: fogFade 4s ease-in 0s forwards; }
@keyframes fogFade { 0%,15% { opacity: 1; } 100% { opacity: .18; } }
#intro .mbook { position: absolute; left: 50%; top: 50%; width: min(94vw, 760px); transform: translate(-50%, -50%); animation: bookRise 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes bookRise { from { opacity: 0; transform: translate(-50%, -42%) scale(.92); filter: blur(10px); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); } }
#intro .mbook svg { width: 100%; height: auto; display: block; overflow: visible; }
#intro .a { opacity: 0; animation: aIn .8s var(--d, 0s) ease-out forwards; }
@keyframes aIn { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
#intro .star { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.4s 1.2s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
#intro .starfill { opacity: 0; animation: aIn .9s 2.3s ease-out forwards; }
#intro .eye { opacity: 0; animation: eyeOn 1s 2.3s ease-out forwards, eyePulse 1.8s 3.3s ease-in-out infinite; }
@keyframes eyeOn { to { opacity: 1; } }
@keyframes eyePulse { 50% { filter: drop-shadow(0 0 9px #ff2a3a); } }
#intro .piece { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pieceIn .7s var(--d) cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes pieceIn { from { opacity: 0; transform: scale(.2) rotate(-25deg); } to { opacity: 1; transform: none; } }
#intro .blood { fill: #b3122a; opacity: 0; animation: aIn .6s var(--d) ease-out forwards; font-family: var(--serif, serif); font-style: italic; }
#intro .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .21s infinite alternate ease-in-out; }
#intro .flame.b { animation-duration: .27s; animation-delay: -.1s; }
@keyframes flicker { 0% { transform: scale(1, 1) rotate(-2deg); opacity: .95; } 100% { transform: scale(.88, 1.14) rotate(3deg); opacity: .8; } }
#intro .halo { animation: halo .6s infinite alternate ease-in-out; }
@keyframes halo { from { opacity: .55; } to { opacity: .9; } }
.mort-title { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font-family: var(--display, serif); letter-spacing: .5em; text-transform: uppercase; color: #e0c486; font-size: clamp(.9rem, 3vw, 1.4rem); opacity: 0; animation: fadeUp 1s 3.2s ease-out forwards; text-shadow: 0 0 20px rgba(194,57,79,.9); }

/* enlace discreto para repetir la animación */
.replay-intro { background: none; border: 0; color: var(--muted); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; padding: .3rem 0; }
.replay-intro:hover { color: var(--gold); }

/* Versión tranquila (prefers-reduced-motion): solo desvanecidos */
#intro.calm .flame, #intro.calm .fog i { animation: none !important; }
#intro.calm .piece { animation-name: pieceFade; animation-duration: .9s; }
@keyframes pieceFade { from { opacity: 0; } to { opacity: 1; } }
