/* Carved walnut, inset brass and worn iron corners. */
.home .portrait-button{position:relative;padding:13px 12px 14px;border:0;border-radius:0;background:#2a2419;box-shadow:0 8px 19px #0008;isolation:isolate;transition:filter .2s}
.home .portrait-button:before{content:'';position:absolute;inset:0;width:100%;height:100%;border:0;background:url('assets/quest/portrait-frame.svg') center/100% 100% no-repeat;box-shadow:none;transform:none;z-index:3;pointer-events:none}
.home .portrait-button:after{display:none}.home .portrait-button:hover{filter:brightness(1.12)}
.home .portrait-button .scene{border:1px solid #171b14;border-radius:2px;box-shadow:inset 0 0 9px #080d0b;clip-path:polygon(3px 0,calc(100% - 3px) 0,100% 3px,100% 100%,0 100%,0 3px)}
.home .portrait-label{font-size:11px;color:#dbc898;margin-top:9px}.home .portrait-label small{color:#b1a184}
.tooth-icon{image-rendering:pixelated;object-fit:contain}.dossier-teeth .tooth-icon{width:28px;height:33px;filter:drop-shadow(1px 2px #101510)}
.ascension-emblem canvas.rank-number,.ascension-emblem canvas.rank-echo{inset:0!important;margin:auto!important;left:0!important;top:0!important;translate:none!important;object-position:50% 50%;width:100%;height:100%}
/* The stage never changes size. One camera transform handles the whole retreat. */
.spoils-screen,.loot-revealed.spoils-screen{justify-content:flex-start!important}
.spoils-screen .loot-stage,.spoils-screen.loot-pullback .loot-stage,.spoils-screen.loot-revealed .loot-stage{height:var(--stage-small)!important;transition:none!important}
.spoils-screen .chest-camera{transition:transform .8s cubic-bezier(.22,.68,.25,1)!important;transform:translate(-50%,-50%) translateY(calc((var(--stage-open) - var(--stage-small))/2)) scale(1)}
.spoils-screen.loot-pullback .chest-camera,.spoils-screen.loot-revealed .chest-camera{transform:translate(-50%,-50%) translateY(-8px) scale(.62)}
.spoils-screen>h2{transform:translateY(calc(var(--stage-open) - var(--stage-small)));transition:transform .8s cubic-bezier(.22,.68,.25,1)}
.spoils-screen.loot-pullback>h2,.spoils-screen.loot-revealed>h2{transform:none}
.loot-revealed .treasure-item{animation-delay:calc(450ms + var(--order)*1250ms)!important}
/* The row disappears, its space stays. Ash carries the old stones off-screen. */
.ash-row{position:relative;opacity:.68;min-height:29px;display:flex;align-items:center;justify-content:center}
.ash-caption{font:italic 9px Georgia;letter-spacing:1.4px;color:#8c8170;opacity:.7;z-index:1}
.ash-remnant{position:absolute;inset:0;display:flex;justify-content:space-around;align-items:end;opacity:.45}.ash-remnant i{width:20px;height:3px;background:linear-gradient(90deg,transparent,#8c775b,transparent);clip-path:polygon(0 100%,18% 45%,32% 80%,50% 0,62% 65%,85% 30%,100% 100%)}
.room-5.enemyAttack .ashen-impact .tile{animation:rune-to-ash 1.12s ease-in calc(780ms + var(--tile-index)*20ms) both!important;transform-origin:50% 100%}
.ashen-impact .tile-char{animation:charcoal-scar 1s linear 780ms both!important}.ashen-impact .tile-char i{display:none}.ashen-impact .row-damage{animation:burned-inscription .3s ease 1.5s both}
@keyframes rune-to-ash{0%{filter:none;opacity:1;transform:none}10%{filter:brightness(2.3) sepia(1);box-shadow:0 0 18px #ff982bbb}35%{filter:brightness(.55) saturate(.12);transform:translateY(1px)}59%{filter:brightness(.4) grayscale(1);opacity:1;clip-path:polygon(0 0,100% 0,100% 100%,75% 75%,60% 100%,48% 62%,29% 94%,0 68%)}100%{filter:brightness(.3) grayscale(1);opacity:0;transform:translateY(22px) scale(.8,.45);clip-path:polygon(8% 62%,23% 31%,41% 72%,55% 45%,65% 84%,83% 43%,100% 90%,72% 100%,0 100%)}}
@keyframes charcoal-scar{from{opacity:0}20%{opacity:1;background:#e9a15255}to{opacity:1;background:#151511b3}}
@keyframes burned-inscription{to{opacity:0}}
.room-5.enemyAttack .floating-damage.player-hit,.room-5.enemyAttack .heart-loss{animation-delay:780ms}.stage-combat:has(.room-5.enemyAttack){animation-delay:780ms}
/* The final chest has one permanent stage and a touch-driven opening. */
.hoard-finale{width:min(760px,100%);max-width:760px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:calc(100svh - var(--ad-space));padding:64px 24px 30px;gap:0;position:relative}
.hoard-finale header{position:relative;z-index:1}.hoard-finale h1{font:700 clamp(25px,4vw,40px)/1.2 'Knightle Herald';letter-spacing:2px;margin:9px 0 13px;color:#f0db9e;text-shadow:2px 3px #25160b}.hoard-finale .eyebrow{font-size:8px;letter-spacing:2px;color:#d4b87d;margin:0}.hoard-provenance{font:italic 16px Georgia;color:#c9b48b;margin:0}
.hoard-theater{position:relative;width:100%;height:clamp(230px,38svh,390px);flex:none;margin:0 auto 12px}
.hoard-casket{display:block;position:absolute;inset:0;width:100%;height:100%;padding:0;background:none;border:0;box-shadow:none;opacity:1!important;overflow:visible;cursor:pointer;touch-action:manipulation}
.hoard-casket:disabled{cursor:default;filter:none}.hoard-casket:focus-visible{outline:1px solid #d6bb77;outline-offset:3px}.hoard-canvas{width:100%;height:100%;display:block;image-rendering:pixelated;pointer-events:none}
.hoard-invitation{position:absolute;left:0;right:0;bottom:-9px;min-height:12px;font:7px/1.5 'Knightle Quill';letter-spacing:1px;color:#cfbb8c;pointer-events:none;margin:0}.hoard-waiting .hoard-invitation{animation:hoard-invitation 2s ease-in-out infinite}
.hoard-receipt{min-height:139px;width:100%;display:flex;flex-direction:column;align-items:center;opacity:0;transition:opacity .4s}.hoard-opening .hoard-receipt,.hoard-revealed .hoard-receipt{opacity:1}
.hoard-gold{display:flex;align-items:center;justify-content:center;gap:9px;height:48px;color:#ffe3a3;font:700 39px/1 'Knightle Herald';font-variant-numeric:tabular-nums;text-shadow:0 0 14px #e1ac4650}.hoard-gold b{font-weight:700;min-width:3ch;text-align:center}.hoard-gold .coin-icon{width:33px;height:33px}.hoard-gold-caption{font:7px 'Knightle Quill';letter-spacing:2px;color:#b7a17a;margin:3px 0 13px}
.hoard-opening .hoard-gold{animation:hoard-gold-warmth 1.5s ease-in-out infinite}.hoard-tooth{display:flex;align-items:center;justify-content:center;gap:13px;opacity:0;transform:translateY(7px);transition:opacity .65s ease,transform .65s ease;width:100%;color:#e5d4a9}.hoard-tooth>.tooth-icon{width:45px;height:53px;filter:drop-shadow(0 0 9px #d1aa5f55)}.hoard-tooth>span{text-align:left;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:4px 10px}.hoard-tooth b{font:26px 'Knightle Herald'}.hoard-tooth em{font:8px 'Knightle Quill';font-style:normal;letter-spacing:1px}.hoard-tooth small{grid-column:1/-1;font:italic 12px Georgia;color:#b7aa8b}.receipt-ready .hoard-tooth{opacity:1;transform:none;transition-delay:.3s}.receipt-ready .hoard-gold{animation:hoard-total-stamp .65s ease both}
.hoard-continue{font-size:11px;min-width:245px;margin-top:14px;opacity:0;pointer-events:none;transition:opacity .5s ease .6s}.hoard-revealed .hoard-continue{opacity:1;pointer-events:auto}
.hoard-finale:not(.hoard-revealed) .hoard-continue{visibility:hidden}
@keyframes hoard-invitation{50%{color:#fff0be;text-shadow:0 0 10px #d5b96466}}@keyframes hoard-gold-warmth{50%{text-shadow:0 0 20px #e1ac4690;color:#fff1c4}}@keyframes hoard-total-stamp{25%{transform:scale(1.12);text-shadow:0 0 25px #f6cd74}100%{transform:none}}
@media(max-width:700px){.home .portrait-button{padding:10px 9px 11px}.home .portrait-label{font-size:9px}.hoard-finale{padding:60px 20px 25px;justify-content:center}.hoard-finale h1{font-size:24px;letter-spacing:1px}.hoard-finale .eyebrow{font-size:6px}.hoard-provenance{font-size:14px}.hoard-theater{height:clamp(225px,35svh,300px)}.hoard-gold{font-size:35px}.hoard-invitation{font-size:6px}.hoard-continue{font-size:10px}.hoard-receipt{min-height:133px}}
@media(max-width:700px) and (max-height:720px){.hoard-finale{padding-top:49px;padding-bottom:15px}.hoard-theater{height:200px}.hoard-finale h1{font-size:21px}.hoard-receipt{min-height:118px}.hoard-gold{height:36px;font-size:30px}.hoard-tooth>.tooth-icon{width:36px;height:44px}.hoard-continue{margin-top:8px;min-height:44px}}
@media(max-width:700px) and (max-height:760px){.spoils-screen .loot-stage{--stage-small:80px}}
@media(prefers-reduced-motion:reduce){.hoard-gold,.hoard-invitation,.hoard-tooth{animation:none!important}.room-5.enemyAttack .ashen-impact .tile{animation:burned-inscription .3s linear 780ms both!important}.ashen-impact .tile-char{display:none}.spoils-screen .loot-stage,.spoils-screen .chest-camera{transition-duration:.1s!important}}
