*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#101e26;color:#ecf6ea;font-family:system-ui,-apple-system,sans-serif;touch-action:none;overscroll-behavior:none}canvas{display:block;width:100%;height:100%}header{position:absolute;top:max(18px,env(safe-area-inset-top));left:22px;right:22px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}header small{display:block;color:#acbdb1;letter-spacing:.15em;font-size:11px}header strong{font-size:28px;font-variant-numeric:tabular-nums}.stats{display:flex;align-items:center;gap:16px;font-weight:700}button{font:inherit;color:inherit;border:1px solid #526756;background:#253c36;border-radius:14px;padding:16px;cursor:pointer;touch-action:manipulation}button:active{background:#47614c}#pause{pointer-events:auto;padding:10px 16px}.bars{position:absolute;top:90px;left:22px;width:min(280px,60vw);pointer-events:none}.track{height:7px;border-radius:8px;background:#273934;overflow:hidden;margin-bottom:6px}#health{height:100%;background:#f68c87;width:100%}.xp{height:4px}#xp{height:100%;background:#b8e89e;width:0}#hint{position:absolute;bottom:max(26px,env(safe-area-inset-bottom));width:100%;text-align:center;font-size:12px;color:#b1c4b6;pointer-events:none}.overlay{position:absolute;inset:0;background:#08151cbb;display:flex;align-items:center;justify-content:center;padding:24px;backdrop-filter:blur(8px)}.overlay.hidden{display:none}section{width:min(480px,100%);text-align:center}section .eyebrow{color:#b8e89e;letter-spacing:.25em;font-size:12px}h1{font-size:clamp(32px,6vw,48px);margin:14px 0}p{color:#b5c8bd;line-height:1.8;margin:16px 0 24px}.primary{background:#b8e89e;color:#172b25;border:none;width:100%;font-weight:800;font-size:18px}.choices{display:grid;gap:12px}.choice{text-align:left;width:100%;display:block}.choice b{display:block;margin-bottom:5px}.choice span{color:#c0d0c4;font-size:13px}footer{font-size:12px;color:#8fa69b;margin-top:18px}

#sound{pointer-events:auto;padding:10px;font-size:12px}.stats{gap:10px}@media(max-width:480px){header{left:12px;right:12px}.stats{gap:6px;font-size:12px}#pause{padding:10px}.bars{left:12px}h1{font-size:30px}}

#hp-label{font-size:12px;font-weight:700;margin-bottom:5px;font-variant-numeric:tabular-nums;text-shadow:0 1px 3px #10232b}

.vitals{display:flex;align-items:baseline;gap:14px;margin-bottom:6px}.vitals #hp-label{margin:0}.vitals #level{font-size:17px;font-weight:800;color:#c4eca5}.kill-hud{position:absolute;left:22px;top:calc(max(18px,env(safe-area-inset-top)) + 143px);pointer-events:none;text-shadow:0 2px 5px #081c25}.kill-hud small{font-size:11px;color:#b8cdbf;letter-spacing:.15em}.kill-hud>strong{display:block;font-size:36px;line-height:1.1;color:#fff1ba;font-variant-numeric:tabular-nums}.bars{top:calc(max(18px,env(safe-area-inset-top)) + 72px)}@media(max-width:480px){.kill-hud{left:12px}.kill-hud>strong{font-size:30px}}

