.forest-gate{position:absolute;right:5%;bottom:25px;padding:13px 22px;border:1px solid #7d8468;background:#f5efd9;color:#455743;border-radius:8px;font:18px 'Songti SC',serif;cursor:pointer}.turn-world{padding:0;border:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none;overflow:hidden;background:#c9d6a2;color:#384c3b}.turn-world [hidden]{display:none!important}.turn-world button{font:15px system-ui;border:1px solid #b6b893;background:#fff9e8eb;color:#384c3b;border-radius:12px;padding:12px 18px;min-height:44px;cursor:pointer}.turn-world button:disabled{opacity:.45;cursor:default}.turn-world button:focus-visible{outline:3px solid #b97835;outline-offset:3px}.turn-map{position:absolute;inset:0;overflow:hidden;touch-action:none}.turn-land{position:absolute;left:0;top:0;width:3400px;max-width:none;pointer-events:none}.turn-top{position:absolute;inset:24px 30px auto;display:flex;align-items:flex-start;justify-content:space-between;z-index:4;pointer-events:none}.turn-top>div:last-child{pointer-events:auto;display:flex;gap:8px}.turn-top small{letter-spacing:3px;font-size:11px}.turn-top h2{font:36px 'Songti SC',serif;margin:6px 0}.turn-top p{font:12px system-ui;background:#fffae4c9;padding:7px 10px;border-radius:8px}.explore-tip{position:absolute;bottom:100px;left:50%;transform:translateX(-50%);width:max-content;max-width:85%;text-align:center;background:#fff8e8e8;padding:10px 18px;border-radius:10px;font:14px system-ui}.explore-pets{position:absolute;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:8px}.explore-pets button,.swap-options button{display:flex;align-items:center;gap:8px}.explore-pets img,.swap-options img{width:35px;height:40px;object-fit:contain}.explore-pets button[aria-pressed=true]{border:2px solid #ae7342}.map-hero,.map-enemy{position:absolute!important;left:0;top:0;will-change:transform}.map-hero>img:first-child{position:absolute;width:160px;height:170px;object-fit:contain;left:-80px;bottom:0;filter:drop-shadow(0 8px 3px #53634344)}.map-pet{position:absolute;width:85px;height:85px;object-fit:contain;left:-145px;bottom:15px;filter:drop-shadow(0 8px 3px #53634344)}.map-hero.walking img{animation:walk-bob .3s ease-in-out infinite alternate}.turn-world .map-enemy{padding:0;border:0;background:none;width:120px;height:120px;margin:-110px 0 0 -60px;filter:drop-shadow(0 8px 3px #53634344)}.map-enemy img{width:100%;height:100%;object-fit:contain}.map-enemy span{display:block;background:#fff8e9df;border-radius:8px;font-size:12px;padding:4px}.battle-scene{position:absolute;inset:0;z-index:3;background:linear-gradient(#26483833,#fff6df08 40%,#ded8ae66),url('assets/bamboo-map-v2.webp') center/cover}.battle-heading{position:absolute;top:32px;left:50%;transform:translateX(-50%);text-align:center}.battle-heading h2{font:30px 'Songti SC',serif;margin:4px}.round{font-size:12px;letter-spacing:3px}.intent{background:#fff8e9ee;border:1px solid #e6d2ab;border-radius:20px;padding:9px 20px;font-size:14px;white-space:nowrap}.fighter{position:absolute;width:230px;height:250px;text-align:center;filter:drop-shadow(0 14px 5px #374e3d44)}.ally{left:17%;top:34%;}.enemy{right:16%;top:23%}.fighter-art{height:205px;transform-origin:50% 90%;}.fighter img{width:100%;height:100%;object-fit:contain}.fighter-name{font:bold 16px system-ui;text-shadow:0 2px 3px #fff;background:#fff9e3c9;display:inline-block;padding:5px 14px;border-radius:20px}.enemy-hp{display:block;width:120px;height:11px;margin:6px auto;accent-color:#af7744}.battle-console{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);width:min(700px,90%);padding:15px 20px 10px;background:#fff9e9f2;border:1px solid #c7b891;box-shadow:0 8px 40px #58634322;border-radius:22px}.battle-stats{display:flex;gap:24px;margin:0 4px 12px;font:13px system-ui}.battle-stats b{font-size:20px;margin-left:5px}.token{color:#478895}.turn-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.turn-actions button{display:grid;text-align:left;gap:6px}.turn-actions b{font:21px 'Songti SC',serif}.turn-actions small{font-size:11px;opacity:.75}.turn-actions button:first-child{background:#526d50;color:#fff8df}.turn-note{text-align:center;font-size:11px;opacity:.7;margin:10px 0 0}.battle-caption{position:absolute;bottom:210px;left:50%;transform:translateX(-50%);max-width:85%;background:#fff9e9e8;border-radius:14px;padding:10px 20px;text-align:center;font:17px 'Songti SC',serif}.swap-options{position:absolute;bottom:100%;margin-bottom:10px;left:0;right:0;display:flex;justify-content:center;gap:8px}.turn-outcome{position:absolute;z-index:6;left:50%;top:50%;transform:translate(-50%,-50%);width:min(420px,85%);box-sizing:border-box;padding:35px;background:#fff9e9f5;border:1px solid #c5b78c;border-radius:22px;text-align:center;box-shadow:0 20px 100px #324b4466}.turn-outcome h2{font:32px 'Songti SC',serif}.turn-outcome p{font:15px/1.8 system-ui}.turn-outcome small{letter-spacing:3px;font-size:11px}.spell-effect{position:absolute;pointer-events:none;left:50%;top:43%;width:100px;height:100px;border-radius:50%;transform:translate(-50%,-50%);opacity:0}.spell-effect.wave{border:12px solid #a3e7e7;animation:water-ring .8s ease-out}.spell-effect.claw{border-left:8px solid #dd986d;border-right:8px solid #dd986d;border-radius:0;animation:claw-snap .6s}.spell-effect.shield{left:28%;border:5px solid #ffe79b;animation:water-ring .8s}.act-attack .fighter-art,.act-claw .fighter-art{animation:pet-lunge .75s ease-in-out}.act-wave .fighter-art{animation:whale-rise .78s ease-in-out}.act-shield .fighter-art,.act-swap .fighter-art{animation:summon .75s ease-out}.counter .fighter-art{animation:enemy-lunge .75s}.hurt .fighter-art{animation:hit-shake .4s}.adventuring{overscroll-behavior:none}
@keyframes walk-bob{to{translate:0 -5px}}@keyframes pet-lunge{45%{transform:translate(90px,-25px) rotate(8deg) scale(1.1)}}@keyframes whale-rise{45%{transform:translateY(-65px) rotate(-12deg) scale(1.15)}}@keyframes summon{0%{opacity:.25;transform:scale(.7)}60%{transform:scale(1.12)}}@keyframes enemy-lunge{45%{transform:translate(-80px,20px) rotate(-8deg)}}@keyframes hit-shake{25%,75%{transform:translateX(-10px);filter:brightness(1.5)}50%{transform:translateX(10px)}}@keyframes water-ring{0%{opacity:.8;scale:.2}100%{opacity:0;scale:4}}@keyframes claw-snap{0%{opacity:0;scale:2;rotate:20deg}50%{opacity:1;scale:1}100%{opacity:0;scale:.5}}
@media(max-width:600px){.turn-top{inset:14px 14px auto}.turn-top h2{font-size:27px}.turn-top small{font-size:10px;letter-spacing:1px}.turn-top p{max-width:140px;font-size:11px}.turn-top button{padding:8px;font-size:11px}.battle-heading{top:125px;width:100%}.battle-heading h2{font-size:24px}.intent{display:inline-block;font-size:12px;padding:8px 12px}.fighter{width:150px;height:170px}.fighter-art{height:140px}.ally{left:6%;top:43%}.enemy{right:5%;top:28%}.fighter-name{font-size:12px}.battle-console{bottom:18px;width:94%;padding:12px;box-sizing:border-box;border-radius:18px}.battle-stats{gap:16px}.turn-actions{gap:6px}.turn-actions button{padding:12px 7px}.turn-actions b{font-size:18px}.turn-actions small{font-size:9px}.battle-caption{bottom:190px;width:max-content;max-width:83%;font-size:14px;padding:8px 12px}.explore-pets{width:94%;justify-content:center}.explore-pets button{padding:8px;font-size:12px;gap:4px}.explore-pets img{width:26px}.explore-tip{font-size:12px}.swap-options button{padding:8px;font-size:12px;gap:4px}.swap-options img{width:28px}.spell-effect{top:42%;width:60px;height:60px}.spell-effect.shield{left:26%;top:50%}}
@media(prefers-reduced-motion:reduce){.turn-world *{animation-duration:.01ms!important}}

.turn-top{padding:0;width:auto}.turn-top>div:first-child{padding:10px 14px;background:#fff9e8e8;border:1px solid #c7b891;border-radius:16px}.turn-top p{margin:4px 0 0;background:none;padding:0}.turn-world.battling .turn-top>div:first-child{display:none}.battle-heading{color:#304332;text-shadow:0 1px 5px #fff9e8,0 0 14px #fff9e8}.battle-heading .round{display:inline-block;background:#fff9e8e8;border-radius:20px;padding:5px 12px}.battle-heading h2{margin-top:10px}.turn-world.battling .turn-top{justify-content:flex-end}.battle-scene:not([hidden])~.turn-outcome{isolation:isolate}
@media(max-width:600px){.battle-heading{top:82px}.battle-heading h2{margin-top:6px}.intent{margin-top:8px}.turn-top>div:first-child{padding:8px}.turn-top h2{margin:3px 0}}
@media(max-height:650px) and (max-width:600px){.fighter{width:115px;height:130px}.fighter-art{height:105px}.ally{top:38%}.enemy{top:27%}.battle-caption{bottom:172px}.battle-console{bottom:8px}.battle-heading{top:65px}.battle-heading h2{font-size:20px}.intent{margin:5px 0}.turn-actions b{font-size:16px}.turn-actions button{padding:10px 5px}}
/* Battle study: diagonal formation, edge HUD, target-led commands. */
.battle-scene{background:linear-gradient(180deg,#17392a55,transparent 35%,#172e2522),url('assets/bamboo-map-v2.webp') center 56%/cover}
.battle-scene:before{content:'';position:absolute;left:14%;right:12%;top:35%;height:45%;border:1px solid #faf0bf35;border-radius:50%;background:radial-gradient(ellipse,#f8edb830,transparent 68%);transform:rotate(-12deg);pointer-events:none}
.battle-heading{top:24px}.battle-heading h2{font-size:21px;letter-spacing:6px;color:#fff2ce;text-shadow:0 2px 4px #183527;margin:9px}.battle-heading .round{color:#fae6b6;background:#244539e6;border:1px solid #d5ba7f;padding:7px 20px;border-radius:3px;font-size:14px;box-shadow:0 2px 0 #132e24}.intent{font-size:12px;border:0;background:#19352fcc;color:#fff1cb;margin:6px 0;border-radius:3px;padding:6px 12px;text-shadow:none}
.turn-world.battling .turn-top{left:22px;right:auto;top:20px;z-index:5}.turn-world.battling .turn-top button{background:#1c3c31da;color:#f8e7c3;border:1px solid #b8a16d;border-radius:4px;padding:8px 12px;font-size:12px}
.fighter{width:160px;height:185px;filter:none;z-index:6}.fighter:before,.tamer:before{content:'';position:absolute;left:13%;bottom:23px;width:74%;height:20px;border-radius:50%;background:#233e365e;filter:blur(4px)}.fighter-art{height:150px;position:relative;z-index:2}.fighter-art img{filter:drop-shadow(0 4px 1px #273b3433)}.ally{left:56%;top:48%}.enemy{right:auto;left:26%;top:25%}.fighter-name{background:none;color:#fff3bf;text-shadow:1px 1px 2px #162f26,-1px -1px 2px #162f26;font-size:14px;padding:0;position:relative;z-index:3;font-weight:600}.enemy-hp{height:8px;width:85px;margin:3px auto}.tamer{position:absolute;left:71%;top:55%;width:135px;height:180px;z-index:5;text-align:center}.tamer img{height:155px;width:135px;object-fit:contain;position:relative;filter:drop-shadow(0 4px 2px #233e3655)}.tamer span{position:relative;display:block;color:#bff5ca;text-shadow:0 1px 2px #123024,1px 0 2px #123024;font:13px system-ui}
.pet-hud{position:absolute;right:22px;top:20px;display:flex;align-items:center;gap:10px;width:210px;padding:9px 12px;background:linear-gradient(135deg,#193e37ed,#16332ce8);border:1px solid #ceae72;outline:2px solid #193c30;box-shadow:0 4px 14px #182c3544;color:#f8e7c6;z-index:5}.pet-hud>img{width:47px;height:56px;object-fit:contain;background:#35594a;border:1px solid #cfb579;border-radius:50%}.pet-hud>div{flex:1}.pet-hud strong{font:15px 'Songti SC',serif;letter-spacing:1px}.pet-hud label{display:block;font:9px system-ui;margin-top:4px}.pet-hud label span{float:right;font-size:10px}.pet-hud i{display:block;height:5px;background:#102922;border:1px solid #576554;margin-top:3px;overflow:hidden}.pet-hud em{display:block;height:100%;transition:width .3s;background:linear-gradient(#edb875,#b86248)}.pet-hud .token-track em{background:linear-gradient(#a4dcdd,#487e9b)}
.battle-console{left:auto;right:23px;bottom:55px;transform:none;width:105px;padding:0;border:0;background:none;box-shadow:none;border-radius:0;z-index:10}.battle-stats{display:none}.turn-actions{display:flex;flex-direction:column;gap:9px}.turn-actions button,.turn-actions button:first-child{min-height:47px;display:block;padding:9px 4px;text-align:center;border-radius:4px;color:#fff0c9;border:1px solid #e6cb91;background:linear-gradient(180deg,#647c56,#2f503e 20%,#234533 80%,#183525);box-shadow:inset 0 0 0 2px #6a7e52,0 3px 0 #15372c,0 5px 8px #122d2855}.turn-actions b{font:22px 'Songti SC',serif;letter-spacing:5px;text-shadow:0 2px 1px #102d21}.turn-actions small,.turn-actions .skill-name{display:none}.turn-actions button:hover{filter:brightness(1.2);translate:-3px 0}.turn-note{position:fixed;bottom:13px;left:50%;transform:translateX(-50%);width:max-content;max-width:95vw;color:#fff6dc;text-shadow:0 1px 3px #183f2d;background:#1c382dad;padding:6px 14px;border-radius:3px;opacity:1;font-size:11px}.battle-caption{left:20px;bottom:20px;transform:none;width:280px;max-width:35%;padding:10px 14px;background:#102f28bd;border-left:2px solid #c8ae73;color:#f6e4c2;border-radius:0;font:14px/1.6 system-ui;text-align:left;z-index:5}.swap-options{left:auto;right:120px;bottom:0;margin:0;padding:14px;background:#183e34f5;border:1px solid #c8ae73;flex-direction:column;min-width:135px}.swap-options button{background:#365443;color:#f4e4bf;border:1px solid #998c61;border-radius:3px}.resolving .battle-console{opacity:0;pointer-events:none;transition:opacity .15s}.targeting .enemy{cursor:crosshair;outline:none}.targeting .enemy:after{content:'▼';position:absolute;left:50%;top:-28px;transform:translateX(-50%);font-size:24px;color:#ffdd6d;text-shadow:0 2px 4px #443c20;animation:target-bob .7s infinite alternate}.targeting .enemy .fighter-art{filter:drop-shadow(0 0 7px #fff4a7)}.targeting .enemy:before{border:2px solid #f4dc78;background:#ffe68433;filter:none}
.damage-number{position:absolute;left:35%;top:12%;z-index:30;color:#ffeeb3;font:bold 35px Georgia,serif;text-shadow:2px 2px 0 #79351d,-1px -1px 0 #79351d;animation:damage-rise 1.1s ease-out forwards;pointer-events:none}.spell-effect{z-index:8;left:33%;top:40%}.spell-effect.wave{width:130px;height:50px;border:12px double #bceef4;box-shadow:0 0 35px #65c3d6;animation:water-ring .8s ease-out}.spell-effect.claw{width:50px;height:80px;box-shadow:0 0 18px #f9df9a;border-color:#fff2b9;rotate:-35deg}.spell-effect.shield{left:63%;top:61%}
@keyframes target-bob{to{translate:0 -7px}}@keyframes damage-rise{0%{opacity:0;transform:translateY(5px) scale(.7)}15%{opacity:1;transform:translateY(-10px) scale(1.15)}70%{opacity:1}100%{opacity:0;transform:translateY(-65px) scale(1)}}
@media(max-width:600px){.battle-heading{top:109px}.battle-heading h2{font-size:18px;margin:7px}.battle-heading .round{font-size:11px;padding:5px 15px}.intent{font-size:10px;padding:5px 10px}.turn-world.battling .turn-top{left:12px;top:17px}.turn-world.battling .turn-top>div:last-child{flex-direction:column;gap:5px}.turn-world.battling .turn-top button{padding:4px 8px;min-height:32px;font-size:10px}.pet-hud{right:12px;top:17px;width:176px;padding:7px 9px;gap:7px}.pet-hud>img{width:37px;height:47px}.pet-hud strong{font-size:13px}.enemy{left:15%;top:29%}.ally{left:36%;top:54%}.fighter{width:125px;height:145px}.fighter-art{height:115px}.fighter-name{font-size:12px}.tamer{left:63%;top:44%;width:100px;height:145px}.tamer img{width:100px;height:120px}.tamer span{font-size:10px}.battle-console{right:14px;bottom:58px;width:70px}.turn-actions{gap:8px}.turn-actions button,.turn-actions button:first-child{min-height:41px;padding:7px 3px}.turn-actions b{font-size:18px;letter-spacing:3px}.battle-caption{left:13px;bottom:60px;font-size:12px;width:185px;max-width:50%;padding:9px 12px}.turn-note{bottom:17px;font-size:10px}.swap-options{right:82px;min-width:118px;padding:10px}.spell-effect{left:31%;top:40%}.spell-effect.shield{left:51%;top:65%}.damage-number{font-size:29px}}
@media(max-width:600px) and (max-height:650px){.battle-heading{top:95px}.battle-heading h2{display:none}.enemy{top:29%;left:13%}.ally{top:51%;left:30%}.tamer{top:40%;left:61%}.fighter{width:100px;height:120px}.fighter-art{height:95px}.tamer img{height:105px;width:90px}.battle-caption{bottom:48px}.battle-console{bottom:47px;width:65px}.turn-actions{gap:6px}.turn-actions button,.turn-actions button:first-child{min-height:35px;padding:6px 3px}.turn-actions b{font-size:17px}.turn-note{bottom:8px}.pet-hud{width:158px}.tamer span{font-size:9px}}

/* Wenz: familiar faces, readable tactical choices. */
.tamer img{transform:scaleX(-1)}.enemy .fighter-art img{transform:scaleX(-1)}
.battle-heading .battle-status{font:12px system-ui;color:#344b3c;background:#fff9e9e8;border-radius:8px;padding:6px 10px;text-shadow:none}.battle-status:empty{display:none}
.battle-console{width:194px;bottom:55px}.turn-actions{gap:7px}.turn-actions button,.turn-actions button:first-child{background:#fff8e9ed;color:#435543;border:1px solid #b4b691;border-radius:10px;box-shadow:0 3px 10px #233b2922;text-align:left;padding:9px 13px}.turn-actions b{font-size:19px;letter-spacing:2px;text-shadow:none}.turn-actions small,.turn-actions .skill-name{display:block;font:11px/1.5 system-ui;opacity:1;margin-top:2px}.turn-actions .skill-name{display:inline;margin-left:7px;color:#946b3c}.turn-actions .skill-detail{font-size:10px;color:#596b59}.swap-options{right:205px;border-radius:12px}.swap-options small{display:block;font-size:10px;margin-top:4px}.battle-caption{max-width:30%}.ally{left:51%}.tamer{left:66%;top:44%}
@media(max-width:600px){.battle-console{width:148px;right:12px;bottom:48px}.turn-actions{gap:4px}.turn-actions button,.turn-actions button:first-child{padding:7px 9px;min-height:40px}.turn-actions b{font-size:16px}.turn-actions small,.turn-actions .skill-name{font-size:10px}.turn-actions .skill-detail{font-size:9px}.swap-options{right:157px;min-width:115px}.battle-caption{bottom:56px;width:135px;max-width:36%;font-size:11px}.ally{left:20%;top:51%}.tamer{left:60%;top:34%}.battle-heading .battle-status{font-size:10px;max-width:90vw;white-space:normal}.enemy{left:12%;top:29%}}
@media(max-width:600px) and (max-height:650px){.battle-heading{top:94px}.battle-heading .intent{margin:3px 0}.battle-heading .battle-status{margin:3px}.battle-console{bottom:40px}.turn-actions button,.turn-actions button:first-child{padding:5px 8px}.ally{top:48%;left:14%}.tamer{top:29%;left:59%}.battle-caption{bottom:42px}}

/* Formation: friendly lower-left, enemy upper-right. Faces remain visible. */
.ally{left:36%;top:48%}.tamer{left:22%;top:58%}.enemy{left:65%;top:25%;right:auto}
.tamer img,.enemy .fighter-art img{transform:none}.ally .fighter-art img{transform:scaleX(-1)}
@media(max-width:600px){.ally{left:24%;top:48%}.tamer{left:2%;top:57%}.enemy{left:59%;top:28%}}
@media(max-width:600px) and (max-height:650px){.ally{left:24%;top:47%}.tamer{left:1%;top:56%}.enemy{left:59%;top:27%}}
/* Touch layout: preserve the right-side command rail. */
@media(max-width:600px){
 .battle-console{left:auto;right:max(12px,env(safe-area-inset-right));bottom:max(42px,env(safe-area-inset-bottom));width:76px;padding:0;border:0;background:none;border-radius:0;box-shadow:none}
 .turn-actions{display:flex;flex-direction:column;gap:8px}
 .turn-actions button,.turn-actions button:first-child{height:46px;min-height:46px;padding:6px 3px;text-align:center;border-radius:6px;background:linear-gradient(#43644e,#213f31);color:#fff0c9;border:1px solid #d7bc83;box-shadow:inset 0 0 0 2px #607252,0 3px 0 #18392d}
 .turn-actions b{font-size:19px;letter-spacing:3px;text-shadow:0 2px 1px #173327}
 .turn-actions small,.turn-actions .skill-name,.turn-actions .skill-detail,.turn-actions .skill-cost{display:none}
 .turn-actions .skill-cost{display:block;font:9px/1.1 system-ui;margin:1px 0 0;color:#ead6a8}
 .turn-actions button:hover{translate:0}
 .battle-caption{left:14px;right:auto;bottom:max(42px,env(safe-area-inset-bottom));width:calc(100% - 122px);max-width:260px;font-size:12px;line-height:1.6;padding:9px 11px;border-radius:4px;background:#244234e8;box-sizing:border-box}
 .turn-note{display:block;bottom:8px;font-size:10px;padding:4px 9px;max-width:90vw}
 .swap-options{left:auto;right:86px;bottom:58px;width:140px;min-width:0;flex-direction:column;gap:6px;padding:8px;background:#183e34f5;border-radius:8px}
 .swap-options button{padding:7px;min-height:48px;gap:7px;font-size:12px;justify-content:flex-start}
 .swap-options img{width:30px;height:34px}.swap-options small{font-size:10px}
 .pet-hud{right:12px;top:14px;width:156px;padding:7px 9px;border-radius:10px;outline:none}.pet-hud>img{width:32px;height:42px}.pet-hud strong{font-size:12px}.pet-hud label{font-size:9px}.turn-world.battling .turn-top{left:12px;top:14px}.turn-world.battling .turn-top>div:last-child{flex-direction:row}.turn-world.battling .turn-top button{min-height:40px;padding:6px 8px;border-radius:8px}
 .battle-heading{top:102px;width:100%;pointer-events:none}.battle-heading h2{display:none}.battle-heading .round{padding:4px 12px;font-size:11px}.battle-heading .intent{font-size:11px;padding:6px 10px;margin:5px auto;width:max-content;max-width:90%;white-space:normal;box-sizing:border-box}.battle-heading .battle-status{font-size:10px;margin:4px auto;padding:4px 8px;width:max-content;max-width:90%;box-sizing:border-box}
 .fighter{width:118px;height:140px}.fighter-art{height:112px}.fighter-name{font-size:12px}.enemy{left:auto;right:10%;top:28%}.ally{left:29%;top:46%}.tamer{left:5%;top:51%;width:86px;height:122px}.tamer img{width:86px;height:104px}.tamer span{font-size:10px}.enemy-hp{width:75px}
}
@media(max-width:600px) and (max-height:700px){
 .battle-heading{top:91px}.battle-heading .intent{margin:3px auto;padding:4px 8px}.battle-heading .battle-status{margin:2px auto}.fighter{width:94px;height:112px}.fighter-art{height:88px}.enemy{top:27%;right:12%}.ally{top:44%;left:30%}.tamer{top:47%;left:5%;height:105px}.tamer img{height:88px}.battle-console{bottom:34px}.turn-actions{gap:6px}.turn-actions button,.turn-actions button:first-child{height:44px;min-height:44px}.battle-caption{bottom:34px;font-size:11px;padding:7px 9px}
}
@media(max-width:350px){.pet-hud{width:139px;right:9px}.turn-world.battling .turn-top{left:9px}.turn-world.battling .turn-top button{font-size:9px;padding:5px}.turn-actions .skill-detail{font-size:9px}.swap-options img{width:20px}.tamer{left:2%}}

/* Visible silhouette normalization: shared extent, bottom-aligned feet. */
.battle-scene{--actor-size:150px}.fighter,.tamer{width:var(--actor-size);height:calc(var(--actor-size) + 30px)}
.fighter-art,.tamer-art{position:relative;width:var(--actor-size);height:var(--actor-size);margin:0;overflow:visible}
.fighter-art img,.tamer-art img{position:absolute;max-width:none;object-fit:fill;transform:none!important;filter:drop-shadow(0 4px 2px #273b3433)}
.ally[data-pet="1"] .fighter-art,.ally[data-pet="2"] .fighter-art{--face:-1}
.ally[data-pet="1"] .fighter-art img,.ally[data-pet="2"] .fighter-art img{scale:-1 1}
.tamer span{margin-top:3px;font-size:13px}.fighter:before,.tamer:before{bottom:25px}
.map-hero .traveler{position:absolute;left:-55px;bottom:0;width:110px;height:155px;transform-origin:50% 100%}.traveler>img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 2px #233e3644)}
.travel-walk{display:none;position:absolute;inset:0;background:url('assets/hero-walk-v2.png') 0 50%/400% 100% no-repeat;filter:drop-shadow(0 4px 2px #233e3644)}
.map-hero.walking .traveler>img{visibility:hidden}.map-hero.walking .travel-walk{display:block}.map-hero.face-left .traveler{scale:-1 1}.map-hero.walking img{animation:none}.map-hero .map-pet{width:100px;height:100px;left:-140px;bottom:0}.map-hero.face-left .map-pet{left:40px;scale:-1 1}
@media(max-width:600px){.battle-scene{--actor-size:104px}.ally{left:34%;top:46%}.tamer{left:4%;top:49%}.tamer span{font-size:10px}.fighter-name{font-size:11px}.map-hero .traveler{width:95px;height:134px;left:-47px}.map-hero .map-pet{width:85px;height:85px;left:-120px}}
@media(max-width:600px) and (max-height:700px){.battle-scene{--actor-size:84px}.ally{left:34%;top:44%}.tamer{left:4%;top:47%}}

#player.walking .walk-sprite{animation:none!important}#player.left>img{transform:scaleX(-1)}

#player.walking .walk-sprite{background-image:url(assets/hero-walk-v2.png)}

.turn-map{overflow:clip}.map-actors{position:absolute;inset:0;overflow:visible}
/* Match the idle silhouette to the walking sheet's visible height. */
.map-hero .traveler>img{position:absolute;width:151.7%;height:112.9%;max-width:none;left:-26%;top:-2.8%;object-fit:fill}

/* Spell silhouettes: pincers, water rings and a paper seal. No full-screen flash. */
.spell-effect[class*="effect-"]{width:clamp(100px,15vw,180px);height:clamp(100px,15vw,180px);border:0;box-shadow:none;background:none;rotate:0;opacity:1;animation:effect-fade .85s both;transform:translate(-50%,-50%)}
.spell-effect i{position:absolute;display:block;box-sizing:border-box;pointer-events:none}
.effect-claw i:nth-child(-n+2){top:10%;width:42%;height:75%;border:7px solid #fbc388;border-top-color:transparent;border-radius:50%;filter:drop-shadow(0 0 6px #e88b51);animation:pincer-close .7s both}
.effect-claw i:first-child{left:0;--claw-side:-1;rotate:-30deg}.effect-claw i:nth-child(2){right:0;--claw-side:1;rotate:30deg}
.effect-claw i:nth-child(n+3),.effect-impact i{left:46%;top:46%;width:8%;height:28%;border-radius:80%;background:#fff2bf;transform-origin:50% 10%;rotate:calc(var(--ray)*60deg);animation:impact-ray .65s both}
.spell-effect i:nth-child(1){--ray:0}.spell-effect i:nth-child(2){--ray:1}.spell-effect i:nth-child(3){--ray:2}.spell-effect i:nth-child(4){--ray:3}.spell-effect i:nth-child(5){--ray:4}.spell-effect i:nth-child(6){--ray:5}
.effect-wave i:nth-child(-n+3){inset:12%;border:4px solid #a9edf0;border-left-color:#4fabc4;border-radius:50%;box-shadow:0 0 12px #86dddf66,inset 0 0 10px #86dddf44;animation:whale-ring .8s both;animation-delay:calc(var(--ray)*.1s)}
.effect-wave i:nth-child(n+4){left:calc(12% + (var(--ray) - 3)*32%);top:45%;width:12%;height:19%;background:#b9f4ee;border:1px solid #529fae;border-radius:60% 60% 65% 5%;rotate:-35deg;animation:water-droplet .8s both}
.effect-shield i:first-child,.effect-summon i:first-child{inset:0;border:2px solid #e3c77d;border-radius:50%;box-shadow:inset 0 0 30px #f3d88555,0 0 16px #f3d88544;animation:seal-rise .85s both}
.effect-shield i:nth-child(2){inset:15% 32%;border:2px solid #bc8846;background:#fae8aeeb;box-shadow:0 3px 8px #60431e44;rotate:8deg;animation:seal-rise .85s both}
.effect-shield i:nth-child(2):after{content:'守';position:absolute;inset:0;display:grid;place-items:center;color:#986637;font:clamp(24px,4vw,40px) 'Songti SC',serif}
.effect-shield i:nth-child(n+3),.effect-summon i:nth-child(n+2){width:7px;height:7px;background:#ffedb1;left:50%;top:50%;rotate:calc(var(--ray)*60deg);transform-origin:0 0;animation:seal-spark .85s both}
.skill-callout{position:absolute;z-index:20;left:50%;top:-34px;white-space:nowrap;pointer-events:none;transform:translateX(-50%);font:18px 'Songti SC',serif;letter-spacing:3px;color:#fff1ca;text-shadow:0 2px 3px #354c35;background:#244b3ce0;padding:6px 15px;border-block:1px solid #d6bc83;animation:skill-title 1.4s both}
.ally.has-shield:before{border:2px solid #e6cf86;box-shadow:0 0 12px #ffdc8477}.enemy.is-wet:before{border:2px solid #80d9df;box-shadow:0 0 12px #79d9e077;background:#75cfdb44}
@keyframes effect-fade{0%{opacity:0}12%,75%{opacity:1}100%{opacity:0}}
@keyframes pincer-close{0%{translate:calc(var(--claw-side)*35px) -8px;scale:1.1}45%,70%{translate:calc(var(--claw-side)*-12px) 0;scale:.9}100%{translate:0 8px;opacity:0}}
@keyframes impact-ray{0%{translate:0 0;scale:.2}60%{translate:0 15px;scale:1}100%{translate:0 25px;scale:.5;opacity:0}}
@keyframes whale-ring{0%{scale:.25;opacity:0}20%{opacity:1}100%{scale:1.5;opacity:0;rotate:20deg}}
@keyframes water-droplet{0%{translate:0 15px;scale:.4;opacity:0}40%{translate:0 -25px;scale:1;opacity:1}100%{translate:0 10px;scale:.5;opacity:0}}
@keyframes seal-rise{0%{translate:0 20px;scale:.65;opacity:0}30%,75%{translate:0 0;scale:1;opacity:1}100%{translate:0 -10px;scale:1.1;opacity:0}}
@keyframes seal-spark{0%{transform:translateX(10px);opacity:0}30%{opacity:1}100%{transform:translateX(65px);opacity:0}}
@keyframes skill-title{0%{opacity:0;margin-top:8px}15%,75%{opacity:1;margin-top:0}100%{opacity:0;margin-top:-8px}}
@media(max-width:600px){.skill-callout{font-size:14px;top:-30px;padding:5px 10px}}
@media(prefers-reduced-motion:reduce){.spell-effect[class*="effect-"],.spell-effect i,.skill-callout{animation:none!important;opacity:0}}

/* One active partner. The trainer watches from the sideline. */
.tamer{--actor-size:90px;left:16%;top:auto;bottom:105px;opacity:.9}.tamer span{font-size:11px}
.turn-phase{width:170px;margin:9px auto 0;padding:6px 10px;background:#183b31e6;color:#f6e6c1;border:1px solid #b7a477;border-radius:4px;text-shadow:none;box-sizing:border-box}
.turn-phase span{font:11px system-ui;letter-spacing:1px}.turn-phase>div{height:3px;margin-top:5px;background:#ffffff22;overflow:hidden}.turn-phase i{display:block;height:100%;width:0;background:#d8c28a;transition:width .25s}
.battle-scene[data-phase=choose] .ally:before,.battle-scene[data-phase=ally] .ally:before{bottom:22px;left:0;width:100%;height:25px;filter:none;border:2px solid #c3f1d3;background:#84ceb044;box-shadow:0 0 0 4px #397e6a55,0 0 17px #9be3be;animation:turn-aura 2.2s ease-in-out infinite}
.battle-scene[data-phase=enemy] .enemy:before{bottom:22px;left:0;width:100%;height:25px;filter:none;border:2px solid #f2d98e;background:#e7c36a33;box-shadow:0 0 0 4px #b69c5355,0 0 17px #f0d996}
@keyframes turn-aura{50%{box-shadow:0 0 0 5px #397e6a33,0 0 23px #9be3be77}}
@media(max-width:600px){.tamer{--actor-size:64px;left:4%;top:auto;bottom:175px}.tamer span{font-size:9px}.ally{left:25%;top:47%}.turn-phase{width:155px;margin-top:6px;padding:5px 8px}.turn-phase span{font-size:10px}}
@media(max-width:600px) and (max-height:700px){.tamer{--actor-size:56px;top:auto;bottom:105px}.ally{left:20%;top:48%}.turn-phase{margin-top:3px;padding:4px 8px}}
@media(prefers-reduced-motion:reduce){.battle-scene[data-phase] .ally:before{animation:none}.turn-phase i{transition:none}}

.evolution-portrait{display:block;width:150px;height:135px;object-fit:contain;margin:0 auto 14px;filter:drop-shadow(0 6px 3px #30483222)}
.turn-outcome:has(.evolution-portrait){max-height:90dvh;overflow:auto}
@media(max-height:650px){.evolution-portrait{width:110px;height:95px;margin-bottom:5px}.turn-outcome{padding:22px}.turn-outcome h2{font-size:25px;margin:10px 0}}

/* A paired silhouette makes each evolution readable before it happens. */
.turn-outcome.with-evolution{width:min(460px,91%);padding:28px;max-height:92dvh;overflow:auto}
.evolution-scene{display:flex;align-items:center;justify-content:center;gap:13px;padding:8px 0 4px;position:relative}
.evolution-scene figure{margin:0;width:130px;text-align:center;position:relative;z-index:1}
.evolution-art{position:relative;width:120px;height:120px;margin:0 auto;isolation:isolate}
.evolution-art img{position:absolute;max-width:none;object-fit:fill;filter:drop-shadow(0 4px 2px #30483222)}
.evolution-scene figcaption{font:14px 'Songti SC',serif;color:#59705a;margin-top:10px;letter-spacing:1px}
.evolution-arrow{font:25px Georgia,serif;color:#b59051;flex-shrink:0}
.evolution-after .evolution-art:before{content:'';position:absolute;inset:10%;border:1px solid #c7b574;border-radius:50%;background:radial-gradient(circle,#f7eab5aa,transparent 70%);z-index:-1}
.evolving .evolution-before{animation:evolution-away 1.1s both}.evolving .evolution-after{animation:evolution-arrive 1.1s both}
.evolving .evolution-after .evolution-art:before{animation:evolution-ring 1.1s both}
.evolving .evolution-arrow{animation:evolution-away 1.1s both}
@keyframes evolution-away{0%,15%{opacity:1;translate:0 0}80%,100%{opacity:.12;translate:8px 0}}
@keyframes evolution-arrive{0%{scale:1;filter:brightness(1)}35%{scale:.92;filter:brightness(1.25)}70%{scale:1.1;filter:brightness(1.1)}100%{scale:1;filter:brightness(1)}}
@keyframes evolution-ring{0%{scale:.6;opacity:0}50%{scale:1.5;opacity:1}100%{scale:1.9;opacity:0}}
@media(max-width:600px){.turn-outcome.with-evolution{padding:22px 16px}.evolution-scene{gap:5px}.evolution-scene figure{width:110px}.evolution-art{width:100px;height:100px}.evolution-scene figcaption{font-size:13px}.turn-outcome.with-evolution h2{font-size:26px;margin:18px 0}.turn-outcome.with-evolution p{font-size:13px}}
@media(max-height:650px){.evolution-art{width:88px;height:88px}.evolution-scene{padding:0}.turn-outcome.with-evolution{padding:18px}.evolution-scene figcaption{margin-top:5px}}
@media(prefers-reduced-motion:reduce){.evolving .evolution-before,.evolving .evolution-after,.evolving .evolution-arrow,.evolving .evolution-after .evolution-art:before{animation:none!important}}

.evolution-family{font:11px system-ui;color:#8b704b;letter-spacing:2px;margin:0 0 3px;text-align:center}.evolution-row+.evolution-row{margin-top:13px;padding-top:10px;border-top:1px solid #baa77e44}.evolution-scenes:has(.evolution-row+.evolution-row) .evolution-art{width:88px;height:88px}.evolution-scenes:has(.evolution-row+.evolution-row) .evolution-scene figcaption{margin-top:5px}.turn-outcome.with-evolution:has(.evolution-row+.evolution-row) h2{font-size:24px;margin:12px 0}.turn-outcome.with-evolution:has(.evolution-row+.evolution-row) p{font-size:13px;line-height:1.6}
@media(max-height:650px){.evolution-scenes:has(.evolution-row+.evolution-row) .evolution-art{width:64px;height:64px}.evolution-row+.evolution-row{margin-top:7px;padding-top:5px}.evolution-scenes .evolution-scene figcaption{font-size:12px;margin-top:3px}.turn-outcome.with-evolution:has(.evolution-row+.evolution-row){padding:14px}.turn-outcome.with-evolution:has(.evolution-row+.evolution-row) p{font-size:12px;margin:8px 0}}
@media(max-width:600px){.pet-hud>div{min-width:0}.pet-hud strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:11px/1.3 system-ui;letter-spacing:0}}

.effect-insight i:first-child{inset:9%;border:2px solid #d5bf7e;border-radius:50%;background:#e7dfaf18;box-shadow:0 0 12px #c9ddbd44;animation:seal-rise .85s both}
.effect-insight i:nth-child(2){inset:29%;border:3px solid #8fbd9e;rotate:45deg;animation:seal-rise .85s both}
.effect-insight i:nth-child(3){inset:46%;border-radius:50%;background:#f3d67d;box-shadow:0 0 8px #fae8aa;animation:seal-rise .85s both}
.effect-insight i:nth-child(n+4){width:6px;height:6px;background:#e6ce86;left:50%;top:50%;rotate:calc(var(--ray)*90deg);transform-origin:0 0;animation:seal-spark .85s both}
.enemy.is-marked:before{border:2px solid #d8c27b;box-shadow:0 0 0 3px #82b59944,0 0 15px #dfc57c55;background:#a7c6a72b;filter:none}
.turn-world .turn-top button{white-space:nowrap}.turn-top>div:last-child{flex-shrink:0}

/* Keep tactical feedback away from silhouettes, especially on narrow screens. */
.battle-scene>.turn-phase{position:absolute;left:50%;top:150px;transform:translateX(-50%);margin:0;z-index:4}
.battle-status{position:absolute;top:204px;left:50%;transform:translateX(-50%);display:flex;flex-wrap:wrap;justify-content:center;gap:5px;width:320px;max-width:45%;z-index:4}
.turn-world .battle-status button{min-height:32px;padding:5px 9px;border:1px solid #b7a47788;border-radius:4px;background:#183b31e8;color:#f6e6c1;font:11px/1.4 system-ui;text-shadow:none;box-shadow:none}
.battle-status button:focus-visible{outline-offset:1px}
@media(max-width:600px){
 .battle-heading{transform:none;left:0}
 .battle-scene>.turn-phase{left:14px;top:auto;bottom:max(6px,env(safe-area-inset-bottom));transform:none;width:calc(100% - 122px);max-width:260px;height:25px;padding:3px 7px}
 .turn-phase span{font:9px/1.1 system-ui;letter-spacing:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .turn-phase>div{height:2px;margin-top:4px}
 .battle-status{top:146px;left:14px;transform:none;justify-content:flex-start;width:calc(57% - 14px);max-width:210px;gap:4px}
 .turn-world .battle-status button{min-height:32px;padding:4px 7px;font-size:10px}
 .turn-note{display:none}
 .battle-caption{max-height:96px;overflow-y:auto;overscroll-behavior:contain}
}
@media(max-width:600px) and (max-height:700px){.battle-status{top:132px;width:calc(57% - 14px)}.turn-world .battle-status button{min-height:30px;padding:3px 6px}.battle-caption{max-height:80px}}

@media(max-width:600px){.tamer span{display:none}}
.battle-scene[data-phase=target] .ally:before{bottom:22px;left:0;width:100%;height:25px;filter:none;border:2px solid #c3f1d3;background:#84ceb044;box-shadow:0 0 0 4px #397e6a55,0 0 17px #9be3be}

/* An illustrated field notebook, opened only while exploring. */
.turn-world .journal-launch{pointer-events:auto;min-height:34px;margin-top:10px;padding:6px 11px;font:12px system-ui;background:#244b3c;color:#f6e6c1;border:1px solid #a8976b;border-radius:4px}
.pet-journal{padding:0;width:min(780px,94vw);height:min(740px,92dvh);max-height:92dvh;margin:auto;border:1px solid #b7a477;border-radius:12px;background:#faf3e3;color:#35483a;overflow:hidden;box-shadow:0 20px 80px #142d3b66}
.pet-journal[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto}
.pet-journal::backdrop{background:#142d27a6;backdrop-filter:blur(4px)}
.journal-header{padding:18px 24px 13px;gap:16px;background:#213f32;color:#f6e6c1}.journal-header h2{font:27px/1.2 'Songti SC',serif;margin:0}.journal-header p{font:11px/1.4 system-ui;margin:6px 0 0;color:#d5d0ae}
.journal-close{flex-shrink:0;border:1px solid #c4b88777;border-radius:50%;background:transparent;color:inherit;width:44px;height:44px;font:28px/1 system-ui}
.journal-tabs{display:flex;gap:0;padding:0 24px;border-bottom:1px solid #a89b7844;background:#e6e5cf}
.journal-tabs button{flex:1;min-width:0;min-height:48px;border:0;border-bottom:3px solid transparent;background:none;color:#5d705c;font:12px/1.4 system-ui;padding:10px 5px}
.journal-tabs button[aria-selected=true]{border-bottom-color:#526c4e;color:#213f32;font-weight:700}
.journal-page{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:22px 28px;outline-offset:-3px}
.journal-feature{display:grid;grid-template-columns:160px 1fr;align-items:center;gap:26px;margin:0 0 20px}.journal-portrait{position:relative;display:block;width:160px;height:160px;isolation:isolate}.journal-portrait:before{content:'';position:absolute;inset:6%;background:#dde2c066;border:1px solid #9aab8a44;border-radius:50%;z-index:-1}
.journal-portrait img,.journal-form-art img{position:absolute;max-width:none;object-fit:fill;filter:drop-shadow(0 4px 2px #324c3422)}
.journal-feature h3{font:30px/1.2 'Songti SC',serif;margin:0 0 8px}.journal-feature p{font:13px/1.8 system-ui;margin:6px 0}.journal-feature .journal-role{font-size:12px;color:#8a683d}
.journal-forms{list-style:none;padding:0;margin:0}.journal-forms li{display:grid;grid-template-columns:62px 1fr;gap:17px;padding:14px 0;border-top:1px solid #a89b7844;position:relative}.journal-form-art{position:relative;display:block;width:62px;height:62px;margin-top:6px}.journal-forms h4{font:17px/1.5 'Songti SC',serif;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0}.journal-forms h4 small{font:10px/1.4 system-ui;color:#6d7c68;padding:3px 6px;border:1px solid #8f9e7a55;border-radius:3px}.journal-forms .current h4 small{background:#d9e2c1;border-color:#9baa7b;color:#355031}.journal-forms p{font:12px/1.65 system-ui;margin:4px 0 0;color:#66705c}.journal-forms .journal-move{color:#88643a;font-size:11px}.journal-forms .locked .journal-form-art{filter:grayscale(1);opacity:.45}
.journal-footer{max-width:none;margin:0;padding:12px 24px;gap:12px;border-top:1px solid #a89b7844;background:#ebe9d4;align-items:center;color:#6b7660}.journal-footer small{font:10px/1.5 system-ui}.journal-equip{min-height:44px;flex-shrink:0;padding:9px 18px;border:1px solid #8a9b73;border-radius:5px;background:#315140;color:#fff0c9;font:13px system-ui}.journal-equip:disabled{background:#d5dbc4;color:#5b6c51;cursor:default}
.pet-journal button:focus-visible{outline:2px solid #ad7d3e;outline-offset:-3px}
@media(max-width:600px){.journal-header{padding:14px 16px 12px}.journal-header h2{font-size:23px}.journal-tabs{padding:0 10px}.journal-tabs button{font-size:11px}.journal-page{padding:16px}.journal-feature{grid-template-columns:92px 1fr;gap:16px;margin-bottom:16px}.journal-portrait{width:92px;height:92px}.journal-feature h3{font-size:24px}.journal-feature p{font-size:11px;line-height:1.7}.journal-forms li{grid-template-columns:48px 1fr;gap:12px;padding:12px 0}.journal-form-art{width:48px;height:48px}.journal-forms h4{font-size:16px;gap:7px}.journal-forms p{font-size:11px}.journal-footer{padding:10px 14px;gap:8px}.journal-footer small{max-width:48%;font-size:9px}.journal-equip{font-size:11px;padding:8px 12px;max-width:56%}}
.pet-journal .journal-footer{position:static;inset:auto;width:100%;transform:none}

.pet-journal .journal-footer{justify-content:space-between}
@media(max-width:600px){.journal-tabs button{font-size:10px;white-space:nowrap;padding-inline:1px}}

.journey-resume{width:min(430px,92vw);padding:34px 30px 26px;background:#faf3e3;color:#35483a;border:1px solid #b7a477;border-radius:12px}
.resume-close{position:absolute;top:8px;right:8px;width:44px;height:44px;border:0;background:none;color:#657359;font:26px system-ui}
.resume-kicker{font:11px/1.6 system-ui;letter-spacing:2px;color:#7c805c;margin:0 0 12px}.journey-resume h2{font:30px/1.3 'Songti SC',serif;margin:0 0 20px}.resume-summary{white-space:pre-line;font:14px/2 system-ui;border-block:1px solid #b7a47755;padding:15px 0;margin:0;color:#3b5844}.resume-note{font:12px/1.8 system-ui;color:#71765d;margin:16px 0}.resume-actions{display:flex;gap:10px;margin-top:20px}.resume-actions button{flex:1;min-height:48px;border:1px solid #9aa47c;border-radius:5px;background:#315140;color:#fff0c9;font:14px system-ui;padding:10px}.resume-actions button:last-child{background:transparent;color:#506348}.journey-resume>small{display:block;font:10px/1.7 system-ui;color:#7d816b;margin-top:16px}.journey-resume button:focus-visible{outline:2px solid #ac7b3b;outline-offset:3px}
@media(max-width:350px){.journey-resume{padding:28px 22px 22px}.journey-resume h2{font-size:26px}.resume-summary{font-size:12px}}

/* Slow images keep their layout and a readable placeholder, never a broken icon. */
.fighter-art img[data-asset-state=loading],.fighter-art img[data-asset-state=failed],.evolution-art img[data-asset-state=loading],.evolution-art img[data-asset-state=failed],.journal-portrait img[data-asset-state=loading],.journal-portrait img[data-asset-state=failed],.journal-form-art img[data-asset-state=loading],.journal-form-art img[data-asset-state=failed]{opacity:0}
.evolution-art:has(img[data-asset-state=loading]):after,.journal-portrait:has(img[data-asset-state=loading]):after{content:'画面准备中';position:absolute;inset:0;display:grid;place-items:center;font:10px system-ui;color:#7a8265}
.evolution-art:has(img[data-asset-state=failed]):after,.journal-portrait:has(img[data-asset-state=failed]):after{content:'画面暂未赶到';position:absolute;inset:0;display:grid;place-items:center;font:10px system-ui;color:#7a8265}

/* One-turn forecasts use the existing caption and target marker, not another panel. */
.battle-caption.forecasting{white-space:pre-line;line-height:1.5;border-left-color:#b7d49a}
.targeting .enemy[data-forecast]:after{content:'▼ ' attr(data-forecast);top:-25px;font:12px/1.5 system-ui;white-space:nowrap;background:#213f31e8;border:1px solid #d1bb76;border-radius:4px;padding:3px 7px;color:#ffebae}
@media(max-width:600px){.battle-caption.forecasting{font-size:11px;line-height:1.45}.targeting .enemy[data-forecast]:after{top:-24px;font-size:10px;padding:2px 5px}}
@media(min-width:601px){.battle-scene>.turn-phase{width:240px}.turn-phase span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* A grounded follower has its own feet, path and depth, separate from the hero. */
.map-actors{position:absolute;inset:0;isolation:isolate;z-index:1;pointer-events:none}.map-actors .map-enemy{pointer-events:auto}
.map-companion{position:absolute;left:0;top:0;will-change:transform;pointer-events:none;--companion-size:100px;--stride-lift:0px;--stride-tilt:0deg}
.map-companion:before{content:'';position:absolute;left:-26px;bottom:-3px;width:52px;height:12px;background:#273c3440;filter:blur(3px);border-radius:50%}
.companion-art{position:absolute;left:calc(var(--companion-size)*-.5);bottom:0;width:var(--companion-size);height:var(--companion-size);transform:translateY(var(--stride-lift)) rotate(var(--stride-tilt));transform-origin:50% 90%}
.companion-art img{position:absolute;object-fit:fill;max-width:none;filter:drop-shadow(0 3px 1px #233e3422)}
.companion-art img[data-asset-state=loading],.companion-art img[data-asset-state=failed]{opacity:0}
.map-companion.face-left .companion-art{scale:-1 1}
.map-companion[data-pet="1"] .companion-art{animation:companion-whale 3.6s ease-in-out infinite}
.map-companion[data-pet="2"] .companion-art{animation:companion-cloud 4.4s ease-in-out infinite}
@keyframes companion-whale{0%,100%{translate:0 -6px}50%{translate:0 -10px}}
@keyframes companion-cloud{0%,100%{translate:0 -12px}50%{translate:0 -18px}}
@media(max-width:600px){.map-companion{--companion-size:85px}.map-companion:before{left:-22px;width:44px;height:10px}}
@media(prefers-reduced-motion:reduce){.map-companion .companion-art{animation:none!important}}

@media(max-width:600px){.turn-world:not(.battling) .turn-top>div:first-child{padding:9px 11px}.turn-world:not(.battling) .turn-top small{display:none}.turn-world:not(.battling) .turn-top h2{font-size:24px;line-height:1.2;margin:0 0 5px}.turn-world:not(.battling) .turn-top p{font-size:10px;line-height:1.4}.turn-world:not(.battling) .journal-launch{font-size:10px;min-height:34px;padding:5px 8px;margin-top:7px}.turn-world:not(.battling) .turn-top>div:last-child>button{font-size:10px;min-height:40px;padding:7px 9px}}

/* The encounter owns its backdrop; unused arenas do not delay village entry. */
.battle-scene{background-image:linear-gradient(180deg,#17392a45,transparent 35%,#172e2518),var(--battle-backdrop,url('assets/bamboo-map-v2.webp'));background-position:center,center 56%;background-size:cover,cover}
.battle-scene[data-place=terrace]:before{background:radial-gradient(ellipse,#fff0c620,transparent 68%);border-color:#f5e9b51a}

.checkpoint-handoff h2{font-size:27px}.checkpoint-handoff .resume-note{font-size:13px;line-height:1.9}.checkpoint-handoff .resume-actions button{font-size:12px}
@media(max-width:350px){.checkpoint-handoff h2{font-size:24px}}

/* Tap feedback is attached to ground coordinates, beneath the character feet. */
.map-destination{position:absolute;left:0;top:0;width:0;height:0;z-index:0;pointer-events:none;color:#516b40}
.map-destination i{position:absolute;left:-24px;top:-10px;width:48px;height:20px;box-sizing:border-box;border:2px solid currentColor;border-radius:50%;box-shadow:0 0 0 4px #fff6ce88,inset 0 0 0 3px #fff8dd77;background:#f8edb633}
.map-destination i:before,.map-destination i:after{content:'';position:absolute;left:50%;top:50%;width:9px;height:2px;background:currentColor;translate:-50% -50%}.map-destination i:after{rotate:90deg;width:7px}
.map-destination[data-state=arrived]{animation:waypoint-arrived .45s ease-out both}
.map-destination[data-state=blocked]{color:#a26042}.map-destination[data-state=blocked] i{border-style:dashed;background:#d7a47a22}.map-destination[data-state=blocked] i:before,.map-destination[data-state=blocked] i:after{display:none}
.map-destination span{position:absolute;left:0;top:-18px;translate:-50% -50%;font:24px/1 system-ui;color:inherit;text-shadow:0 1px 3px #fffbe7}
.map-actors .map-enemy.approaching img{filter:drop-shadow(0 0 5px #fff3a8)}.map-actors .map-enemy.approaching span{outline:1px solid #d4b264;background:#fff4d6}
@keyframes waypoint-arrived{to{opacity:0}}
@media(prefers-reduced-motion:reduce){.map-destination[data-state=arrived]{animation:none}}

.battle-scene[data-place=lotus]:before{background:radial-gradient(ellipse,#fff2c118,transparent 68%);border-color:#f3d6961a}

@media(max-width:600px){.battle-heading .round:before{content:attr(data-place-name) ' · ';letter-spacing:1px}}

/* The final trial page gathers the actual current companions and run totals. */
.turn-outcome.with-completion{width:min(540px,94vw);max-height:94dvh;padding:0;overflow:hidden;text-align:center;background:#faf2de;border:1px solid #b3a16f;border-radius:12px;box-shadow:0 20px 100px #142b35aa}
.turn-outcome.with-completion>:not(.completion-sheet){display:none}
.completion-sheet{display:flex;flex-direction:column;max-height:94dvh;min-height:0}
.completion-story{min-height:0;overflow:auto;padding:28px 32px 0;overscroll-behavior:contain}
.turn-outcome .completion-kicker{margin:0 0 10px;color:#66725b;font:11px/1.4 system-ui;letter-spacing:2px}
.turn-outcome .completion-story h2{font:42px/1.2 'Songti SC',serif;letter-spacing:4px;color:#294c3a;margin:0 0 22px}
.completion-roster{display:flex;justify-content:center;gap:20px;margin:0 0 22px}
.completion-roster figure{flex:1;min-width:0;max-width:120px;margin:0;text-align:center}
.completion-art{position:relative;width:100px;height:100px;margin:0 auto 9px;isolation:isolate}
.completion-art:before{content:'';position:absolute;left:8%;right:8%;bottom:-3px;height:13px;border-radius:50%;background:#85927027;filter:blur(3px);z-index:-1}
.completion-art img{position:absolute;max-width:none;object-fit:fill;filter:drop-shadow(0 3px 1px #29463122)}
.completion-art img[data-asset-state=loading],.completion-art img[data-asset-state=failed]{opacity:0}
.completion-roster figcaption small{display:block;font:10px/1.5 system-ui;color:#66725b;letter-spacing:.5px}
.completion-roster figcaption strong{display:block;font:18px/1.5 'Songti SC',serif;color:#3c4633}
.completion-stats{display:flex;border-block:1px solid #b3a16f66;margin:0;padding:14px 0;gap:0}
.completion-stats>div{flex:1;display:flex;flex-direction:column-reverse;gap:4px;min-width:0}
.completion-stats>div+div{border-left:1px solid #b3a16f44}
.completion-stats dt{font:11px/1.5 system-ui;color:#66725b}.completion-stats dd{font:27px/1.1 system-ui;color:#294c3a;margin:0}
.completion-stats dd span{font-size:10px;margin-left:4px;color:#66725b}
.turn-outcome .completion-copy{font:13px/1.8 'Songti SC',serif;color:#59674e;margin:16px 0 0}
.completion-actions{flex:none;padding:20px 32px 18px}
.completion-buttons{display:flex;gap:10px}
.turn-world .completion-buttons button{flex:1;min-width:0;min-height:48px;padding:10px 9px;border:1px solid #a1ac86;border-radius:5px;background:#294c3a;color:#fff0c9;font:15px/1.4 'Songti SC',serif}
.turn-world .completion-buttons button:last-child{background:transparent;color:#496047}
.completion-xhs{display:inline-flex;align-items:center;min-height:36px;margin-top:10px;color:#775c3f;text-decoration:none;font:11px/1.5 system-ui;text-underline-offset:3px}
.completion-xhs:hover{text-decoration:underline}
.turn-world .completion-sheet :is(button,a):focus-visible{outline:3px solid #aa803d;outline-offset:3px}
.turn-world:has(.turn-outcome.with-completion:not([hidden])) .battle-scene{filter:saturate(.8) brightness(.83)}
@media(max-width:600px){.completion-story{padding:23px 21px 0}.turn-outcome .completion-story h2{font-size:36px;margin-bottom:18px}.completion-roster{gap:10px;margin-bottom:17px}.completion-art{width:78px;height:78px}.completion-roster figcaption strong{font-size:16px}.completion-roster figcaption small{font-size:9px}.completion-actions{padding:17px 21px 12px}.turn-world .completion-buttons button{font-size:14px}.completion-stats{padding:11px 0}.completion-stats dd{font-size:24px}.completion-stats dt{font-size:10px}.turn-outcome .completion-copy{font-size:12px;margin-top:12px}}
@media(max-height:600px){.completion-story{padding-top:17px}.turn-outcome .completion-kicker{margin-bottom:5px}.turn-outcome .completion-story h2{font-size:30px;margin-bottom:13px}.completion-art{width:67px;height:67px;margin-bottom:5px}.completion-roster{margin-bottom:12px}.completion-actions{padding-top:12px;padding-bottom:8px}.turn-outcome .completion-copy{font-size:11px}.completion-roster figcaption strong{font-size:15px}}

.turn-world:has(.turn-outcome.with-completion:not([hidden])) .battle-scene :is(.battle-console,.battle-caption,.turn-phase,.battle-heading,.battle-status,.pet-hud,.fighter,.tamer){visibility:hidden}

/* Optional field atlas. The actual map art is reused; navigation still walks. */
.explore-tools{display:flex;gap:6px;margin-top:10px}.turn-world .explore-tools .journal-launch{margin-top:0}
.turn-world .atlas-launch{min-width:44px}.atlas-launch kbd{font:10px system-ui;padding:1px 3px;border:1px solid #a8976b88;border-radius:2px;margin-left:2px;color:#d8d6af}
.trail-atlas{width:min(540px,94vw);height:fit-content;max-height:92dvh;padding:0;border:1px solid #b3a16f;border-radius:11px;background:#faf2de;color:#294c3a;overflow:hidden;box-shadow:0 20px 90px #142d3b66}
.trail-atlas[open]{display:flex;flex-direction:column}.trail-atlas::backdrop{background:#142d278c;backdrop-filter:blur(3px)}
.atlas-header{flex:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px 24px 15px;border-bottom:1px solid #b3a16f55}
.atlas-header h2{font:28px/1.2 'Songti SC',serif;margin:4px 0 0;letter-spacing:2px}.atlas-header p{font:10px/1.5 system-ui;color:#66725b;margin:0}
.atlas-close{width:44px;height:44px;flex:none;padding:0;background:transparent;border:1px solid #a1ac8666;border-radius:50%;font:27px system-ui;color:#496047;cursor:pointer}
.atlas-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 24px 12px}
.atlas-map{position:relative;width:100%;aspect-ratio:1672/941;border:1px solid #a1ac86;border-radius:5px;overflow:hidden;box-sizing:border-box;background:#aab580}
.atlas-map>img{display:block;width:100%;height:100%;object-fit:fill}.atlas-pins{position:absolute;inset:0;pointer-events:none}
.atlas-pin{position:absolute;width:18px;height:18px;translate:-50% -50%;display:grid;place-items:center;border:2px solid #fff8df;border-radius:50%;font:10px/1 system-ui;background:#795e35;color:#fff8df;box-shadow:0 2px 4px #28443277}
.atlas-pin.done{background:#526b48}.atlas-player{position:absolute;width:13px;height:17px;translate:-50% -50%;clip-path:polygon(50% 0,100% 100%,50% 75%,0 100%);background:#fff8dc;filter:drop-shadow(0 0 2px #183a2f)}.atlas-player:after{content:'';position:absolute;inset:3px;clip-path:inherit;background:#214e3c}
.atlas-legend{font:11px/1.6 system-ui;color:#66725b;margin:9px 0 4px}
.atlas-choice{display:grid;grid-template-columns:34px 1fr auto;gap:11px;align-items:center;width:100%;min-height:62px;padding:10px 0;border:0;border-bottom:1px solid #b3a16f55;background:transparent;text-align:left;color:#294c3a;cursor:pointer}
.atlas-choice:last-child{border-bottom:0}.atlas-choice img{width:34px;height:38px;object-fit:contain}.atlas-choice strong{display:block;font:17px/1.4 'Songti SC',serif;font-weight:400}.atlas-choice small{display:block;font:10px/1.5 system-ui;color:#66725b;margin-top:2px}.atlas-choice-state{font:11px/1.4 system-ui;color:#6e5837;padding:4px 7px;border:1px solid #b3a16f66;border-radius:4px;white-space:nowrap}
.atlas-choice:disabled{opacity:.6;cursor:default}.atlas-choice:disabled .atlas-choice-state{border-color:transparent;color:#496047}.atlas-choice:not(:disabled):hover{background:#e8e9cf66}
.trail-atlas button:focus-visible{outline:3px solid #aa803d;outline-offset:2px}
@media(max-width:600px){.explore-tools{margin-top:7px}.turn-world:not(.battling) .explore-tools .journal-launch{margin-top:0}.atlas-launch kbd{display:none}.atlas-header{padding:16px 18px 12px}.atlas-header h2{font-size:25px}.atlas-body{padding:14px 18px 9px}.atlas-choice strong{font-size:16px}}
@media(max-height:400px){.atlas-header{padding-block:10px}.atlas-header h2{font-size:22px}.atlas-body{padding-top:10px}}

@media(min-width:480px) and (max-height:400px){.atlas-body{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);column-gap:16px;align-items:start}.atlas-map{grid-column:1;grid-row:1}.atlas-legend{grid-column:1;grid-row:2;margin-top:6px}.atlas-choices{grid-column:2;grid-row:1 / span 2}.atlas-choice{grid-template-columns:28px minmax(0,1fr) auto;gap:7px}.atlas-choice img{width:28px;height:34px}.atlas-choice strong{font-size:14px}.atlas-choice-state{padding:3px 5px;font-size:10px}}

/* Committed turns are read as a short field journal, not a future projection. */
.turn-world.battling .battle-log-launch{min-width:44px;min-height:44px}
.battle-history{width:min(540px,94vw);height:fit-content;max-height:92dvh;padding:0;border:1px solid #b3a16f;border-radius:11px;background:#faf2de;color:#294c3a;overflow:hidden;box-shadow:0 20px 90px #142d3b66}
.battle-history[open]{display:flex;flex-direction:column}.battle-history::backdrop{background:#142d278c;backdrop-filter:blur(3px)}
.history-header{flex:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px 24px 15px;border-bottom:1px solid #b3a16f55}
.history-header h2{font:28px/1.2 'Songti SC',serif;margin:4px 0 0;letter-spacing:2px}.history-header p{font:10px/1.5 system-ui;color:#66725b;margin:0}
.history-close{width:44px;height:44px;flex:none;padding:0;background:transparent;border:1px solid #a1ac8666;border-radius:50%;font:27px system-ui;color:#496047;cursor:pointer}
.history-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 24px 10px;outline-offset:-4px}.history-body:focus:not(:focus-visible){outline:none}
.history-empty{font:14px/1.8 'Songti SC',serif;color:#59674e;margin:24px 0}
.history-turns{list-style:none;margin:0;padding:0}.history-turns>li{padding:18px 0 16px;border-bottom:1px solid #b3a16f55}.history-turns>li:last-child{border:0}
.history-turns h3{font:18px/1.5 'Songti SC',serif;font-weight:400;color:#294c3a;margin:0}
.history-actor{font:11px/1.5 system-ui;color:#66725b;margin:2px 0 8px}.history-intent{font:11px/1.6 system-ui;color:#6e5837;margin:0 0 9px}
.history-stats{display:flex;gap:12px;margin:0 0 10px}.history-stats>div{flex:1;min-width:0}.history-stats dt{font:10px/1.4 system-ui;color:#66725b}.history-stats dd{font:14px/1.5 system-ui;color:#294c3a;margin:2px 0 0;white-space:nowrap}
.history-notes{list-style:none;margin:0;padding:0;font:12px/1.8 system-ui;color:#496047}.history-notes>li{margin:3px 0 0;padding-left:10px;border-left:2px solid #b3a16f55}
.battle-history button:focus-visible{outline:3px solid #aa803d;outline-offset:3px}
@media(max-width:600px){.history-header{padding:16px 18px 12px}.history-header h2{font-size:25px}.history-body{padding-inline:18px}.history-turns h3{font-size:16px}.history-stats{gap:7px}.history-stats dd{font-size:13px}.history-notes{font-size:11px}}
@media(max-height:400px){.history-header{padding-block:10px}.history-header h2{font-size:22px}}
.turn-world.battling .turn-top .battle-log-launch{min-width:44px;min-height:44px;height:44px}
.history-body:focus-visible{outline:2px solid #aa803d;outline-offset:-3px}

/* Real spell names stay legible on the existing command rail. */
@media(max-width:600px){
 .turn-world .turn-actions [data-command=skill]{height:auto;min-height:56px;padding:6px 4px}
 .turn-world .turn-actions [data-command=skill]>b{display:none}
 .turn-world .turn-actions .skill-name{display:block;margin:0;color:#fff0c9;font:14px/1.35 'Songti SC',serif;letter-spacing:0;white-space:normal;overflow-wrap:anywhere}
 .turn-world .turn-actions .skill-cost{display:block;font:10px/1.3 system-ui;margin:3px 0 0;color:#ead6a8}
 .turn-world .turn-actions .short-on-token{opacity:.75}
}
.turn-world .swap-options{width:230px;min-width:0;max-width:calc(100vw - 120px);box-sizing:border-box;gap:7px;padding:12px;background:#faf2defa;border:1px solid #b3a16f;border-radius:9px;box-shadow:0 8px 28px #16372e55}
.swap-heading{font:12px/1.5 system-ui;color:#66725b;margin:0 0 3px}
.turn-world .swap-options button{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:68px;padding:8px 6px;border:0;border-bottom:1px solid #b3a16f55;border-radius:0;background:transparent;color:#294c3a;text-align:left}
.turn-world .swap-options button:last-child{border-bottom:0}
.turn-world .swap-options button:disabled{opacity:.6}
.swap-art{position:relative;flex:none;width:42px;height:42px}
.turn-world .swap-options .swap-art img{position:absolute;max-width:none;object-fit:fill}
.swap-copy{display:block;min-width:0;flex:1}.swap-copy strong{display:block;font:13px/1.5 system-ui;font-weight:500;overflow-wrap:anywhere}
.turn-world .swap-options .swap-copy small{display:block;font:11px/1.5 system-ui;color:#6e5837;margin:3px 0 0;white-space:normal;overflow-wrap:anywhere}
.swap-current{display:inline-block;margin-top:3px;font:10px/1.4 system-ui;color:#496047}
.turn-world .swap-options button:focus-visible{outline:2px solid #aa803d;outline-offset:1px;background:#e9e8ca55}
@media(max-width:600px){.turn-world .swap-options{right:86px;bottom:0;padding:10px}.turn-world .swap-options button{min-height:66px;gap:8px;padding:7px 2px}.swap-art{width:36px;height:36px}.swap-copy strong{font-size:12px}.turn-world .swap-options .swap-copy small{font-size:10px}}

/* The swap forecast stays visible inside the roster; only the rows scroll. */
.turn-world .swap-options{max-height:calc(100dvh - 58px);overflow:hidden}
.swap-heading,.swap-preview{flex:none}.swap-rows{min-height:0;overflow:auto;overscroll-behavior:contain}
.swap-preview{font:12px/1.6 system-ui;white-space:pre-line;color:#496047;margin:0;padding-top:9px;border-top:1px solid #b3a16f77}
.swap-preview.danger{color:#953f2a}
.battle-scene:has(.swap-options:not([hidden])) .battle-caption{visibility:hidden}
@media(max-width:600px){.swap-preview{font-size:11px}.swap-rows{flex:1 1 auto}}
