@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800;900&display=swap');
:root{--ink:#28423d;--muted:#74847a;--paper:#f6f4e9;--green:#406a4c;--line:#e3e6d8;--orange:#efb34d;--white:#fffef8}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'M PLUS Rounded 1c',system-ui,sans-serif;font-weight:500}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit;border:0}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible{outline:3px solid #4b88c4;outline-offset:4px}button:hover:not(:disabled){filter:brightness(.97)}button:active:not(:disabled){transform:translateY(2px)}[hidden]{display:none!important}.app{max-width:1320px;padding:28px 44px 18px;margin:auto}.header{display:flex;align-items:center;justify-content:space-between;padding-bottom:27px;border-bottom:1px solid var(--line);gap:12px}.brand{display:flex;align-items:center;gap:13px;text-decoration:none;color:var(--ink)}.brand-mark{display:grid;place-items:center;width:47px;height:47px;background:#42674c;border-radius:16px;color:#ffdf84;font-size:35px;transform:rotate(-8deg)}.brand small{display:block;font-size:10px;letter-spacing:.16em;margin-bottom:2px;color:var(--muted)}.brand strong{font-size:23px;font-weight:900;letter-spacing:.01em}.header-actions{display:flex;gap:12px}.icon-button{height:46px;display:flex;align-items:center;gap:8px;background:var(--white);border:1px solid var(--line);padding:0 13px;border-radius:13px;font-size:21px}.icon-button span{font-size:11px;font-weight:700}.journey{display:flex;align-items:center;gap:28px;padding:30px 0 24px}.eyebrow{font-size:10px;letter-spacing:.1em;color:var(--muted);font-weight:800}h1{font-size:26px;letter-spacing:.02em;margin:7px 0 0;font-weight:900}h2{font-size:18px;margin:5px 0 16px;font-weight:800}.stage-line{display:flex;align-items:center;flex:1;justify-content:center}.stage-dot{width:29px;height:29px;display:grid;place-items:center;border-radius:50%;border:1px solid #d5dbcc;font-size:11px;color:#9aa38e;background:#eaece0}.stage-dot.done{background:#537957;color:white;border-color:#537957}.stage-dot.current{background:#f3c773;border:3px solid var(--paper);box-shadow:0 0 0 2px #e7b863;color:#694b24;width:37px;height:37px;font-weight:900}.stage-connector{width:24px;height:2px;background:#d5dbcc}.wallet{display:flex;align-items:center;gap:10px;background:#fff9e3;border:1px solid #e9dfbb;border-radius:16px;padding:10px 19px;min-width:120px}.coin{display:grid;place-items:center;background:#ecc363;color:#a77722;border:3px solid #f9d77c;border-radius:50%;width:29px;height:29px}.wallet small{display:block;font-size:10px;color:#977535}.wallet b{font-size:22px;line-height:1.2;color:#69512d}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:24px;align-items:start}.play-panel{background:var(--white);border:1px solid var(--line);border-radius:24px;padding:18px;box-shadow:0 7px 0 #e8e9dc}.board-top{display:flex;align-items:center;justify-content:space-between;padding:0 5px 13px;font-size:11px}.stage-tag{background:#ecefdf;padding:6px 12px;border-radius:8px;font-weight:800}.enemy-label{color:#9a745e;font-weight:700}#boss-label{color:#a26a3c}.field{isolation:isolate;position:relative;padding:15px 40px 18px;border:1px solid #c6d9af;background:linear-gradient(#e9ebcf 0%,#e8eed7 47%,#deedd3 53%,#d8e9c9 100%);border-radius:18px;overflow:hidden;min-height:434px}.field:before,.field:after{content:'';position:absolute;width:160px;height:70px;background:#a6c88b33;border-radius:50%;z-index:-1}.field:before{left:-55px;top:80px;transform:rotate(-25deg)}.field:after{right:-65px;bottom:35px;transform:rotate(20deg)}.unit-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.slot{position:relative;min-width:0;height:61px;display:flex;align-items:center;justify-content:center;background:#ffffff22;border:1px dashed #91ad7766;border-radius:11px;padding:0;touch-action:none;user-select:none}.enemy-grid .slot{border-color:transparent;background:transparent}.slot.has-unit{border-style:solid;border-color:#fff9;background:#fff5;box-shadow:0 3px 0 #a4bc8b55}.slot.selected{outline:3px solid #e8ab3e;outline-offset:0;background:#fff5c2;z-index:2}.slot.mergeable{box-shadow:0 0 0 2px #6f9c65;background:#eaffe0}.slot.drag-over{outline:3px solid #608e64}.slot :is(svg,.character-art){height:53px;width:55px;pointer-events:none;filter:drop-shadow(0 3px 1px #3a563019)}.level-badge{position:absolute;right:4px;bottom:3px;font-size:9px;background:#fffdf0;padding:0 4px;border-radius:5px;font-weight:900;color:#536441}.slot .unit-name{display:none}.field-divider{height:33px;display:flex;align-items:center;gap:12px;color:#9dad89;font-size:11px;font-weight:900;letter-spacing:.1em}.field-divider:before,.field-divider:after{content:'';height:1px;flex:1;background:#a9bd9366}.field-divider span{background:#f5f4dca6;border:1px solid #c3cdab;border-radius:20px;width:37px;text-align:center;line-height:22px}.field-decor{position:absolute;z-index:-1;pointer-events:none}.flower{color:#f3fff0;font-size:20px}.f1{left:12px;bottom:85px}.f2{right:13px;top:100px;color:#eece88}.pebble{width:18px;height:9px;background:#a7b592;border-radius:50%;bottom:19px;right:12px}.board-bottom{display:flex;justify-content:space-between;align-items:center;padding:14px 5px 8px;gap:8px;font-size:10px}.team-label{white-space:nowrap;font-weight:800}.team-label i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#6a9c63}.team-label b{color:#82927c;font-size:10px;margin-left:6px}.board-tip{color:#869078;font-size:9px;text-align:right}.action-bar{display:flex;align-items:center;gap:12px;padding:12px 0 7px}.sub-button{background:#f0f1e7;border:1px solid #e4e6d9;border-radius:12px;padding:12px 10px;font-size:10px;font-weight:800;white-space:nowrap}.fight-button{flex:1;background:var(--orange);color:#60471f;box-shadow:0 4px 0 #cf8e32;border:1px solid #e2a03e;border-radius:14px;padding:14px 15px;font-size:16px;font-weight:900;display:flex;justify-content:center;gap:25px;align-items:center}.fight-button span{font-size:23px;line-height:1}.message{text-align:center;font-size:11px;color:#6e8568;min-height:25px;padding-top:11px}.side-panel{display:grid;gap:16px}.shop,.merge-card,.selected-card{border:1px solid var(--line);background:var(--white);border-radius:20px;padding:19px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:4px}.price-tag{font-size:9px;color:#a87e34;background:#fff4d4;padding:5px 7px;border-radius:7px;white-space:nowrap}.shop-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.shop-item{background:var(--tint);border:1px solid var(--edge);border-radius:13px;padding:9px 5px 7px;display:flex;align-items:center;flex-direction:column;gap:2px;box-shadow:0 3px 0 var(--edge);font-size:12px;font-weight:800}.shop-item :is(svg,.character-art){width:57px;height:56px}.soft-note{font-size:9px;text-align:center;color:#889081;margin:14px 0 0}.merge-card{background:#ecefdc;border-color:#dce2c5}.merge-card h2{margin-bottom:12px}.recipe-preview{display:flex;align-items:center;justify-content:center;gap:6px}.recipe-preview :is(svg,.character-art){width:50px;height:53px}.recipe-preview span{color:#9caa7b;font-weight:800}.merge-card p{font-size:10px;text-align:center;color:#758564;margin:10px 0 13px}.text-button{background:none;padding:0;color:#668061;font-size:10px;font-weight:800}.merge-card .text-button{display:flex;justify-content:space-between;width:100%;padding-top:12px;border-top:1px solid #d9e0c1}.selected-card{padding:15px 19px}#selected-info{display:flex;align-items:center;gap:10px;min-height:60px}#selected-info :is(svg,.character-art){width:57px;height:60px}#selected-info p{font-size:10px;line-height:1.9;color:#879180;margin:8px 0}.empty-info{font-size:39px;color:#c1ccb0;width:55px;text-align:center}.unit-detail b{font-size:12px}.unit-detail small{display:block;font-size:9px;color:#71806b;margin-top:5px}.save-note{font-size:9px;color:#89927f;text-align:center;margin:0}footer{display:flex;justify-content:space-between;font-size:9px;color:#98a08d;padding:25px 5px 5px}dialog{border:1px solid #dbe1ce;border-radius:24px;width:min(620px,calc(100% - 24px));max-height:85dvh;padding:0;background:var(--white);color:var(--ink);box-shadow:0 20px 70px #203a3540}dialog::backdrop{background:#203a3570;backdrop-filter:blur(4px)}.modal-inner{padding:30px;position:relative}.close-button{position:absolute;right:15px;top:12px;width:35px;height:35px;border-radius:50%;font-size:25px;background:#eff0e5}.modal-inner h2{font-size:25px;padding-right:20px;margin:7px 0 18px}.modal-inner p{font-size:13px;line-height:1.9}.help-step{display:flex;gap:15px;align-items:center;margin:20px 0}.step-number{display:grid;place-items:center;flex-shrink:0;width:35px;height:35px;background:#edf1dd;border-radius:12px;font-weight:900}.help-step strong{font-size:14px}.help-step p{margin:3px 0;font-size:11px;color:#7c8773}.modal-primary{background:#efb34d;border-radius:12px;padding:12px 22px;font-weight:900;font-size:13px;margin-top:15px;display:block;width:100%}.collection{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.collection-item{padding:12px 7px;background:#f1f3e7;border-radius:14px;text-align:center;font-size:11px}.collection-item :is(svg,.character-art){width:65px;height:65px;display:block;margin:auto}.collection-item.locked{color:#9caa91}.collection-item.locked .unknown{font-size:40px;line-height:65px}.collection-item small{display:block;font-size:9px;margin-top:5px;color:#839176}.recipe-row{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid #edf0e3;font-size:11px}.recipe-row .recipe-side{display:flex;align-items:center;gap:5px}.recipe-row :is(svg,.character-art){width:32px;height:34px}.result{text-align:center}.result .result-symbol{font-size:64px}.result h2{padding:0}.result p{color:#7e8c70}.reward{display:inline-block;background:#fff2c9;color:#97712c;border:1px solid #e9d493;border-radius:12px;padding:10px 25px;font-weight:900}.danger{background:#f6e8df;color:#9e674e;padding:10px 14px;border-radius:10px;font-size:11px}.settings-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:15px}.settings-actions button{padding:11px 15px;background:#edf0e3;border-radius:10px;font-size:12px}.battle-status{position:absolute;bottom:10px;left:0;right:0;text-align:center;font-size:11px;color:#4d6943;background:#f8f6eacc;padding:7px}canvas{position:absolute;inset:0;width:100%;height:100%;z-index:5}.confetti{position:fixed;inset:0;pointer-events:none;z-index:10;overflow:hidden}.confetti i{position:absolute;top:-20px;width:8px;height:13px;animation:fall 2.5s ease-in forwards}@keyframes fall{to{transform:translateY(110vh) rotate(600deg)}}.merge-pop{animation:pop .4s ease-out}@keyframes pop{0%{transform:scale(.7)}50%{transform:scale(1.2)}100%{transform:scale(1)}}
.enemy-grid .slot:disabled{opacity:1}
@media(min-width:1300px){.field{padding-left:55px;padding-right:55px}.slot{height:67px}.field{min-height:470px}.slot :is(svg,.character-art){height:59px;width:62px}}
@media(max-width:1000px){.app{padding:22px}.game-layout{grid-template-columns:minmax(0,1fr) 250px;gap:17px}.field{padding-left:17px;padding-right:17px}.brand strong{font-size:20px}.stage-connector{width:14px}.board-tip{display:none}.header-actions{gap:7px}.icon-button{padding:0 10px}.action-bar{gap:7px}.fight-button{font-size:14px;gap:8px}.sub-button{font-size:9px;padding:12px 8px}}
@media(max-width:740px){.app{padding:17px 14px}.header{padding-bottom:17px}.brand{gap:9px}.brand-mark{width:37px;height:39px;font-size:27px;border-radius:12px}.brand strong{font-size:16px}.brand small{font-size:8px;letter-spacing:.02em}.icon-button{width:36px;height:38px;justify-content:center;padding:0;font-size:20px}.icon-button span{display:none}.journey{padding:22px 1px 18px;gap:12px;flex-wrap:wrap}.journey h1{font-size:21px}.journey .eyebrow{font-size:8px}.stage-line{order:3;flex-basis:100%;justify-content:flex-start;padding:6px 0 0}.stage-connector{width:30px}.wallet{margin-left:auto;min-width:100px;padding:8px 12px}.wallet b{font-size:21px}.game-layout{grid-template-columns:1fr;gap:22px}.play-panel{padding:12px;border-radius:20px}.field{padding:10px 12px 14px;min-height:420px}.slot{height:61px}.unit-grid{gap:5px}.slot :is(svg,.character-art){width:52px;height:53px}.fight-button{font-size:14px;padding:14px 9px}.side-panel{grid-template-columns:1fr 1fr;gap:12px}.shop{grid-column:1/-1;padding:15px}.shop-grid{grid-template-columns:repeat(4,1fr)}.shop-item{font-size:11px;padding-top:7px}.shop-item :is(svg,.character-art){width:50px;height:51px}.shop h2{margin-bottom:12px}.soft-note{margin-top:12px}.merge-card,.selected-card{padding:14px}.merge-card h2{font-size:15px}.recipe-preview :is(svg,.character-art){width:37px;height:41px}.recipe-preview{gap:3px}.merge-card p{font-size:9px}.selected-card .eyebrow{font-size:8px}#selected-info{display:block;text-align:center}#selected-info :is(svg,.character-art){display:block;margin:5px auto;width:52px;height:53px}#selected-info p{font-size:9px}.empty-info{margin:auto}.unit-detail small{font-size:9px}.save-note{grid-column:1/-1}.board-bottom{padding-top:12px}.message{font-size:10px}.modal-inner{padding:25px 20px}.modal-inner h2{font-size:23px}}
@media(max-width:360px){.brand strong{font-size:14px}.header-actions{gap:4px}.icon-button{width:31px}.slot{height:56px}.field{min-height:395px}.slot :is(svg,.character-art){width:44px;height:47px}.level-badge{font-size:8px}.sub-button{font-size:8px;padding:12px 5px}.fight-button{font-size:12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;scroll-behavior:auto!important}}
/* Larger text and controls for seven-year-old tablet players. */
@media(min-width:741px){.eyebrow{font-size:12px;letter-spacing:.04em}.brand small{font-size:11px}.icon-button span{font-size:12px}.price-tag,.soft-note,.save-note,.text-button{font-size:11px}.board-top,.team-label,.team-label b,.message{font-size:12px}.board-tip{font-size:11px}.sub-button{min-height:46px;font-size:12px}.fight-button{min-height:52px}.shop-item{font-size:14px;min-height:94px}.merge-card p{font-size:12px}#selected-info p{font-size:12px}.unit-detail small{font-size:11px;line-height:1.8}.unit-detail b{font-size:14px}}
.close-button{width:44px;height:44px;right:10px;top:8px}.help-step p{font-size:13px}.modal-inner p{font-size:14px}.recipe-row{font-size:12px}.modal-primary{min-height:48px;font-size:15px}.collection-item{font-size:13px}.collection-item small{font-size:11px}
@media(min-width:741px) and (max-width:1000px){.game-layout{grid-template-columns:1fr}.side-panel{grid-template-columns:1fr 1fr}.shop{grid-column:1/-1}.shop-grid{grid-template-columns:repeat(4,1fr)}.save-note{grid-column:1/-1}.slot{height:72px}.slot :is(svg,.character-art){width:65px;height:67px}.field{min-height:515px}.header-actions .icon-button span{display:none}.icon-button{width:46px}.field{padding-left:40px;padding-right:40px}.stage-line{display:none}.action-bar .fight-button{font-size:18px}}
.field{padding:0;background:#dcebba url('assets/arena-meadow.png') center/cover no-repeat;aspect-ratio:960/650;min-height:470px;touch-action:none}.field:before,.field:after,.field-decor{display:none}.field .unit-grid{position:absolute;inset:0;display:block;pointer-events:none;padding:0;margin:0}.enemy-grid{z-index:3}.team-grid{z-index:4}.field .slot{position:absolute;transform:translate(-50%,-50%);width:76px;height:82px;padding:4px 0 0;background:none;border:0;border-radius:17px;box-shadow:none;pointer-events:auto;touch-action:none;outline-offset:3px}.field .slot :is(svg,.character-art){width:70px;height:71px;filter:drop-shadow(0 3px 2px #263d2740)}.field .slot:hover{filter:none;background:#fff3}.field .slot:active{transform:translate(-50%,-50%)}.field .slot.selected{outline:3px solid #f6c75b;background:#fff4}.field .slot.mergeable,.field .slot.drag-over{outline:3px solid #a0e283;background:#eefae133;box-shadow:0 0 10px #e9ffd1}.field .slot.dragging{z-index:20;background:#fff5;box-shadow:0 4px 12px #35532933}.field .slot.targeted{outline:3px solid #d66e54;background:#fff2}.target-mark{display:none;position:absolute;top:-29px;left:0;right:0;color:#b35139;font-weight:900;font-size:27px;text-shadow:0 1px 2px #fff}.targeted .target-mark{display:block}.hp-track{position:absolute;top:-5px;left:6px;right:6px;height:8px;background:#4955439c;border:1px solid #fffde6;border-radius:10px;overflow:hidden;box-shadow:0 1px 2px #24412a33}.hp-track>span{display:block;height:100%;background:linear-gradient(#a7dd77,#6da750);border-radius:7px}.enemy-hp>span{background:linear-gradient(#f6b294,#cd775c)}.field .level-badge{bottom:1px;left:10px;right:10px;font-size:10px;border:1px solid #ffffff88;background:#fffdf0ed;color:#435d39}.field-divider{position:absolute;left:5%;right:5%;top:49%;height:22px;pointer-events:none;opacity:.65}.field-divider span{background:#fffde0;border-color:#d0d7a5}.battle-status{z-index:6;pointer-events:none;font-size:12px;background:#fffce4dc;bottom:4px;border-radius:8px;margin:0 10px}canvas{z-index:5;pointer-events:none}.target-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:35px;font-size:12px;background:#f4f0e2;border-radius:9px;padding:7px 10px;margin:3px 0}.target-bar button{background:#fffaf0;border:1px solid #e0d8c0;font-size:11px;padding:8px;border-radius:8px;min-height:36px;white-space:nowrap}.slot.merge-pop{animation:unit-pop .4s ease-out}@keyframes unit-pop{0%{transform:translate(-50%,-50%) scale(.75)}50%{transform:translate(-50%,-50%) scale(1.15)}100%{transform:translate(-50%,-50%) scale(1)}}.evolution-guide{background:var(--white);border:1px solid var(--line);border-radius:21px;padding:23px;margin-top:30px}.guide-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.guide-heading h2{margin:5px 0 12px}.evolution-guide>p{font-size:12px;color:#7c8870;line-height:1.8}.evolution-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:13px}.evolution-family{background:#eff3e5;border-radius:14px;padding:12px}.evolution-family h3{font-size:13px;margin:0 0 5px;color:#637953}.evolution-chain{display:flex;align-items:center;justify-content:space-around}.evolution-chain>div{display:flex;flex-direction:column;align-items:center}.evolution-chain :is(svg,.character-art){width:55px;height:59px}.evolution-chain b{font-size:12px}.evolution-chain small{font-size:10px;color:#8b977b}.chain-arrow{font-size:14px;color:#9eae8b}.early-recipes{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-top:18px}.early-recipes .recipe-row{flex-wrap:wrap;justify-content:center;gap:7px;font-size:10px;background:#f3f3e7;border:0;border-radius:12px;padding:12px}.early-recipes .recipe-side span{font-size:10px;line-height:1.6}.early-recipes :is(svg,.character-art){width:32px;height:36px}.guide-note{margin-bottom:0}.journey-map section{margin:18px 0}.journey-map h3{font-size:14px;margin-bottom:10px}.map-stages{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.map-stage{display:flex;align-items:center;justify-content:center;gap:5px;min-height:43px;background:#eef0e5;border:1px solid #e0e4d3;border-radius:9px;font-size:13px;color:#929f87}.map-stage small{font-size:10px}.map-stage.done{background:#d9eaca;color:#5d8151;border-color:#c1d6b3}.map-stage.current{background:#ffdfa0;color:#785927;border:2px solid #d6a449}.locked-recipe{color:#9aa389;font-size:12px;line-height:1.8}.recipe-row .recipe-side{min-width:0}.recipe-row .recipe-side span{line-height:1.6}
@media(min-width:1100px){.evolution-grid{grid-template-columns:repeat(4,1fr)}.evolution-chain :is(svg,.character-art){width:43px;height:47px}}
@media(max-width:740px){.field{min-height:420px}.field .slot{width:54px;height:65px}.field .slot :is(svg,.character-art){width:51px;height:55px}.hp-track{left:3px;right:3px;height:7px}.field .level-badge{font-size:8px;left:4px;right:4px;bottom:-1px}.target-mark{top:-24px;font-size:23px}.target-bar{font-size:10px}.target-bar button{font-size:10px}.evolution-guide{padding:16px;margin-top:24px}.guide-heading{align-items:start;flex-direction:column}.evolution-grid{grid-template-columns:1fr}.evolution-chain :is(svg,.character-art){width:54px;height:58px}.early-recipes{grid-template-columns:1fr;gap:8px}.early-recipes .recipe-row{justify-content:space-between;flex-wrap:nowrap}.evolution-guide>p{font-size:11px}.recipe-row .recipe-side{gap:2px}.recipe-row :is(svg,.character-art){width:25px;height:29px}.recipe-row{font-size:10px;gap:4px}.battle-status{font-size:10px}}
@media(prefers-reduced-motion:reduce){.slot.merge-pop{animation:none}}
.field .slot.taking-hit :is(svg,.character-art){filter:drop-shadow(0 0 6px #fff5a2) brightness(1.3)}
.field{min-height:520px}.field .slot{height:70px}.field .slot :is(svg,.character-art){width:64px;height:62px}
@media(max-width:740px){.field{min-height:460px}.field .slot{height:65px}.field .slot :is(svg,.character-art){width:51px;height:55px}}
.play-panel,.side-panel{min-width:0}.field{width:100%;max-width:100%}
/* Landscape tablet: the arena and six modal controls fit one screen. */
html,body{height:100%;overflow:hidden}.app{height:100dvh;max-width:none;margin:0;padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:8px;min-width:0}.header{flex:none;padding:0;border:0;min-height:56px;gap:20px}.brand-mark{width:42px;height:42px;font-size:30px}.brand strong{font-size:23px}.brand small{font-size:10px}.adventure-heading{text-align:center;margin-left:auto;margin-right:auto}.adventure-heading h1{font-size:19px;margin:3px 0 0}.stage-tag{font-size:11px;padding:3px 10px}.wallet{min-width:120px;padding:7px 16px}.wallet b{font-size:23px}.app>main{flex:1;min-height:0;display:flex}.play-panel{flex:1;display:flex;flex-direction:column;min-height:0;padding:10px 12px 6px;border-radius:22px;box-shadow:0 3px 0 #e3e7d7}.board-top{flex:none;padding:0 5px 8px;font-size:13px}.team-label,.team-label b{font-size:13px}.field{flex:1;width:100%;min-height:0;height:auto;aspect-ratio:auto;border-radius:16px;padding:0}.field-divider{left:50%;right:auto;top:7%;bottom:7%;height:auto;width:1px;display:flex;flex-direction:column;gap:9px;opacity:.65}.field-divider:before,.field-divider:after{width:1px;height:auto;flex:1}.field-divider span{flex:none;width:37px;font-size:11px}.field .slot{width:72px;height:69px}.field .slot :is(svg,.character-art){width:64px;height:62px}.field .hp-track{height:8px;left:5px;right:5px;top:-5px}.field .level-badge{font-size:10px;bottom:-1px;left:6px;right:6px}.target-bar{flex:none;margin:6px 0 0;padding:0 6px;background:none;min-height:32px;font-size:12px}.board-tip{display:block;font-size:11px;color:#819175;margin-left:auto}.target-bar button{min-height:32px;padding:5px 10px;font-size:11px}.bottom-dock{flex:none;display:block;padding:0;color:var(--ink)}.dock-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) minmax(0,1.4fr) minmax(0,1fr);gap:10px}.dock-button{border:1px solid #dae1cc;background:#fffef6;border-radius:16px;box-shadow:0 3px 0 #dfe6ce;min-height:62px;display:flex;align-items:center;justify-content:center;gap:10px;padding:8px;font-size:17px}.dock-button>span{font-size:25px;color:#749763}.dock-button>b{font-size:15px;font-weight:800}.dock-button.fight-button{background:#f4be5f;border-color:#dda34b;box-shadow:0 3px 0 #cc913e;color:#61471f;gap:13px}.dock-button.fight-button>span{color:#7d5925;font-size:22px}.dock-status{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:22px;padding:3px 5px 0}.message{min-height:0;padding:0;text-align:left;font-size:11px}.save-note{font-size:10px;white-space:nowrap}dialog{width:min(880px,calc(100% - 32px));max-height:calc(100dvh - 24px);overflow:hidden;border:3px solid #dce4ce;border-radius:25px;background:#fffdf3;box-shadow:0 18px 90px #1f3e3a66}dialog::backdrop{background:#243e36a6;backdrop-filter:blur(5px)}.modal-inner{padding:0;display:flex;flex-direction:column;max-height:calc(100dvh - 30px)}.modal-header{flex:none;display:flex;align-items:center;gap:14px;padding:12px 16px 12px 22px;background:#eef2df;border-bottom:1px solid #dce4ce;min-height:66px}.modal-brand{font-size:15px;font-weight:900;color:#53734a}.modal-wallet{margin-left:auto;background:#fff6d5;border:1px solid #e8d99f;border-radius:13px;padding:6px 12px;color:#987434;font-size:16px}.close-button{position:static;flex:none;width:44px;height:44px;background:#fffdf4;border:1px solid #d8dfc8;line-height:1;font-size:30px}.modal-inner h2{padding:0;font-size:24px;margin:4px 0 14px}#modal-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:22px 26px;flex:1}.modal-footer{flex:none;min-height:40px;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 22px;border-top:1px solid #e4e8d9;color:#64815a;background:#f5f5e9;font-size:12px}.modal-footer:has(#modal-feedback:empty):not(:has(#modal-pause-note:not([hidden]))){display:none}#modal-pause-note{white-space:nowrap;color:#9a783d}.shop-panel{display:grid;grid-template-columns:1.2fr 1fr;gap:16px}.shop-panel .shop{grid-row:span 2}.shop-panel .shop-grid{grid-template-columns:1fr 1fr;gap:13px}.shop-item{min-height:115px;font-size:17px;padding:13px}.shop-item :is(svg,.character-art){width:75px;height:76px}.price-tag{font-size:13px}.soft-note{font-size:12px}.shop-panel .merge-card,.shop-panel .selected-card{padding:16px}.shop-panel .text-button{min-height:44px;font-size:13px}.evolution-guide{margin:0;padding:0;border:0;background:none}.evolution-grid{grid-template-columns:repeat(2,1fr)}.evolution-chain :is(svg,.character-art){width:58px;height:60px}.early-recipes{grid-template-columns:repeat(3,1fr)}.menu-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.menu-buttons button{width:auto;min-height:72px;justify-content:center;font-size:16px;padding:12px}.menu-buttons .icon-button span{display:inline;font-size:15px}.menu-buttons .icon-button{font-size:23px}.battle-preview{display:grid;grid-template-columns:1fr 45px 1fr;align-items:center;gap:15px;text-align:center;border-radius:18px;background:#edf2df;padding:22px 14px}.battle-preview>div>span{font-size:14px;font-weight:800}.battle-preview>div>div{display:flex;flex-wrap:wrap;justify-content:center;margin:10px 0}.battle-preview :is(svg,.character-art){width:55px;height:62px}.preview-vs{font-weight:900;color:#8a9d78}.battle-preview>div>b{font-size:13px;color:#789167}.map-stages{grid-template-columns:repeat(10,1fr)}.collection{grid-template-columns:repeat(4,1fr)}.collection-item :is(svg,.character-art){width:72px;height:73px}
@media(max-height:650px){.app{padding-top:7px;gap:6px}.header{min-height:46px}.brand-mark{width:34px;height:34px}.brand strong{font-size:20px}.brand small{display:none}.adventure-heading h1{font-size:16px}.wallet{padding:4px 12px}.wallet b{font-size:20px}.play-panel{padding-top:7px}.board-top{padding-bottom:5px}.field .slot{width:57px;height:54px}.field .slot :is(svg,.character-art){width:50px;height:48px}.field .level-badge{font-size:8px}.field .hp-track{height:6px;top:-3px}.target-mark{top:-23px;font-size:22px}.dock-button{min-height:53px}.dock-status{min-height:20px}}
@media(max-width:850px){.brand strong{font-size:18px}.brand small{display:none}.adventure-heading h1{font-size:15px}.header{gap:10px}.wallet{min-width:90px;padding:6px 9px}.board-tip{display:none}.dock-buttons{gap:7px}.dock-button{gap:6px}.dock-button>b{font-size:13px}.dock-button>span{font-size:20px}.shop-panel{grid-template-columns:1fr 1fr}.shop-item{min-height:88px}.shop-item :is(svg,.character-art){width:55px;height:60px}.shop-panel .shop{grid-column:auto}.early-recipes{grid-template-columns:1fr}.collection{grid-template-columns:repeat(3,1fr)}.save-note{display:none}}

/* Generated transparent illustrations; original atlases stay intact. */
.character-art{display:inline-block;position:relative;width:64px;height:64px;flex-shrink:0;pointer-events:none;vertical-align:middle;contain:layout paint;user-select:none}.art-crop{position:absolute;display:block;background-repeat:no-repeat;pointer-events:none}.character-art .art-crop{filter:none}.battle-preview .character-art{width:55px;height:62px}.field .slot>.character-art{filter:drop-shadow(0 3px 2px #263d2740)}
/* Leave the full illustration visible between the HP meter and level badge. */
.field .slot{height:76px}.field .slot>.character-art{position:absolute;left:50%;top:4px;transform:translateX(-50%);width:58px;height:58px}.enemy-grid .slot>.character-art{transform:translateX(-50%) scaleX(-1)}
@media(max-height:750px){.field .slot{height:64px}.field .slot>.character-art{width:48px;height:48px}}
@media(max-height:650px){.field .slot{height:54px}.field .slot>.character-art{top:3px;width:40px;height:40px}}
/* Individual ally special gauges and a soft, touch-safe ready halo. */
.special-track{position:absolute;top:4px;left:6px;right:6px;height:5px;border:1px solid #fff9dc;border-radius:7px;background:#405a6699;overflow:hidden;pointer-events:none}.special-track>span{display:block;height:100%;background:linear-gradient(90deg,#6dafea,#b3e5ff);border-radius:6px}.field .team-grid .slot>.character-art{top:11px;width:52px;height:52px}.team-grid .level-badge{font-size:9px;line-height:13px;padding:0 3px;bottom:0}.special-mark{display:none;position:absolute;right:-9px;top:13px;width:24px;height:24px;align-items:center;justify-content:center;border-radius:50%;background:#fff8cf;border:1px solid #f0ce6a;color:#bb882b;font-size:17px;box-shadow:0 1px 5px #aa8d4544;pointer-events:none}.field .slot.special-ready{isolation:isolate}.special-ready .special-mark{display:flex}.special-ready .special-track>span{background:linear-gradient(90deg,#efc453,#fff2a0)}.field .slot.special-ready::before,.field .slot.special-ready::after{content:'';position:absolute;inset:-13px -15px;border-radius:50%;pointer-events:none;z-index:-1}.field .slot.special-ready::before{background:radial-gradient(ellipse,#ffed9b66 0%,#f9ffc654 38%,#bceecd25 61%,transparent 73%);box-shadow:0 0 16px #fff4a766;animation:special-breathe 1.8s ease-in-out infinite}.field .slot.special-ready::after{border:2px solid #fff7b780;box-shadow:0 0 12px #d2f9da66;animation:special-wave 2.4s ease-out infinite}.field .slot.special-casting .character-art{filter:drop-shadow(0 0 10px var(--special-color)) brightness(1.14)}.special-announcement{position:absolute;z-index:7;top:12px;left:50%;transform:translateX(-50%);max-width:calc(100% - 36px);padding:9px 22px;border:2px solid #ffe29b;background:#345745ed;color:#fff4c4;border-radius:18px;box-shadow:0 5px 18px #29493844;font-size:18px;font-weight:900;text-align:center;pointer-events:none}.battle-status{padding:5px;font-size:11px;bottom:2px}.board-tip{font-size:10px}@keyframes special-breathe{0%,100%{opacity:.45;transform:scale(.91)}50%{opacity:1;transform:scale(1.1)}}@keyframes special-wave{0%{opacity:.7;transform:scale(.85)}100%{opacity:0;transform:scale(1.25)}}
@media(max-height:750px){.field .team-grid .slot>.character-art{width:40px;height:40px}.special-mark{width:20px;height:20px;font-size:14px;right:-5px;top:11px}.special-announcement{font-size:15px}}
@media(max-height:650px){.field .team-grid .slot>.character-art{top:10px;width:31px;height:31px}.team-grid .level-badge{font-size:8px;line-height:11px}.special-track{height:4px;left:4px;right:4px}}
@media(prefers-reduced-motion:reduce){.field .slot.special-ready::before{opacity:.8;transform:none}.field .slot.special-ready::after{opacity:.6;transform:none}}
/* Stage scenery stays below every actor, target and attack effect. */
/* Recipe ingredients stay readable while undiscovered artwork stays hidden. */
.account-menu{border-top:1px solid var(--line);margin-top:22px;padding-top:18px}.account-menu p{font-size:12px;overflow-wrap:anywhere}.account-menu a{display:inline-block;padding:12px 16px;border:1px solid var(--line);border-radius:12px;font-size:12px;font-weight:700}.account-menu small{display:block;font-size:10px;line-height:1.8;margin-top:12px;color:var(--muted)}
.character-loading{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:24px;background:#f6f4e9f2}
.character-loading-card{width:min(420px,100%);padding:30px 24px;border:1px solid var(--line);border-radius:24px;background:var(--white);text-align:center;box-shadow:0 8px 0 #e3e7d7}
.character-loading-card .brand-mark{margin:0 auto 20px}.character-loading-card h2{font-size:22px}.character-loading-card p{font-size:13px;line-height:1.9;color:var(--muted)}
.character-loading-card progress{width:100%;height:14px;accent-color:var(--green);margin:12px 0}.character-loading-card button{display:block;margin:14px auto 0;font-size:14px;min-height:44px}
.roster-card{grid-column:1/-1;border:1px solid var(--line);background:var(--white);border-radius:20px;padding:19px}
.boss-art>img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.roster-note{font-size:12px;line-height:1.8;color:var(--muted);margin:0 0 14px}
.roster-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px}
.roster-item{display:flex;align-items:center;gap:10px;min-width:0;background:#f3f5e9;border:1px solid #e0e6d5;border-radius:14px;padding:10px}
.roster-item>.character-art{width:48px;height:52px}
.roster-item b,.roster-item small,.remove-preview small{display:block}
.roster-item b{font-size:13px}.roster-item small{font-size:11px;color:var(--muted)}
.remove-member{border:1px solid #dbbca9;border-radius:11px;background:#f8e9df;color:#935b40;min-height:44px;padding:9px 13px;font-size:12px;font-weight:800}
.roster-item .remove-member{margin-left:auto;flex-shrink:0}
.remove-preview{display:flex;align-items:center;justify-content:center;gap:20px;padding:20px;background:#f0f3e5;border-radius:18px;margin:16px 0}
.remove-preview>.character-art{width:100px;height:105px}.remove-preview b{font-size:20px}.remove-preview small{font-size:14px;color:var(--muted)}
.remove-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:22px}
.remove-actions button{min-height:48px;padding:12px 20px;font-size:14px}
@media(max-width:550px){.shop-panel{grid-template-columns:minmax(0,1fr)}.shop-panel .shop{grid-row:auto}.roster-card{padding:14px}.roster-grid{grid-template-columns:minmax(0,1fr)}}
.recipe-row .recipe-side .recipe-unknown{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:36px;border:1px dashed #b6c4a3;border-radius:10px;background:#e9eedc;color:#718363;font-size:23px;line-height:1}
.recipe-result{flex-shrink:0}
#early-recipes{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:850px){#early-recipes{grid-template-columns:1fr}}
.field{background:#dcebba}
.scene{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden;border-radius:inherit}
.scene img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;opacity:0;transition:opacity 1.2s ease-in-out;user-select:none}
.scene img.scene-current{opacity:1}
@media(prefers-reduced-motion:reduce){.scene img{transition:none}}

/* Keep a usable arena even with mobile browser bars or a short landscape viewport. */
html.game-page, .game-page body{overflow-x:hidden;overflow-y:auto;background:var(--paper)}
.game-page body{height:auto;min-height:100%;overflow-x:clip;overflow-y:visible}
.game-page .app{height:100vh;height:100dvh;min-height:calc(580px + env(safe-area-inset-top) + env(safe-area-inset-bottom));display:grid;grid-template-rows:auto minmax(440px,1fr) auto}
.game-page .app>main{min-height:440px;min-width:0}
.game-page .field{min-height:380px;touch-action:none}
@media(max-height:580px){.game-page .bottom-dock{position:sticky;bottom:0;z-index:8;background:var(--paper);padding:6px 0 max(4px,env(safe-area-inset-bottom));box-shadow:0 -6px 12px #f6f4e9cc}}
.game-page .header{gap:12px}
.display-toggle{display:flex;align-items:center;justify-content:center;gap:6px;flex:none;min-width:98px;min-height:44px;padding:8px 12px;background:#fffdf4;border:1px solid #cfdcc3;border-radius:12px;font-size:12px}
.display-toggle>span{font-size:22px;line-height:1}
.display-feedback{position:fixed;left:50%;top:max(70px,env(safe-area-inset-top));transform:translateX(-50%);width:min(440px,calc(100% - 32px));z-index:80;margin:0;padding:12px 16px;border:1px solid #b9ccaa;border-radius:12px;background:#fffdf4;box-shadow:0 4px 20px #304c3833;font-size:12px;line-height:1.7}
.game-page.display-expanded .brand{display:none}
.game-page.display-expanded .header{min-height:44px}
.game-page.display-expanded .adventure-heading{margin-left:0;margin-right:auto;text-align:left}
@media(max-width:600px){
  .game-page .app{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right));gap:6px}
  .game-page .header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:5px 8px;min-height:0}
  .game-page .brand{gap:6px;min-width:0}
  .game-page .brand strong{font-size:14px}
  .game-page .brand-mark{width:28px;height:28px;font-size:23px;border-radius:9px}
  .game-page .wallet{min-width:0;margin:0;padding:3px 7px;gap:4px;border-radius:10px}
  .game-page .wallet small{display:none}
  .game-page .wallet b{font-size:17px}
  .game-page .coin{width:22px;height:22px;font-size:12px}
  .game-page .display-toggle{min-width:82px;padding:6px;font-size:11px}
  .game-page .adventure-heading{grid-row:2;grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:7px;margin:0;min-width:0}
  .game-page .adventure-heading h1{font-size:13px;margin:0}
  .game-page .stage-tag{font-size:10px;white-space:nowrap}
  .game-page .play-panel{padding:7px 6px 4px;border-radius:14px}
  .game-page .board-top{font-size:10px;padding:0 2px 6px;gap:4px}
  .game-page .team-label,.game-page .team-label b{font-size:10px}
  .game-page .target-bar{font-size:10px;padding:0 2px;margin-top:4px;min-height:32px}
  .game-page .dock-buttons{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
  .game-page .dock-button{flex-direction:column;min-height:48px;padding:4px 1px;gap:1px;border-radius:10px}
  .game-page .dock-button>span{font-size:18px;line-height:20px}
  .game-page .dock-button>b{font-size:10px;white-space:nowrap}
  .game-page .dock-status{padding-left:2px;min-height:20px}
  .game-page .message{font-size:10px}
  .game-page.display-expanded .adventure-heading{grid-row:1;grid-column:1;justify-content:flex-start}
  .game-page.display-expanded .adventure-heading h1{display:none}
}
@media(max-height:500px) and (min-width:601px){
  .game-page .app{gap:6px;padding-top:max(6px,env(safe-area-inset-top));padding-bottom:max(6px,env(safe-area-inset-bottom))}
  .game-page .header{min-height:44px;gap:10px}
  .game-page .brand-mark{width:28px;height:28px;font-size:23px}
  .game-page .brand strong{font-size:15px}
  .game-page .adventure-heading h1{font-size:13px}
  .game-page .wallet{min-width:80px;padding:3px 8px}
  .game-page .wallet small{display:none}
  .game-page .wallet b{font-size:18px}
  .game-page .board-top,.game-page .team-label,.game-page .team-label b{font-size:11px}
  .game-page .dock-button{min-height:44px;padding:5px;gap:5px}
  .game-page .dock-button>b{font-size:12px}
  .game-page .target-bar{font-size:10px}
}
.game-page.display-expanded .app{gap:4px;padding-top:max(4px,env(safe-area-inset-top));padding-bottom:max(4px,env(safe-area-inset-bottom))}
.game-page.display-expanded .play-panel{padding:5px 6px 3px}
.game-page.display-expanded .board-top{padding-bottom:4px;font-size:10px}
.game-page.display-expanded .team-label,.game-page.display-expanded .team-label b{font-size:10px}
.game-page.display-expanded .adventure-heading h1{display:none}
.game-page.display-expanded .target-bar{min-height:24px;margin-top:2px;font-size:10px}
.game-page.display-expanded .target-bar button{min-height:24px;padding:3px 6px;font-size:10px}
.game-page.display-expanded .dock-button{min-height:44px;padding:4px;gap:3px}
.game-page.display-expanded .dock-button>b{font-size:11px}
.game-page.display-expanded .dock-button>span{font-size:18px}
.game-page.display-expanded .dock-status{min-height:18px;padding-top:0}
.game-page.display-expanded .message{font-size:10px}

/* Battle roles, progression records and the surprise-only star variants. */
.character-art.star-variant .art-crop{filter:hue-rotate(95deg) saturate(1.4)}
.field .slot.boss-unit{width:120px;height:128px}
.field .slot.boss-unit>.character-art{width:108px;height:108px;top:8px}
.field .boss-unit .hp-track{height:10px;left:4px;right:4px}
.field .boss-unit .level-badge{font-size:10px;bottom:0}
.field .slot.shielded-unit{box-shadow:0 0 0 3px #a9c87499;background:#e5ffd22b}
.field .slot.frozen-unit{background:#bfeefb70;outline:2px solid #98d7ed}
.field .slot.burning-unit .level-badge{background:#ffe2bc}
.field .slot.boss-warning{outline:3px solid #e8a046;background:#ffbd4d22}
.status-marks{position:absolute;left:0;right:0;top:-24px;font-size:11px;font-weight:900;color:#476d91;text-shadow:0 1px 2px white;pointer-events:none}
.boss-unit .status-marks{top:-25px}
.name-member{display:block;min-height:36px;padding:6px 10px;background:#edf2e2;border:1px solid #d4dfc5;border-radius:8px;font-size:11px;margin-top:6px}
.nickname-label{display:block;font-size:12px;line-height:1.8;margin:18px 0 8px}
.nickname-input{display:block;width:100%;min-height:46px;padding:10px 12px;border:1px solid #b9cba9;border-radius:10px;font:inherit;color:var(--ink);background:#fffef5}
.discovery{text-align:center;padding:10px 0}.discovery-art{margin:18px auto}
.discovery-art .character-art{width:min(230px,65vw);height:min(230px,65vw)}
.discovery h2{font-size:27px}.discovery .eyebrow{font-size:13px;color:#9a783a}
.record-section{border:1px solid #dce4ce;border-radius:14px;background:#f4f6eb;margin:12px 0;padding:10px 14px}
.record-section>summary{min-height:44px;display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px;font-weight:800;list-style:none}
.record-section>summary::-webkit-details-marker{display:none}
.record-section>summary::after{content:'＋';margin-left:auto;color:#789366;font-size:18px}
.record-section[open]>summary::after{content:'−'}
.record-section>summary .character-art{width:48px;height:48px}
.record-section>summary small{display:block;font-size:11px;font-weight:500;margin-top:3px;color:#718365}
.record-section p{font-size:12px;line-height:1.8}
.record-title{margin-top:28px!important;font-size:20px!important}
.evolution-record{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.evolution-record .collection-item{padding:8px 2px;min-width:0}
.evolution-record .character-art{width:65px;height:65px;max-width:100%}
.boss-collection{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}
.boss-collection b{display:block;font-size:12px}
.reward-list>div{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e0e6d7;padding:10px 0}
.reward-list b{font-size:12px}.reward-list small{display:block;font-size:10px;color:#718365;line-height:1.8}
.reward-list button{min-width:105px;min-height:44px;font-size:11px}
.map-stage{flex-direction:column;gap:2px;min-height:52px;font-size:13px}
.map-stage small{font-size:10px;white-space:nowrap;color:#a47c25}
.area-rule{background:#edf2df;padding:10px 12px;border-radius:12px;font-size:12px!important}
.skill-guide section{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid #e0e6d7}
.skill-guide h3{font-size:14px;margin:0 0 4px}.skill-guide p{font-size:12px;margin:0;line-height:1.8}
.skill-guide .character-art{width:56px;height:56px}
.special-roster section{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-top:1px solid #dce4ce}
.special-roster section>div{flex:1;min-width:0}.special-roster .character-art{width:54px;height:54px}
.special-roster b{font-size:14px}.special-roster small{display:block;font-size:11px;color:#738467;line-height:1.8}
.special-roster p{font-size:12px;line-height:1.8;margin:4px 0 8px}.special-roster button{min-height:44px;font-size:12px}
.name-member{min-height:44px}
@media(max-width:550px){.map-stages{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.evolution-record{grid-template-columns:repeat(4,minmax(0,1fr))}.boss-collection{grid-template-columns:repeat(2,minmax(0,1fr))}.record-section{padding:8px}.record-section>summary{font-size:12px}.reward-list button{min-width:95px}}
@media(max-height:500px){.field .slot.boss-unit{width:100px;height:106px}.field .slot.boss-unit>.character-art{width:88px;height:88px}}

/* Grow only the illustration: meters, labels and touch targets keep their space. */
/* A full 30-member formation needs narrower cards and room between six rows. */
.field:has(#team-grid>.slot:nth-child(16)){container-type:size}
.field:has(#team-grid>.slot:nth-child(16)) .team-grid .slot{--dense-art:min(52px,6cqw,7cqh);width:min(72px,7cqw);height:min(69px,12cqh)}
.field:has(#team-grid>.slot:nth-child(16)) .team-grid .slot>.character-art{top:10px;width:var(--dense-art);height:var(--dense-art)}
.field:has(#team-grid>.slot:nth-child(16)) .team-grid .hp-track{left:2px;right:2px;height:4px;top:-3px}
.field:has(#team-grid>.slot:nth-child(16)) .team-grid .special-track{left:2px;right:2px;top:2px;height:3px}
.field:has(#team-grid>.slot:nth-child(16)) .team-grid .level-badge{left:0;right:0;bottom:0;font-size:7px;line-height:10px;padding:0}
.field .slot>.character-art{transform:translateX(-50%) scale(var(--unit-scale,1))}
.field .enemy-grid .slot>.character-art{transform:translateX(-50%) scaleX(-1) scale(var(--unit-scale,1))}
/* Boss illustrations already face right toward the allied team. */
.field .enemy-grid .slot>.boss-art{transform:translateX(-50%) scale(var(--unit-scale,1))}

/* One parachute and one helper keep the surprise clear on a small battlefield. */
.lucky-layer{position:absolute;inset:0;z-index:8;pointer-events:none;overflow:hidden}
.lucky-drop{position:absolute;width:76px;min-height:112px;padding:0;background:transparent;transform:translate(-50%,-50%);pointer-events:auto;touch-action:manipulation;display:flex;flex-direction:column;align-items:center;gap:0;border-radius:18px;filter:drop-shadow(0 3px 4px #5b66474d)}
.lucky-drop>img{width:76px;height:96px;pointer-events:none}.lucky-drop>span{font-size:11px;line-height:18px;font-weight:900;color:#785321;background:#fff3bd;border:1px solid #d5a445;border-radius:8px;padding:1px 9px;white-space:nowrap;pointer-events:none}
.lucky-drop:hover{background:#fff9c42b}.lucky-drop:active:not(:disabled){transform:translate(-50%,-50%) scale(.96)}
.lucky-drop:focus-visible{outline:3px solid #ffe989;outline-offset:3px}
.field .slot.lucky-helper .level-badge{background:#fff3bc;border:1px solid #d6ab50;color:#886124}
.field .slot.lucky-helper>.character-art{animation:lucky-hatch .5s ease-out}
@keyframes lucky-hatch{0%{opacity:0;transform:translateX(-50%) scale(.25)}60%{opacity:1;transform:translateX(-50%) scale(1)}100%{transform:translateX(-50%) scale(var(--unit-scale,1))}}
@media(max-width:550px),(max-height:500px){.lucky-drop{width:64px;min-height:96px}.lucky-drop>img{width:64px;height:81px}.lucky-drop>span{font-size:10px;line-height:15px}}
@media(prefers-reduced-motion:reduce){.field .slot.lucky-helper>.character-art{animation:none}}

/* Fusion uses the existing battle button and two decorative spirits, without reducing the field. */
.fight-button.combo-ready{background:linear-gradient(135deg,#f4c45f,#ffe9a6);box-shadow:0 0 0 2px #e9ad36,0 0 18px #efc44c66;color:#684d20}
.fight-button.combo-ready:focus-visible{outline:3px solid #8caecd;outline-offset:4px}
.fusion-layer{position:absolute;inset:0;z-index:6;pointer-events:none}
.fusion-spirit{position:absolute;display:block;width:54px;height:54px;filter:drop-shadow(0 0 6px #ffe593);pointer-events:none}
.fusion-spirit>.character-art{width:100%;height:100%}
.field .slot.combo-forming>.character-art{opacity:.25}
.combo-choice{margin:14px 0;padding:16px;border:1px solid #e4c879;border-radius:16px;background:#fff5d6}.combo-choice>b{font-size:18px}.combo-choice p{font-size:12px}.combo-choice button{width:100%;min-height:44px}
.combo-announcement{position:absolute;z-index:7;top:12%;left:50%;transform:translateX(-50%);max-width:calc(100% - 16px);text-align:center;color:#6d4920;pointer-events:none}
.combo-announcement>b{display:block;font-size:clamp(22px,3.4vw,40px);line-height:1.2;font-weight:900;white-space:normal;text-wrap:balance;text-shadow:2px 2px #fffef0,-2px -2px #fffef0,2px -2px #fffef0,-2px 2px #fffef0,0 4px 12px #ffce55}
.combo-announcement>small{display:inline-block;padding:4px 10px;border-radius:20px;background:#fff5bded;color:#7a5b25;font-size:12px;font-weight:900;white-space:nowrap}
@media(max-height:650px){.fusion-spirit{width:36px;height:36px}}
@media(prefers-reduced-motion:reduce){.field .slot.combo-forming>.character-art{opacity:1}}

.special-actions{display:flex;flex-wrap:wrap;gap:8px}.special-actions button{min-height:44px}.combo-choice>small{display:block;font-size:11px;line-height:1.7;color:#786b48}.combo-choice>b{display:block;line-height:1.5}

.combo-picks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.combo-pick{display:flex;align-items:center;gap:6px;min-width:0;min-height:52px;padding:6px;border:2px solid #dce3cc;border-radius:12px;background:#fffdf2;text-align:left}.combo-pick>.character-art{width:36px;height:36px;flex:none}.combo-pick>span{min-width:0}.combo-pick b{display:block;overflow-wrap:anywhere;font-size:12px}.combo-pick small{display:block;font-size:10px;margin-top:2px}.combo-pick[aria-pressed=true]{border-color:#c99834;background:#fff0b7;color:#715225}
/* Calling companions leaves the arena visible above a compact bottom sheet. */
dialog.shop-sheet{position:fixed;inset:auto 0 0;margin:0 auto;width:min(760px,100%);max-width:none;max-height:min(320px,50dvh);border-width:1px;border-bottom:0;border-radius:20px 20px 0 0;box-shadow:0 -5px 24px #203a3529}
dialog.shop-sheet::backdrop{background:transparent;backdrop-filter:none}
.shop-sheet .modal-inner{max-height:min(320px,50dvh)}
.shop-sheet .modal-header{min-height:52px;padding:4px 10px 4px 16px;gap:8px}
.shop-sheet .modal-brand{font-size:15px}.shop-sheet .modal-wallet{font-size:14px;padding:4px 9px}
.shop-sheet #modal-content{padding:8px 12px;scrollbar-gutter:stable}
.shop-sheet .modal-footer{min-height:32px;padding:6px 12px max(6px,env(safe-area-inset-bottom));gap:6px;font-size:11px;line-height:1.4}
.shop-sheet .shop-panel{grid-template-columns:minmax(0,1fr);gap:12px}
.shop-sheet .shop{grid-row:auto;padding:0;border:0;background:transparent}
.shop-sheet .shop .section-heading{justify-content:flex-end;margin-bottom:6px}
.shop-sheet .shop .section-heading>div,.shop-sheet .shop .soft-note{display:none}
.shop-sheet .shop .price-tag{font-size:11px;padding:2px 7px}
.shop-sheet .shop-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.shop-sheet .shop-item{min-height:88px;padding:7px 2px 5px;gap:3px;font-size:12px;white-space:nowrap}
.shop-sheet .shop-item :is(svg,.character-art){width:54px;height:54px}
@media(max-height:500px){
  .shop-sheet .modal-header{min-height:44px;padding:0 8px 0 12px}
  .shop-sheet #modal-content{padding:4px 10px}
  .shop-sheet .modal-footer{min-height:24px;padding:3px 10px max(3px,env(safe-area-inset-bottom));font-size:10px}
  .shop-sheet .shop .section-heading{margin-bottom:3px}
  .shop-sheet .shop-item{min-height:60px;padding:3px 2px;font-size:11px;gap:1px}
  .shop-sheet .shop-item :is(svg,.character-art){width:36px;height:36px}
}
/* Narrow screens keep every menu option inside the dialog. */
@media(max-width:900px){
  .game-page #modal .settings-actions button{min-height:44px}
}
@media(max-width:600px){
  .game-page #modal:not(.shop-sheet){width:calc(100% - 16px);max-width:calc(100% - 16px)}
  .game-page #modal:not(.shop-sheet) .modal-header{min-height:56px;padding:6px 10px;gap:6px}
  .game-page #modal:not(.shop-sheet) .modal-brand{font-size:13px;min-width:0}
  .game-page #modal:not(.shop-sheet) .modal-wallet{font-size:14px;padding:5px 8px}
  .game-page #modal:not(.shop-sheet) #modal-content{padding:14px 12px;min-width:0;overflow-wrap:anywhere}
  .game-page #modal .menu-buttons{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .game-page #modal .menu-buttons button{min-width:0;min-height:52px;padding:10px 6px;font-size:13px;white-space:normal;overflow-wrap:anywhere}
  .game-page #modal .menu-buttons .icon-button{gap:5px;font-size:20px}
  .game-page #modal .menu-buttons .icon-button span{font-size:13px;min-width:0}
  .game-page #modal .evolution-grid{grid-template-columns:minmax(0,1fr)}
  .game-page #modal .evolution-family{min-width:0}
  .game-page #modal .evolution-chain :is(svg,.character-art){width:48px;height:50px}
  .game-page #modal .settings-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
  .game-page #modal .settings-actions button{width:100%;min-width:0;min-height:44px;margin-top:0;font-size:13px;white-space:normal;overflow-wrap:anywhere}
  .game-page #modal .account-menu :is(a,button){max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere}
  .game-page #modal .modal-footer{min-width:0;gap:6px;padding:8px 12px max(8px,env(safe-area-inset-bottom));overflow-wrap:anywhere}
  .game-page .brand>span:last-child{min-width:0}
  .game-page .adventure-heading h1{min-width:0;overflow-wrap:anywhere}
  .game-page .target-bar{flex-wrap:wrap;gap:4px}
  .game-page .target-bar>span{min-width:0;flex:1;overflow-wrap:anywhere}
  .game-page .target-bar button{min-height:44px;flex:none}
}