.hero-choices{display:grid;gap:10px;margin-bottom:20px}.hero-card{text-align:left}.hero-card b,.hero-card span{display:block}.hero-card span{font-size:12px;color:#bdcfc3;margin-top:5px}.hero-card[aria-pressed="true"]{border-color:#c1eea8;background:#35583e;box-shadow:0 0 0 1px #c1eea8}

.level-panel,.treasure-panel{padding:28px 20px;border:1px solid #e4d28b99;border-radius:24px;background:radial-gradient(ellipse at top,#675e3066,#152b29dd 70%);box-shadow:0 0 70px #eed68b25;animation:reward-enter .45s ease-out}.level-panel h1{color:#fff0ae;text-shadow:0 0 25px #efca73;letter-spacing:.08em}.level-medal,.reward-icon{font-size:56px;color:#ffdf8f;text-shadow:0 0 28px #ffe9a2;animation:star-glow 1.4s ease-in-out infinite alternate}.level-panel .choice{border-color:#a39862}.overlay{overflow-y:auto}section{max-height:100%;overflow-y:auto}@keyframes reward-enter{from{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}@keyframes star-glow{from{transform:scale(.9);filter:brightness(1)}to{transform:scale(1.08);filter:brightness(1.3)}}@media(prefers-reduced-motion:reduce){.level-panel,.treasure-panel,.level-medal,.reward-icon{animation:none}}

#boss-hud{position:absolute;left:50%;transform:translateX(-50%);bottom:72px;width:min(400px,80vw);pointer-events:none;text-align:center;font-size:13px;font-weight:700;color:#ffcab0;text-shadow:0 2px 4px #081c25}#boss-hud.hidden{display:none}.boss-track{height:9px;background:#291b2b;border:1px solid #8c5c63;border-radius:6px;margin-top:6px;overflow:hidden}#boss-health{height:100%;background:linear-gradient(90deg,#a84666,#ef9472)}

.settings-button{display:block;width:100%;margin-top:12px;padding:12px;font-size:14px}.setting-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin:14px 0;text-align:left;font-size:14px}.setting-row input{width:100%;accent-color:#b8e89e;touch-action:pan-x}.setting-row select{background:#253c36;color:#ecf6ea;border:1px solid #6b806e;border-radius:8px;padding:10px;font:inherit}.settings-note{font-size:12px;margin:15px 0}#barrier-status{position:absolute;bottom:48px;left:0;right:0;text-align:center;color:#a5f0ff;font-weight:700;font-size:14px;pointer-events:none}

.home-screen header,.home-screen .bars,.home-screen .kill-hud,.home-screen #hint,.home-screen #boss-hud,.home-screen #barrier-status{visibility:hidden}.home-overlay{background:radial-gradient(ellipse at 50% 35%,#1e403bb3,#07151ded 75%);backdrop-filter:blur(2px)}.home-panel{width:min(660px,100%);padding:24px 20px;background:radial-gradient(ellipse at 50% 55%,#93d9b712,transparent 70%)}.home-panel .eyebrow{font-size:11px;letter-spacing:.3em;color:#b8ceb4}.game-logo{font-family:serif;font-size:clamp(40px,7vw,70px);letter-spacing:.08em;color:#f7eac1;text-shadow:0 3px 0 #665c3d,0 0 35px #d6e2a533;margin:20px 0 12px}.title-rule{display:flex;align-items:center;justify-content:center;gap:16px;color:#dcc58c}.title-rule:before,.title-rule:after{content:'';height:1px;width:80px;background:linear-gradient(90deg,transparent,#bba56b)}.title-rule:after{transform:rotate(180deg)}.title-story{font-size:14px;color:#ccd8c6;line-height:1.9;margin:18px 0 8px}.title-heroes{display:flex;align-items:center;justify-content:center;gap:26px;padding:5px 0 24px}.title-heroes>div{position:relative;filter:drop-shadow(0 0 18px #92adcd33)}.title-heroes span{display:block;font-size:9px;letter-spacing:.22em;color:#bdbbaf}.title-heroes i{color:#eed395;font-style:normal}.hero-portrait{image-rendering:pixelated;max-width:100%;object-fit:contain}.home-panel .primary{max-width:360px;background:linear-gradient(135deg,#ead9a0,#b9d9a0);color:#25362d;border-radius:8px;box-shadow:0 4px 20px #0004}.text-button{display:block;margin:12px auto 0;border:0;background:transparent;padding:9px 12px;color:#bcccbd;font-size:13px}.text-button:hover{color:#fff0bb;background:#34544855}.hero-card .hero-portrait{float:left;width:64px;height:74px;margin-right:15px}.hero-card{min-height:108px;padding:16px}.hero-card b{padding-top:12px}.hero-card span{line-height:1.5}.home-panel footer{font-size:10px;color:#869a8f}@media(max-width:480px){.home-panel{padding:14px 4px}.title-heroes{gap:10px}.title-heroes canvas{width:120px;height:140px}.home-panel .game-logo{font-size:40px}.hero-card .hero-portrait{width:52px;margin-right:10px}.hero-card b{padding-top:8px}}@media(max-height:550px){.home-panel{padding:8px}.game-logo{margin:10px 0;font-size:38px}.title-story{margin:8px 0}.title-heroes{padding-bottom:12px}.title-heroes canvas{height:100px;width:100px}.home-panel footer{margin-top:8px}}

.language-switch{display:flex;justify-content:center;gap:8px;margin-bottom:20px}.language-switch button{padding:8px 14px;font-size:12px;border-radius:8px;color:#b8c9bc;background:#1c322d}.language-switch button[aria-pressed="true"]{color:#ffefbc;border-color:#c9b578}.game-logo{font-size:clamp(30px,5vw,50px);line-height:1.35}.home-panel .game-logo{font-size:clamp(30px,5vw,50px)}html[lang="en"] .home-panel .game-logo{font-size:clamp(32px,5vw,52px);letter-spacing:.01em}.setting-row{line-height:1.5}.hero-card span{overflow-wrap:anywhere}@media(max-height:550px){.language-switch{margin-bottom:8px}.home-panel .game-logo{font-size:30px}}

/* Reward text and symbols share the focus, with readable numeric effects. */
.upgrade-icon{width:46px;height:46px;flex-shrink:0;color:#ffe4a2;filter:drop-shadow(0 0 8px #ffd35c55)}
.icon-heart{color:#ff9eb0}.icon-shield{color:#9fddff}.icon-boot,.icon-speed{color:#a7f5cd}.icon-wand,.icon-stars{color:#dec0ff}
.level-panel .choice{display:flex;align-items:center;gap:16px;padding:17px;background:linear-gradient(110deg,#3e443b,#182f31);border:1px solid #d9bd7399;box-shadow:inset 0 1px #fff1;min-height:90px}
.level-panel .choice:hover,.level-panel .choice:focus-visible{border-color:#fff0b1;box-shadow:0 0 18px #ffd36244;outline:2px solid #ffe4a2;outline-offset:2px}
.choice-copy{flex:1}.level-panel .choice b{font-size:16px;color:#ecf1e9;margin-bottom:7px}.level-panel .choice span{display:block;font-size:clamp(18px,3.8vw,23px);font-weight:850;color:#fff1b6;line-height:1.4;text-shadow:0 2px 3px #0009}
.level-medal .upgrade-icon,.reward-icon .upgrade-icon{width:68px;height:68px}.level-panel h1{font-size:clamp(36px,7vw,54px);margin:8px 0}.level-panel p{margin:10px 0 18px}
.treasure-panel h1{color:#fff2b7;font-size:clamp(29px,6vw,40px);text-shadow:0 0 18px #e9b44b77}.reward-effect{font-size:clamp(23px,4.8vw,31px);font-weight:900;color:#fff8da;line-height:1.55;padding:20px 16px;border:1px solid #f4da8999;border-radius:16px;background:#142b32;box-shadow:0 0 22px #eec66d22;text-shadow:0 2px 4px #000b}.reward-confirmation{color:#e9dba5;font-weight:700;margin:18px 0}
#title-music{color:#d8e7ff;border:1px solid #7895af77;border-radius:12px;margin-top:12px;padding:10px 16px}
@media(max-height:700px){.level-panel,.treasure-panel{padding:16px}.level-medal .upgrade-icon,.reward-icon .upgrade-icon{width:44px;height:44px}.level-panel .choice{min-height:72px;padding:12px}.level-panel .choices{gap:8px}}

.overlay:has(.level-panel){background:#08151c88;backdrop-filter:blur(2px)}
.level-panel{position:relative;isolation:isolate;overflow-x:hidden;box-shadow:0 0 0 3px #ffe9a255,0 0 85px #ffd46266,inset 0 0 35px #ffe19922;animation:level-arrival .65s ease-out}
.level-panel .level-medal{filter:drop-shadow(0 0 20px #ffe69c);animation:star-glow .8s ease-in-out infinite alternate}
.level-panel h1{color:#fff9d9;text-shadow:0 0 12px #fff2a6,0 0 36px #ffbf35,0 4px 1px #806229;animation:level-heading .65s ease-out}
@keyframes level-arrival{0%{opacity:0;transform:scale(.68);filter:brightness(2)}55%{opacity:1;transform:scale(1.035);filter:brightness(1.3)}100%{transform:scale(1);filter:brightness(1)}}
@keyframes level-heading{from{letter-spacing:.3em;transform:translateY(-15px)}to{letter-spacing:.08em;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.level-panel,.level-panel h1,.level-panel .level-medal{animation:none}}

.overlay:has(.treasure-panel){background:#08151c88;backdrop-filter:blur(2px)}
.treasure-panel{border:2px solid #ffe1a3;background:radial-gradient(ellipse at top,#8f6839cc,#152b29f5 70%);box-shadow:0 0 90px #ffd05c66,inset 0 0 40px #ffd36222;animation:level-arrival .7s ease-out}
.treasure-panel .reward-icon{animation:treasure-reveal .8s ease-out,star-glow 1.1s .8s ease-in-out infinite alternate}
.treasure-panel h1{text-shadow:0 0 12px #ffe89a,0 0 35px #ffbd37;animation:level-heading .7s ease-out}
@keyframes treasure-reveal{from{opacity:0;transform:translateY(-24px) scale(.3) rotate(-25deg);filter:brightness(2)}to{opacity:1;transform:translateY(0) scale(1) rotate(0);filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){.treasure-panel,.treasure-panel .reward-icon,.treasure-panel h1{animation:none}}

/* Keep gameplay instructions readable over every stage background. */
#hint{left:50%;transform:translateX(-50%);bottom:calc(18px + env(safe-area-inset-bottom,0px));width:max-content;max-width:calc(100% - 32px);padding:12px 22px;border:1px solid #e8d79b99;border-radius:14px;background:#081923eb;color:#fff3cb;font-size:clamp(17px,2.2vw,21px);font-weight:750;line-height:1.55;letter-spacing:.02em;text-shadow:0 2px 3px #0009;box-shadow:0 4px 18px #0007;overflow-wrap:anywhere;pointer-events:none}
@media(max-width:480px){#hint{max-width:calc(100% - 24px);padding:10px 14px;font-size:17px}}
@media(max-height:500px){#hint{bottom:calc(8px + env(safe-area-inset-bottom,0px));padding:7px 14px;font-size:16px}}

.overlay:has(.victory-panel){background:#08151c88;backdrop-filter:blur(1px)}
.victory-panel{padding:28px 22px;border:2px solid #ffe0a0;border-radius:24px;background:radial-gradient(ellipse at top,#736133dd,#142a2aee);box-shadow:0 0 80px #ffe09266;animation:victory-reveal 1s ease-out}
.victory-panel .eyebrow{font-size:20px;font-weight:900;color:#fff1b8;letter-spacing:.12em;text-shadow:0 0 20px #ffcd55}.victory-panel h1{color:#fff5d2;text-shadow:0 0 24px #ffc75d88}
@keyframes victory-reveal{from{opacity:0;transform:scale(.8) translateY(15px)}to{opacity:1;transform:scale(1) translateY(0)}}
@media(prefers-reduced-motion:reduce){.victory-panel{animation:none}}

.volume-control{display:block;text-align:left;margin:24px 0;padding:18px;border:1px solid #8ba69866;border-radius:14px;background:#152b32}.volume-control span{display:flex;justify-content:space-between;align-items:center;font-size:18px;font-weight:700}.volume-control output{color:#ffe7aa;font-variant-numeric:tabular-nums}.volume-control input{display:block;width:100%;height:32px;margin:14px 0 0;accent-color:#c5e8a3;cursor:pointer;touch-action:pan-y}#sound-preview{margin:0 0 8px;width:100%}

/* Stage and timer remain legible against both the forest and palace. */
header{align-items:flex-start;gap:12px}header>div:first-child{max-width:calc(100% - 150px);padding:10px 14px;background:#081923eb;border:1px solid #d8be7b99;border-left:3px solid #efd69a;border-radius:12px;box-shadow:0 3px 16px #0005}
#stage-label{font-size:17px;font-weight:850;line-height:1.35;letter-spacing:.035em;color:#ffe9ae;text-shadow:0 2px 3px #0009;overflow-wrap:anywhere}
#time{display:block;margin-top:3px;font-size:32px;line-height:1.1;color:#fffbed;text-shadow:0 2px 4px #0008}
.bars{top:calc(max(18px,env(safe-area-inset-top)) + 96px)}.kill-hud{top:calc(max(18px,env(safe-area-inset-top)) + 158px)}
@media(max-width:480px){header{gap:8px}header>div:first-child{max-width:calc(100% - 125px);padding:8px 10px}#stage-label{font-size:14px;line-height:1.4;min-height:40px}#time{font-size:28px}.bars{top:calc(max(18px,env(safe-area-inset-top)) + 106px)}.kill-hud{top:calc(max(18px,env(safe-area-inset-top)) + 170px)}}

.hero-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.hero-card .hero-portrait{float:none;margin:0 auto 8px;display:block;width:64px;height:74px}.hero-card{padding:12px}.hero-card b{padding-top:0}.hero-card span{font-size:12px}.hero-card:focus-visible{outline:2px solid #ffe4a2;outline-offset:2px}
.title-heroes{gap:14px;flex-wrap:wrap}.title-heroes>div{width:120px}.title-heroes canvas{width:120px;height:140px}@media(max-width:560px){.title-heroes{gap:8px}.title-heroes>div{width:calc(50% - 8px)}.title-heroes canvas{margin:auto;width:96px;height:112px}}

.hero-hp{display:inline-block;font-style:normal;font-size:12px;color:#fff0ba;padding:3px 7px;margin-left:4px;border:1px solid #cebe8a66;border-radius:7px;background:#0b202a88;font-variant-numeric:tabular-nums}

.hero-card .hero-portrait{width:128px;height:auto;aspect-ratio:1;margin:0 auto 8px;max-width:100%}.hero-card{min-height:208px}

body.ending-screen header,body.ending-screen .bars,body.ending-screen .kill-hud,body.ending-screen #boss-hud,body.ending-screen #barrier-status,body.ending-screen #hint{display:none}
body.ending-screen .overlay{background:#101a3044;backdrop-filter:none;overflow-y:auto;touch-action:pan-y;align-items:center;padding:24px 20px 140px}
.ending-panel{width:min(600px,100%);padding:26px;border:1px solid #efd6a577;border-radius:20px;background:#142336e8;box-shadow:0 16px 60px #11182788;animation:ending-appear .55s ease-out}.ending-panel h1{font-size:clamp(26px,5vw,38px);color:#ffe7b2}.ending-panel .ending-dialogue{font-size:clamp(17px,2.4vw,21px);line-height:1.85;color:#f4eee1;min-height:100px}.ending-panel .eyebrow{color:#ebcf9a}.ending-panel .primary{background:#eed7a9}.ending-credits{display:grid;gap:9px;color:#d7dfeb;font-size:14px}.ending-credits strong{margin:14px 0;color:#ffe7b2;letter-spacing:.12em}.ending-panel>p:not(.ending-dialogue){font-size:13px;margin:12px 0}.ending-panel .text-button{margin-top:12px}@keyframes ending-appear{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-height:650px){body.ending-screen .overlay{align-items:flex-start;padding-bottom:50px}.ending-panel{padding:18px}.ending-panel .ending-dialogue{min-height:0}}@media(prefers-reduced-motion:reduce){.ending-panel{animation:none}}

body.prologue-screen header,body.prologue-screen .bars,body.prologue-screen .kill-hud,body.prologue-screen #boss-hud,body.prologue-screen #barrier-status,body.prologue-screen #hint{display:none}body.prologue-screen .overlay{background:#101a3044;backdrop-filter:none;overflow-y:auto;touch-action:pan-y;padding-bottom:140px}@media(max-height:650px){body.prologue-screen .overlay{align-items:flex-start;padding-bottom:50px}}

/* Coalesced kill pulses avoid layout changes and repeated animation buildup. */
#kills{transform-origin:left center;position:relative;z-index:1}#kill-flash{position:absolute;left:-9px;top:10px;width:66px;height:66px;border:2px solid #ffe09a;border-radius:50%;opacity:0;box-shadow:0 0 15px #ffd36977;pointer-events:none}#kill-sparks{position:absolute;left:42px;top:22px;font-size:22px;line-height:1;color:#fff0b5;text-shadow:0 0 12px #ffd36e;opacity:0;pointer-events:none}

/* Hidden by default, including before scripts initialize. */
.kill-hud{display:none}body.combat-active .kill-hud{display:block}

/* HUD typography: strong contrast with restrained metallic accents. */
body.combat-active #stage-label{font-size:18px;letter-spacing:.025em;color:#ffe7a3;background:linear-gradient(180deg,#fff9de 0%,#f2d88e 55%,#d8ad57 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 1px 1px #07111e);text-shadow:none}
body.combat-active header>div:first-child{background:linear-gradient(135deg,#132a39f5,#0a1823f2);border-color:#e7c67a99;box-shadow:inset 0 1px 0 #fff1c022,0 4px 18px #0006}
body.combat-active .vitals{gap:12px;margin-bottom:9px;align-items:center}.vitals #level,.vitals #hp-label{font-size:18px;font-weight:850;line-height:1.2;font-variant-numeric:tabular-nums;letter-spacing:.015em;text-shadow:0 2px 3px #061322}
body.combat-active #level{padding:5px 9px;border:1px solid #abd6bb77;border-radius:7px;background:linear-gradient(135deg,#294a43ee,#163337ee);color:#e1ffc5;box-shadow:inset 0 1px 0 #dcffe822}
body.combat-active #hp-label{padding:5px 8px;border:1px solid #f4aaaa44;border-radius:7px;background:#152632ed}
body.combat-active .kill-hud{padding:8px 12px 9px;min-width:92px;border:1px solid #e8cf8366;border-left:3px solid #edd082;border-radius:10px;background:linear-gradient(135deg,#142c3be8,#101e2be5);box-shadow:inset 0 1px 0 #f8e3a51a,0 4px 14px #0004}
body.combat-active .kill-hud small{display:block;font-size:12px;font-weight:750;color:#d9d6c0;letter-spacing:.1em;margin-bottom:3px}
body.combat-active #kills{font-size:42px;font-weight:950;line-height:1.05;letter-spacing:.02em;background:linear-gradient(180deg,#fffce8 0%,#ffe8a4 40%,#e3ad52 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;text-shadow:none;filter:drop-shadow(0 2px 1px #080f1b)}
body.combat-active #kill-flash{left:2px;top:19px}body.combat-active #kill-sparks{left:62px;top:28px}
@media(max-width:480px){body.combat-active #stage-label{font-size:15px}.vitals #level,.vitals #hp-label{font-size:16px}body.combat-active .vitals{gap:6px}body.combat-active #level,body.combat-active #hp-label{padding:4px 6px}body.combat-active #kills{font-size:36px}body.combat-active .kill-hud{padding:7px 9px;min-width:80px}}
@supports not ((background-clip:text) or (-webkit-background-clip:text)){body.combat-active #stage-label,body.combat-active #kills{background:none;-webkit-text-fill-color:currentColor}}
body.combat-active .kill-hud{top:calc(max(18px,env(safe-area-inset-top)) + 174px)}@media(max-width:480px){body.combat-active .kill-hud{top:calc(max(18px,env(safe-area-inset-top)) + 186px)}}

/* Reward choices stay in their final hit-test positions from the first frame. */
.level-panel{animation:choice-panel-reveal .18s ease-out;transform:none;filter:none}.level-panel h1{animation:none}.level-panel .choice{animation:none;transition:none;position:relative}.level-panel .choice>*{pointer-events:none}.level-panel .choice:hover,.level-panel .choice:focus-visible{background:linear-gradient(110deg,#645a37,#25423b);border-color:#fff0b1;outline:2px solid #ffe4a2;outline-offset:2px;box-shadow:inset 0 0 0 1px #ffe4a244,0 0 12px #ffd36233}.overlay:has(.level-panel){backdrop-filter:none}.level-panel .choice::after{content:'›';font-size:30px;font-weight:800;line-height:1;color:#a69d77;flex:0 0 12px}.level-panel .choice:hover::after,.level-panel .choice:focus-visible::after{color:#fff0b1}@keyframes choice-panel-reveal{from{opacity:.85}to{opacity:1}}@media(prefers-reduced-motion:reduce){.level-panel{animation:none}}

.home-overlay{background:radial-gradient(ellipse at 50% 40%,#0c1d2955,#07151d99 80%);backdrop-filter:none}.home-panel{background:radial-gradient(ellipse at center,#19333bc9,#11233166 75%);border:1px solid #e3cc8b33;border-radius:24px}body.selection-screen header,body.selection-screen .bars,body.selection-screen #boss-hud,body.selection-screen #barrier-status,body.selection-screen #hint{visibility:hidden}body.selection-screen .overlay{background:#07151d66;backdrop-filter:none}.selection-panel{padding:24px 20px;border:1px solid #e3cc8b77;border-radius:24px;background:linear-gradient(145deg,#172e3cee,#10232fee);box-shadow:0 12px 40px #0005}.selection-panel h1{color:#ffe6af}.selection-panel .eyebrow{color:#d7ccaa}@media(max-width:480px){.selection-panel{padding:18px 12px}}

/* Open menu composition: the artwork extends past the controls without a enclosing panel. */
.home-panel,.selection-panel{border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}.home-overlay,body.selection-screen .overlay{background:radial-gradient(ellipse at center,#08182455 0%,#08182422 55%,#06121d44 100%);backdrop-filter:none}.home-panel{width:min(1000px,100%)}.home-panel .title-story,.selection-panel>p,.selection-panel>h1{color:#e4eadd;text-shadow:0 2px 5px #061321}.home-panel .text-button{display:inline-block;margin:12px 6px 0;padding:10px 14px;background:#10233199;border:1px solid #d1c18b33;border-radius:9px}.home-panel .primary{display:block;margin:12px auto 0}.selection-panel{width:min(1060px,100%)}.selection-panel .hero-card{background:linear-gradient(145deg,#193542ee,#102530ee);border-color:#bdcbaa55;box-shadow:0 8px 22px #0003}.selection-panel .hero-card[aria-pressed="true"]{background:linear-gradient(145deg,#3c5748ee,#203e3cee);border-color:#f1d895;box-shadow:0 0 0 1px #f1d895,0 0 20px #f1d89522}.selection-panel .primary,.selection-panel .settings-button{max-width:480px;margin:12px auto 0}.selection-panel .primary{display:block}.selection-panel>footer,.home-panel>footer{color:#b6c9c6;text-shadow:0 2px 3px #071624}
@media(min-width:1000px){.selection-panel .hero-choices{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:28px 0}.selection-panel .hero-card{padding:20px 14px;min-height:252px}.selection-panel .hero-portrait{width:160px}.home-panel .title-heroes{gap:50px;padding:16px 0 28px}.home-panel .title-heroes>div{width:150px}.home-panel .title-heroes canvas{width:144px;height:168px}.home-panel .game-logo{font-size:clamp(54px,4.5vw,78px)}}

.title-heroes{align-items:flex-start}.title-heroes .hero-name{font-size:17px;font-weight:850;letter-spacing:.045em;line-height:1.4;color:#fff0c5;text-shadow:0 2px 4px #07121d}.title-heroes .hero-lore{margin:9px 0 0;font-size:13px;line-height:1.7;color:#cadbd9;letter-spacing:.015em;text-shadow:0 2px 3px #06121d}.hero-card .hero-lore{margin:12px 0 0;padding-top:10px;border-top:1px solid #d2c39433;font-size:13px;font-weight:400;line-height:1.65;color:#cbd8dc;text-shadow:none}.title-heroes>div{width:160px}@media(min-width:1000px){.home-panel .title-heroes{gap:28px}.home-panel .title-heroes>div{width:200px}.home-panel .title-heroes canvas{margin:auto}}@media(max-width:560px){.title-heroes .hero-name{font-size:16px}.title-heroes .hero-lore{font-size:12px}}@media(max-height:780px){.home-overlay{align-items:flex-start}.home-panel{margin:0 auto}.home-panel .title-heroes{padding:8px 0 14px}.home-panel .game-logo{margin-top:12px}}

.title-logo{position:relative;isolation:isolate;padding:0 10px 8px;margin:0 auto;max-width:960px}.title-logo:before{content:"";position:absolute;inset:25% 8% 0;z-index:-1;background:radial-gradient(ellipse,#77e5de24,transparent 68%);filter:blur(12px);pointer-events:none}.title-crest{display:block;width:200px;height:92px;margin:0 auto -14px;color:#d8bb78;filter:drop-shadow(0 0 10px #e0c58455)}.home-panel .title-logo .game-logo{margin:0 0 12px;font-weight:900;font-size:clamp(32px,5vw,68px);line-height:1.3;letter-spacing:.035em;color:#ffe6a8;background:linear-gradient(180deg,#fff9df 15%,#ffe4a0 45%,#c99245 80%,#ffebac);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 3px 0 #473421) drop-shadow(0 5px 8px #0009);text-shadow:none}.game-subtitle{font-size:clamp(15px,2.1vw,22px);font-weight:700;letter-spacing:.14em;color:#e7eee4;margin:0 0 14px;text-shadow:0 2px 5px #06121d,0 0 18px #8ccfc955}.title-logo .title-rule:before,.title-logo .title-rule:after{width:clamp(70px,18vw,220px)}html[lang="en"] .home-panel .title-logo .game-logo{font-size:clamp(30px,4.6vw,64px);letter-spacing:.015em}html[lang="en"] .game-subtitle{letter-spacing:.055em}@media(max-width:560px){.title-crest{width:156px;height:72px;margin-bottom:-8px}.title-logo{padding-inline:0}.game-subtitle{letter-spacing:.06em}.home-panel .title-story{margin-top:10px}.home-panel .title-heroes>div{width:calc(50% - 8px)}}@media(max-height:780px){.title-crest{height:66px;width:144px}.language-switch{margin-bottom:12px}.title-logo{padding-bottom:0}.home-panel .title-story{margin:10px 0 4px}}

.home-panel #begin{margin:20px auto 12px}.home-panel .title-heroes{padding-top:4px;padding-bottom:4px}.home-panel #title-music,.home-panel #audio-settings,.home-panel #read-story,.home-panel #howto{margin-top:4px}@media(max-height:780px){.home-panel #begin{margin-top:14px}.home-panel .title-heroes{padding-bottom:4px}}

/* Keep hero selection and its actions together within the viewport. */
body.selection-screen .overlay{padding:16px;align-items:center}.selection-panel{padding:12px 16px}.selection-panel>h1{font-size:clamp(26px,3.5vw,40px);margin:8px 0}.selection-panel>p{margin:8px 0;font-size:14px;line-height:1.5}.selection-panel .hero-choices{gap:12px;margin:14px 0 8px}.selection-panel .hero-card{min-height:0;padding:12px}.selection-panel .hero-portrait{width:clamp(88px,16vh,144px);height:auto;margin:0 auto 6px}.selection-panel .hero-card b{padding:0;font-size:16px}.selection-panel .hero-card span{line-height:1.4}.selection-panel .selected-hero-lore{min-height:42px;margin:10px auto 12px;max-width:680px;padding:8px 14px;border-left:2px solid #e6cd8b;background:#19354288;color:#eadfbd;font-size:14px;line-height:1.5}.selection-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;max-width:680px;margin:auto;align-items:center}.selection-panel .selection-actions .primary{grid-column:1/-1;max-width:none;margin:0;padding:13px}.selection-panel .selection-actions .settings-button,.selection-panel .selection-actions .text-button{max-width:none;width:100%;margin:0;padding:10px;font-size:13px}.selection-panel>footer{margin-top:10px;font-size:11px}@media(min-width:1000px){.selection-panel .hero-choices{gap:14px;margin:16px 0 8px}}@media(max-height:720px){body.selection-screen .overlay{padding:10px}.selection-panel{padding:6px 12px}.selection-panel .hero-portrait{width:clamp(70px,13vh,100px)}.selection-panel .hero-choices{margin-top:10px;gap:8px}.selection-panel .hero-card{padding:9px}.selection-panel .selected-hero-lore{margin:8px auto;min-height:0}.selection-panel>footer{margin-top:6px}}@media(max-width:560px){.selection-panel{padding:4px}.selection-panel>p{font-size:12px}.selection-panel .hero-card b{font-size:14px}.selection-panel .hero-hp{display:block}.selection-panel .hero-card span{font-size:11px}.selection-panel .selected-hero-lore{font-size:12px}.selection-panel .eyebrow{font-size:10px;letter-spacing:.14em}}@media(max-height:500px) and (min-width:700px){.selection-panel .hero-choices{grid-template-columns:repeat(4,minmax(0,1fr))}.selection-panel>p{font-size:12px}.selection-panel .hero-portrait{width:64px}.selection-panel .hero-card b{font-size:13px}.selection-panel .hero-card span{font-size:11px}.selection-panel>h1{font-size:24px;margin:4px 0}.selection-panel .selected-hero-lore{font-size:12px;padding:5px 10px}.selection-panel>footer{display:none}}
@media(max-width:560px){.selection-panel .hero-portrait{width:88px}.selection-panel .hero-card{padding:8px}.selection-panel .hero-choices{gap:8px}.selection-panel .hero-hp{display:inline-block;margin-left:3px;padding:3px 5px;font-size:10px}.selection-panel .selection-actions .primary{padding:11px}.selection-panel .selection-actions .settings-button,.selection-panel .selection-actions .text-button{font-size:12px;padding:8px}}
@media(max-height:500px) and (min-width:700px){.selection-panel>p:not(.selected-hero-lore){display:none}.selection-panel .eyebrow{font-size:10px}.selection-panel .hero-choices{margin:6px 0}.selection-panel .selection-actions .primary{padding:9px}.selection-panel .selection-actions .settings-button,.selection-panel .selection-actions .text-button{padding:7px}.selection-panel .selected-hero-lore{margin:6px auto}}
body.selection-screen .overlay{background:radial-gradient(ellipse at center,#07152166 0%,#07152133 65%,#07152155 100%)}

.level-transition{display:flex;align-items:center;justify-content:center;gap:18px;margin:16px 0 10px;font-variant-numeric:tabular-nums;line-height:1.15}.level-before{font-size:clamp(24px,4vw,32px);font-weight:700;color:#bbcbc4}.level-arrow{font-size:30px;color:#dfca83}.level-after{font-size:clamp(42px,7vw,60px);font-weight:900;color:#ffe9a8;text-shadow:0 3px 0 #775422,0 0 22px #ffce6855}.level-panel .level-medal{font-size:42px}.level-panel h1{margin:10px 0}.level-panel>p{margin:10px 0 18px}@media(max-height:720px){.level-panel{padding:18px 16px}.level-transition{margin:10px 0 6px}.level-after{font-size:42px}.level-panel .level-medal{font-size:32px}.level-panel h1{font-size:30px;margin:6px 0}.level-panel>p{margin:8px 0 12px}}
@media(max-height:780px){.level-panel .level-medal .upgrade-icon{width:44px;height:44px}.level-panel .choice{min-height:76px;padding:12px}.level-panel .choices{gap:9px}}

/* A single compact upgrade heading leaves room for all three choices. */
.level-panel{padding:20px 18px}.level-panel .level-up-heading{font-size:clamp(24px,4vw,32px);line-height:1.2;margin:0 0 8px}.level-panel .level-transition{margin:8px 0;gap:14px}.level-panel .level-after{font-size:clamp(38px,6vw,48px)}.level-panel .level-before{font-size:26px}.level-panel .upgrade-prompt{font-size:13px;line-height:1.4;margin:8px 0 14px}.level-panel .choices{gap:10px}.level-panel .choice{min-height:80px;padding:13px}@media(max-height:650px){.level-panel{padding:14px}.level-panel .level-up-heading{font-size:23px;margin-bottom:4px}.level-panel .level-transition{margin:5px 0}.level-panel .level-after{font-size:36px}.level-panel .upgrade-prompt{margin:6px 0 10px}.level-panel .choice{min-height:68px;padding:10px}.level-panel .choice span{font-size:18px}.level-panel .choices{gap:8px}}@media(max-height:480px){.level-panel .choice{min-height:58px;padding:8px 10px}.level-panel .choice b{font-size:14px;margin-bottom:3px}.level-panel .choice span{font-size:16px}.level-panel .choice .upgrade-icon{width:32px;height:32px}.level-panel .level-up-heading{font-size:20px}.level-panel .level-after{font-size:30px}.level-panel .level-before{font-size:22px}.level-panel .upgrade-prompt{margin:4px 0 8px}}

.level-panel .skill-progress{display:block;margin:4px 0;font-size:12px;line-height:1.3;font-weight:650;color:#c1d9d0}.skill-progress em{color:#ffe8a3;font-style:normal}.level-panel .choice .upgrade-value{font-size:clamp(15px,2.4vw,18px);line-height:1.4}.level-panel .choice b{margin-bottom:3px}.level-panel .choice-copy{min-width:0}@media(max-height:480px){.level-panel .skill-progress{font-size:11px;margin:2px 0}.level-panel .choice .upgrade-value{font-size:14px}}
@media(max-height:480px){.level-panel{padding:10px 12px}.level-panel .level-up-heading{font-size:18px;margin-bottom:2px}.level-panel .level-transition{margin:3px 0}.level-panel .upgrade-prompt{display:none}.level-panel .choice{padding:7px 10px}.level-panel .choices{gap:6px}}

.selection-panel>.stage-lore{max-width:780px;margin:10px auto 6px;font-size:14px;line-height:1.6;color:#eee5c9;text-shadow:0 2px 4px #07121d}.selection-panel .stage-rules{font-size:11px;line-height:1.4;color:#bacdc9;margin:0 0 4px}@media(max-width:560px){.selection-panel>.stage-lore{font-size:12px;line-height:1.5;margin:7px auto 5px}.selection-panel .stage-rules{font-size:10px}}@media(max-height:500px) and (min-width:700px){.selection-panel>.stage-lore{display:block!important;font-size:11px;line-height:1.35;margin:4px auto;max-width:760px}.selection-panel .stage-rules{display:none}.selection-panel .hero-portrait{width:54px}.selection-panel .selected-hero-lore{margin:4px auto}.selection-panel .hero-choices{margin:4px 0}}
.ending-finale{width:min(720px,100%);padding:22px 26px;background:radial-gradient(ellipse at top,#564830dd,#152c3aee 70%);border-color:#ffe2a4aa;box-shadow:0 0 60px #ffde8b33,0 12px 40px #10213188}.ending-victory-seal{font-size:40px;line-height:1;color:#fff0b7;text-shadow:0 0 22px #ffdd73}.ending-achievement{margin-top:10px;color:#ffe8ac;font-size:15px;font-weight:850;letter-spacing:.15em}.ending-finale h1{font-size:clamp(25px,4vw,36px);margin:10px 0;color:#fff0c9}.ending-finale .ending-resolution{font-size:14px;line-height:1.65;margin:8px auto 12px;max-width:530px;color:#e0e8df}.ending-realms{display:flex;justify-content:center;gap:12px;margin:12px 0}.ending-realms .ending-realm{display:flex;gap:4px;align-items:center;justify-content:center;width:48px;height:34px;border:1px solid #e0c38777;border-radius:8px;background:#d6ac4d15;font-size:11px;color:#e7d9b8;animation:realm-restored .8s both;animation-delay:var(--realm-delay)}.ending-realms i{font-size:21px;font-style:normal;color:#ffe7a4}.ending-restoration{padding:10px 14px;background:#0a203d88;border-top:1px solid #ddc08744;border-bottom:1px solid #ddc08744;min-height:89px}.ending-restoration b{font-size:15px;color:#ffe5af}.ending-restoration p{margin:6px 0 0;font-size:13px;line-height:1.55;color:#d9e7e5}.ending-party{display:flex;justify-content:center;align-items:center;gap:22px;margin:6px 0}.ending-party canvas{width:90px;height:105px;object-fit:contain}.ending-record{padding:6px 10px;border-radius:8px;background:#fcde9612;color:#eedcb5}.ending-record small{font-size:10px;letter-spacing:.13em}.ending-record p{font-size:13px;margin:4px 0}.ending-finale .ending-thanks{font-size:13px;color:#e9e7d5;margin:12px 0}.ending-thanks strong{display:block;margin-top:7px;font-size:15px;letter-spacing:.11em;color:#ffe7ad}.ending-staff{font-size:12px;color:#c5d7d7;margin:10px 0 14px}.ending-staff summary{cursor:pointer;touch-action:manipulation;padding:5px}.ending-staff .ending-credits{padding:10px;gap:6px;font-size:12px}.ending-finale .primary{padding:12px;font-size:16px}.ending-finale .text-button{margin-top:6px;padding:8px}@keyframes realm-restored{from{opacity:0;transform:translateY(6px);filter:brightness(2)}to{opacity:1;transform:none;filter:brightness(1)}}body.ending-screen .overlay:has(.ending-finale){padding:18px;align-items:center}@media(max-height:780px){.ending-finale{padding:14px 20px}.ending-victory-seal{font-size:28px}.ending-achievement{margin-top:6px;font-size:13px}.ending-finale h1{margin:6px 0;font-size:28px}.ending-finale .ending-resolution{margin:6px 0 8px}.ending-realms{margin:8px 0}.ending-party canvas{width:70px;height:82px}.ending-restoration{min-height:72px;padding:8px 12px}.ending-finale .ending-thanks{margin:8px 0}.ending-staff{margin:6px 0 10px}}@media(max-width:560px){.ending-finale{padding:16px 12px}.ending-party{gap:8px}.ending-party canvas{width:64px;height:75px}.ending-realms{gap:6px}.ending-realms .ending-realm{width:40px}.ending-finale h1{font-size:26px}.ending-finale .ending-resolution{font-size:12px}.ending-restoration p{font-size:12px}.ending-thanks strong{font-size:12px}}@media(max-height:600px){body.ending-screen .overlay:has(.ending-finale){align-items:flex-start;padding:12px}.ending-victory-seal{display:none}.ending-party canvas{width:52px;height:60px}.ending-achievement{margin-top:0}.ending-finale .ending-resolution{font-size:12px}.ending-finale .ending-thanks{font-size:12px}.ending-finale .ending-restoration{min-height:0}}@media(prefers-reduced-motion:reduce){.ending-realms .ending-realm{animation:none}}

.ending-realms .ending-realm{padding:0}.ending-realms .ending-realm:hover,.ending-realms .ending-realm:focus-visible{background:#f8d77b33;border-color:#ffe1a0;outline:2px solid #ffe1a066;outline-offset:2px}

.ending-realms .ending-realm[aria-pressed="true"]{background:#f8d77b33;border-color:#ffe1a0;box-shadow:0 0 12px #ffdf8b33}

.ending-restoration{position:relative;isolation:isolate;overflow:hidden;border-radius:9px;background:#0a203d;min-height:100px;display:flex;flex-direction:column;justify-content:center}.ending-restoration #ending-realm-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2;opacity:.7;pointer-events:none}.ending-restoration:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#071521bb,#07152166 50%,#071521bb);pointer-events:none}.ending-restoration b,.ending-restoration p{text-shadow:0 2px 4px #000,0 0 8px #06121d}.ending-restoration p{color:#f0f5e9}@media(max-height:780px){.ending-restoration{min-height:90px}}@media(max-width:560px){.ending-restoration{min-height:110px}}@media(max-height:600px){.ending-finale .ending-restoration{min-height:76px}}

.ending-credits .credits-subtitle{display:block;font-size:11px;line-height:1.6;color:#e4d5b3;letter-spacing:.025em}

#minimap{display:none;position:absolute;top:calc(max(18px,env(safe-area-inset-top)) + 64px);right:22px;width:160px;padding:8px;border:1px solid #c9d5bb55;border-radius:12px;background:linear-gradient(145deg,#17323bea,#071723ee);box-shadow:0 5px 18px #0005;pointer-events:none}body.combat-active #minimap{display:block}.minimap-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:10px;margin-bottom:5px;color:#e3e8cb}.minimap-heading span{font-size:9px;color:#dbbbb2;font-variant-numeric:tabular-nums}#minimap-canvas{display:block;width:100%;height:auto;aspect-ratio:1;border-radius:5px}.minimap-legend{display:flex;justify-content:space-between;font-size:9px;margin-top:5px;line-height:1.3;white-space:nowrap}#map-player{color:#aaffdd}#map-enemy{color:#ff9693}#map-boss{color:#ffdc7d}@media(max-width:600px){#minimap{right:12px;width:120px;padding:6px}.minimap-heading{font-size:9px}.minimap-legend{font-size:8px}}@media(max-width:350px){#minimap{width:98px}.minimap-heading span{display:none}.minimap-legend{font-size:7px}}@media(max-height:500px){#minimap{width:112px;padding:5px}}

.stage-menu-panel{width:min(900px,100%);padding:14px 18px;overflow:visible}.stage-menu-panel h1{font-size:clamp(25px,4vw,36px);margin:10px 0;color:#ffe5b4}.stage-menu-panel>p{font-size:13px;margin:8px 0 16px}.stage-menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.stage-menu-card{overflow:hidden;padding:0 0 12px;background:#102a36ef;border:1px solid #b9c7b366;border-radius:12px;text-align:left;box-shadow:0 5px 16px #0004}.stage-menu-card canvas{width:100%;height:110px;object-fit:cover;border-bottom:1px solid #c6d5bf44}.stage-menu-card small{display:block;font-size:10px;margin:10px 12px 4px;color:#b5c9ca;letter-spacing:.08em}.stage-menu-card b{display:block;font-size:17px;margin:0 12px;color:#ffebbd}.stage-menu-card:hover,.stage-menu-card:focus-visible{border-color:#ffe1a0;background:#29483f;outline:2px solid #ffe1a077;outline-offset:2px}.stage-menu-panel .text-button{margin-top:16px}.home-panel #choose-stage{display:inline-block;margin:4px 6px 0;padding:10px 14px;background:#10233199;border:1px solid #d1c18b33;border-radius:9px}@media(max-width:700px){.stage-menu-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stage-menu-panel{padding:8px 0}.stage-menu-card canvas{height:88px}.stage-menu-card b{font-size:14px}.stage-menu-card small{margin-top:7px}.stage-menu-panel>p{font-size:12px}}@media(max-height:600px){.stage-menu-panel{padding:6px 0}.stage-menu-card canvas{height:64px}.stage-menu-card{padding-bottom:8px}.stage-menu-panel h1{font-size:26px;margin:6px 0}.stage-menu-panel>p{margin:6px 0 10px}.stage-menu-card b{font-size:14px}.stage-menu-panel .text-button{margin-top:8px}}@media(max-height:480px) and (min-width:700px){.stage-menu-card canvas{height:44px}.stage-menu-grid{gap:8px}.stage-menu-card small{margin:5px 10px 3px}.stage-menu-panel>p{font-size:11px}}

@media(max-height:480px) and (min-width:700px){.stage-menu-card canvas{height:34px}.stage-menu-panel h1{font-size:23px;margin:4px 0}.stage-menu-panel .text-button{padding:6px;margin-top:6px}}

.ending-dialogue .divine-name{font-weight:850;color:#ffe5a2;text-shadow:0 0 10px #ffd06f66,0 2px 4px #101b2c;letter-spacing:.045em}

.treasure-panel .treasure-heading{font-size:clamp(30px,5vw,40px);margin:0 0 10px;line-height:1.25}.chest-quota{font-size:12px;font-weight:750;color:#f4e0ae;margin-bottom:12px}.treasure-reward-name{font-size:24px;color:#fff1b9;margin:8px 0 14px}.chest-actions{display:grid;grid-template-columns:1.3fr 1fr;gap:10px}.chest-actions .settings-button{margin:0;font-size:15px}.treasure-panel .chest-note{font-size:11px;line-height:1.5;margin:12px 0 0;color:#d4d8c9}.treasure-panel .reward-confirmation{font-size:14px;line-height:1.5;margin:14px 0}.treasure-panel .reward-effect{font-size:clamp(19px,4vw,25px);line-height:1.45;padding:14px 12px}@media(max-height:650px){.treasure-panel .treasure-heading{font-size:29px;margin-bottom:6px}.chest-quota{margin-bottom:6px}.treasure-panel .reward-icon .upgrade-icon{width:40px;height:40px}.treasure-reward-name{font-size:21px;margin:6px 0 10px}.treasure-panel .reward-effect{font-size:19px;padding:10px}.treasure-panel .reward-confirmation{margin:10px 0}.chest-actions button{padding:10px}.treasure-panel .chest-note{margin-top:8px}}@media(max-height:480px){.treasure-panel .reward-icon{display:none}.treasure-panel .treasure-heading{font-size:25px}.treasure-panel .reward-effect{font-size:17px}.treasure-panel{padding:12px}.treasure-reward-name{font-size:19px}.treasure-panel .chest-note{font-size:10px}}

/* Keep the language selector compact as more translations are added. */
.language-switch{align-items:center;margin-bottom:12px}.language-switch label{font-size:13px;color:#d6e4df}.language-switch select{max-width:190px;border:1px solid #c9b57888;background:#172d35;color:#fff0c5;border-radius:9px;padding:7px 12px;font:inherit;font-size:14px}.maintenance-note{font-size:13px;color:#b8c9cc}.maintenance-message{color:#ffe3a0;min-height:1.5em}.home-panel #maintenance{margin-top:4px}html:not([lang="ja"]) .game-subtitle{letter-spacing:.025em}html:not([lang="ja"]) .home-panel .title-logo .game-logo{font-size:clamp(28px,4.5vw,58px);overflow-wrap:break-word}html:not([lang="ja"]) .hero-card b{font-size:clamp(15px,1.7vw,21px)}html:not([lang="ja"]) .selection-panel .stage-lore{line-height:1.4}html:not([lang="ja"]) .choice-copy b{overflow-wrap:anywhere}@media(max-width:560px){.language-switch{margin-bottom:8px}.language-switch select{font-size:13px}.game-subtitle{font-size:14px}.maintenance-note{font-size:12px}}

/* Portrait phones: reserve less space for the HUD while keeping 44px touch targets. */
@media(max-width:600px) and (max-aspect-ratio:1/1){
 body.combat-active header{top:max(10px,env(safe-area-inset-top));left:10px;right:10px;gap:8px}
 body.combat-active header>div:first-child{flex:1;min-width:0;width:auto;max-width:calc(100% - 102px);padding:6px 8px;border-radius:9px;border-left-width:2px}
 body.combat-active #stage-label{font-size:12px;line-height:1.25;min-height:0;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
 body.combat-active #time{font-size:24px;line-height:1.1;margin-top:2px}
 body.combat-active .stats{gap:6px;flex:none}
 body.combat-active #sound,body.combat-active #pause{width:44px;min-width:44px;min-height:44px;padding:5px;font-size:10px;line-height:1.1;overflow-wrap:anywhere;border-radius:10px}
 body.combat-active #pause{font-size:16px}
 body.combat-active .bars{left:10px;top:calc(max(10px,env(safe-area-inset-top)) + 64px);width:min(260px,calc(100vw - 112px))}
 body.combat-active .vitals{gap:6px;margin-bottom:5px}
 body.combat-active #level,body.combat-active #hp-label{font-size:13px;padding:3px 5px;letter-spacing:0}
 body.combat-active .track{height:4px;margin-bottom:4px}
 body.combat-active .track.xp{height:2px}
 body.combat-active .kill-hud{left:10px;top:calc(max(10px,env(safe-area-inset-top)) + 104px);display:flex;align-items:center;gap:8px;padding:4px 8px;min-width:0;border-left-width:2px;border-radius:8px}
 body.combat-active .kill-hud small{font-size:10px;letter-spacing:0;margin:0}
 body.combat-active #kills{font-size:23px;line-height:1}
 body.combat-active #kill-flash{top:3px}
 body.combat-active #kill-sparks{top:8px;left:auto;right:5px}
 body.combat-active #minimap{top:calc(max(10px,env(safe-area-inset-top)) + 50px);right:10px;width:76px;padding:5px;border-radius:8px;box-shadow:0 2px 8px #0004}
 body.combat-active .minimap-heading{justify-content:center;margin-bottom:3px;line-height:1}
 body.combat-active .minimap-heading b,body.combat-active .minimap-legend{display:none}
 body.combat-active .minimap-heading span{font-size:8px;display:block;white-space:nowrap}
 body.combat-active #hint{font-size:13px;line-height:1.4;padding:7px 11px;max-width:calc(100% - 24px);border-radius:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px))}
 body.combat-active #boss-hud{font-size:11px;bottom:calc(72px + env(safe-area-inset-bottom,0px));width:min(300px,80vw)}
 body.combat-active .boss-track{height:6px;margin-top:4px}
}

/* Game UI is not a document: holding a finger must not open iOS copy/selection menus. */
#game,#panel,header,.bars,.kill-hud,#hint,#boss-hud,#minimap,#barrier-status{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#panel select,#panel input{user-select:auto;-webkit-user-select:auto;-webkit-touch-callout:default}
button{-webkit-tap-highlight-color:transparent}
