/* ENZOJUMPER — spectacle: event effects, transitions, talking effects, set
   pieces, travel, in-world speech and the quiet HUD. Loaded last. Everything
   here is a burst that settles: nothing loops forever except a typing caret. */

/* ─── layers ─── */
#spx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 11; pointer-events: none; }
#trans { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 62; pointer-events: none; }
#sp-pieces { position: absolute; inset: 0; z-index: 28; pointer-events: none; overflow: hidden; }
#sp-speech { position: absolute; inset: 0; z-index: 29; pointer-events: none; overflow: hidden; }
#sp-ghosts { position: absolute; inset: 0; z-index: 41; pointer-events: none; }
#sp-pieces *, #sp-speech * { pointer-events: none; }

/* ═══ type that talks ═══ */
.fxrich .w { display: inline-block; white-space: nowrap; }
.fxrich .c { display: inline-block; opacity: 0; white-space: pre; }
.fxrich .c.s { display: inline; white-space: pre-wrap; }
/* letters animate only opacity and transform (the compositor's cheap pair: no per-letter blur), and
   fill backwards only, so a finished letter drops its animation instead of holding a layer */
.fxrich .c.on { opacity: 1; animation: c-pop .2s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.fxrich .c.quick { animation-duration: .01s !important; }
.fxrich[data-enter=wave] .c.on { animation: c-wave .75s cubic-bezier(.2, .8, .2, 1) backwards; }
.fxrich[data-enter=slow] .c.on { animation: c-slow .6s ease-out backwards; }
.fxrich[data-enter=type] .c.on, .fxrich[data-enter=snap] .c.on { animation: none; }
.fxrich[data-enter=ink] .c { transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); }
.fxrich[data-enter=ink] .c.on { animation: c-ink .32s ease-out backwards; }
.fxrich[data-enter=flutter] .c.on { animation: c-flutter .5s cubic-bezier(.2, .8, .3, 1) backwards; }
.fxrich[data-enter=bounce] .c.on { animation: c-bounce .4s cubic-bezier(.2, 1.8, .4, 1) backwards; }
.fxrich[data-enter=fade] .c.on { animation: c-fade .5s ease-out backwards; }
@keyframes c-pop { from { opacity: 0; transform: translateY(5px) scale(.55); } }
@keyframes c-wave { 0% { opacity: 0; transform: translateY(9px); } 30% { opacity: 1; transform: translateY(-4px); } 55% { transform: translateY(2px); } 80% { transform: translateY(-1px); } 100% { transform: none; } }
@keyframes c-slow { from { opacity: 0; transform: translateY(3px) scale(1.06); } }
@keyframes c-ink { from { opacity: 0; transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)) scale(1.35); } to { transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); } }
@keyframes c-flutter { from { opacity: 0; transform: translate(calc(var(--y, 0px) * 3), -10px) rotate(var(--r, 0deg)); } }
@keyframes c-bounce { 0% { opacity: 0; transform: translateY(-14px) scale(.8); } 60% { opacity: 1; transform: translateY(2px) scale(1.05, .9); } }
@keyframes c-fade { from { opacity: 0; } }

