/* ============ Celebración de ascenso de rango ============ */
body.asc-open { overflow: hidden; }
.ascend { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; overflow: hidden; color: #f2f5f9;
  background: radial-gradient(120% 90% at 50% 38%, #121821 0%, #07090d 55%, #020305 100%);
  padding: max(16px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  animation: ascIn .35s ease both; }
.ascend.out { opacity: 0; transition: opacity .28s ease; }
.asc-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.asc-light { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(42% 32% at 50% 40%, color-mix(in srgb, var(--m2) 42%, transparent), transparent 70%),
    radial-gradient(70% 50% at 50% 40%, color-mix(in srgb, var(--m1) 10%, transparent), transparent 75%); }
.asc-rays { position: absolute; left: 50%; top: 40%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--m1) 9%, transparent) 0deg 4deg, transparent 4deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 42%); mask: radial-gradient(circle, #000 0%, transparent 42%); }
.asc-beam { position: absolute; left: 50%; bottom: 0; width: 140px; height: 100%; margin-left: -70px; pointer-events: none; opacity: 0; transform-origin: bottom;
  background: linear-gradient(0deg, transparent, color-mix(in srgb, var(--m1) 55%, transparent) 50%, transparent); filter: blur(12px); }
.asc-skip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 2; background: none; border: 0; color: rgba(255, 255, 255, .55);
  font: inherit; font-size: .82rem; font-weight: 600; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.asc-skip:hover, .asc-skip:focus-visible { color: #fff; background: rgba(255, 255, 255, .06); }
.asc-stage { position: relative; z-index: 1; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.asc-eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .28em; text-transform: uppercase; color: color-mix(in srgb, var(--m1) 80%, #fff); margin: 0; }
.asc-emblem { position: relative; display: grid; place-items: center; width: 220px; height: 240px; margin: 4px 0 2px; }
.asc-ins { position: relative; filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .55)) drop-shadow(0 0 22px color-mix(in srgb, var(--m2) 45%, transparent)); }
.asc-ins .insignia { filter: none; }
.asc-ring { position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--m1) 80%, transparent); opacity: 0; }
.asc-sheen { position: absolute; inset: 10px 30px; pointer-events: none; overflow: hidden;
  -webkit-mask: radial-gradient(ellipse 46% 50% at 50% 50%, #000 62%, transparent 72%); mask: radial-gradient(ellipse 46% 50% at 50% 50%, #000 62%, transparent 72%); }
.asc-sheen::after { content: ""; position: absolute; top: -20%; bottom: -20%; width: 34%; left: 0; transform: translateX(-160%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); mix-blend-mode: overlay; }
.asc-title { margin: 6px 0 0; font-size: clamp(1.6rem, 7vw, 2.3rem); font-weight: 900; letter-spacing: -.01em; line-height: 1.1;
  background: linear-gradient(100deg, var(--m2) 0%, var(--m1) 45%, var(--m2) 55%, var(--m1) 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.asc-sub { margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.asc-transition { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; padding: 10px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.asc-transition > span:not(.asc-arrow) { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 96px; }
.asc-transition small { font-size: .7rem; color: rgba(255, 255, 255, .65); font-weight: 600; }
.asc-from { opacity: .55; filter: grayscale(.4); }
.asc-arrow { font-size: 1.4rem; color: color-mix(in srgb, var(--m1) 85%, #fff); }
.asc-msg { margin: 6px 0 0; font-size: 1rem; line-height: 1.45; color: rgba(255, 255, 255, .86); max-width: 340px; }
.asc-next { margin: 0; font-size: .8rem; color: rgba(255, 255, 255, .5); }
.asc-preview { margin: 0; font-size: .72rem; color: rgba(255, 255, 255, .4); }
.asc-continue { margin-top: 14px; min-width: 220px; height: 52px; border: 0; border-radius: 999px; font-weight: 800; font-size: 1.02rem; color: #15100a;
  background: linear-gradient(135deg, var(--m1), var(--m2)); box-shadow: 0 10px 30px color-mix(in srgb, var(--m2) 35%, transparent); }
.asc-continue:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Presentación del nivel (ascenso de nivel completo) */
.asc-levelup { position: absolute; top: 18%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; opacity: 0; pointer-events: none; }
.asc-levelup span { font-size: .9rem; font-weight: 800; letter-spacing: .5em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.asc-levelup b { font-size: clamp(5rem, 28vw, 8rem); font-weight: 900; line-height: 1; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff, var(--m1) 55%, var(--m0)); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* «LEYENDA» letra a letra */
.asc-legend-word { display: flex; gap: .18em; font-size: clamp(2rem, 10vw, 3rem); font-weight: 900; letter-spacing: .08em; margin-bottom: 2px;
  background: linear-gradient(180deg, #fff6d6, #ffd36b 50%, #b97a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.asc-legend-word span { display: inline-block; opacity: 0; }
.type-legend { background: radial-gradient(120% 90% at 50% 38%, #1d1606 0%, #0b0803 55%, #030201 100%); }
.type-legend .asc-eyebrow { color: #ffe9a8; }

/* ---------- Línea de tiempo (las demoras dependen del tipo) ---------- */
.ascend { --t-light: .05s; --t-emblem: .3s; --t-title: 1.15s; --t-trans: 1.55s; --t-msg: 1.95s; --t-btn: 2.9s; }
.ascend.type-level { --t-light: 1.9s; --t-emblem: 2.45s; --t-title: 3.4s; --t-trans: 3.9s; --t-msg: 4.5s; --t-btn: 5.6s; }
.ascend.type-legend { --t-light: 2.6s; --t-emblem: 3.25s; --t-title: 4.25s; --t-trans: 4.75s; --t-msg: 5.35s; --t-btn: 6.8s; }
.ascend .asc-eyebrow, .ascend .asc-emblem, .ascend .asc-title, .ascend .asc-sub, .ascend .asc-transition, .ascend .asc-msg, .ascend .asc-next, .ascend .asc-preview, .ascend .asc-continue { opacity: 0; }
.ascend.play .asc-light { animation: ascLight 1.2s ease var(--t-light) forwards; }
.ascend.play .asc-rays { animation: ascLight 1.6s ease var(--t-light) forwards, ascSpin 60s linear infinite; }
.ascend.play .asc-beam { animation: ascBeam 1.9s cubic-bezier(.2, .7, .2, 1) .15s forwards; }
.ascend.play .asc-eyebrow { animation: ascFade .6s ease calc(var(--t-emblem) - .15s) forwards; }
.ascend.play .asc-emblem { animation: ascReveal 1.1s cubic-bezier(.2, .9, .25, 1) var(--t-emblem) forwards; }
.ascend.play .asc-ring { animation: ascRing 1.3s ease-out calc(var(--t-emblem) + .45s) forwards; }
.ascend.play .asc-sheen::after { animation: ascSheen 1.1s ease-in-out calc(var(--t-emblem) + .8s) forwards; }
.ascend.play .asc-title { animation: ascFade .6s ease var(--t-title) forwards, ascShine 2.4s ease calc(var(--t-title) + .3s) 1; }
.ascend.play .asc-sub { animation: ascFade .6s ease calc(var(--t-title) + .15s) forwards; }
.ascend.play .asc-transition { animation: ascFade .6s ease var(--t-trans) forwards; }
.ascend.play .asc-msg { animation: ascFade .7s ease var(--t-msg) forwards; }
.ascend.play .asc-next, .ascend.play .asc-preview { animation: ascFade .6s ease calc(var(--t-msg) + .3s) forwards; }
.ascend.play .asc-continue { animation: ascFade .5s ease var(--t-btn) forwards; }
.ascend.play .asc-levelup { animation: ascLevel 2.3s cubic-bezier(.2, .8, .2, 1) .25s forwards; }
.ascend.play .asc-legend-word span { animation: ascLetter .7s ease calc(.5s + var(--i) * .16s) forwards; }
/* «Omitir» o final de la animación: todo en su estado final, sin bloquear */
.ascend.done .asc-eyebrow, .ascend.done .asc-emblem, .ascend.done .asc-title, .ascend.done .asc-sub, .ascend.done .asc-transition, .ascend.done .asc-msg,
.ascend.done .asc-next, .ascend.done .asc-preview, .ascend.done .asc-continue, .ascend.done .asc-light, .ascend.done .asc-legend-word span { animation: none; opacity: 1; transform: none; filter: none; }
.ascend.done .asc-rays { opacity: 1; animation: ascSpin 60s linear infinite; }
.ascend.done .asc-levelup, .ascend.done .asc-beam { display: none; }
/* Movimiento reducido: sin escalados ni partículas, solo el resultado */
.ascend.reduced *, .ascend.reduced *::after { animation: none !important; transition: none !important; }
.ascend.reduced .asc-eyebrow, .ascend.reduced .asc-emblem, .ascend.reduced .asc-title, .ascend.reduced .asc-sub, .ascend.reduced .asc-transition,
.ascend.reduced .asc-msg, .ascend.reduced .asc-next, .ascend.reduced .asc-preview, .ascend.reduced .asc-continue, .ascend.reduced .asc-light,
.ascend.reduced .asc-legend-word span { opacity: 1; }
.ascend.reduced .asc-levelup, .ascend.reduced .asc-beam, .ascend.reduced .asc-skip { display: none; }

@keyframes ascIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ascLight { from { opacity: 0; } to { opacity: 1; } }
@keyframes ascSpin { to { transform: rotate(360deg); } }
@keyframes ascFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ascReveal {
  0% { opacity: 0; transform: scale(.6); filter: blur(10px) brightness(2.4); }
  55% { opacity: 1; transform: scale(1.05); filter: blur(0) brightness(1.5); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}
@keyframes ascRing { 0% { opacity: .9; transform: scale(.45); } 100% { opacity: 0; transform: scale(2.1); } }
@keyframes ascSheen { from { transform: translateX(-160%) skewX(-18deg); } to { transform: translateX(360%) skewX(-18deg); } }
@keyframes ascShine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes ascBeam { 0% { opacity: 0; transform: scaleY(0); } 35% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); } }
@keyframes ascLevel {
  0% { opacity: 0; transform: scale(1.25); letter-spacing: .3em; filter: blur(8px); }
  30% { opacity: 1; transform: scale(1); filter: none; }
  75% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-24px) scale(.9); }
}
@keyframes ascLetter { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

@media (max-height: 640px) {
  .asc-emblem { width: 170px; height: 186px; }
  .asc-emblem .insignia { width: 130px; height: auto; }
  .asc-transition { margin: 4px 0 0; padding: 6px 10px; }
  .asc-continue { margin-top: 8px; height: 46px; }
}

/* ---------- Medalla desbloqueada / reto completado ---------- */
.award-fx { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 24px; color: #f4f6f8; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc2) 28%, #07090d) 0%, #07090d 70%); animation: awIn .3s ease both; }
.award-fx.is-challenge { --rc: #b9ff8a; --rc2: #00c853; }
.award-fx.r-comun { --rc: #e3e8f0; --rc2: #7d8798; } .award-fx.r-poco_comun { --rc: #69f0ae; --rc2: #00c853; } .award-fx.r-rara { --rc: #82b1ff; --rc2: #2962ff; } .award-fx.r-epica { --rc: #e08cff; --rc2: #9c27ff; } .award-fx.r-legendaria { --rc: #ffe08a; --rc2: #ff8f00; }
.award-fx.out { animation: awOut .26s ease both; }
.aw-stage { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; max-width: 360px; }
.aw-eyebrow { margin: 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rc); opacity: 0; animation: awUp .5s .15s ease both; }
.aw-emblem { position: relative; width: 150px; height: 150px; margin: 10px 0 6px; display: grid; place-items: center; }
.aw-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--rc); box-shadow: 0 0 40px color-mix(in srgb, var(--rc2) 60%, transparent), inset 0 0 30px color-mix(in srgb, var(--rc2) 40%, transparent); transform: scale(.2); opacity: 0; animation: awRing .7s .2s cubic-bezier(.2, 1.4, .4, 1) both; }
.aw-ic { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; color: #10131a;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--rc) 45%, var(--rc2) 100%); transform: scale(0) rotate(-40deg); animation: awPop .75s .3s cubic-bezier(.2, 1.5, .4, 1) both; }
.aw-ic svg { width: 56px; height: 56px; stroke-width: 2.2; }
.aw-sheen { position: absolute; inset: 19px; border-radius: 50%; overflow: hidden; pointer-events: none; }
.aw-sheen::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); transform: skewX(-18deg); animation: awSheen 1.1s 1s ease both; }
.aw-rarity { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--rc); padding: 3px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent); opacity: 0; animation: awUp .45s .75s ease both; }
.aw-title { margin: 2px 0 0; font-size: 1.7rem; opacity: 0; animation: awUp .5s .85s ease both; }
.aw-desc { margin: 0; color: #b7bfcc; opacity: 0; animation: awUp .5s .95s ease both; }
.aw-xp { margin: 4px 0 0; font-size: 1.4rem; font-weight: 800; color: var(--rc); opacity: 0; animation: awUp .5s 1.05s ease both; }
.aw-continue { margin-top: 16px; min-width: 180px; opacity: 0; animation: awUp .4s 1.15s ease both; }
.aw-burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.aw-burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 26px; border-radius: 3px; background: linear-gradient(var(--rc), transparent); transform: rotate(var(--a)) translateY(-20px) scaleY(0); opacity: 0; animation: awRay .9s calc(.35s + var(--d)) ease-out both; }
@keyframes awIn { from { opacity: 0; } }
@keyframes awOut { to { opacity: 0; transform: scale(1.03); } }
@keyframes awUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes awRing { to { transform: scale(1); opacity: 1; } }
@keyframes awPop { to { transform: scale(1) rotate(0); } }
@keyframes awSheen { to { left: 130%; } }
@keyframes awRay { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-40px) scaleY(.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) scaleY(1); } }
.award-fx.reduced, .award-fx.reduced * { animation-duration: .01s !important; animation-delay: 0s !important; }

/* Inicio: frase tocable y avisos que repiten la animación */
.home-quote { display: block; width: 100%; margin-top: 16px; padding: 0; background: none; border: 0; font: inherit; font-style: italic; text-align: left; cursor: pointer; color: var(--muted); }
.home-quote:hover { color: var(--text); }
.notif .notif-body { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.notif .notif-play { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--accent-text); font-weight: 700; }
.notif .notif-play svg { width: 12px; height: 12px; }
.notif.r-rara .ic { color: #82b1ff; } .notif.r-epica .ic { color: #e08cff; } .notif.r-legendaria .ic { color: #ffd36b; }
