/* TikTok Wrapped — historia, pantallas de carga/listo y resumen final */
:root { --beat: .5357s; }
html.is-story, html.is-story body, html.is-ov, html.is-ov body { overflow: hidden; }

/* ================= pantalla (slide) ================= */
.sl { position: absolute; inset: 0; overflow: hidden; color: var(--fg); background: var(--bg); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
.sl__bg { position: absolute; inset: 0; background: var(--bg); }
.sl__art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sl__grain { position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: soft-light; background-size: 160px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.sl--enter { z-index: 2; animation: sweep .78s cubic-bezier(.75, 0, .2, 1) both; }
.sl--fade { z-index: 2; animation: fadeIn .35s ease both; }
.sl.is-leaving { z-index: 1; }
@keyframes sweep { from { clip-path: circle(0% at var(--cx, 80%) var(--cy, 50%)); } to { clip-path: circle(150% at var(--cx, 80%) var(--cy, 50%)); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sl__body { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + 22cqw) 8cqw calc(env(safe-area-inset-bottom, 0px) + 12cqw); pointer-events: none; }
.sl__body [data-ia], .sl__body button, .sl__body a { pointer-events: auto; }
.sl__body--top { justify-content: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 24cqw); }
.sl__body--tight { padding-bottom: 0; }
.sl__body--narrow { padding-right: 34cqw; }
.sl .k { font: 700 4.4cqw/1.2 var(--sans); letter-spacing: -0.005em; opacity: .92; }
.sl .t { font: 800 11.5cqw/.94 var(--display); font-variation-settings: "wdth" 82, "opsz" 96; letter-spacing: -0.035em; margin-top: 2.4cqw; overflow-wrap: anywhere; }
.sl .big { font: 800 var(--fs, 24cqw)/.84 var(--display); font-variation-settings: "wdth" 75, "opsz" 96; letter-spacing: -0.045em; margin-top: 2.6cqw; white-space: nowrap; }
.sl .u { font: 800 6.8cqw/1 var(--display); font-variation-settings: "wdth" 84, "opsz" 72; letter-spacing: -0.02em; margin-top: 1.8cqw; }
.sl .s { font: 500 4.75cqw/1.32 var(--sans); margin-top: 5cqw; max-width: 94%; }
.sl .n { font: 500 3.55cqw/1.38 var(--sans); margin-top: 3.4cqw; opacity: .78; max-width: 92%; }
.sticker { align-self: flex-start; margin-bottom: 4.2cqw; padding: 2.4cqw 4cqw 2.6cqw; border-radius: 99px; background: var(--a); color: var(--ai); font: 800 6cqw/1 var(--display); font-variation-settings: "wdth" 84; letter-spacing: -0.02em; rotate: -4deg; }
.handle { font: 800 var(--fs, 12cqw)/.96 var(--display); font-variation-settings: "wdth" 78, "opsz" 96; letter-spacing: -0.035em; margin-top: 3cqw; overflow-wrap: anywhere; }
.quote { font: 800 var(--fs, 9cqw)/1.02 var(--display); font-variation-settings: "wdth" 84, "opsz" 96; letter-spacing: -0.03em; margin-top: 4cqw; overflow-wrap: anywhere; }
.cq { margin-top: 2cqw; padding: 3.4cqw 4.2cqw; border-radius: 4.5cqw; background: color-mix(in srgb, var(--fg) 12%, transparent); font: 600 4.3cqw/1.35 var(--sans); overflow-wrap: anywhere; }

/* entradas */
.sl .a-in, .sl .a-pop { opacity: 0; }
.sl .a-rise .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.sl .a-rise .w > span { display: inline-block; transform: translateY(110%); }
.sl.is-on .a-in { animation: inUp .75s var(--ease) both; animation-delay: calc(var(--d, 0) * 110ms + 160ms); }
.sl.is-on .a-pop { animation: popIn .85s var(--spring) both; animation-delay: calc(var(--d, 0) * 110ms + 160ms); }
.sl.is-on .a-rise .w > span { animation: riseW .8s var(--ease) both; animation-delay: calc(var(--d, 0) * 110ms + var(--w, 0) * 65ms + 160ms); }
@keyframes inUp { from { opacity: 0; transform: translateY(5cqw); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.55) rotate(-5deg); } to { opacity: 1; transform: none; } }
@keyframes riseW { to { transform: none; } }

/* formas */
.sl__art .ring, .sl__art .beat, .sl__art .spin, .sl__art .pop, .sl__art .float, .sl__art .pulse { transform-box: fill-box; transform-origin: center; }
.sl__art .ring { animation: ripple calc(var(--beat) * 4) ease-in-out infinite; animation-delay: calc(var(--phase, 0s) - var(--i, 0) * .11s); }
.sl__art .beat { animation: beat var(--beat) cubic-bezier(.2, .7, .3, 1) infinite; animation-delay: calc(var(--phase, 0s) - var(--i, 0) * var(--beat) / 2); }
.sl__art .spin { animation: spin 26s linear infinite; }
.sl__art .scroll { animation: scrollUp calc(7s + var(--i, 0) * 1.3s) linear infinite; }
.sl__art .float { animation: floaty 4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.7s); }
.sl__art .twinkle { animation: twinkle 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.37s); }
.sl__art .pulse { animation: beat var(--beat) ease-out infinite; animation-delay: var(--phase, 0s); }
.sl__art .up { animation: upArrow 2.2s var(--ease) infinite; animation-delay: calc(var(--i, 0) * .22s); }
.sl__art .grow { transform-box: view-box; transform-origin: 50px 124px; transform: scale(0); }
.sl.is-on .sl__art .grow { animation: growR .9s var(--spring) both; animation-delay: calc(var(--i, 0) * 28ms + 250ms); }
.sl__art .cell { opacity: 0; }
.sl.is-on .sl__art .cell { animation: fadeIn .5s ease both; animation-delay: calc(var(--i, 0) * 22ms + 200ms); }
.sl__art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.sl.is-on .sl__art .draw { animation: draw 2.6s var(--ease) .3s both; }
.sl__art .pop { transform: scale(0); }
.sl.is-on .sl__art .pop { animation: popS .7s var(--spring) both; animation-delay: calc(var(--i, 0) * 90ms + 300ms); }
.sl__art .drop { transform: translateY(-200px); }
.sl.is-on .sl__art .drop { animation: dropIn .9s var(--spring) both; animation-delay: calc(var(--i, 0) * 110ms + 250ms); }
@keyframes ripple { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes beat { 0% { transform: scale(1.07); } 55%, 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scrollUp { from { transform: translateY(0); } to { transform: translateY(-150px); } }
@keyframes floaty { 50% { transform: translateY(-4px) rotate(6deg); } }
@keyframes twinkle { 50% { opacity: .15; } }
@keyframes upArrow { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
@keyframes growR { to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popS { to { transform: scale(1); } }
@keyframes dropIn { to { transform: none; } }

/* adivina */
.quiz { display: grid; gap: 3cqw; margin-top: 8cqw; }
.quiz__opt { display: flex; align-items: center; justify-content: space-between; padding: 4.2cqw 6cqw; border-radius: 99px; border: .55cqw solid color-mix(in srgb, var(--fg) 55%, transparent); background: transparent; color: var(--fg); font: 800 8.6cqw/1 var(--display); font-variation-settings: "wdth" 80; letter-spacing: -0.03em; text-align: left; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s, opacity .3s, transform .3s var(--spring); }
.quiz__opt:hover:not(:disabled) { border-color: var(--fg); transform: scale(1.02); }
.quiz__opt:disabled { cursor: default; }
.quiz__opt.is-right { background: var(--a); border-color: var(--a); color: var(--ai); transform: scale(1.04); }
.quiz__opt.is-wrong { opacity: .38; text-decoration: line-through; text-decoration-thickness: .5cqw; }
.quiz__fb { min-height: 1.2em; margin-top: 5cqw; font: 800 7cqw/1.05 var(--display); font-variation-settings: "wdth" 84; letter-spacing: -0.02em; }

/* ranking */
.rank { list-style: none; margin: 6cqw 0 0; padding: 0; display: grid; gap: 3cqw; }
.rank li { display: grid; grid-template-columns: 8.5cqw 1fr auto; align-items: baseline; gap: 2.4cqw; font: 700 5.4cqw/1.12 var(--sans); }
.rank b { font: 800 9.5cqw/.9 var(--display); font-variation-settings: "wdth" 75; letter-spacing: -0.04em; }
.rank li:first-child span { font: 800 7.4cqw/1 var(--display); font-variation-settings: "wdth" 84; letter-spacing: -0.03em; }
.rank span { overflow-wrap: anywhere; }
.rank em { font: 700 3.5cqw/1 var(--sans); font-style: normal; opacity: .7; white-space: nowrap; }

/* ticket */
.sl__body--receipt { justify-content: center; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 18cqw) 6cqw 8cqw; }
.rc { width: 80cqw; rotate: -2.2deg; filter: drop-shadow(0 3cqw 4cqw rgba(0, 0, 0, .22)); }
.rc__paper { background: #fffdf5; color: #17124a; padding: 6cqw 5.4cqw 7cqw; font: 600 3.25cqw/1.42 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 3.2cqw 51% repeat-x, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 3.2cqw 51% repeat-x;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 3.2cqw 51% repeat-x, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 3.2cqw 51% repeat-x; }
.rc__h { text-align: center; font: 800 6.4cqw/1 var(--display); font-variation-settings: "wdth" 80; letter-spacing: -0.01em; }
.rc__s { text-align: center; margin-top: 1.2cqw; letter-spacing: .12em; font-size: 2.7cqw; opacity: .8; }
.rc__m { display: flex; justify-content: space-between; gap: 2cqw; margin-top: 2cqw; font-size: 2.8cqw; }
.rc__m:first-of-type { margin-top: 4cqw; }
.rc hr { border: 0; border-top: .4cqw dashed rgba(23, 18, 74, .45); margin: 2.4cqw 0; }
.rc__row { display: flex; align-items: baseline; gap: 1.6cqw; }
.rc__row i { flex: 1; border-bottom: .4cqw dotted rgba(23, 18, 74, .38); transform: translateY(-.6cqw); }
.rc__row--b { font-weight: 800; font-size: 3.6cqw; }
.rc__paid { text-align: center; font-weight: 800; font-size: 3.8cqw; }
.rc__bar { display: flex; justify-content: center; align-items: stretch; gap: .55cqw; height: 9cqw; margin: 3.2cqw 0 2cqw; }
.rc__bar i { width: calc(var(--b) * .38cqw); background: #17124a; }
.rc__thx { text-align: center; letter-spacing: .14em; font-size: 2.7cqw; }
.sl .a-print { opacity: 1; clip-path: inset(0 0 100% 0); }
.sl.is-on .a-print { animation: print 2s steps(16, end) .25s both; }
@keyframes print { to { clip-path: inset(0 0 0 0); } }

/* vídeo repetido */
.ring-num { position: absolute; z-index: 2; left: 0; right: 0; top: 68.5%; transform-origin: center; translate: 0 -50%; text-align: center; font: 800 20cqw/1 var(--display); font-variation-settings: "wdth" 75; letter-spacing: -0.04em; pointer-events: none; }
.sl__foot { position: absolute; z-index: 3; left: 8cqw; right: 8cqw; bottom: calc(env(safe-area-inset-bottom, 0px) + 7cqw); display: flex; flex-wrap: wrap; gap: 2.4cqw; align-items: center; }
.sl__foot .n { flex-basis: 100%; margin-top: 1cqw; }
.pill { display: inline-flex; align-items: center; justify-content: center; padding: 3.2cqw 5cqw; border-radius: 99px; border: .45cqw solid currentColor; background: transparent; color: var(--fg); font: 700 4cqw/1 var(--sans); text-decoration: none; cursor: pointer; transition: transform .25s var(--spring), background-color .2s; }
.pill:hover { transform: scale(1.04); }
.pill--fg { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill--ghost { border-color: transparent; text-decoration: underline; text-underline-offset: 1cqw; }
.embed { position: absolute; z-index: 4; left: 50%; top: 58%; translate: -50% -50%; width: 70cqw; aspect-ratio: 9 / 16; max-height: 64cqh; border-radius: 4cqw; overflow: hidden; background: #000; box-shadow: 0 4cqw 8cqw rgba(0, 0, 0, .4); }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* intereses */
.tags { list-style: none; margin: 6cqw 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2.8cqw 2.2cqw; }
.tags li { padding: 3.2cqw 4.6cqw 3.4cqw; border-radius: 99px; background: var(--fg); color: var(--bg); font: 800 5.8cqw/1 var(--display); font-variation-settings: "wdth" 84; letter-spacing: -0.02em; rotate: var(--r, 0deg); }
.tags li:nth-child(3n + 2) { background: var(--a); color: var(--ai); }
.tags li:nth-child(3n) { background: var(--b); color: #fff; }

/* carta de personalidad */
.holo { position: absolute; z-index: 3; left: 50%; top: 57%; width: 74cqw; aspect-ratio: 63 / 88; max-height: 70cqh; translate: -50% -50%; perspective: 1400px; cursor: pointer; outline: none; }
.holo:focus-visible .holo__in { outline: .8cqw solid var(--a); outline-offset: 1.4cqw; border-radius: 5cqw; }
.holo__in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + 180deg)); transition: transform 1.1s var(--spring); }
.holo.is-open .holo__in { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.holo__front, .holo__back { position: absolute; inset: 0; border-radius: 5cqw; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.holo__front { transform: rotateY(180deg); background: repeating-linear-gradient(-38deg, #ff3d7f 0 7cqw, #ffd23f 7cqw 14cqw, #5b2eff 14cqw 21cqw, #2ef0e4 21cqw 28cqw); display: flex; align-items: flex-end; justify-content: center; box-shadow: 0 5cqw 10cqw -3cqw rgba(0, 0, 0, .6); animation: wiggle 2.4s ease-in-out infinite; }
.holo__ribbon { position: absolute; left: 50%; top: 0; bottom: 0; width: 9cqw; translate: -50% 0; background: #fff; box-shadow: 0 0 0 .8cqw rgba(0, 0, 0, .08); }
.holo__ribbon--h { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 9cqw; translate: 0 -50%; }
.holo__bow { position: absolute; left: 50%; top: 50%; width: 15cqw; height: 15cqw; translate: -50% -50%; rotate: 45deg; border-radius: 3cqw; background: #fff; box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, .18); }
.holo__front p { position: relative; margin-bottom: 6cqw; padding: 2.6cqw 5cqw; border-radius: 99px; background: #0b0b10; color: #fff; font: 800 4.4cqw/1 var(--display); font-variation-settings: "wdth" 86; letter-spacing: -0.01em; }
@keyframes wiggle { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -2.4deg; } 82% { rotate: 2.4deg; } 88% { rotate: -1.4deg; } 94% { rotate: 1deg; } }
.holo__back { display: flex; flex-direction: column; padding: 5.6cqw 5.6cqw 6cqw; color: #fff; background: radial-gradient(120% 80% at 80% 0%, #3b1fb0 0%, #17124a 45%, #0b0b10 100%); border: .5cqw solid rgba(255, 255, 255, .22); box-shadow: 0 5cqw 10cqw -3cqw rgba(0, 0, 0, .6); }
.holo__foil { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .55;
  background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255, 255, 255, .55), transparent 38%), repeating-linear-gradient(115deg, #ff3d7f 0%, #ffd23f 9%, #2ef0e4 18%, #5b2eff 27%, #ff3d7f 36%);
  background-size: 100% 100%, 320% 320%; background-position: 0 0, var(--mx, 30%) var(--my, 20%); animation: foil 6s linear infinite; }
@keyframes foil { to { background-position: 0 0, calc(var(--mx, 30%) + 100%) var(--my, 20%); } }
.holo__top { position: relative; display: flex; justify-content: space-between; gap: 2cqw; font: 700 2.8cqw/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.holo__back h3 { position: relative; margin-top: auto; font: 800 8.6cqw/.95 var(--display); font-variation-settings: "wdth" 80, "opsz" 96; letter-spacing: -0.035em; }
.holo__desc { position: relative; margin-top: 2.6cqw; font: 500 3.35cqw/1.36 var(--sans); opacity: .86; }
.holo__stats { position: relative; list-style: none; margin: 4.4cqw 0 0; padding: 0; display: grid; gap: 1.9cqw; }
.holo__stats li { display: grid; grid-template-columns: 17cqw 1fr 6cqw; align-items: center; gap: 2cqw; font: 700 3cqw/1 var(--sans); }
.holo__stats i { height: 1.8cqw; border-radius: 99px; background: rgba(255, 255, 255, .16); position: relative; overflow: hidden; }
.holo__stats i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: inherit; background: linear-gradient(90deg, #2ef0e4, #c6ff3a); }
.holo__stats b { text-align: right; font-variant-numeric: tabular-nums; }

/* resumen */
.sl__body--summary { justify-content: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 22cqw); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 7cqw); }
.sum__user { font: 800 9cqw/1 var(--display); font-variation-settings: "wdth" 80; letter-spacing: -0.03em; margin-top: 1.8cqw; overflow-wrap: anywhere; }
.sum__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5.4cqw 4cqw; margin-top: 7cqw; }
.sum__grid span, .sum__top > span { display: block; font: 600 3.4cqw/1.2 var(--sans); opacity: .72; }
.sum__grid b { display: block; margin-top: 1.4cqw; font: 800 8.4cqw/.98 var(--display); font-variation-settings: "wdth" 78; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.sum__grid div:nth-child(4) b { font-size: 5.8cqw; line-height: 1.04; }
.sum__top { margin-top: 6cqw; }
.sum__top ol { margin: 1.6cqw 0 0; padding-left: 5.4cqw; font: 700 4.5cqw/1.42 var(--sans); }
.sum__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 2.4cqw; padding-top: 5cqw; }

/* ================= reproductor ================= */
.story { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; gap: 28px; background: #07070b; animation: fadeIn .35s ease; overscroll-behavior: contain; }
.story.is-closing { animation: fadeOut .35s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.story__backdrop { position: absolute; inset: 0; background: radial-gradient(55% 60% at 50% 50%, color-mix(in srgb, var(--story-bg, #5b2eff) 50%, transparent) 0%, transparent 72%), #07070b; transition: background-color .8s; }
.story__card { position: relative; z-index: 1; height: min(100dvh - 48px, 900px); aspect-ratio: 9 / 16; max-width: calc(100vw - 32px); border-radius: 24px; overflow: hidden; background: #000; container-type: size; outline: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .8); }
.story__slides { position: absolute; inset: 0; }
.story__top { position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top, 0px) + 2.8cqw) 3.4cqw 4cqw; pointer-events: none; color: var(--story-fg, #fff); transition: opacity .25s, color .5s; }
.story__bars { display: flex; gap: .9cqw; }
.story__bars span { flex: 1; height: max(3px, .75cqw); border-radius: 99px; background: color-mix(in srgb, var(--story-fg, #fff) 30%, transparent); overflow: hidden; }
.story__bars i { display: block; height: 100%; width: 0; background: var(--story-fg, #fff); border-radius: inherit; }
.story__head { display: flex; align-items: center; justify-content: space-between; margin-top: 2.2cqw; }
.story__brand { font: 800 3.7cqw/1 var(--display); font-variation-settings: "wdth" 86; letter-spacing: -0.01em; }
.story__btns { display: flex; gap: .4cqw; pointer-events: auto; margin-right: -1.6cqw; }
.story__btns button { width: 9.6cqw; height: 9.6cqw; max-width: 46px; max-height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; transition: background-color .2s; }
.story__btns button:hover { background: color-mix(in srgb, var(--story-fg, #fff) 14%, transparent); }
.story__btns svg { width: 5.6cqw; height: 5.6cqw; max-width: 24px; max-height: 24px; }
.story__card.is-holding .story__top { opacity: 0; }
.story__arrow { position: relative; z-index: 2; flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .2s, transform .25s var(--spring), opacity .2s; }
.story__arrow svg { width: 26px; height: 26px; }
.story__arrow:hover { background: rgba(255, 255, 255, .2); transform: scale(1.06); }
.story.is-first .story__arrow--prev, .story.is-last .story__arrow--next { opacity: .2; pointer-events: none; }
.story__toast { position: absolute; z-index: 6; left: 50%; bottom: 7cqw; translate: -50% 1cqw; margin: 0; padding: 2.6cqw 5cqw; border-radius: 99px; background: #0b0b10; color: #fff; font: 700 3.8cqw/1 var(--sans); opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s; }
.story__toast.is-on { opacity: 1; translate: -50% 0; }
/* canción que suena, con la insignia de Apple Music (Apple la exige junto a cada avance) */
.story__song { position: absolute; z-index: 5; left: 3.4cqw; right: 3.4cqw; bottom: calc(env(safe-area-inset-bottom, 0px) + 3.2cqw); display: flex; align-items: center; gap: 2.6cqw; padding: 1.8cqw; border-radius: 3.4cqw; background: color-mix(in srgb, var(--story-fg, #fff) 11%, transparent); color: var(--story-fg, #fff); text-decoration: none; transition: opacity .3s, background-color .5s, color .5s; }
.story__song[hidden], .story.is-muted .story__song { display: none; }
.story__song.is-new { animation: songIn .55s var(--ease) both; }
.story__song-art { flex: none; width: 9.6cqw; height: 9.6cqw; border-radius: 1.8cqw; object-fit: cover; background: color-mix(in srgb, var(--story-fg, #fff) 16%, transparent); }
.story__song-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .8cqw; }
.story__song-txt b, .story__song-txt small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.story__song-txt b { font: 700 3.6cqw/1.1 var(--sans); }
.story__song-txt small { font: 500 3cqw/1.1 var(--sans); opacity: .72; }
.story__song-badge { flex: none; display: block; height: 8.4cqw; width: auto; }
.story__song:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.story__card.is-holding .story__song { opacity: 0; }
.story.has-song:not(.is-muted) .sl__body:not(.sl__body--summary):not(.sl__body--receipt) { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 17cqw); }
.story.has-song:not(.is-muted) .sl__body--summary { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18cqw); }
.story.has-song:not(.is-muted) .sl__body--receipt { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 15cqw); }
.story.has-song:not(.is-muted) .sl__body--receipt .rc { scale: .92; translate: 0 -2cqw; }
.story.has-song:not(.is-muted) .story__toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 18cqw); }
@keyframes songIn { from { opacity: 0; transform: translateY(2.4cqw); } }
@media (max-width: 640px), (max-height: 520px) and (max-width: 960px) {
  .story { gap: 0; background: #000; }
  .story__card { width: 100vw; height: 100dvh; max-width: none; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .story__arrow, .story__backdrop { display: none; }
}

/* ================= capas de la app (carga, listo, resumen) ================= */
.ov { position: fixed; inset: 0; z-index: 250; overflow-y: auto; overscroll-behavior: contain; animation: fadeIn .3s ease; }
.ov.is-closing { animation: fadeOut .3s ease forwards; }
.ov__close { position: absolute; z-index: 3; top: max(16px, env(safe-area-inset-top)); right: 16px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .08); color: inherit; display: grid; place-items: center; cursor: pointer; }
.ov__close svg { width: 22px; height: 22px; }

.ov--load { background: var(--violet); color: #fff; display: grid; place-items: center; text-align: center; }
.unwrap { position: relative; width: 120px; height: 120px; margin: 0 auto 36px; }
.unwrap span { position: absolute; inset: 0; border-radius: 30px; animation: unwrap 2.4s var(--ease) infinite; }
.unwrap span:nth-child(1) { background: var(--lime); }
.unwrap span:nth-child(2) { background: var(--pink); animation-delay: -.8s; }
.unwrap span:nth-child(3) { background: var(--cyan); animation-delay: -1.6s; }
@keyframes unwrap { 0% { transform: scale(.2) rotate(0deg); opacity: 0; } 20% { opacity: 1; } 70% { transform: scale(1) rotate(90deg); opacity: 1; } 100% { transform: scale(1.4) rotate(120deg); opacity: 0; } }
.load__msg { font: 800 clamp(26px, 5vw, 40px)/1.1 var(--display); font-variation-settings: "wdth" 86; letter-spacing: -0.02em; min-height: 2.3em; padding: 0 24px; }
.load__msg span { display: inline-block; animation: inUpPx .5s var(--ease); }
@keyframes inUpPx { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.load__sub { margin-top: 10px; font-size: 15px; opacity: .75; }

.ov--ready { background: var(--lime); color: var(--ink); display: grid; place-items: center; padding: 72px 20px 40px; }
.ready { width: min(640px, 100%); text-align: center; }
.ready__k { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: rgba(11, 11, 16, .08); font-weight: 700; font-size: 14px; }
.ready h2 { margin-top: 20px; font-size: clamp(40px, 8vw, 84px); line-height: .94; letter-spacing: -0.04em; font-variation-settings: "wdth" 80, "opsz" 96; overflow-wrap: anywhere; }
.ready__line { margin-top: 16px; font-size: 17px; color: rgba(11, 11, 16, .72); }
.ready__years { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 0; padding: 0; border: 0; }
.ready__years legend { width: 100%; margin-bottom: 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(11, 11, 16, .6); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 10px 18px; border-radius: 99px; border: 1.5px solid rgba(11, 11, 16, .25); font-weight: 700; font-size: 16px; transition: background-color .2s, color .2s, border-color .2s; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }
.ready__go { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.ready__go .btn { height: 64px; padding: 0 34px; font-size: 18px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 46px; height: 28px; border-radius: 99px; background: rgba(11, 11, 16, .2); transition: background-color .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid var(--violet); outline-offset: 2px; }
.ready__tip { margin-top: 26px; font-size: 14px; color: rgba(11, 11, 16, .65); }
.ready__alt { margin-top: 10px; border: 0; background: none; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: inherit; }

/* resumen final: vista dentro de la página (no ventana emergente) */
body.is-recap main > :not(#app) { display: none; }
#app:empty { display: none; }
.recap { width: min(1120px, 100% - 40px); margin: 0 auto; padding: 36px 0 72px; animation: inUpPx .5s var(--ease); }
.recap__top h3 { margin-bottom: 16px; }
.recap__card img { display: block; }
.recap__card .shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%) var(--soft); background-size: 250% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.recap__head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.recap__head h2 { font-size: clamp(40px, 6vw, 80px); line-height: .95; letter-spacing: -0.04em; font-variation-settings: "wdth" 80, "opsz" 96; }
.recap__head p { margin-top: 12px; color: var(--ink-2); }
.recap__top { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 40px; margin-top: 40px; align-items: start; }
.recap__card { position: relative; border-radius: 26px; overflow: hidden; aspect-ratio: 9 / 16; background: var(--soft); box-shadow: 0 30px 60px -30px rgba(20, 10, 60, .45); }
.recap__card img { width: 100%; height: 100%; object-fit: cover; }
.recap__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.recap__actions .btn { flex: 1 1 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.tile { padding: 18px 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.tile span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); line-height: 1.3; }
.tile b { display: block; margin-top: 8px; font: 700 28px/1.05 var(--sans); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tile b.sm { font-size: 20px; line-height: 1.15; }
.recap h2:focus { outline: none; }
.tile small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.recap h3 { font-size: 26px; letter-spacing: -0.02em; }
.recap__sec { margin-top: 56px; }
.recap__sec > p { margin-top: 8px; color: var(--ink-3); font-size: 15px; }
.charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 18px; }
.chart { position: relative; margin: 0; min-width: 0; padding: 20px 20px 14px; border: 1px solid var(--line); border-radius: 22px; }
.chart--wide { grid-column: 1 / -1; }
.chart h4 { font: 700 15px/1.3 var(--sans); letter-spacing: 0; }
.chart svg { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart .bar { fill: #5b2eff; transition: opacity .15s; }
.chart .bar.is-dim { fill: #c9bcff; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { opacity: .75; }
.chart .ax { fill: var(--ink-3); font: 500 11px var(--sans); }
.chart .lbl { fill: var(--ink); font: 700 12px var(--sans); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart details { margin-top: 8px; font-size: 13px; }
.chart summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
.chart table { margin-top: 8px; width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart th, .chart td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.chart td:last-child, .chart th:last-child { text-align: right; }
.ctip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.3; white-space: nowrap; translate: -50% -110%; opacity: 0; transition: opacity .12s; }
.ctip b { display: block; font-size: 15px; }
.ctip.is-on { opacity: 1; }
.toplist { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: r; }
.toplist li { counter-increment: r; display: flex; align-items: baseline; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; font-weight: 600; }
.toplist li::before { content: counter(r); font: 800 22px/1 var(--display); color: var(--violet); min-width: 18px; }
.toplist small { margin-left: auto; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
.recap__note { margin-top: 40px; padding: 18px 20px; border-radius: 18px; background: var(--soft); font-size: 14.5px; color: var(--ink-2); }
.recap__foot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 860px) {
  .recap__top, .charts { grid-template-columns: 1fr; }
  .recap__card { max-width: 340px; }
  .recap__head { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sl .a-in, .sl .a-pop { opacity: 1; animation: none !important; }
  .sl .a-rise .w > span { transform: none; animation: none !important; }
  .sl__art * { animation: none !important; transform: none !important; opacity: inherit; }
  .sl__art .cell, .sl__art .pop { opacity: 1; }
  .sl .a-print { clip-path: none; animation: none !important; }
  .sl__art .draw { stroke-dashoffset: 0; }
}