/* emphasis: *shake*  ^grow^  ~wave~  |rainbow| */
.fxrich .e-shake, .fxrich .e-grow, .fxrich .e-wave, .fxrich .e-rain { font-weight: 800; }
.fxrich .e-shake { color: #c8452e; }
.fxrich .e-shake.on { animation: c-pop .18s both, e-shake .09s .18s 7 linear !important; }
.fxrich .e-grow { font-size: 1.16em; line-height: 1; color: var(--sp-accent, #23864a); }
.fxrich .e-grow.on { animation: e-grow .5s cubic-bezier(.2, 1.8, .4, 1) both !important; }
.fxrich .e-wave { color: var(--sp-accent, #23864a); }
.fxrich .e-wave.on { animation: c-pop .2s both, e-wave .9s calc(.15s + var(--i) * 45ms) ease-in-out 2 !important; }
.fxrich .e-rain.on { animation: c-pop .2s both, e-rain 2.4s linear calc(var(--i) * -.12s) infinite !important; }
@keyframes e-shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1.5px, 1px) rotate(-3deg); } 50% { transform: translate(1.5px, -1px); } 75% { transform: translate(-1px, -1px) rotate(3deg); } }
@keyframes e-grow { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.35); } 100% { transform: none; } }
@keyframes e-wave { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@keyframes e-rain { 0%, 100% { color: #e5484d; } 20% { color: #e08a1a; } 40% { color: #23864a; } 60% { color: #2a8fc2; } 80% { color: #8a4fd8; } }

/* MOSS lying: the letters glitch in, then the lie gets struck through */
.fxrich.lie .c.on { animation: c-lie .34s steps(3) backwards; }
@keyframes c-lie { 0% { opacity: 0; transform: translate(3px, -2px); text-shadow: 2px 0 #ff0050, -2px 0 #00e0ff; } 50% { opacity: 1; transform: translate(-2px, 1px); text-shadow: -2px 0 #ff0050, 2px 0 #00e0ff; } 100% { transform: none; text-shadow: none; } }
.fxrich.lie .c { text-decoration: line-through; text-decoration-color: transparent; text-decoration-thickness: 2px; transition: text-decoration-color .35s calc(var(--i) * 14ms); }
.fxrich.lie.lie-done .c { text-decoration-color: rgba(200, 69, 46, .7); }

/* ─── each voice in type ─── */
[data-sp=moss] { --sp-accent: #23864a; }
[data-sp=fern] { --sp-accent: #b9771a; }
[data-sp=fern] :is(.dtext, .say-t, .tt) { font-family: var(--serif); font-style: italic; color: #5c3b12; }
[data-sp=snail] :is(.dtext, .say-t, .tt) { font-family: var(--serif); color: #46552a; letter-spacing: .015em; }
[data-sp=system] { --sp-accent: #b3261e; }
[data-sp=system] :is(.dtext, .say-t, .tt) { font: 600 15px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #9b1c14; letter-spacing: .02em; }
#dialog[data-sp=system] .dtext::after { content: '▋'; margin-left: 2px; animation: caret .9s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
[data-sp=brindle] { --sp-accent: #3a55b8; }
[data-sp=brindle] :is(.dtext, .say-t, .tt) { font-family: Arial, Helvetica, sans-serif; font-weight: 600; color: #26324f; letter-spacing: -.01em; }
[data-sp=wren] { --sp-accent: #c8452e; }
[data-sp=wren] :is(.dtext, .say-t, .tt) { font: italic 500 1.06em/1.5 var(--serif); color: #3a2410; }
[data-sp=moth] { --sp-accent: #7a4fc8; }
[data-sp=moth] :is(.dtext, .say-t, .tt) { font-family: var(--serif); font-style: italic; color: #4a3270; }
[data-sp=council] :is(.dtext, .say-t, .tt) { font-family: var(--serif); font-variant: small-caps; letter-spacing: .04em; color: #5b4a14; }
[data-sp=note] :is(.dtext, .say-t, .tt), [data-sp=past] :is(.dtext, .say-t, .tt) { font-family: var(--serif); font-style: italic; color: #4a3f22; }
[data-sp=aphid] :is(.dtext, .say-t, .tt) { font-weight: 700; color: #355f10; }
[data-sp=beetle] :is(.dtext, .say-t, .tt) { color: #5d4a0c; }
[data-sp=shroom] :is(.dtext, .say-t, .tt) { color: #8a2848; }

/* ─── faces that react ─── */
.r-enter { animation: r-enter .45s cubic-bezier(.2, 1.7, .4, 1) !important; }
.r-bounce { animation: r-bounce .4s ease-out !important; }
.r-squash { animation: r-squash .45s cubic-bezier(.2, 1.4, .4, 1) !important; }
.r-tilt { animation: r-tilt .6s cubic-bezier(.2, 1.4, .4, 1) !important; }
.r-shake { animation: r-shake .5s linear !important; }
.r-droop { animation: r-droop .8s ease-in-out !important; }
.r-blink img.head, .r-blink.tk-portrait img, img.tp.r-blink { animation: r-blink .16s !important; }
@keyframes r-enter { 0% { transform: scale(.55) translateY(8px); opacity: .3; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
@keyframes r-bounce { 40% { transform: translateY(-6px); } 70% { transform: translateY(1px); } }
@keyframes r-squash { 25% { transform: scale(1.16, .84); } 55% { transform: scale(.92, 1.1) translateY(-4px); } 100% { transform: none; } }
@keyframes r-tilt { 35% { transform: rotate(-9deg); } 70% { transform: rotate(3deg); } 100% { transform: none; } }
@keyframes r-shake { 10%, 50%, 90% { transform: translateX(-4px) rotate(-2deg); } 30%, 70% { transform: translateX(4px) rotate(2deg); } 100% { transform: none; } }
@keyframes r-droop { 40% { transform: translateY(4px) scaleY(.93); } 100% { transform: none; } }
@keyframes r-blink { 50% { transform: scaleY(.72); } }

/* the jaw: the portrait splits at the mouth, and the lower part drops as the words come */
.dportrait { position: relative; isolation: isolate; }
.dportrait img.head { clip-path: inset(0 0 calc(100% - var(--jaw, 62%)) 0); }
.dportrait img.jaw { position: absolute; left: 50%; top: 50%; translate: -50% -50%; clip-path: inset(var(--jaw, 62%) 0 0 0); transition: transform .06s ease-out; }
.dportrait::before { content: ''; position: absolute; left: 34%; right: 34%; top: calc(var(--jaw, 62%) - 2px); height: 5px; border-radius: 4px; background: #2a160c; z-index: -1; opacity: 0; transition: opacity .06s; }
.dportrait.mo::before, .dportrait.mh::before { opacity: 1; }
.dportrait.mo img.jaw { transform: translateY(3.5px); }
.dportrait.mh img.jaw { transform: translateY(1.5px); }
.dportrait.nojaw img.jaw, .dportrait.nojaw::before { display: none; }
.dportrait.nojaw img.head { clip-path: none; }
.dportrait.speaking img.head, .dportrait.speaking img.jaw { animation: none; }
.dportrait.nojaw.speaking img.head { animation: talk .2s infinite alternate; }

/* the box itself: a new speaker steps in, a shout jolts it */
#dialog.sp-swap { animation: d-swap .32s ease-out; }
#dialog.sp-shout { animation: d-shout .45s linear; }
@keyframes d-swap { 0% { opacity: .6; translate: 0 6px; } 100% { opacity: 1; translate: 0 0; } }
@keyframes d-shout { 15% { translate: -7px 0; } 35% { translate: 6px -2px; } 55% { translate: -4px 1px; } 75% { translate: 3px 0; } 100% { translate: 0 0; } }
.dchoices .btn { animation: ch-in .4s calc(.05s + var(--i, 0) * .09s) cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ch-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }

/* in a letterboxed scene the skin drops the box's paper; give it back so the words stay readable */
body.cinema #dialog:not(.world) { background: #fbf6ea !important; border: 2.5px solid #142419 !important; border-radius: 18px !important; box-shadow: 6px 6px 0 #000 !important; }
body.cinema.edition-b #dialog:not(.world) { background: #fff !important; border-color: #d5dae3 !important; border-radius: 6px !important; box-shadow: 0 10px 30px rgba(20, 30, 60, .3) !important; }

/* a line said out in the world: the box steps aside, leaving only Skip (and the screen-reader text) */
#dialog.world { background: none !important; border-image: none !important; border-color: transparent !important; box-shadow: none !important; filter: none !important; padding: 0 !important; width: auto; left: auto; bottom: auto; top: calc(66px + var(--safe-t, 0px)); right: calc(16px + var(--safe-r, 0px)); transform: none; rotate: none; pointer-events: none; animation: none; cursor: default; }
#dialog.world .dportrait, #dialog.world .dnext { display: none; }
#dialog.world .dbody { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#dialog.world .dskip { position: static; pointer-events: auto; background: var(--paper); border: 2px solid var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; }

/* ═══ in-world speech ═══ */
.sp-say { position: absolute; left: 0; top: 0; max-width: min(320px, 74vw); width: max-content; padding: 9px 14px 11px; background: var(--paper, #fbf6ea); color: var(--ink, #142419); border: 2.5px solid var(--ink, #142419); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink, #142419); font: 600 16px/1.42 var(--ui); opacity: 0; transition: opacity .22s ease; will-change: transform; }
.sp-say::after { content: ''; position: absolute; bottom: -10px; left: calc(var(--tail, 50%) - 8px); width: 14px; height: 14px; background: inherit; border-right: 2.5px solid var(--ink, #142419); border-bottom: 2.5px solid var(--ink, #142419); transform: rotate(45deg); }
.sp-say::before { content: ''; position: absolute; left: 10px; top: -1px; width: 22px; height: 4px; border-radius: 0 0 4px 4px; background: var(--sp-color, #5dff8a); }
.sp-say.in { opacity: 1; }
.sp-say.in .say-t { animation: say-pop .32s cubic-bezier(.2, 1.6, .4, 1); }
.sp-say.out { opacity: 0; transition: opacity .35s ease; }
.sp-say.far { opacity: .6; }
.sp-say .say-next { position: absolute; right: 9px; bottom: 6px; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0; }
.sp-say.ready .say-next { opacity: .55; animation: bob .9s ease-in-out infinite alternate; }
@keyframes say-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
body.bigtext .sp-say { font-size: 18px; }
/* MOSS, written across the sky */
.sp-say.m-sky { left: 50%; top: calc(13% + var(--safe-t, 0px)); transform: translateX(-50%) !important; max-width: min(760px, 88vw); background: none; border: 0; box-shadow: none; padding: 0; text-align: center; font: 600 clamp(20px, 2.7vw, 32px)/1.3 var(--serif); color: #fffbe8; -webkit-text-stroke: 5px rgba(16, 34, 22, .62); paint-order: stroke fill; text-shadow: 0 0 22px rgba(190, 255, 205, .7), 0 3px 16px rgba(0, 28, 10, .45); }
.intro.sp-yield { opacity: 0 !important; transition: opacity .35s ease; }
.sp-say.m-sky::after, .sp-say.m-sky::before, .sp-say.m-ground::after, .sp-say.m-ground::before, .sp-say.m-sign::before { display: none; }
.sp-say.m-sky .fxrich .c.on { animation: c-cloud .9s ease-out backwards; }
.sp-say.m-sky.out .say-t { transition: transform .5s ease-in, opacity .5s; transform: translateY(-14px); opacity: 0; }
.sp-say.m-sky .e-shake, .sp-say.m-sky .e-grow, .sp-say.m-sky .e-wave { color: #e6ffb0; }
@keyframes c-cloud { from { opacity: 0; transform: translateY(6px) scale(1.25); } }
/* …carved into the ground at your feet */
.sp-say.m-ground { background: none; border: 0; box-shadow: none; padding: 2px 4px; max-width: min(420px, 86vw); text-align: center; font: 800 17px/1.25 var(--ui); letter-spacing: .05em; color: rgba(34, 20, 8, .86); text-shadow: 0 1px 0 rgba(255, 238, 205, .55), 0 -1px 0 rgba(0, 0, 0, .3); }
.sp-say.m-ground .fxrich .c.on { animation: c-carve .28s ease-out backwards; }
.sp-say.m-ground[data-biome=hollow], .sp-say.m-ground[data-biome=static], .sp-say.m-ground[data-biome=neon] { color: #c6ff5a; text-shadow: 0 0 8px rgba(198, 255, 90, .75), 0 1px 0 #000; }
@keyframes c-carve { 0% { opacity: 0; transform: scale(1.6); } 60% { opacity: 1; transform: scale(.94); } 100% { transform: none; } }
/* …or flickering onto a sign */
.sp-say.m-sign { display: grid; place-items: center; max-width: none; padding: 6px 10px; text-align: center; background: #2a1a0c; border-color: #3a2410; border-radius: 6px; box-shadow: 0 0 18px rgba(93, 255, 138, .4), inset 0 0 18px rgba(93, 255, 138, .12); color: #b6ff8a; font: 700 14px/1.25 var(--ui); text-shadow: 0 0 6px #5dff8a; }
.sp-say.m-sign::after { display: none; }
.sp-say.m-sign.in { animation: sign-flicker .7s steps(1) both; }
@keyframes sign-flicker { 0% { opacity: 0; } 10% { opacity: 1; } 16% { opacity: .15; } 24% { opacity: 1; } 58% { opacity: .7; } 62% { opacity: 1; } }

/* ═══ screens drop in like cards, and flutter away ═══ */
.screen.sp-enter > .panel { animation: card-in .42s cubic-bezier(.2, 1.3, .35, 1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(26px) rotate(-2.2deg) scale(.94); } }
.sp-ghost { position: fixed !important; margin: 0 !important; overflow: hidden !important; animation: card-out .4s cubic-bezier(.5, 0, .75, 0) forwards; }
@keyframes card-out { to { opacity: 0; transform: translateY(80px) rotate(var(--rot, 4deg)) scale(.9); } }

/* ═══ the complete card: lighter, low on the screen, the world still in view ═══ */
.screen.sp-complete-wrap { background: linear-gradient(180deg, transparent 40%, rgba(10, 20, 14, .35)) !important; place-items: end center; padding-bottom: calc(14px + var(--safe-b, 0px)); animation: none; }
.panel.complete.sp-card { width: min(540px, 100%); max-height: min(72dvh, 600px); animation: card-up .5s cubic-bezier(.2, 1.25, .35, 1) both; }
@keyframes card-up { from { opacity: 0; transform: translateY(60px) scale(.96); } }
.sp-card .medal.on { opacity: 0; transform: scale(.4) rotate(-14deg); animation: none; }
.sp-card .medal.on.sp-landed { opacity: 1; transform: none; transition: transform .45s cubic-bezier(.2, 1.9, .4, 1), opacity .15s; }
/* compact: the same facts in less of the screen */
.panel.complete.sp-card { padding-top: 16px; padding-bottom: 18px; }
.sp-card h2 { margin-bottom: 8px; }
.sp-card .medals { margin: 2px 0 8px; gap: 5px; }
.sp-card .medal { padding: 4px 3px !important; gap: 2px; }
.sp-card .medal .mi { height: 26px; }
.sp-card .medal .mi svg { width: 26px; height: 26px; }
.sp-card .complete-stats { gap: 5px !important; margin-bottom: 0; }
.sp-card .complete-stats div { padding: 6px 4px; }
.sp-card .complete-stats b { font-size: 17px !important; }
.sp-card .xpline { margin-top: 8px !important; padding: 6px 10px !important; }
.sp-card .next-preview { margin-top: 8px; padding: 6px 10px; font-size: 13px; }
@media (max-height: 760px) { .sp-card .next-preview { display: none; } }
.sp-card .xpline.sp-lvup { animation: lvglow 1.2s ease-out; }
@keyframes lvglow { 0% { filter: drop-shadow(0 0 0 #ffd166); } 30% { filter: drop-shadow(0 0 14px #ffd166); } }
.sp-stamp { position: absolute; right: 22px; top: 58px; z-index: 3; padding: 6px 12px 5px; border: 3px solid #c8452e; border-radius: 6px; color: #c8452e; font: 800 15px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; background: rgba(255, 248, 235, .4); transform: rotate(-12deg) scale(2.3); opacity: 0; pointer-events: none; mix-blend-mode: multiply; }
.sp-stamp.in { opacity: .92; transform: rotate(-12deg) scale(1); transition: transform .2s cubic-bezier(.5, 0, .6, 1.6), opacity .08s; }
.sp-thump { animation: thump .32s ease-out; }
@keyframes thump { 30% { translate: 0 4px; } }
.talk .tk-stamp { top: 42%; left: 50%; right: auto; transform: translate(-50%, -50%) rotate(-9deg) scale(2.2); font-size: 20px; }
.talk .tk-stamp.in { transform: translate(-50%, -50%) rotate(-9deg) scale(1); }

/* ═══ HUD: it steps back while you explore ═══ */
#hud .hud-left > *, #hud .hud-right > *, #hud .hud-center { transition: opacity .9s ease, translate .9s ease; }
body.hud-calm #hud .pill.level, body.hud-calm #hud-timer, body.hud-calm #hud .hud-right > .pill { opacity: 0; translate: 0 -8px; }
body.hud-calm #hud-pause { opacity: .55; }
body.hud-calm.hud-level #hud .pill.level, body.hud-calm.hud-seeds #hud .hud-right > .pill:not(.online), body.hud-calm.hud-timer #hud-timer { opacity: 1; translate: 0 0; transition-duration: .25s; }
.sp-bump { animation: sp-bump .32s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes sp-bump { 40% { transform: scale(1.22); } }

/* the combo counter only stamps the bonuses now */
.combo[data-tier] { font-family: var(--nums, var(--display)); }
.combo.on.big { animation: combo-stamp .45s cubic-bezier(.2, 1.8, .4, 1); }
.combo[data-tier='3'], .combo[data-tier='4'] { color: #b9771a; }
@keyframes combo-stamp { 0% { transform: translateX(-50%) scale(2.2) rotate(-8deg); opacity: 0; } 100% { transform: translateX(-50%) scale(1) rotate(0); opacity: 1; } }
.pop { transition: opacity .3s, translate .3s; }
.pop.out { opacity: 0; translate: 0 12px; }
.pop.pop-lvl .pi { background: #ffd166; }
.pop.pop-heart .pi { background: #ffc2d1; }

/* ═══ cinematics, upgraded ═══ */
.cc-brush { display: block; width: min(560px, 80vw); height: 26px; margin: -10px auto 0; overflow: visible; }
.cc-brush path { fill: none; stroke: #c8f06e; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 720; stroke-dashoffset: 720; animation: brush 1.1s .85s cubic-bezier(.6, 0, .2, 1) forwards; }
@keyframes brush { to { stroke-dashoffset: 0; } }
.cc-ch2 .cc-brush path, .cc-ch4 .cc-brush path { stroke: #9be15d; }
.cc-ch5 .cc-t { text-shadow: 0 0 34px rgba(255, 107, 214, .6), 0 6px 60px rgba(110, 240, 255, .35); }
.cc-ch5 .cc-brush path { stroke: #ff6bd6; }
.cc-ch6 .cc-t { text-shadow: 0 0 40px rgba(191, 227, 255, .55); }
.cc-ch6 .cc-brush path { stroke: #bfe3ff; }
.cc-ch7 .cc-brush path { stroke: #f2b36b; }
.cc-ch8 .cc-brush path { stroke: #ffb3c7; }
.cc-ch10 .cc-t, .cc-ch11 .cc-t { text-shadow: 0 0 50px rgba(255, 209, 102, .65); }
.cc-ch10 .cc-brush path, .cc-ch11 .cc-brush path { stroke: #ffd166; }
.lt-paper { animation: lt-unfold 1.1s cubic-bezier(.2, .9, .3, 1) both; background-image: linear-gradient(180deg, transparent 32.8%, rgba(110, 90, 50, .14) 33.3%, transparent 34%, transparent 65.8%, rgba(110, 90, 50, .14) 66.3%, transparent 67%), radial-gradient(rgba(120, 100, 60, .12) 1px, transparent 1px), linear-gradient(180deg, #f6f0df, #e9dfc5) !important; background-size: 100% 100%, 5px 5px, 100% 100% !important; }
@keyframes lt-unfold { 0% { opacity: 0; transform: perspective(900px) rotateX(78deg) rotate(-1.4deg) scale(.9) translateY(30px); } 55% { opacity: 1; transform: perspective(900px) rotateX(-7deg) rotate(-1.4deg); } 100% { transform: rotate(-1.4deg); } }
.lt-seal { position: absolute; right: 24px; bottom: -16px; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #d0503f, #8b1e1e 72%); box-shadow: 0 3px 0 #5a1010, inset 0 0 0 4px rgba(0, 0, 0, .14); opacity: 0; transform: scale(2.4) rotate(-24deg); animation: seal-in .26s 3.9s cubic-bezier(.5, 0, .6, 1.7) forwards; }
.lt-seal::after { content: '❦'; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(60, 0, 0, .45); font-size: 22px; }
@keyframes seal-in { to { opacity: 1; transform: rotate(-14deg); } }
.freeze::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(255, 120, 40, .45) 85%, rgba(60, 10, 0, .7)); mix-blend-mode: multiply; animation: burn 1.4s ease-out both; }
@keyframes burn { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: .55; } }

/* ═══ set pieces ═══ */
.sp-piece { position: absolute; inset: 0; transition: opacity .7s ease; }
.sp-piece.out { opacity: 0; }
/* Ultimo's polaroids */
.sp-polaroids { display: flex; justify-content: center; align-items: flex-start; gap: clamp(6px, 2vw, 22px); flex-wrap: wrap; padding: calc(13vh + var(--safe-t, 0px)) 4vw 0; }
.sp-pol { width: clamp(108px, 18vw, 176px); padding: 8px 8px 26px; background: #fbf8f0; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); transform: translateY(-40px) rotate(calc(var(--r) * 2.5)) scale(.8); opacity: 0; transition: transform .6s cubic-bezier(.2, 1.4, .35, 1), opacity .3s; position: relative; }
.sp-pol.in { opacity: 1; transform: rotate(var(--r)); }
.sp-pol canvas { display: block; width: 100%; height: auto; aspect-ratio: 200 / 170; filter: brightness(2.6) sepia(1) contrast(.3) blur(1.5px); transition: filter 3.4s ease-out .3s; }
.sp-pol.in canvas { filter: sepia(.35) contrast(1.05) saturate(.9); }
.sp-pol b { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font: italic 500 13px/1 var(--serif); color: #4a3f22; }
@media (max-width: 560px) { .sp-polaroids { flex-wrap: nowrap; gap: 3px; padding: calc(7vh + var(--safe-t, 0px)) 6px 0; } .sp-pol { width: 23vw; padding: 4px 4px 15px; } .sp-pol b { font-size: 10px; bottom: 3px; } }
/* every fall, a flower */
.sp-flowers { top: auto; height: 55%; }
.sp-flowers canvas { width: 100%; height: 100%; display: block; }
.sp-piece.sp-flowers.out { transition-duration: 1.2s; }
/* 4095 → 4096 */
.sp-counter { inset: auto; left: 50%; top: calc(14vh + var(--safe-t, 0px)); transform: translateX(-50%); display: flex; gap: 6px; font: 800 clamp(40px, 8vw, 84px)/1 var(--nums, var(--display)); color: #fbf6ea; }
.sp-counter > span { display: inline-block; min-width: .72em; padding: 8px 6px; text-align: center; background: #142419; border-radius: 10px; box-shadow: 0 6px 0 #050a07, 0 14px 30px rgba(0, 0, 0, .4); position: relative; overflow: hidden; }
.sp-counter .flip { height: 1.2em; }
.sp-counter .flip i { display: block; font-style: normal; transition: transform .5s cubic-bezier(.6, 0, .3, 1.4); }
.sp-counter.go .flip i { transform: translateY(-1.2em); }
.sp-counter.stamped .flip { background: #c8452e; transition: background .2s; }
/* the Gardener's vines, and the split's tear */
.sp-vines canvas, .sp-tear canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sp-piece.sp-vines.out { transition-duration: 1.2s; }
.sp-ed { position: absolute; top: 30%; padding: 8px 14px; opacity: 0; transform: scale(2) rotate(var(--r)); transition: transform .22s cubic-bezier(.5, 0, .6, 1.6), opacity .1s; }
.sp-ed.in { opacity: 1; transform: rotate(var(--r)); }
.sp-ed-w { --r: -7deg; right: calc(50% + 28px); font: italic 600 clamp(20px, 3.4vw, 34px)/1 var(--serif); color: #c8452e; background: #fff8e8; border: 2.5px solid #2b2116; border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; box-shadow: 5px 5px 0 #2b2116; }
.sp-ed-b { --r: 3deg; left: calc(50% + 28px); font: 700 clamp(13px, 2vw, 18px)/1 Arial, Helvetica, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: #4f6bd8; border-radius: 3px; box-shadow: 0 8px 24px rgba(20, 30, 60, .35); }
@media (max-width: 560px) { .sp-ed { top: 22%; } .sp-ed-w { right: calc(50% + 16px); } .sp-ed-b { left: calc(50% + 16px); } }
/* a memory, flicked through */
.sp-flip { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 12, 9, .62); cursor: pointer; animation: cc-bg .35s ease-out; }
.fb-book { position: relative; width: min(480px, 88vw); aspect-ratio: 480 / 340; padding: 0; background: #f6f1e3; border-radius: 6px 12px 12px 6px; box-shadow: -6px 0 0 #c9b88f, -10px 2px 0 #b3a173, 0 30px 70px rgba(0, 0, 0, .55); transform: rotate(-2deg); animation: fb-in .45s cubic-bezier(.2, 1.3, .35, 1); }
.fb-book canvas { width: 100%; height: 100%; display: block; border-radius: inherit; }
.fb-rings { position: absolute; left: -14px; top: 6%; bottom: 6%; width: 14px; background: repeating-linear-gradient(180deg, transparent 0 10px, #6b6a62 10px 14px, transparent 14px 22px); }
.sp-flip.flick .fb-book::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 30%; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .16)); border-radius: 0 12px 12px 0; animation: flick .18s ease-out forwards; }
@keyframes flick { to { opacity: 0; width: 0; } }
@keyframes fb-in { from { opacity: 0; transform: rotate(-8deg) scale(.7) translateY(40px); } }
.sp-flip.out { opacity: 0; transition: opacity .3s; }
.sp-flip.out .fb-book { transform: rotate(-2deg) scaleX(.06); transition: transform .3s ease-in; }

/* ═══ journeys between chapters ═══ */
.sp-trip { position: absolute; inset: 0; background: #0a120d; cursor: pointer; touch-action: none; animation: cc-bg .45s ease-out; }
.sp-trip canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sp-trip.out { opacity: 0; transition: opacity .45s; }
.tr-card { position: absolute; left: 50%; top: calc(9% + var(--safe-t, 0px)); transform: translateX(-50%); text-align: center; pointer-events: none; animation: tr-card 3.6s ease-out forwards; }
.tr-card b { display: block; font: 800 clamp(26px, 5vw, 52px)/1 var(--display); color: #fbf6ea; -webkit-text-stroke: 2px #142419; paint-order: stroke fill; text-shadow: 4px 4px 0 #142419; }
.tr-card span { display: inline-block; margin-top: 10px; padding: 5px 12px; background: #fbf6ea; color: #142419; border: 2px solid #142419; border-radius: 10px; font: 700 14px/1.2 var(--ui); }
@keyframes tr-card { 0% { opacity: 0; transform: translate(-50%, -14px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.tr-seeds { position: absolute; left: calc(16px + var(--safe-l, 0px)); top: calc(16px + var(--safe-t, 0px)); display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; background: #fbf6ea; color: #142419; border: 2.5px solid #142419; border-radius: 12px; box-shadow: 3px 3px 0 #142419; font: 800 18px/1 var(--nums, var(--ui)); pointer-events: none; }
.tr-seeds img { width: 20px; height: 20px; }
.tr-seeds.bump { animation: sp-bump .3s cubic-bezier(.2, 1.8, .4, 1); }
.tr-skip { position: absolute; right: calc(16px + var(--safe-r, 0px)); bottom: calc(16px + var(--safe-b, 0px)); padding: 8px 14px; background: #fbf6ea; color: #142419; border: 2.5px solid #142419; border-radius: 12px; box-shadow: 3px 3px 0 #142419; font: 800 14px/1 var(--ui); cursor: pointer; }

/* ═══ reduced motion: the same information, without the movement ═══ */
body.reduced .fxrich .c.on, body.reduced .fxrich .e-shake.on, body.reduced .fxrich .e-grow.on, body.reduced .fxrich .e-wave.on, body.reduced .fxrich.lie .c.on { animation: c-fade .15s both !important; }
body.reduced .fxrich .e-rain.on { animation: c-fade .15s both !important; color: #8a4fd8; }
body.reduced [class*=' r-'], body.reduced [class^='r-'] { animation: none !important; }
body.reduced .screen.sp-enter > .panel, body.reduced .panel.complete.sp-card, body.reduced .lt-paper, body.reduced .sp-say.in .say-t { animation: c-fade .2s both !important; }
body.reduced .sp-ghost { display: none; }
body.reduced .sp-pol, body.reduced .sp-pol canvas { transition-duration: .3s; }
body.reduced #dialog.sp-shout, body.reduced #dialog.sp-swap { animation: none; }
/* a film's vignette while a cutscene has its bars up (a static layer: cheap even without the post pass) */
#vignette::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(2, 8, 4, .45) 100%); opacity: 0; transition: opacity 1.2s ease; }
body.cinema #vignette::after { opacity: 1; }
body.reduced #vignette::after { transition: none; }
