:root{color-scheme:dark;--ink:#151619;--gray:#494949;--light:#d1d1cb;--green:#8fce4f;--gold:#f4dc40}*{box-sizing:border-box}body{margin:0;background:#151617;display:flex;justify-content:center;align-items:center;min-height:100dvh;color:#fff;font:700 13px/1.5 ui-monospace,'Hiragino Kaku Gothic ProN','Yu Gothic',monospace}button,select{font:inherit}button{color:#fff;text-shadow:2px 2px #151515,-1px -1px #151515,1px -1px #151515,-1px 1px #151515;background:#c2c3be;border:3px solid #171717;border-radius:7px;box-shadow:inset 3px 3px #f2f2ea,inset -3px -3px #838580,0 2px #090909;cursor:pointer;padding:7px 10px;touch-action:manipulation}button:hover:not(:disabled){outline:1px solid #c1edff;outline-offset:-2px}button:active:not(:disabled){transform:translateY(2px);box-shadow:inset 2px 2px #777,inset -2px -2px #ccc}button:focus-visible,select:focus-visible{outline:3px solid #ffed75;outline-offset:2px}button:disabled{filter:brightness(.45);cursor:not-allowed}.blue{background:#2789dc;box-shadow:inset 3px 3px #85c6ff,inset -3px -3px #085eb3,0 2px #090909}.magenta{background:#b928c8;box-shadow:inset 3px 3px #e780ef,inset -3px -3px #76147d,0 2px #090909}.gold{background:#e7c347;box-shadow:inset 3px 3px #fff5a0,inset -3px -3px #947426,0 2px #090909}[hidden]{display:none!important}.game-shell{width:min(100%,460px);height:min(96dvh,820px);min-height:590px;position:relative;border:4px solid #91938d;box-shadow:0 0 0 3px #111,0 12px 50px #0008;background:repeating-linear-gradient(#454545 0 2px,#3d3d3d 2px 4px);overflow:hidden}#play-screen{height:100%;position:relative}.hud{height:32px;background:#333b;border-bottom:2px solid #686868;display:flex;justify-content:space-between;align-items:center;padding:0 7px;font-size:16px;line-height:1;text-shadow:2px 2px #111;white-space:nowrap}.hud>div{display:flex;gap:3px;align-items:center}.coin{color:#ffed35;text-shadow:2px 0 #978318,-2px 0 #978318,0 2px #978318}.hourglass{color:#8adaff;font-size:15px}#stage{font-size:16px}#timer{font-size:14px}.battle-screen{height:calc(100% - 88px);position:relative}.field{height:62%;padding-top:17%;display:flex;flex-direction:column;justify-content:space-between;gap:15px}.enemy-line{display:flex;align-items:center;gap:0;min-height:95px}.unit-row{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;align-content:start}.enemy-row{flex:1;grid-template-columns:repeat(4,minmax(0,1fr))}.ally-row{margin:0 6px;max-height:175px;overflow-y:auto;scrollbar-width:thin;padding-bottom:7px}.unit{border:0;box-shadow:none;background:transparent;border-radius:0;padding:0;min-width:0;position:relative;text-align:center;height:98px;font-size:10px;line-height:1.2;text-shadow:1px 1px #000,-1px -1px #000}.unit:hover:not(:disabled){background:#ffffff0b}.unit:active:not(:disabled){box-shadow:none}.unit.selected{filter:drop-shadow(0 0 3px #ffff4e)}.unit .hero{width:52px;max-width:100%;height:54px;object-fit:contain;image-rendering:pixelated;position:relative;z-index:2;display:block;margin:0 auto -16px;transition:transform .1s}.unit.attack .hero{transform:translateY(-8px)}.enemy-row .unit.attack .hero{transform:translateY(6px)}.unit.stunned .hero{opacity:.55}.platform{display:block;width:100%;height:35px;overflow:visible}.unit .unit-label{display:block;height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:-9px;position:relative;z-index:3}.bar{height:6px;background:#171717;padding:1px;margin:1px 3px 0;border-bottom:1px solid #777}.bar i{display:block;height:100%;background:#8ce86e}.bar.danger i{background:#f47c61}.bar.action{height:4px;margin-top:2px}.bar.action i{background:#fff}.empty-unit .platform{margin-top:31px}.empty-unit .unit-label{color:#fff9}.sign{flex:0 0 46px;height:95px;position:relative;background:none;box-shadow:none;border:0;padding:0;border-radius:0;font-size:11px}.sign span{display:block;background:#edc344;border:3px solid #171717;box-shadow:inset 2px 2px #fff392,inset -2px -2px #846814;padding:5px 1px;position:relative;z-index:2}.sign:after{content:'';position:absolute;background:#ad8530;border:2px solid #191919;width:7px;height:28px;left:19px;top:44px}.sign small{position:absolute;bottom:0;left:0;width:100%;z-index:3}.sign.back span{clip-path:polygon(18% 0,100% 0,100% 100%,18% 100%,0 50%)}.sign.next span{clip-path:polygon(0 0,82% 0,100% 50%,82% 100%,0 100%)}.sign:active:not(:disabled){box-shadow:none}.battle-status,.event-line{margin:8px 6px 0;padding:4px 6px;background:#292929aa;font-size:11px;min-height:24px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.event-line{background:transparent;color:#ddd;font-size:10px;margin-top:2px}.battle-hint{text-align:center;font-size:11px;color:#ccc;padding:12px}.bottom-menu{position:absolute;bottom:5px;left:5px;right:5px;display:grid;grid-template-columns:1fr 1.15fr .55fr .65fr;gap:4px;height:45px}.bottom-menu button{padding:5px 2px;font-size:13px;letter-spacing:-.6px}.bottom-menu .active{color:#fff04c}.pixel-panel{background:#414141;border:3px solid #eee;border-radius:7px;box-shadow:0 0 0 2px #111,inset 0 0 0 2px #929292}.detail{position:absolute;bottom:59px;left:5px;right:5px;min-height:164px;padding:9px 8px;z-index:5}.close{padding:0;width:34px;height:34px;font-size:27px;line-height:24px}.detail>.close{position:absolute;right:5px;top:5px;z-index:2}.detail-grid{display:grid;grid-template-columns:68px 1fr;gap:8px}.detail-portrait{width:64px;height:66px;image-rendering:pixelated;object-fit:contain}.stat-column{font-size:11px;line-height:1.5}.stat-column img{display:block}.detail h2{font-size:15px;margin:0 35px 2px 0;line-height:1.4}.detail .type{font-size:10px;color:#ddd}.detail .description{font-size:10px;margin:4px 0;min-height:32px}.detail-actions{display:flex;gap:5px}.detail-actions button{flex:1;font-size:11px;line-height:1.2;padding:6px 2px}.detail-actions small{display:block;font-size:11px}.shop-screen{padding:6px 6px 0;height:calc(100% - 90px);overflow:auto}.shop-heading{display:flex;justify-content:space-between;font-size:10px;margin-bottom:8px;color:#ddd}.shop-heading>span:first-child{font-size:15px;color:#fff}.pager{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:3px 0}.pager button{width:105px;font-size:12px;padding:6px}.pager b{letter-spacing:2px;font-size:13px}.market{display:grid;gap:3px;margin:4px 0}.market-row{display:flex;align-items:center;height:43px;border-width:2px;border-radius:6px;padding:2px 6px;gap:7px;box-shadow:inset 2px 2px #eee,inset -2px -2px #888,0 1px #111;text-align:left;color:#fff}.market-row.chosen{background:#5291b5}.market-row.locked{background:#797973}.market-row img{width:34px;height:35px;object-fit:contain;image-rendering:pixelated}.market-row .name{flex:1;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.market-row .price{font-size:12px;white-space:nowrap}.market-row .rate{font-size:10px;color:#eee;min-width:37px;text-align:right}.shop-tools{display:flex;gap:5px;align-items:center;margin-top:9px;font-size:9px;color:#ddd;flex-wrap:wrap}.shop-tools select{font-size:10px;padding:3px;background:#333;border:1px solid #aaa;border-radius:2px;max-width:100px}.shop-screen:has(~.detail:not([hidden])){padding-bottom:175px}.overlay{position:absolute;inset:45px 8px 62px;z-index:10;padding:12px;overflow:auto}.overlay>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.overlay h2{margin:0;font-size:20px}.overlay p{font-size:12px;font-weight:500;line-height:1.8}.overlay h3{font-size:14px;color:#f8e050}.setting{display:flex;align-items:center;gap:6px;font-size:12px}.option-actions{display:flex;gap:8px;margin:18px 0}.option-actions button{flex:1;font-size:12px}#options-panel>button{display:block;width:100%;margin:12px 0}a{color:#b6daff}.artifact{display:flex;align-items:center;gap:14px;border:2px solid #96968e;padding:12px 8px;margin:8px 0;background:#343434}.artifact .icon{font-size:24px;color:#f5db49}.artifact small{display:block;font-size:11px;color:#ccc}.chest{width:82px;height:59px;margin:24px auto 20px;background:#985e32;border:5px solid #151515;border-radius:9px 9px 2px 2px;box-shadow:inset 0 4px #d4a14b,inset 0 -4px #5f391f;position:relative}.chest:before{content:'';position:absolute;left:0;right:0;top:19px;height:5px;background:#181613;border-top:3px solid #d9ac46}.chest:after{content:'';position:absolute;left:29px;top:17px;width:13px;height:18px;background:#f1cf53;border:3px solid #2e2918}.save-warning{position:absolute;bottom:54px;left:8px;right:8px;background:#552c20;color:#fff;font-size:10px;z-index:12;margin:0}.save-warning:empty{display:none}dialog{color:#fff;max-width:calc(100% - 30px);width:390px;text-align:center;padding:22px;max-height:90dvh}dialog::backdrop{background:#000b}dialog h2{font-size:21px}dialog p{font-size:12px}#reward{padding:12px;font-size:12px}#reward strong{display:block;color:#f4db55;font-size:19px;margin-bottom:8px}#retry{width:100%}.title-screen{height:100%;position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;background:#30362e}.title-logo{text-align:center;z-index:1;line-height:1.1;margin-top:30px}.title-logo h1{color:#b0ef79;font-size:53px;letter-spacing:-4px;margin:5px 0 12px;text-shadow:4px 4px #16240d,-3px -3px #fff,3px -3px #fff,-3px 3px #fff,6px 7px #101410;font-weight:1000}.title-logo small{font-size:11px;letter-spacing:3px;color:#eee}.title-logo>span{letter-spacing:5px;color:#d5eaad;font-size:12px}.start{width:75%;font-size:22px;height:65px;z-index:1;margin-top:28px}.title-note{font-size:10px;z-index:1;background:#191919aa;padding:4px 12px}.title-menu{position:absolute;bottom:18px;display:flex;gap:10px;z-index:1}.title-menu button{min-width:120px;font-size:12px}#title-cast{position:absolute;inset:0;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(5,1fr);align-items:center;opacity:.45;overflow:hidden}#title-cast img{width:90%;height:90px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 4px #121612)}@media(max-width:500px){body{align-items:flex-start}.game-shell{width:100%;height:100dvh;min-height:580px;border-width:2px;box-shadow:none}.hud{font-size:14px;height:30px}#stage{font-size:14px}#timer{font-size:12px}.unit .hero{width:48px;height:50px}.unit{height:92px}.sign{flex-basis:43px}.field{padding-top:19%}.bottom-menu{height:44px;bottom:max(5px,env(safe-area-inset-bottom))}.title-logo h1{font-size:48px}}@media(max-height:690px){.shop-heading{margin-bottom:2px}.market-row{height:36px}.market-row img{height:29px}.pager button{padding:4px}.shop-tools{margin-top:4px}.field{padding-top:10%;height:58%}.detail{min-height:152px}.detail .description{min-height:22px;font-size:9px}.title-logo h1{font-size:44px}.overlay{inset:35px 7px 58px}.unit{height:85px}.battle-hint{padding:5px}}
.game-shell{--game-height:min(96dvh,820px)}.field{height:65%;padding-top:calc(var(--game-height)*.20);justify-content:flex-start;gap:35px}.enemy-row{display:flex;justify-content:center;flex-wrap:wrap}.enemy-row .unit{width:calc(25% - 3px);flex:none}.ally-row{flex-shrink:0}.market-row .name{font-size:14px}.market-row .price{font-size:13px}@media(max-width:500px){.game-shell{--game-height:100dvh}.market-row .name{font-size:12px}.field{gap:30px}}@media(max-height:690px){.field{padding-top:calc(var(--game-height)*.17);gap:25px}.battle-status{font-size:10px}}
.game-shell{--menu-gap:max(5px,env(safe-area-inset-bottom))}.bottom-menu{bottom:var(--menu-gap)}.detail{bottom:calc(var(--menu-gap) + 54px)}.overlay{bottom:calc(var(--menu-gap) + 57px)}
#battle-effects{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4;image-rendering:pixelated}.unit .hero{transform:translate(var(--fx-x,0px),var(--fx-y,0px));transition:none;will-change:transform}.motion-setting{margin-top:14px}@media(prefers-reduced-motion:reduce){button:active:not(:disabled){transform:none}}
/* Modern arcade finish: keep the portrait layout and pixel characters. */
body{background:radial-gradient(ellipse at 50% 25%,#182841,#070d19 75%)}
.game-shell{border-color:#5c7494;background:radial-gradient(ellipse at 50% 27%,#2b4057 0,#182638 56%,#111b2e 100%);box-shadow:0 0 0 2px #091322,0 20px 80px #0008}
.hud{background:linear-gradient(180deg,#22354e,#162439);border-bottom:1px solid #7393b64d;height:32px;color:#e9f4ff;position:relative}.hud #coins{color:#ffdc79;display:inline-block}
button{background:linear-gradient(#516681,#33465f);border-color:#172338;box-shadow:inset 0 1px #c3d8ec80,inset 0 -3px #182539,0 3px 0 #080f1d;border-radius:9px;text-shadow:0 2px 1px #07101c}
.blue{background:linear-gradient(#369cec,#216acb);box-shadow:inset 0 1px #c6eeffb3,inset 0 -3px #184c95,0 3px #0a1831}.magenta{background:linear-gradient(#b562cf,#8444ad);box-shadow:inset 0 1px #ecc4ff,inset 0 -3px #593270,0 3px #100f25}.gold{background:linear-gradient(#f8d675,#c39138);box-shadow:inset 0 1px #fff2bd,inset 0 -3px #8e6127,0 3px #26190e}
.unit,.sign{background:transparent;box-shadow:none;border-radius:0}.unit .hero{filter:drop-shadow(0 3px 2px #09142488)}.unit.selected .hero{filter:drop-shadow(0 0 4px #8bffda)}
.bar{border-bottom-color:#63879b66;border-radius:2px;background:#091422}.bar i{background:linear-gradient(90deg,#50d49a,#c6ff89);box-shadow:0 0 4px #74ffb34d}.bar.danger i{background:linear-gradient(90deg,#ee745f,#ffc28a)}.bar.action i{background:linear-gradient(90deg,#7ab9ff,#f0fcff)}
.battle-status{background:linear-gradient(90deg,#6be9c21c,#6be9c204);border-left:2px solid #74e8c0;color:#cbffe8}.event-line{color:#aabed4}.battle-hint{color:#a5b8d2}.bottom-menu{z-index:6}.bottom-menu button{font-size:12px}.pixel-panel{background:linear-gradient(145deg,#24364d,#142135);border:2px solid #91b1cd;box-shadow:0 0 0 2px #09111f,0 12px 32px #0007}
.market-row{background:linear-gradient(100deg,#3a516d,#293c56);box-shadow:inset 0 1px #8aa5bf66,0 2px #0d1728;border-color:#152339}.market-row.chosen{background:linear-gradient(100deg,#306b82,#29497c);border-color:#82efd5}.market-row.locked{background:#263347}.artifact{background:#17283d;border-color:#405c78;border-radius:10px}.artifact small{color:#a9c5de}
#trade-feedback{position:absolute;top:45px;left:50%;transform:translateX(-50%);width:max-content;max-width:94%;z-index:8;pointer-events:none;padding:10px 14px;border:1px solid #84f0cc;border-radius:12px;background:#143a37f5;color:#d3ffed;box-shadow:0 5px 25px #0005;font-size:12px;text-align:center}#trade-feedback[data-tone=gold]{background:#49391af5;border-color:#e9c977;color:#fff0b6}
#result[open] .chest{animation:chest-open .75s ease-out both}#result[open] #reward{animation:reward-reveal .8s ease-out both}#result[open] .chest:before{animation:lid-open .75s ease-out both}#result[open] .chest i{position:absolute;inset:-28px;z-index:-1;background:conic-gradient(from 0deg,transparent,#ffdc754d,transparent,#8cffe04d,transparent);border-radius:50%;animation:reward-reveal .8s ease-out both}#result{overflow-x:hidden;background:radial-gradient(ellipse at 50% 40%,#3b4250,#142135 75%)}#result-title{color:#edffe8;letter-spacing:1px}.reward-kicker{display:block;font-size:9px;letter-spacing:2px;color:#8edac8;margin:10px 0 5px}.boost-change{font-size:22px;margin:8px 0;color:#a7bace}.boost-change span{color:#6ef0be}.boost-change b{color:#bdff9b;font-size:28px}
@keyframes chest-open{0%{transform:scale(.92)}25%{transform:rotate(-4deg) scale(.96)}45%{transform:rotate(4deg)}60%{transform:scale(1.2);filter:drop-shadow(0 0 16px #ffdc77)}100%{transform:scale(1);filter:drop-shadow(0 0 8px #ffdc7766)}}
@keyframes lid-open{0%,40%{transform:translateY(0)}65%,100%{transform:translateY(-20px) rotate(-8deg)}}
@keyframes reward-reveal{0%,45%{opacity:0;transform:translateY(12px) scale(.9)}75%{opacity:1;transform:translateY(-3px) scale(1.04)}100%{opacity:1;transform:none}}
:root[data-motion=reduced] *, :root[data-motion=reduced] *:before{animation:none!important;transition:none!important}:root[data-motion=reduced] button:active{transform:none}
.audio-setting{display:grid;grid-template-columns:45px 1fr 58px;gap:8px;align-items:center;margin:14px 0;font-size:12px}.audio-setting input[type=range]{width:100%;accent-color:#74e8c0}.audio-setting label{font-size:10px}.audio-note{color:#a9c5de;font-size:10px!important}
.audio-setting>span small{display:block;font-size:10px;color:#a9c5de}#trade-feedback{top:35px;padding:6px 12px;font-size:11px}
#dungeon-bg{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;opacity:.76;pointer-events:none}.field,.battle-status,.event-line,.battle-hint{position:relative;z-index:1}.dungeon-heading{position:absolute;top:12px;left:12px;right:12px;z-index:2;text-shadow:0 2px 3px #000;display:flex;flex-direction:column;gap:3px}.dungeon-heading span{font-size:16px;color:#e7ffe8}.dungeon-heading b{font-size:10px;color:#bde4ef;letter-spacing:1px}.enemy-row .unit{width:calc(16.666% - 3px)}.enemy-line{padding:0 8px}.battle-status,.event-line{background:#0c1928cc}.battle-hint{color:white;text-shadow:0 1px 3px #000}.battle-hint button{position:relative}.title-note{font-size:11px}#perk-choice{width:410px;padding:20px 16px;background:radial-gradient(at top,#315757,#142135 65%)}#perk-choice>small{color:#ffdf87;letter-spacing:3px}#perk-choice h2{font-size:19px}#perk-cards{display:grid;gap:10px;margin:16px 0}#perk-cards button{text-align:left;padding:14px;background:linear-gradient(110deg,#355568,#223349);border:1px solid #7dc9bd;display:grid;grid-template-columns:32px 1fr;gap:5px 10px}#perk-cards button>span{font-size:26px;grid-row:span 2;color:#ffe4a0}#perk-cards strong{font-size:15px;display:flex;justify-content:space-between}#perk-cards small{font-size:11px;color:#a8ffd9}#perk-cards p{margin:0;color:#e0edf6;font-size:11px;font-weight:500}#choice-depth{color:#a9d5df}.field{background:linear-gradient(transparent,#08121d22)}
#floor-fade{position:absolute;inset:0;z-index:3;background:#08121c;opacity:0;pointer-events:none}
/* Persistent aura layers: only their transform follows the simulation clock. */
.unit.miniboss{--aura:#ffbc54;--aura-core:#ffebaf}.unit.boss{--aura:#b34dff;--aura-core:#ff4678}.unit.miniboss,.unit.boss{isolation:isolate}
.boss-aura{position:absolute;z-index:0;left:50%;top:-4px;width:58px;height:64px;pointer-events:none;background:var(--aura);mask-image:var(--aura-image);mask-size:contain;mask-position:center;mask-repeat:no-repeat;transform:translateX(-50%) scale(var(--aura-pulse,1));opacity:.8}
.boss-flames{position:absolute;left:50%;top:-8px;width:60px;height:66px;z-index:0;pointer-events:none;background:radial-gradient(ellipse at 50% 85%,var(--aura-core),var(--aura) 35%,transparent 70%);clip-path:polygon(0 100%,7% 45%,21% 65%,24% 18%,39% 46%,52% 0,64% 45%,80% 16%,82% 65%,95% 36%,100% 100%);opacity:.55;transform:translate(-50%,var(--aura-rise,0px)) scaleX(var(--aura-pulse,1))}
.unit.miniboss .hero,.unit.boss .hero{filter:drop-shadow(1px 0 var(--aura-core)) drop-shadow(-1px 0 var(--aura)) drop-shadow(0 -2px var(--aura))}
.boss-tag{position:absolute;top:-25px;left:50%;transform:translateX(-50%);z-index:3;background:#211429;color:var(--aura-core);border:1px solid var(--aura);border-radius:4px;padding:2px 5px;white-space:nowrap;font-size:10px;letter-spacing:1px;pointer-events:none}.unit.boss .bar:not(.action) i{background:linear-gradient(90deg,#ed4287,#ff927a)}.unit.miniboss .bar:not(.action) i{background:linear-gradient(90deg,#ed963f,#ffe1a0)}
.home-screen{padding:24px 20px;justify-content:flex-start;gap:14px;background:radial-gradient(at 50% 10%,#2b4951,#142135 75%);overflow-y:auto}.home-screen>*:not(#title-cast){position:relative;z-index:1;flex-shrink:0}.home-screen #title-cast{opacity:.08;pointer-events:none}.home-brand{width:100%}.home-brand small{color:#b7e4d4;letter-spacing:4px;font-size:10px}.home-brand h1{font-size:25px;margin:7px 0 2px}.home-brand p{font-size:10px;color:#99b7cf;margin:0}.home-summary{width:100%;padding:16px;border:1px solid #789ea15c;border-radius:12px;background:#112638d9}.home-summary>span{font-size:9px;letter-spacing:2px;color:#85baa9}.home-summary h2{font-size:19px;margin:8px 0}.home-summary p{font-size:11px;color:#bdcedd;margin:4px 0}.home-screen .start{width:100%;height:55px;margin:0;font-size:18px}.home-vault{display:grid;grid-template-columns:82px 1fr;align-items:center;width:100%;gap:10px;padding:14px;border:1px solid #d9af555e;border-radius:14px;background:linear-gradient(120deg,#463b27b0,#172637)}.home-vault .chest{margin:6px 0;transform:scale(.85);transform-origin:left center}.home-vault small{font-size:11px;color:#e5d6b1}.home-vault strong{display:block;font-size:30px;line-height:1.2;color:#ffe29b}.home-vault p{font-size:9px;margin:5px 0;color:#b6c5d0}.home-vault button{grid-column:span 2;width:100%}.home-record{width:100%;text-align:center;color:#a6bfd4;font-size:10px}.home-menu{display:grid;grid-template-columns:1fr 1fr 1fr;width:100%;gap:7px;margin-top:auto}.home-menu button{font-size:11px;padding:10px 4px}#home-message{font-size:11px;color:#ffd2a2;margin:0}#home-message:empty,#home-unlock:empty{display:none}@media(max-height:690px){.home-screen{padding:16px;gap:10px}.home-brand h1{font-size:22px}.home-summary{padding:10px 14px}.home-vault{padding:10px}.home-vault .chest{margin:0}.home-screen .start{height:47px}.home-menu{margin-top:0}}
.terrain-patch{image-rendering:pixelated;filter:none}.unit .unit-label{color:#e8f3ed;text-shadow:0 1px 2px #06131e,1px 0 #06131e,-1px 0 #06131e}.empty-unit .terrain-patch{opacity:.55}.empty-unit:hover .terrain-patch{opacity:.9}
#intermission{position:absolute;top:65px;left:12px;right:12px;z-index:5;background:#132c3eed;border:1px solid #79d9bd;border-radius:12px;padding:12px;text-align:center;box-shadow:0 6px 20px #0005}#intermission small{display:block;color:#91e8c6;font-size:9px;letter-spacing:1px}#departure-count{display:block;font-size:18px;margin:5px 0 10px}#intermission>div{display:flex;gap:8px}#intermission button{flex:1;font-size:12px;padding:8px}#intermission p{font-size:10px;color:#b1c8d6;margin:8px 0 0}@media(max-height:690px){#intermission{top:54px;padding:9px}#departure-count{font-size:16px;margin:3px 0 7px}}

/* Three ranks, four heroes each. */
.field{height:calc(100% - 72px);padding-top:58px;gap:6px}.enemy-line{min-height:80px}.enemy-row .unit{height:78px}#fighters{display:flex;flex-direction:column;gap:2px;max-height:none;overflow:auto;margin:0 7px;padding:0;flex:1;min-height:0}.formation-row{display:flex;align-items:center;gap:3px}.row-name{width:30px;flex:none;font-size:10px;color:#b9daca;text-align:center}.row-name small{display:block;font-size:9px;color:#819d9b}.formation-units{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;flex:1}.formation-units .unit{height:78px}.formation-units .hero{height:42px;width:44px}.formation-units .platform{height:30px}.formation-units .empty-unit .platform{margin-top:24px}.formation-actions{display:flex;gap:4px;margin-top:9px}.formation-actions button{flex:1;padding:5px 2px;font-size:11px}.detail{max-height:50%;overflow:auto}.battle-hint{padding:3px}.battle-status{margin-top:2px}@media(max-height:690px){.field{padding-top:48px;gap:2px}.enemy-line{min-height:65px}.enemy-row .unit{height:65px}.formation-units .unit{height:65px}.formation-units .hero{height:34px;width:36px}.formation-units .platform{height:25px}.formation-units .empty-unit .platform{margin-top:20px}.formation-units .unit-label{font-size:9px}.bar{height:5px}.detail{max-height:48%}}
/* Reserve the cleared enemy area for departure controls instead of covering allies. */
#intermission{top:56px;padding:8px 10px}
#departure-count{font-size:14px;margin:2px 0 5px}
#intermission button{padding:6px;font-size:11px}
#intermission p{font-size:9px;margin:4px 0 0}
@media(max-height:690px){
 #intermission{top:48px;padding:6px 8px}
 #departure-count{font-size:13px;margin:1px 0 4px}
 #intermission button{padding:5px}
}

#depart-ready{position:absolute;top:12px;right:10px;z-index:5;font-size:11px;padding:7px 10px}.battle-screen:has(#depart-ready:not([hidden])) .dungeon-heading{right:140px}.battle-screen:has(#depart-ready:not([hidden])) .dungeon-heading span{font-size:14px}

/* Keep the enemy slot even after defeat so the allied formation never jumps. */
.enemy-line{height:112px;min-height:112px;flex:0 0 112px}
#intermission:not([hidden]){animation:departure-appear .22s ease-out both}
@keyframes departure-appear{from{opacity:0}to{opacity:1}}
@media(max-height:690px){.enemy-line{height:98px;min-height:98px;flex-basis:98px}}
:root[data-motion="reduced"] #intermission{animation:none}
@media(prefers-reduced-motion:reduce){#intermission:not([hidden]){animation:none}}

#choose-ready{position:absolute;top:12px;right:10px;z-index:5;font-size:11px;padding:7px 10px}.battle-screen:has(#choose-ready:not([hidden])) .dungeon-heading{right:140px}

#result{width:420px;padding:18px 14px}#result>.chest{display:none}#result #reward{padding:8px 0}#result #reward strong{font-size:15px;margin:0 0 5px}.extension-choices{display:grid;gap:9px}.extension-choice{display:grid;grid-template-columns:54px 1fr;align-items:center;gap:10px;text-align:left;padding:12px 10px;background:linear-gradient(115deg,#294a5c,#18283e);border:1px solid #6cafa6;box-shadow:none}.extension-choice img,.extension-owned img{width:52px;height:52px;image-rendering:pixelated;object-fit:contain}.extension-choice small{display:block;font-size:9px;color:#9abdc9}.extension-choice p{font-size:11px;margin:6px 0 0;color:#e1f2ec}.extension-reward{width:96px;height:96px;image-rendering:pixelated;object-fit:contain;margin:12px}.extension-owned{padding:9px;gap:10px;font-size:12px}.extension-owned small{font-size:10px}.home-menu button{font-size:10px}#result-save{font-size:10px;color:#a6c9d4}@media(max-height:690px){#result{padding:12px}#result h2{font-size:18px;margin:4px 0}#result #result-stats{font-size:10px}.extension-choice{padding:8px;gap:8px;grid-template-columns:42px 1fr}.extension-choice img{width:42px;height:42px}#result #reward strong{font-size:12px}.extension-choice p{font-size:10px}}

.battle-readout{display:flex;align-items:center;gap:5px;position:relative;z-index:2;margin:2px 7px 0;min-height:43px;background:#0c1928aa}.battle-messages{flex:1;min-width:0}.battle-readout .battle-status,.battle-readout .event-line{margin-left:0;margin-right:0}.battle-controls{display:flex;gap:5px;flex-shrink:0;padding:2px}.battle-controls button{width:39px;height:36px;padding:0;font-size:23px;line-height:1;border-width:1px;border-radius:6px}.battle-controls #speed{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;font-size:24px;line-height:.8}.battle-controls small{font-size:10px;line-height:1.1}.battle-controls #pause[aria-pressed="true"]{color:#9bf3d0}

.home-brand h1{font-size:42px;letter-spacing:5px;line-height:1.1;margin:8px 0;color:#d3f5db}.home-brand .brand-ja{font-size:12px;color:#d5e8ed;margin:5px 0 8px}.home-brand small{letter-spacing:3px}@media(max-height:690px){.home-brand h1{font-size:34px;margin:5px 0}.home-brand .brand-ja{font-size:11px;margin:3px 0 5px}}

.intro-screen{position:absolute;inset:0;z-index:20;overflow:hidden;background:#08141d;isolation:isolate;transition:opacity .24s ease}.intro-screen.leaving{opacity:0;pointer-events:none}#intro-bg{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;opacity:.8}.intro-shade{position:absolute;inset:0;background:linear-gradient(#05101b 0%,#08172665 33%,#09142700 55%,#07121bd9 79%,#061019 100%)}.intro-logo{position:absolute;top:12%;left:12px;right:12px;text-align:center;z-index:3}.intro-logo>span{font-size:12px;letter-spacing:4px;color:#b3cec9}.intro-logo h1{font-size:76px;line-height:1;margin:14px 0 10px;letter-spacing:5px;color:#eaf6dd;text-shadow:0 3px #719c8f,0 7px #142f38,0 0 35px #70d4bf30}.intro-logo p{font-size:12px;letter-spacing:1px;color:#c9dfd9;margin:0}.intro-logo i{display:block;width:50px;height:2px;margin:22px auto;background:#9edbbc;box-shadow:0 0 14px #b7ffe2}.intro-logo small{font-size:12px;color:#a6c7c7;letter-spacing:2px}.intro-scene{position:absolute;inset:40% 0 23%;z-index:2}.abyss-gate{position:absolute;left:50%;top:0;transform:translateX(-50%);width:146px;height:170px;background:linear-gradient(90deg,#254347,#55716b 14%,#182e38 18%,#101e2b 82%,#476b65 86%,#203d42);clip-path:polygon(0 22%,13% 22%,13% 10%,27% 10%,27% 0,73% 0,73% 10%,87% 10%,87% 22%,100% 22%,100% 100%,0 100%)}.abyss-gate>div{position:absolute;inset:20px 25px 0;background:radial-gradient(ellipse at bottom,#a0efd7 0,#478b8b 18%,#163b51 45%,#061623 75%);box-shadow:inset 0 0 20px #071722}.intro-party{position:absolute;bottom:0;left:5%;right:5%;display:flex;align-items:flex-end;justify-content:center;filter:drop-shadow(0 5px 0 #031119aa)}.intro-party img{width:21%;height:96px;object-fit:contain;image-rendering:pixelated}.intro-party img:nth-child(2),.intro-party img:nth-child(4){margin-bottom:10px}.intro-party img:nth-child(3){height:120px;width:24%;margin-bottom:15px;filter:drop-shadow(0 0 9px #b9dd8f38)}.intro-actions{position:absolute;left:12%;right:12%;bottom:9%;z-index:4;text-align:center}.intro-actions button{width:100%;height:53px;background:linear-gradient(#30565c,#183e4b);border:1px solid #b3debf;box-shadow:inset 0 0 0 3px #142c38,0 4px #06101b;color:#e8f7db;letter-spacing:4px;font-size:16px;border-radius:4px}.intro-actions button span{float:right;margin-right:8px;color:#b9e2c4}.intro-actions>small{display:block;margin-top:15px;font-size:10px;letter-spacing:1px;color:#849ba7}.intro-screen footer{position:absolute;bottom:3%;width:100%;text-align:center;font-size:8px;letter-spacing:2px;color:#647984}.back-to-intro{background:none;border:0;box-shadow:none;color:#8ba8b9;font-size:10px;padding:3px 12px}.back-to-intro:active{box-shadow:none}.home-screen:not([hidden]){animation:departure-appear .22s ease-out}@media(max-height:690px){.intro-logo{top:9%}.intro-logo h1{font-size:64px;margin:9px 0}.intro-logo i{margin:14px auto}.intro-scene{top:39%;bottom:24%}.abyss-gate{height:142px;width:126px}.intro-party img{height:76px}.intro-party img:nth-child(3){height:98px}.intro-actions{bottom:9%}.intro-actions button{height:47px}.intro-actions>small{margin-top:10px}}@media(max-width:380px){.intro-logo h1{font-size:60px}.intro-logo>span{font-size:10px;letter-spacing:3px}.intro-logo p{font-size:10px}.intro-logo small{font-size:10px}}:root[data-motion="reduced"] .intro-screen{transition:none}:root[data-motion="reduced"] .home-screen{animation:none}

.purchase-position{margin:5px 0 9px;padding:8px;background:#102635;border:1px solid #466d79;border-radius:8px}.purchase-position p{font-size:10px;color:#a9c7cf;margin:0 0 5px}#purchase-rows{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}#purchase-rows button{padding:6px 3px;font-size:12px}#purchase-rows small{display:block;font-size:9px;margin-top:2px}#purchase-rows button[aria-pressed="true"]{outline:1px solid #a9e5cb;outline-offset:1px}@media(max-height:690px){.purchase-position{padding:6px;margin:4px 0 6px}#purchase-rows button{padding:4px 2px}}

#purchase-rows{display:grid;grid-template-columns:1fr;gap:5px}.setup-row{display:grid;grid-template-columns:38px repeat(4,minmax(0,1fr));gap:6px;align-items:center}.setup-row>span{font-size:11px;color:#c8dadf}#purchase-rows .setup-row button{height:42px;padding:0;border:1px solid #496875;background:#172936;box-shadow:inset 0 0 0 2px #0b1821;font-size:18px}#purchase-rows .setup-row button[aria-pressed="true"]{background:#66532b;border-color:#f3d470;outline:1px solid #e7c660}#purchase-rows .setup-row img{width:38px;height:38px;object-fit:contain;image-rendering:pixelated}.shop-screen.deploying{padding-bottom:70px}#setup-detail .detail{position:relative;inset:auto;max-height:none;width:100%;margin:10px 0;min-height:0}#finish-deployment{position:sticky;bottom:0;width:100%;margin-top:12px;z-index:7;padding:13px;box-shadow:0 -8px 18px #101c2c,inset 0 1px #85c6ff}#setup-detail:empty{display:none}@media(max-height:690px){#purchase-rows .setup-row button{height:35px}#purchase-rows .setup-row img{height:32px;width:32px}.setup-row{gap:4px}#finish-deployment{padding:10px}}

#sound-prompt{width:340px;padding:25px 20px;background:linear-gradient(145deg,#294554,#142135);border-color:#93bdbb}#sound-prompt h2{font-size:21px;margin:10px 0}#sound-prompt p{font-size:12px;line-height:1.9;color:#bcd0d9}.sound-symbol{font-size:38px;color:#bcecd1}.sound-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}.sound-choices button{padding:12px 5px}

/* Fixed preparation board and footer; only the candidate/detail area scrolls. */
.shop-screen.deploying{display:grid;grid-template-rows:auto auto minmax(0,1fr) 48px;gap:8px;overflow:hidden;padding:6px 6px 5px}.shop-screen.deploying .shop-heading{grid-row:1;margin:0}.shop-screen.deploying .purchase-position{grid-row:2;margin:0}.shop-screen.deploying #shop-catalog,.shop-screen.deploying #setup-detail{grid-row:3;grid-column:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px}.shop-screen.deploying #setup-detail .detail{margin:0;max-height:none;position:relative;inset:auto}.shop-screen.deploying #finish-deployment{grid-row:4;position:static;align-self:stretch;margin:0;padding:8px;box-shadow:inset 0 1px #85c6ff;z-index:auto}.shop-screen.deploying #shop-catalog .shop-tools{margin-bottom:8px}@media(max-height:690px){.shop-screen.deploying{grid-template-rows:auto auto minmax(0,1fr) 42px;gap:6px}}

/* Enemy columns are tied to spawn slots, never to the remaining enemy count. */
.enemy-row{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:0;align-items:start;width:100%}.enemy-row .unit{width:auto;min-width:0;grid-row:1}


#run-result{width:400px;padding:26px 22px;border:1px solid #926d7a;background:radial-gradient(ellipse at top,#442a3b,#142131 70%);border-radius:12px;animation:run-end-reveal .55s ease-out both}#run-result::backdrop{background:#040b14c9;animation:departure-appear .5s ease-out}#run-result header>small{font-size:9px;letter-spacing:3px;color:#b298a8}#run-end-title{font-size:38px;letter-spacing:3px;color:#ffd3d4;margin:14px 0 7px}#run-end-caption{font-size:11px;color:#c4b7c4;margin:0 0 20px}.run-result-details{animation:run-details-reveal .4s .65s both}.run-depth{border-top:1px solid #88627680;border-bottom:1px solid #88627680;padding:15px 0;display:flex;flex-direction:column;gap:3px}.run-depth>span{font-size:11px;color:#aabccc}.run-depth strong{font-size:34px;color:#eff8db}.run-depth small{color:#f5d781;letter-spacing:3px;font-size:9px}#run-summary{margin:18px 0;display:grid;gap:10px}#run-summary>div{display:flex;justify-content:space-between;gap:8px}#run-summary dt{font-size:11px;color:#a9bdca}#run-summary dd{font-size:13px;margin:0;color:#ecf2ef}#run-treasure{padding:12px 8px;background:#8a693021;border:1px solid #bf9d4a60;color:#f1d895;font-size:11px;border-radius:6px}#run-unlock{color:#a9e9c3;font-size:11px}#run-unlock:empty{display:none}#run-home{width:100%;margin-top:9px;padding:12px}#run-result.retired #run-end-title{font-size:30px;color:#d5e8e1}@keyframes run-end-reveal{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes run-details-reveal{from{opacity:0}to{opacity:1}}:root[data-motion="reduced"] #run-result,:root[data-motion="reduced"] #run-result::backdrop,:root[data-motion="reduced"] .run-result-details{animation:none}@media(max-height:690px){#run-result{padding:18px}#run-end-title{font-size:30px;margin-top:9px}.run-depth{padding:10px 0}#run-summary{gap:7px;margin:12px 0}#run-end-caption{margin-bottom:12px}}

/* Level milestones use an absolute glow: no change to formation geometry. */
.level-aura{position:absolute;pointer-events:none;z-index:0;left:50%;top:-9px;width:var(--level-aura-size);height:68px;transform:translateX(-50%);background:radial-gradient(ellipse at 50% 70%,var(--level-aura-color),transparent 72%);opacity:var(--level-aura-opacity);clip-path:polygon(0 100%,8% 42%,22% 62%,28% 14%,41% 40%,50% 0,62% 42%,77% 12%,82% 64%,94% 36%,100% 100%);animation:level-aura-breathe 1.8s ease-in-out infinite alternate}
.unit.awakened .hero{position:relative;z-index:1}.unit.awakened .unit-label{position:relative;z-index:1;color:#fff3b0}
@keyframes level-aura-breathe{from{opacity:calc(var(--level-aura-opacity)*.72)}to{opacity:var(--level-aura-opacity)}}
@media(prefers-reduced-motion:reduce){.level-aura{animation:none}}

