nav{flex-wrap:wrap}
.treasure-header h1{margin:6px 0 10px;font-size:clamp(26px,4vw,40px)}
.treasure-header>p,.treasure-footnote{max-width:72ch;line-height:1.6}
.treasure-wallet{display:flex;flex-wrap:wrap;align-items:center;gap:16px 28px;margin-top:20px;padding-top:18px;border-top:1px solid var(--edge)}
.treasure-wallet>div{display:flex;align-items:center;gap:12px}.treasure-wallet strong{font-size:26px;display:block}.treasure-wallet small{display:block;color:var(--muted)}
.treasure-wallet>button{margin-left:auto}.currency-coin{display:grid;place-items:center;width:36px;height:36px;border:2px solid var(--gold);border-radius:50%;color:var(--gold);background:#463923;font-weight:800}.currency-shard{font-size:38px;color:#aecbe9}
.treasure-welcome{display:grid;grid-template-columns:190px 1fr;align-items:center;gap:20px}.treasure-welcome h2{margin-top:4px}.chest-art{width:100%;height:auto;object-fit:contain;display:block}
.treasure-inventory{margin:28px 0}.treasure-inventory>.panel-title{margin-bottom:14px;flex-wrap:wrap}.treasure-inventory h2{font-size:23px}.treasure-inventory .panel-title>span{font-size:13px;color:var(--muted)}
.chest-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.chest-card{position:relative;min-width:0;border:1px solid var(--edge);border-radius:16px;padding:16px;background:linear-gradient(155deg,#202c33,#171e28);display:flex;flex-direction:column;align-items:stretch;text-align:center}
.chest-card.chest-ready{border-color:var(--chest-color);box-shadow:0 0 25px color-mix(in srgb,var(--chest-color) 14%,transparent)}
.chest-card>.chest-art{height:145px}.chest-card h3{margin:4px 0;font-size:20px;color:var(--chest-color)}.chest-class{align-self:flex-start;font-size:11px;color:var(--muted);padding:3px 6px;border:1px solid var(--edge);border-radius:5px}.chest-source{margin:4px 0 14px;font-size:12px;color:var(--muted)}
.chest-yield{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 14px;font-size:13px;margin-bottom:14px}.reward-gold{color:var(--gold)}.chest-time{font-size:16px;margin-bottom:8px}.chest-ready .chest-time{color:var(--good)}
.chest-card progress,.treasure-milestone progress{appearance:none;width:100%;height:7px;border:0;border-radius:8px;overflow:hidden;background:#0c141d;margin-bottom:16px}.chest-card progress::-webkit-progress-bar,.treasure-milestone progress::-webkit-progress-bar{background:#0c141d}.chest-card progress::-webkit-progress-value{background:var(--chest-color);border-radius:8px}.chest-card progress::-moz-progress-bar{background:var(--chest-color)}
.chest-card details{margin-top:12px;font-size:12px;text-align:left}.chest-card details>summary{text-align:center;color:var(--muted);cursor:pointer}.chest-guarantees{padding-left:18px;line-height:1.7;text-align:left}.chest-card .hint{font-size:12px}
.treasure-milestone{display:grid;grid-template-columns:1fr auto;gap:0 16px;align-items:center}.treasure-milestone>div{grid-column:1/-1}.treasure-milestone h2{font-size:21px;margin:5px 0}.treasure-milestone progress{margin:0}.treasure-milestone>strong{font-size:14px}
.treasure-catalog>summary{cursor:pointer;font-weight:700}.chest-catalog-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:20px}.chest-catalog-grid article{min-width:0;padding:12px;border:1px solid var(--edge);border-radius:10px;text-align:center;background:#17212a}.chest-catalog-grid .chest-art{height:100px}.chest-catalog-grid h3{font-size:17px;margin:5px 0;color:var(--chest-color)}.chest-catalog-grid article>span{font-size:11px;color:var(--muted)}.chest-catalog-grid article>strong{font-size:14px}.chest-catalog-grid .chest-guarantees{font-size:12px}
.card-development{display:flex;justify-content:space-between;flex-wrap:wrap;gap:3px 6px;border-top:1px solid var(--edge);padding-top:8px;font-size:11px}.card-development>strong{color:var(--gold)}.card-development>span{color:var(--muted)}
.unit-development{display:block;font-size:10px;color:var(--gold);line-height:1.3;margin-top:2px}.card-upgrade-panel{border:1px solid #776d51;border-radius:12px;background:#2b2a28;padding:14px;margin:18px 0}.card-upgrade-panel h3{font-size:22px;margin:5px 0 10px}.card-upgrade-panel p{line-height:1.5}.upgrade-cost{display:flex;flex-wrap:wrap;gap:8px 16px;margin:12px 0}.upgrade-cost .enough{color:var(--good)}.upgrade-cost .short{color:var(--bad)}
.upgrade-confirm-values{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:6px;text-align:center;margin:16px 0}.upgrade-confirm-values small{display:block;margin-bottom:6px;color:var(--muted)}.upgrade-confirm-values .values{justify-content:center}.upgrade-costs{width:100%;font-size:13px;border-collapse:collapse;margin-top:12px}.upgrade-costs th,.upgrade-costs td{text-align:left;padding:8px;border-bottom:1px solid var(--edge)}
.treasure-receipt{text-align:center}.treasure-receipt>.chest-art{max-width:220px;margin:auto}.treasure-receipt h2{font-size:25px}.treasure-receipt .reward-gold{display:block;font-size:28px;margin:15px 0}.treasure-receipt-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:18px 0}.treasure-receipt-cards article{width:130px;border:1px solid var(--edge);border-radius:10px;padding:8px}.treasure-receipt-cards .portrait{width:60px;height:82px;margin:0 auto 6px}.treasure-receipt-cards strong{display:block;font-size:13px}.treasure-receipt-cards span{display:block;color:var(--gold);margin-top:8px}
.finish-treasure{display:flex;gap:12px;align-items:center;padding:12px;margin:16px 0;text-align:left;border:1px solid #62583e;background:#242925;border-radius:12px}.finish-treasure>span{width:105px;flex:none}.finish-treasure p{font-size:13px;color:var(--muted);margin:4px 0 10px}.treasure-footer-link{margin:12px 0}
.chest-art{overflow:visible}.chest-art .chest-lid{transform-origin:152px 66px;transform-box:view-box}.chest-art .chest-lock{transform-origin:104px 87px}.chest-art .chest-radiance{transform-origin:112px 94px}.chest-art .chest-particle{transform-origin:112px 90px}
.chest-opening-art{width:min(100%,350px);margin:2px auto 0;isolation:isolate}.chest-opening-art>.chest-art{width:100%;height:auto;display:block}
.chest-scene-open .chest-lid{transform:rotate(0deg) skewX(-12deg) scaleY(.36) translateY(-84px)}.chest-scene-open .chest-lock{opacity:0}.chest-scene-open .chest-inside{opacity:1}.chest-scene-open .chest-radiance{opacity:.42}
.treasure-receipt[data-opening="playing"] .chest-body{animation:chest-settle 620ms cubic-bezier(.2,.7,.25,1) both}
.treasure-receipt[data-opening="playing"] .chest-lid{animation:chest-lid-open 1050ms cubic-bezier(.18,.8,.3,1) 180ms both}
.treasure-receipt[data-opening="playing"] .chest-lock{animation:chest-unlock 420ms ease 110ms both}
.treasure-receipt[data-opening="playing"] .chest-radiance{animation:chest-light 1300ms ease 420ms both}
.treasure-receipt[data-opening="playing"] .chest-inside{animation:chest-inside 220ms ease 450ms both}
.treasure-receipt[data-opening="playing"] .chest-particle{animation:chest-treasure-flight 920ms cubic-bezier(.15,.65,.35,1) calc(460ms + var(--delay)) both}
.treasure-receipt[data-opening="playing"] .chest-reward-reveal{animation:chest-reward-reveal 480ms cubic-bezier(.15,.7,.3,1) 900ms both}
.treasure-receipt[data-opening="playing"] .treasure-receipt-cards>article{animation:chest-reward-reveal 420ms ease var(--reveal-delay) both}
.treasure-receipt[data-opening="complete"] #skip-chest-opening{display:none}
.chest-card.chest-ready:hover .chest-sheen,.chest-card.chest-ready:focus-within .chest-sheen{animation:chest-sheen 1800ms ease both}
.treasure-milestone progress::-webkit-progress-value{background:#b0e5f6}.treasure-milestone progress::-moz-progress-bar{background:#b0e5f6}.treasure-milestone>strong{color:#ccefff}
.chest-preview-button{width:100%;margin-top:8px;font-size:12px;padding:9px 6px}.chest-preview .chest-reward-reveal>p{margin:10px 0}.chest-preview .reward-gold{font-size:26px}
@keyframes chest-settle{0%,100%{transform:translateY(0)}25%{transform:translateY(2px)}50%{transform:translateY(-1px)}75%{transform:translateY(1px)}}
@keyframes chest-unlock{0%{opacity:1;transform:rotate(0)}55%{opacity:1;transform:rotate(18deg) translateY(2px)}100%{opacity:0;transform:rotate(28deg) translateY(7px)}}
@keyframes chest-lid-open{0%,12%{transform:none}28%{transform:rotate(-2deg) translateY(-2px)}78%{transform:skewX(-13deg) scaleY(.33) translateY(-87px)}100%{transform:skewX(-12deg) scaleY(.36) translateY(-84px)}}
@keyframes chest-light{0%{opacity:0;transform:scale(.5)}45%{opacity:.96;transform:scale(1.12)}100%{opacity:.42;transform:scale(1)}}
@keyframes chest-inside{from{opacity:0}to{opacity:1}}
@keyframes chest-treasure-flight{0%{opacity:0;transform:translate(0,0) scale(.6)}15%{opacity:1}60%{opacity:1;transform:translate(var(--mx),var(--my)) rotate(100deg) scale(1.2)}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(200deg) scale(.55)}}
@keyframes chest-reward-reveal{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes chest-sheen{0%{opacity:0;transform:translateX(0)}20%{opacity:.6}80%{opacity:.6}100%{opacity:0;transform:translateX(155px)}}
@media(max-width:760px){.chest-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.chest-card{padding:12px}.chest-card>.chest-art{height:105px}.chest-card h3{font-size:17px}.chest-card .full{font-size:13px;padding:10px 6px}.chest-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.treasure-welcome{grid-template-columns:110px 1fr;gap:12px}.treasure-wallet{gap:12px 20px}.treasure-wallet>button{margin-left:0;width:100%}.treasure-welcome h2{font-size:20px}.treasure-welcome button{font-size:12px;padding:10px}.finish-treasure>span{width:76px}.upgrade-confirm-values .values{gap:5px}.upgrade-confirm-values .value{font-size:12px}}
@media(prefers-reduced-motion:reduce){.chest-card,.chest-art *,.treasure-receipt *{animation:none!important}.chest-reward-reveal,.treasure-receipt-cards>article{opacity:1!important;transform:none!important}#skip-chest-opening{display:none}}

/* Test47: material detail, hinged inner face and restrained opening choreography. */
.chest-art .chest-lid-underside{transform-origin:152px 66px;transform-box:view-box}
.chest-scene-open .chest-lid-underside{opacity:1;transform:skewX(-12deg) scaleY(.8) translateY(-44px)}
.chest-scene-open .chest-aura{opacity:.32}
.treasure-receipt[data-opening="playing"] .chest-lid-underside{animation:chest-inner-lid 1050ms cubic-bezier(.18,.8,.3,1) 180ms both}
.treasure-receipt[data-opening="playing"] .chest-aura{animation:chest-floor-light 1250ms ease 450ms both}
.treasure-receipt[data-opening="playing"] .chest-runes{animation:chest-rune-light 1100ms ease 300ms both}
.chest-opening-art{padding:16px 0 0;background:radial-gradient(ellipse at 50% 66%,color-mix(in srgb,var(--chest-color) 12%,transparent),transparent 68%)}
.chest-card{background:radial-gradient(ellipse at 50% 30%,color-mix(in srgb,var(--chest-color) 9%,transparent),transparent 65%),linear-gradient(155deg,#202c33,#171e28)}
.treasure-receipt-cards article{background:linear-gradient(145deg,#27323e,#151d28);box-shadow:0 8px 18px #0003}
.chest-art[data-chest-material="stone"]{--lid-ease:cubic-bezier(.45,0,.35,1)}
.treasure-receipt[data-opening="playing"] [data-chest-material="stone"] .chest-lid{animation-timing-function:var(--lid-ease)}
.chest-art[data-chest-material="stone"] .chest-radiance{opacity:.16}
.chest-art[data-chest-material="diamond"] .chest-radiance{mix-blend-mode:screen}
@keyframes chest-inner-lid{0%,28%{opacity:0;transform:none}45%{opacity:1}100%{opacity:1;transform:skewX(-12deg) scaleY(.8) translateY(-44px)}}
@keyframes chest-floor-light{0%{opacity:0}40%{opacity:.7}100%{opacity:.32}}
@keyframes chest-rune-light{0%{opacity:.35}50%{opacity:1}100%{opacity:.8}}

/* Reward progress stays visible after a paid upgrade. */
.treasure-receipt-cards .reward-card{width:156px;display:flex;flex-direction:column;gap:7px;text-align:center}
.reward-card small{display:block;color:var(--muted);font-size:11px;line-height:1.4}
.reward-card .reward-progress{font-size:12px;color:var(--ink);display:grid;gap:5px}
.reward-progress progress{width:100%;height:7px;accent-color:var(--gold)}
.reward-card button{font-size:11px;padding:9px 5px;min-height:40px;white-space:normal}
.reward-card .reward-max{color:var(--good);margin:auto 0}
.reward-sources,.reward-wallet{color:var(--muted);font-size:12px;line-height:1.6}
@media(max-width:400px){.treasure-receipt-cards .reward-card{width:calc(50% - 5px);min-width:118px}.treasure-receipt-cards{gap:8px}}

.audio-sliders{display:grid;gap:24px;margin:26px 0}.audio-sliders label{display:grid;grid-template-columns:1fr auto;gap:10px}.audio-sliders input{grid-column:1/-1;width:100%;min-height:40px;accent-color:var(--gold)}.audio-sliders output{color:var(--gold)}
.combat-moment-label{display:block;color:var(--gold);font-size:12px;text-align:center;margin:8px auto}
