/* Skorvath's story scenes: he flees the hunt, or falls onto his hoard. The hero wears the hunt's gear. */
.ds { position: fixed; inset: 0; z-index: 99990; container-type: size; background: #000; overflow: hidden; opacity: 0; transition: opacity .9s; font-family: var(--font-display); }
.ds.in { opacity: 1; } .ds.out { opacity: 0; transition: opacity .6s; }
.ds-stage { position: absolute; inset: 0; background: #120c08 center / cover no-repeat; }
.ds-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: radial-gradient(ellipse at 50% 55%, transparent 45%, rgba(0,0,0,.75)), linear-gradient(180deg, rgba(20,8,4,.35), rgba(0,0,0,.2) 60%, rgba(0,0,0,.55)); }
.ds.shake .ds-stage { animation: dsShake .12s linear infinite; }
@keyframes dsShake { 0% { transform: translate(0,0); } 25% { transform: translate(-7px,4px); } 50% { transform: translate(6px,-5px); } 75% { transform: translate(-4px,-3px); } 100% { transform: translate(0,0); } }

/* the puppets */
.ds-dragon, .ds-hero { position: absolute; }
.ds-dragon { bottom: 8cqh; width: 46cqw; height: 62cqh; z-index: 2; }
.ds-hero { left: 9%; bottom: 8cqh; width: 30cqh; height: 40cqh; z-index: 3; transform: translateX(-45cqw); transition: transform 1.5s cubic-bezier(.3,.7,.4,1); }
.ds-jump { position: absolute; inset: 0; }
.ds-dragon .sprite, .ds-hero .sprite { position: absolute; inset: 0; }
.ds.walk .ds-hero { transform: translateX(0); }
/* knight: one leap at the dragon */
.ds.leap .ds-jump { animation: dsLeap .62s cubic-bezier(.3,.2,.5,1) forwards; }
@keyframes dsLeap { 0% { transform: translate(0,0); } 45% { transform: translate(14cqw,-22cqh); } 100% { transform: translate(24cqw,-4cqh); } }
/* afterwards the hero climbs onto the hoard */
.ds.climb .ds-hero { transform: translate(28cqw,-28cqh); transition: transform 1.6s cubic-bezier(.35,.1,.3,1); }
/* the knight climbs on from where his leap landed (the leap's end + this = the same spot on the hoard) */
.ds-knight.ds.climb .ds-hero { transform: translate(4cqw,-24cqh); }

/* archer's arrow / magician's blaze */
.ds-shot { position: absolute; left: 20%; top: 60%; width: 60px; height: 6px; z-index: 4; opacity: 0; border-radius: 3px; transform: translate(-50%,-50%); }
.ds-archer .ds-shot { width: 110px; height: 18px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E %3Cpath d='M14 10 L104 10' stroke='%2317110c' stroke-width='5' stroke-linecap='round'/%3E %3Cpath d='M14 10 L104 10' stroke='%23d8c39a' stroke-width='2.6' stroke-linecap='round'/%3E %3Cpath d='M100 3 L119 10 L100 17 L104 10 Z' fill='%23cfd3d6' stroke='%2317110c' stroke-width='1.8' stroke-linejoin='round'/%3E %3Cpath d='M2 3 L18 10 L2 17 L8 10 Z M10 3 L26 10 L10 17 L16 10 Z' fill='%23b8322a' stroke='%2317110c' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; filter: drop-shadow(0 0 6px rgba(255,240,200,.55)); }
.ds-magician .ds-shot { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle, #fff6d0, #ffb03a 40%, #d2401c 70%, transparent 72%); box-shadow: 0 0 40px 12px rgba(255,120,40,.6); }
.ds.shot .ds-shot { animation: dsShot .42s cubic-bezier(.3,.05,.7,1) forwards; }
@keyframes dsShot { 0% { opacity: 1; transform: translate(-50%,-50%) rotate(var(--rot, 0rad)) scale(.8); } 100% { opacity: 1; transform: translate(-50%,-50%) translate(var(--tx, 42cqw), var(--ty, -8cqh)) rotate(var(--rot, 0rad)) scale(1.1); } }
.ds.spent .ds-shot { display: none; }
.ds-flash { position: absolute; inset: 0; z-index: 7; background: #fff8e8; opacity: 0; pointer-events: none; transition: opacity .35s; }
.ds.hit .ds-flash { opacity: .75; transition: none; }

/* he goes down */
/* he rears up, then topples onto his side on the hoard */
.ds-dragon { transform-origin: 60% 100%; right: 3%; }
.ds.fall .ds-dragon { transform: rotate(-7deg) translateY(-2cqh); transition: transform .7s cubic-bezier(.3,.1,.3,1), filter 1.5s; }
.ds.crash .ds-dragon { transform: rotate(22deg) translateY(8cqh) translateX(3cqw); filter: brightness(.7) saturate(.8); transition: transform .45s cubic-bezier(.7,0,1,.6), filter 1.5s; }

/* embers always drifting up through the lair */
.ds-embers, .ds-ash, .ds-dust, .ds-coins { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.ds-embers i { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: #ffb04a; box-shadow: 0 0 8px #ff7a20; opacity: 0; animation: dsEmber 4.5s linear infinite; }
@keyframes dsEmber { 0% { opacity: 0; transform: translate(0,0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx, 30px), -85cqh); } }
/* the gust of ash from his wings */
.ds-ash i { position: absolute; right: 30%; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: #6a5f56; opacity: 0; }
.ds.gust .ds-ash i { animation: dsAsh 2.2s ease-out forwards; }
@keyframes dsAsh { 0% { opacity: .9; transform: translate(0,0) scale(.6); } 100% { opacity: 0; transform: translate(var(--dx, -40cqw), var(--dy, 10cqh)) scale(2.4); } }
/* dust and coins when he crashes down */
.ds-dust i { position: absolute; right: 26%; bottom: 8cqh; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, rgba(140,110,80,.75), transparent 70%); opacity: 0; }
.ds.crash .ds-dust i { animation: dsDust 1.8s ease-out forwards; }
@keyframes dsDust { 0% { opacity: .95; transform: translate(0,0) scale(.5); } 100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -6cqh)) scale(5); } }
.ds-coins i { position: absolute; right: 32%; bottom: 14cqh; width: 16px; height: 9px; border-radius: 50%; background: #f1c75a; border: 2px solid #17110c; opacity: 0; }
.ds.crash .ds-coins i { animation: dsCoin 1.3s cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes dsCoin { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 50% { transform: translate(calc(var(--dx, 0) * .6), var(--dy, -20cqh)) rotate(300deg); } 100% { opacity: 0; transform: translate(var(--dx, 0), 6cqh) rotate(720deg); } }

/* captions and buttons, the same as the other story scenes */
.ds-sub { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); width: min(90cqw, 900px); z-index: 8; text-align: center; color: #f0e2c8; font-size: clamp(18px, 3.2cqh, 30px);
  font-style: italic; letter-spacing: .02em; text-shadow: 0 0 12px #000, 0 0 24px #4a1606, 0 2px 0 #000; opacity: 0; transition: opacity .6s; min-height: 1.4em; }
.ds-sub.show { opacity: 1; }
.ds.done .ds-sub { bottom: 16%; }
.ds-continue { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); z-index: 9; padding: 11px 26px; border-radius: 6px; cursor: pointer;
  border: 2px solid #8a6420; background: rgba(20,12,6,.88); color: #f0e2c8; font: 600 15px var(--font-body); letter-spacing: .08em;
  opacity: 0; visibility: hidden; transition: opacity .8s, visibility .8s; }
.ds.done .ds-continue { opacity: 1; visibility: visible; animation: dsPulse 2.4s ease-in-out .8s infinite; }
.ds-continue:hover { background: #3a2a10; }
@keyframes dsPulse { 0%, 100% { box-shadow: 0 0 0 rgba(241,199,90,0); } 50% { box-shadow: 0 0 18px rgba(241,199,90,.5); } }
.ds-skip { position: absolute; right: 3%; top: 4%; z-index: 9; padding: 7px 16px; border-radius: 5px; cursor: pointer; background: rgba(20,12,9,.7); color: #eadfc4;
  border: 1.5px solid rgba(234,223,196,.5); font: 600 14px var(--font-ui, sans-serif); letter-spacing: .04em; opacity: .75; transition: opacity .2s; }
.ds-skip:hover { opacity: 1; } .ds.done .ds-skip { display: none; }
@media (prefers-reduced-motion: reduce) { .ds.shake .ds-stage { animation: none; } }
