/* Battle UI v2 — reference layout, live engine and original illustration assets. */
body.battle-mode{--ink:#06141a;--bone:#efe7d4;--brass:#c9a55b;--ice:#6fd8ff;--coral:#ff4b5c;--battle-num:'Arial Narrow',Arial,sans-serif;background:#030a0d}
body.battle-mode #app.combat-app{width:min(100%,440px);max-width:440px;grid-template-rows:100px minmax(0,1fr);padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);overflow:hidden;isolation:isolate;background:linear-gradient(180deg,#031018d9,transparent 26%,#03101822 48%,#030a0de8 83%),var(--stratum-image) center/cover}
body.battle-mode #app.combat-app:before,body.battle-mode #app.combat-app:after{display:none}
body.battle-mode #app.combat-app .combat-hud{position:relative;display:grid;grid-template-columns:1fr 72px;padding:8px 10px 0;gap:7px;background:none;height:100%;z-index:3}
body.battle-mode .combat-hud .frodia-vitals{width:auto;max-width:none}
body.battle-mode .combat-hud .slant-health{height:54px;transform:none;border:0;border-left:3px solid var(--ice);margin:0;padding:1px 18px 7px 10px;background:var(--ink);clip-path:polygon(0 0,100% 0,calc(100% - 20px) 100%,0 100%);box-shadow:none}
body.battle-mode .slant-health:after{content:'';position:absolute;inset:4px 24px 4px 4px;border:1px solid #c9a55b66;pointer-events:none}
body.battle-mode .combat-hud .slant-health>b{transform:none;padding:0;display:flex;align-items:baseline;gap:6px;font:italic bold 12px var(--battle-num);color:var(--brass);line-height:39px}
body.battle-mode .combat-hud .slant-health strong{font:italic 900 38px/.95 var(--battle-num);color:#fff;text-shadow:2px 2px var(--coral)}
body.battle-mode .combat-hud .slant-health small{font:italic bold 14px var(--battle-num);color:#9fb3b8}
body.battle-mode .combat-hud .slant-health>.bar{inset:auto 23px 7px 15px;height:5px;transform:skewX(-30deg);border:0}
body.battle-mode .combat-hud .slant-health>.bar i{background:linear-gradient(90deg,#3fb3c9,#b5f3ff)}
body.battle-mode .combat-hud .player-shield{right:24px;top:11px;font:italic bold 20px var(--battle-num);color:var(--ice)}
body.battle-mode .combat-hud .tp-stars{margin-top:6px;gap:7px;flex-wrap:nowrap;font:italic bold 13px var(--battle-num);color:var(--brass)}
body.battle-mode .combat-hud .tp-stars>span{gap:4px}
body.battle-mode .combat-hud .tp-star{height:14px;width:14px;clip-path:none;transform:rotate(45deg);border:1px solid #fff2c0;background:linear-gradient(135deg,#fff5c8,#e3b64f 55%,#8b6420);box-shadow:0 0 8px #ffd67888}
body.battle-mode .combat-hud .tp-star.spent{background:#15262c;border-color:#7d6636;box-shadow:none}
body.battle-mode .combat-hud .player-statuses{display:flex;gap:3px;flex-wrap:wrap}
body.battle-mode .combat-hud .player-statuses .status{font-size:11px;padding:1px 6px;border:0;border-radius:0;clip-path:polygon(5px 0,100% 0,calc(100% - 5px) 100%,0 100%);color:var(--ink);background:var(--ice);text-shadow:none}
body.battle-mode .combat-hud .battle-menu{grid-column:2;grid-row:1;width:54px;height:54px;justify-self:end;margin:0;border:1px solid var(--brass);border-radius:50%;clip-path:none;padding:0;display:grid;place-content:center;gap:0;background:#06141ae8;box-shadow:inset 0 0 0 3px #06141a,inset 0 0 0 4px #c9a55b88}
body.battle-mode .battle-menu:after{content:'✦';position:absolute;top:-7px;left:21px;color:var(--brass);font-size:12px}
body.battle-mode .battle-menu>span{display:none}body.battle-mode .battle-menu strong{font:italic 900 26px var(--battle-num);color:white}body.battle-mode .battle-menu small{font-size:7px;color:var(--brass)}
body.battle-mode .battle-location{position:absolute;right:10px;top:65px;padding:0;max-width:140px;font-size:10px;line-height:1.3;text-align:right;display:flex;flex-direction:column-reverse;color:#b4c9ce}
body.battle-mode .battle-location small{margin:0;color:var(--brass);font:italic bold 18px var(--battle-num)}
body.battle-mode .pocket-battle,body.battle-mode .pocket-battle.core-battle{display:grid;grid-template-rows:minmax(130px,1fr) auto 16px 112px 68px;gap:0;overflow:visible;position:relative;padding:0}
body.battle-mode .pocket-battle .battle-stage{grid-row:1;z-index:1;min-height:0;height:100%;overflow:visible}
body.battle-mode .pocket-battle .enemies{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr);height:100%;padding:10px 6px 0;gap:3px;align-items:stretch}
body.battle-mode .pocket-battle .enemy,body.battle-mode .pocket-battle .enemy.forest-core{display:flex;flex-direction:column;align-items:stretch;min-width:0;min-height:0;position:relative;padding:0;background:none;border:0;box-shadow:none;overflow:visible;transform:none;gap:0}
body.battle-mode .enemy-count-1>.enemy{grid-column:2}
body.battle-mode .enemy-count-2>.enemy:first-child{grid-column:1}body.battle-mode .enemy-count-2>.enemy:last-child{grid-column:3}
body.battle-mode .pocket-battle .enemies.wide-encounter{display:flex}.pocket-battle .enemies.wide-encounter>.enemy{flex:var(--enemy-slots,1)}
body.battle-mode .pocket-battle .enemies.wide-encounter.enemy-count-1>.enemy{max-width:calc((100% - 3px)*2/3);margin:auto;height:100%;width:calc((100% - 3px)*2/3)}
body.battle-mode .pocket-battle .enemy h2{flex:none;align-self:flex-start;max-width:100%;margin:0 0 6px 2px;padding:4px 8px;border:0;clip-path:polygon(0 0,100% 0,calc(100% - 6px) 100%,0 100%);transform:rotate(-4deg);background:var(--bone);color:var(--ink);font-size:13px;line-height:1.2;box-shadow:3px 4px var(--coral);overflow:visible;text-shadow:none}
body.battle-mode .pocket-battle .enemy .enemy-hp{display:flex;align-items:baseline;gap:3px;min-height:0;padding:0 3px;background:none;border:0;color:white;font:italic bold 12px var(--battle-num)}
body.battle-mode .enemy .hp-caption{display:none}
body.battle-mode .pocket-battle .enemy .enemy-hp>[data-hp-number]{font:italic 900 25px/1 var(--battle-num)}
body.battle-mode .enemy-max{color:#8fa5aa;font:italic 12px var(--battle-num)}
body.battle-mode .enemy-shield{margin-left:auto;color:var(--ice);font-size:12px}
body.battle-mode .pocket-battle .enemy>.enemybar{flex:none;margin:4px 3px 0;height:5px;min-height:5px;transform:skewX(-30deg);border:1px solid #c9a55b88;background:#2a1418}
body.battle-mode .pocket-battle .enemy>.enemybar>i{background:var(--coral);transition:width .8s ease}
body.battle-mode .pocket-battle .enemy .intent,body.battle-mode .pocket-battle .enemy.forest-core .intent{flex:none;min-height:27px;margin:7px 0 0;padding:3px 5px;display:flex;gap:4px;align-items:center;border:0;border-top:1px solid var(--coral);border-bottom:1px solid var(--coral);background:var(--ink);transform:rotate(-4deg);clip-path:polygon(6px 0,100% 0,calc(100% - 6px) 100%,0 100%)}
body.battle-mode .pocket-battle .enemy .intent .count{color:var(--brass);font:italic bold 9px var(--battle-num);white-space:nowrap}
body.battle-mode .pocket-battle .enemy .intent .count b{font:italic 900 21px/1 var(--battle-num);color:var(--bone)}
body.battle-mode .pocket-battle .enemy .intent>span:last-child{font-size:9px;line-height:1.2;max-height:34px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;color:var(--bone)}
body.battle-mode .pocket-battle .enemy .intent.urgent .count b{color:var(--coral)}
body.battle-mode .pocket-battle .enemy .enemy-art{flex:1;position:relative;min-height:0;height:auto;overflow:visible;container-type:size;filter:drop-shadow(0 10px 10px #0006)}
body.battle-mode .pocket-battle .enemies .enemy .enemy-art img.illustrated-sprite,body.battle-mode .pocket-battle .enemies .enemy .enemy-art svg.illustrated-sprite{position:absolute;top:auto;bottom:-15px;left:50%;right:auto;width:min(150cqw,125cqh);height:auto;max-width:none;max-height:none;transform:translateX(-50%);object-fit:contain;object-position:center bottom;margin:0}
body.battle-mode .pocket-battle .enemies:not(.enemy-count-1) .enemy:first-child .enemy-art img.illustrated-sprite{left:-3px;transform:none}
body.battle-mode .pocket-battle .enemies:not(.enemy-count-1) .enemy:last-child .enemy-art img.illustrated-sprite{left:auto;right:-3px;transform:none}
body.battle-mode .pocket-battle .enemies.enemy-count-3 .enemy:nth-child(2) .enemy-art img.illustrated-sprite{bottom:20px;width:min(135cqw,110cqh)}
body.battle-mode .pocket-battle .enemy .enemy-status{position:absolute;top:113px;left:3px;display:flex;flex-wrap:wrap;z-index:3;gap:2px}
body.battle-mode .pocket-battle .enemy .enemy-status .status{font-size:10px;line-height:1.2;border-radius:0;padding:2px 4px;background:#06141acc;box-shadow:none}
body.battle-mode .lock-reticle{display:none;position:absolute;bottom:15%;left:50%;width:70px;height:70px;margin-left:-35px;border:2px dashed var(--ice);outline:2px solid var(--ice);outline-offset:5px;border-radius:50%;color:var(--ice);font:60px/65px Arial;text-align:center;pointer-events:none;z-index:8}
body.battle-mode .drop-target .lock-reticle{display:block;animation:lock-on .3s ease-out,reticle-pulse 1s .3s infinite}
@keyframes lock-on{from{transform:scale(2.5) rotate(40deg);opacity:0}to{transform:scale(1);opacity:1}}@keyframes reticle-pulse{50%{scale:1.08}}
/* Detail stays separate from the small hand and uses actual card text and modules. */
body.battle-mode .battle-card-detail{grid-row:2;position:relative;z-index:4;margin:0 10px;border:1px solid var(--type-edge);outline:1px solid #c9a55b66;outline-offset:3px;background:#06141a80;backdrop-filter:blur(1.5px);min-height:110px;--type-edge:var(--brass)}
body.battle-mode .Offense{--type-edge:#ff4b5c}body.battle-mode .Defense{--type-edge:#4aa8ff}body.battle-mode .Skill{--type-edge:#f4f1e8}body.battle-mode .Nexus{--type-edge:#6fe0a0}
body.battle-mode .battle-card-detail>.card{display:grid;grid-template-columns:25% 1fr;grid-template-rows:auto auto;width:100%;max-width:none;min-height:110px;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;transform:none;color:var(--bone);overflow:hidden}
body.battle-mode .battle-card-detail .card-art{grid-column:1;grid-row:1/3;width:100%;height:100%;min-height:110px;margin:0;border:0;clip-path:polygon(0 0,100% 0,83% 100%,0 100%);background-size:cover}
body.battle-mode .battle-card-detail .cardhead{position:absolute;left:4px;top:4px;padding:0;border:0;background:none;z-index:3;min-height:0}
body.battle-mode .battle-card-detail .cardhead .card-type,body.battle-mode .battle-card-detail .cardcode{display:none}
body.battle-mode .battle-card-detail .cost{width:29px;height:29px;border:2px solid var(--brass);border-radius:0;background:var(--ink);font:italic 900 22px/25px var(--battle-num);box-shadow:0 0 0 2px var(--ink);color:white}
body.battle-mode .detail-caption{position:absolute;top:6px;left:27%;right:18px;display:flex;justify-content:space-between;gap:4px;font-size:9px;color:var(--type-edge);z-index:3;line-height:1.3}
body.battle-mode .detail-caption b{color:var(--bone);border:1px solid var(--type-edge);padding:0 3px;font-size:9px;white-space:nowrap}
body.battle-mode .battle-card-detail .cardbody{grid-column:2;grid-row:1;margin:0;padding:25px 10px 6px 3px;background:none;border:0;overflow:visible}
body.battle-mode .battle-card-detail .cardbody h3{font-size:17px;line-height:1.25;padding:0 0 7px;margin:0;color:#fff;background:none;border:0;text-align:left}
body.battle-mode .battle-card-detail .cardbody h3:after{content:'─ ◇ ─';display:block;font-size:9px;color:var(--brass);height:9px;margin-top:2px}
body.battle-mode .battle-card-detail .cardbody p{padding:5px 7px;margin:0;background:#e9dfc6ed;color:#28271f;font-size:12px;line-height:1.5;text-align:left}
body.battle-mode .battle-card-detail .condition{font-size:9px;line-height:1.2}
body.battle-mode .battle-card-detail .cardslots{grid-column:2;grid-row:2;display:block;min-height:0;background:none;border:0;padding:0 10px 4px 3px;margin:0}
body.battle-mode .battle-card-detail .cardslots .module-orb{display:none}
body.battle-mode .battle-card-detail .cardslots:has(.empty):not(:has(.equipped)){display:none}
body.battle-mode .battle-card-detail .cardslots small{font-size:10px;line-height:1.3;color:var(--brass)}
body.battle-mode .detail-more{position:absolute;right:2px;top:0;background:none;border:0;color:var(--brass);padding:0;font-size:16px;width:15px;height:22px}
body.battle-mode .pocket-battle .hand-heading{grid-row:3;position:relative;display:flex;justify-content:space-between;padding:0 10px;height:16px;margin:0;z-index:5;font-size:8px;line-height:16px;color:#a9c1c9;background:none}
body.battle-mode .hand-heading button{font-size:9px;padding:0 3px;min-height:0;background:var(--ink);color:var(--bone);border:0}
body.battle-mode .hand-heading [data-action=handDetail],body.battle-mode .hand-heading [data-action=handList]{display:none}
body.battle-mode .pocket-battle .hand-rack{grid-row:4;display:block;position:relative;height:112px;min-height:0;padding:0;overflow:visible;touch-action:none;z-index:6}
body.battle-mode .pocket-battle .hand-rack .card{position:absolute;bottom:17px;left:0;display:flex;flex-direction:column;flex:none;width:62px;height:91px;max-width:none;min-height:0;padding:2px;margin:0;border:1.5px solid var(--type-edge);border-radius:0;background:#071116;box-shadow:inset 0 0 0 2px #071116,inset 0 0 0 3px var(--type-edge);transform:translateX(calc(var(--fan-x) - 50%)) translateY(var(--fan-y)) rotate(var(--fan-r));transform-origin:50% 150%;transition:transform .2s ease-out,opacity .15s;overflow:hidden}
body.battle-mode .pocket-battle .hand-rack.fan-moving .card{transition:none}
body.battle-mode .pocket-battle .hand-rack .card.armed{box-shadow:0 0 8px var(--type-edge),inset 0 0 0 2px #071116;border-color:var(--type-edge)}
body.battle-mode .pocket-battle .hand-rack .card.unplayable{filter:brightness(.5)}
body.battle-mode .pocket-battle .hand-rack .cardhead{position:absolute;inset:1px 0 auto;z-index:2;display:block;height:18px;min-height:0;padding:0;background:none;border:0}
body.battle-mode .pocket-battle .hand-rack .cost{position:absolute;top:0;left:1px;width:19px;height:20px;font:italic 900 16px/18px var(--battle-num);border:1px solid var(--brass);border-radius:0;background:#06141a;box-shadow:none}
body.battle-mode .pocket-battle .hand-rack .card-type,body.battle-mode .pocket-battle .hand-rack .cardcode,body.battle-mode .pocket-battle .hand-rack .cardslots,body.battle-mode .pocket-battle .hand-rack .cardbody p,body.battle-mode .pocket-battle .hand-rack .condition{display:none}
body.battle-mode .pocket-battle .hand-rack .card-art{width:100%;height:56px;flex:none;min-height:0;margin:0;border:0;border-bottom:1px solid var(--type-edge)}
body.battle-mode .pocket-battle .hand-rack .cardbody{padding:1px;margin:0;width:100%;flex:1;border:0;background:#e9dfc6;overflow:hidden}
body.battle-mode .pocket-battle .hand-rack .cardbody h3{padding:0;margin:0;background:none;border:0;color:#272820;font-size:9px;line-height:1.15;text-align:center}
body.battle-mode .pocket-battle .hand-rack .card:after{content:'';position:absolute;right:3px;top:4px;width:10px;height:10px;border:2px solid #06141a;transform:rotate(45deg);background:var(--type-edge)}
body.battle-mode .fan-arrow{position:absolute;bottom:12px;z-index:40;width:25px;height:40px;padding:0;border:1px solid var(--brass);color:var(--brass);background:#06141a;font-size:23px}.fan-arrow.left{left:4px}.fan-arrow.right{right:4px}.fan-arrow[hidden]{display:none}.fan-arrow small{position:absolute;top:-9px;right:-2px;color:var(--ink);background:var(--bone);font:italic bold 11px Arial}
.fan-dots{position:absolute;bottom:0;left:50%;translate:-50% 0;display:flex;gap:5px}.fan-dots i{width:5px;height:5px;rotate:45deg;background:#7d6636}.fan-dots i.on{background:var(--brass);box-shadow:0 0 5px var(--brass)}
body.battle-mode .pocket-battle .combat-actions{grid-row:5;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 12px 5px;position:relative;background:repeating-radial-gradient(ellipse at 10% 50%,transparent 0 24px,#c9a55b15 25px 26px,transparent 27px 46px)}
body.battle-mode .pocket-battle .combat-actions .nexus-peek{position:relative;width:40%;height:51px;display:flex;align-items:center;justify-content:flex-start;gap:10px;border:1px solid #c9a55b88;border-radius:0;padding:7px 10px;background:#06141ae0;box-shadow:inset 0 0 0 3px #06141a;color:var(--brass);clip-path:polygon(0 0,90% 0,100% 100%,0 100%)}
body.battle-mode .nexus-peek:after{content:'未展開';font-size:12px;color:#718a8c;position:absolute;bottom:6px;left:54px}body.battle-mode .nexus-peek.active:after{content:'展開中';color:#6fe0a0}
body.battle-mode .pocket-battle .nexus-peek small{position:absolute;left:54px;top:5px;font-size:10px;display:block}body.battle-mode .nexus-empty{font-size:26px;line-height:28px;width:30px;height:30px;border:1px dashed var(--brass)}
body.battle-mode .nexus-peek-art{position:static;display:block;width:32px;height:32px;border:1px solid #6fe0a0;background-size:cover}
body.battle-mode .pocket-battle .combat-actions .endturn{position:relative;display:flex;align-items:center;justify-content:space-around;gap:8px;width:53%;height:55px;border:0;border-radius:0;clip-path:polygon(16px 0,100% 0,calc(100% - 16px) 100%,0 100%);background:linear-gradient(110deg,var(--ink) 0 21%,var(--brass) 21% 23%,var(--bone) 23% 92%,var(--coral) 92%);box-shadow:none;color:var(--ink);font-size:18px;font-style:normal;line-height:1.3;letter-spacing:.05em;text-shadow:none;padding:3px 10px}
body.battle-mode .endturn small{display:block;font:italic bold 10px var(--battle-num);letter-spacing:.15em;color:#7d6636}
body.battle-mode .discard-card{position:absolute;bottom:70px;left:20%;width:60%;z-index:30;background:var(--bone);color:var(--ink);padding:8px;border:2px solid var(--coral)}
body.battle-mode .turn-confirm{z-index:70;bottom:70px;background:var(--ink);border:1px solid var(--brass)}
.self-drop{position:fixed;inset:0 auto auto 50%;translate:-50% 0;width:min(100%,440px);height:50%;background:linear-gradient(#6fd8ff33,#6fd8ff11);border-bottom:2px solid var(--brass);pointer-events:none;opacity:0;z-index:8}.self-drop span{position:absolute;bottom:12px;left:50%;translate:-50% 0;white-space:nowrap;font-size:12px;color:var(--ink);background:var(--bone);padding:4px 12px}.drag-self .self-drop{opacity:1}.drag-self .self-drop.over{background:#6fd8ff33;border-color:var(--ice)}
.drag-nexus .nexus-peek{animation:reticle-pulse 1s infinite}.nexus-peek.drop-target{outline:2px solid #6fe0a0}.drag-origin{visibility:hidden}
body.battle-mode .drag-ghost{position:fixed!important;width:96px!important;height:140px!important;min-height:0!important;margin:0!important;transform:translate(-50%,-100%) rotate(-5deg)!important;z-index:30000!important;pointer-events:none!important;border:2px solid var(--type-edge);border-radius:0;padding:3px;background:var(--ink);display:flex;flex-direction:column;opacity:1!important;box-shadow:0 8px 20px #0008}
.drag-ghost .cardhead{position:absolute;top:3px;left:3px;z-index:2;background:none;border:0}.drag-ghost .card-type,.drag-ghost .cardcode,.drag-ghost .cardslots,.drag-ghost .condition,.drag-ghost .cardbody p{display:none}.drag-ghost .cost{font-size:22px;width:25px;height:26px;line-height:24px;background:var(--ink);border:1px solid var(--brass);border-radius:0}.drag-ghost .card-art{height:92px;min-height:92px;width:100%;margin:0}.drag-ghost .cardbody{padding:3px;background:var(--bone);color:var(--ink)}.drag-ghost .cardbody h3{font-size:12px;margin:0;color:var(--ink)}.drag-ghost.valid-drop{outline:2px solid var(--ice);filter:brightness(1.2)}
body.battle-mode .combat-number{font:italic 900 45px var(--battle-num);text-shadow:2px 2px var(--coral),0 2px 10px black;animation-name:battle-pop}
@keyframes battle-pop{0%{opacity:0;translate:0 12px;scale:.5}12%{opacity:1;translate:0 -6px;scale:1.2}25%,75%{opacity:1;translate:0 -12px;scale:1}100%{opacity:0;translate:0 -35px;scale:.95}}
@media(max-height:720px){body.battle-mode #app.combat-app{grid-template-rows:90px minmax(0,1fr)}body.battle-mode .pocket-battle,body.battle-mode .pocket-battle.core-battle{grid-template-rows:minmax(115px,1fr) auto 14px 98px 61px}body.battle-mode .pocket-battle .hand-rack{height:98px}body.battle-mode .pocket-battle .hand-rack .card{height:84px;width:57px;bottom:14px}body.battle-mode .pocket-battle .hand-rack .card-art{height:49px}body.battle-mode .battle-card-detail .cardbody h3{font-size:15px}body.battle-mode .battle-card-detail .cardbody p{font-size:11px}body.battle-mode .pocket-battle .combat-actions{padding:5px 12px}body.battle-mode .pocket-battle .combat-actions .endturn{height:51px;font-size:16px}body.battle-mode .battle-location{top:60px}}
@media(prefers-reduced-motion:reduce){body.battle-mode *,body.battle-mode *:before,body.battle-mode *:after{animation:none!important;transition:none!important}}
@font-face{font-family:'Barlow Condensed';font-style:italic;font-weight:800;font-display:swap;src:url('/assets/fonts/BarlowCondensed-800Italic.ttf') format('truetype')}
body.battle-mode{--battle-num:'Barlow Condensed',Arial,sans-serif}
body.battle-mode .slant-health strong,body.battle-mode .slant-health small,body.battle-mode .player-shield,body.battle-mode .battle-menu strong,body.battle-mode .battle-location small,body.battle-mode [data-hp-number],body.battle-mode .enemy-max,body.battle-mode .count,body.battle-mode .count b,body.battle-mode .cost,body.battle-mode .combat-number,body.battle-mode .endturn small,body.battle-mode .fan-arrow small{font-family:var(--battle-num)!important}
/* Reset structural dimensions from the previous grid-based battle skin. */
body.battle-mode .pocket-battle .battle-stage{margin:0;width:100%;background:none;border:0;box-shadow:none}
body.battle-mode .pocket-battle .enemies{width:100%;margin:0;max-width:none}
body.battle-mode .pocket-battle .enemy h2{height:auto;min-height:24px;display:block;text-align:left;align-self:flex-start}
body.battle-mode .pocket-battle .enemy .enemy-hp{flex:none;height:26px;flex-wrap:nowrap}
body.battle-mode .pocket-battle .enemy .enemy-art{width:100%;max-width:none;margin:0;aspect-ratio:auto}
body.battle-mode .pocket-battle .hand-rack .cardhead .card-type,body.battle-mode .battle-card-detail .cardhead .card-type,body.battle-mode .drag-ghost .cardhead .card-type{display:none!important}
body.battle-mode .pocket-battle .enemy h2{border-bottom:4px solid var(--coral);padding-bottom:2px;min-height:27px}
body.battle-mode .pocket-battle .enemy .intent{border-radius:0;justify-content:flex-start}
body.battle-mode .pocket-battle .enemy .intent>span:last-child{display:flex;align-items:center;gap:3px;min-width:0}
body.battle-mode .intent-hit{display:inline-flex;align-items:center;gap:3px;white-space:nowrap;color:var(--coral)}
body.battle-mode .intent-hit b{font:italic 800 23px/1 var(--battle-num)!important;color:var(--bone)}
body.battle-mode .intent small{font-size:8px;line-height:1.2;max-width:58px;overflow:hidden;max-height:28px}
body.battle-mode .pocket-battle .enemy .enemy-status{top:116px}
body.battle-mode .enemy-hp .hp-caption{display:none!important}
body.battle-mode .pocket-battle .hand-rack .card,body.battle-mode .pocket-battle .hand-rack .card *{touch-action:none}
body.battle-mode .battle-card-detail.empty{color:var(--bone);display:grid;place-items:center}
body.battle-mode .pocket-battle .hand-rack .card.armed:hover,body.battle-mode .pocket-battle .hand-rack .card:hover{transform:translateX(calc(var(--fan-x) - 50%)) translateY(var(--fan-y)) rotate(var(--fan-r))}
body.battle-mode .drag-ghost .cardhead .cost{border-radius:0;box-shadow:none;font:italic 800 22px/24px var(--battle-num)!important;width:25px;height:26px}
body.battle-mode .drag-ghost .cardbody h3{background:var(--bone);color:var(--ink);font-size:12px;padding:1px;margin:0;border:0;line-height:1.2}
body.battle-mode .battle-compass{position:absolute;inset:-4px;width:calc(100% + 8px);height:calc(100% + 8px);pointer-events:none}
body.battle-mode .battle-menu strong,body.battle-mode .battle-menu small{position:relative;z-index:1}
body.battle-mode .battle-menu:after{display:none}
body.battle-mode .battle-ornament{color:var(--brass);pointer-events:none}
body.battle-mode .battle-card-detail .vine{position:absolute;right:3px;bottom:3px;width:22px;height:22px}
body.battle-mode .battle-card-detail .leafrule{width:84px;height:9px;display:block;margin:-3px 0 5px}
body.battle-mode .battle-card-detail .cardbody h3:after{display:none}
body.battle-mode .intent-hit .sword{width:13px;height:16px;flex:none}
body.battle-mode .nexus-empty .tree{width:100%;height:100%;display:block}
body.battle-mode .lock-reticle{border:0;outline:0;overflow:visible;width:80px;height:80px;margin-left:-40px}
@keyframes reticle-spin{to{transform:rotate(360deg)}}
body.battle-mode .drag-hint{position:absolute;bottom:calc(68px + 112px + 16px + 116px);left:0;right:0;color:var(--bone);font-size:10px;text-align:center;z-index:4;pointer-events:none;text-shadow:0 1px 3px black}
body.battle-mode .endturn.ready{animation:end-ready 1.8s ease-in-out infinite}
@keyframes end-ready{50%{filter:brightness(1.3)}}
@media(max-height:720px){body.battle-mode .drag-hint{bottom:calc(61px + 98px + 14px + 116px);font-size:9px}}
body.battle-mode{color:var(--bone)}
body.battle-mode #panel{--ink:#eef8f5;color:#eef8f5}
body.battle-mode .battle-card-detail .cardbody p{max-height:105px;overflow-y:auto;overscroll-behavior:contain}
body.battle-mode .empty-hand{color:var(--bone);text-align:center;padding:25px 0;font-size:12px}
body.battle-mode .combat-hud .battle-menu{position:relative}

/* Keep white glyph interiors readable against every battlefield. */
body.battle-mode .combat-number{--number-edge:#c92c40;color:#fff;-webkit-text-fill-color:#fff;-webkit-text-stroke:3px var(--number-edge);paint-order:stroke fill;text-shadow:0 2px 0 var(--number-edge),2px 0 0 var(--number-edge),-2px 0 0 var(--number-edge),0 -2px 0 var(--number-edge),0 3px 6px #000}
body.battle-mode .combat-number.shield,body.battle-mode .combat-number.shieldGain{--number-edge:#1678bc}
body.battle-mode .combat-number.heal{--number-edge:#218345}
body.battle-mode .combat-number.critical,body.battle-mode .combat-number.chain{--number-edge:#9b6b09}
body.battle-mode .combat-number.evade{--number-edge:#487282}
body.battle-mode .pocket-battle .combat-actions .nexus-peek.drop-target{border-color:#9affc4;background:#174a38;box-shadow:inset 0 0 0 3px #6fe0a0,inset 0 0 20px #6fe0a077}
body.battle-mode .nexus-peek.drop-target:after{content:'ここに展開';color:#fff}
body.battle-mode.drag-nexus .pocket-battle .combat-actions .nexus-peek{border-color:#baffd4;background:#164438;filter:drop-shadow(0 0 12px #58ffab) drop-shadow(0 0 22px #46e8a0);animation:nexus-zone-glow 1s ease-in-out infinite alternate}
body.battle-mode.drag-nexus .nexus-peek:after{content:'ここに展開';color:#effff2}
body.battle-mode.drag-nexus .pocket-battle .combat-actions .nexus-peek.drop-target{background:#287753;filter:drop-shadow(0 0 16px #90ffbf) drop-shadow(0 0 28px #65f6a5)}
@keyframes nexus-zone-glow{from{filter:drop-shadow(0 0 7px #63ecac) drop-shadow(0 0 14px #48d895)}to{filter:drop-shadow(0 0 15px #89ffc0) drop-shadow(0 0 25px #64eaa7)}}
@media(prefers-reduced-motion:reduce){body.battle-mode.drag-nexus .pocket-battle .combat-actions .nexus-peek{animation:none}}

/* Full-size, three-across hand: descriptions belong to the cards. */
body.battle-mode .battle-card-detail{display:none}
body.battle-mode .pocket-battle,body.battle-mode .pocket-battle.core-battle{grid-template-rows:minmax(140px,1fr) 18px clamp(250px,38vh,330px) 68px}
body.battle-mode .pocket-battle .hand-heading{grid-row:2;height:18px;font-size:10px;line-height:18px}
body.battle-mode .pocket-battle .hand-rack{grid-row:3;height:100%;overflow:hidden}
body.battle-mode .pocket-battle .combat-actions{grid-row:4}
body.battle-mode .pocket-battle .hand-rack .card{width:calc((100% - 38px)/3);height:calc(100% - 20px);bottom:16px;padding:3px;border-radius:8px;background:#061923;box-shadow:inset 0 0 0 1px #c9a55b,0 2px 5px #0009;touch-action:none}
body.battle-mode .pocket-battle .hand-rack .cardhead{position:relative;inset:auto;display:flex;height:42px;min-height:42px;padding:2px;gap:3px;border-bottom:1px solid var(--type-edge)}
body.battle-mode .pocket-battle .hand-rack .cost{position:relative;inset:auto;flex-shrink:0;width:32px;height:32px;border-radius:50%;border:2px solid #d9c58f;background:radial-gradient(circle at 30% 20%,#6cc4d3,#143b4d 65%,#071824);font:italic 400 27px/28px Georgia,serif!important;box-shadow:0 0 0 1px #769ca4}
body.battle-mode .pocket-battle .hand-rack .cardhead .card-type{display:block!important;flex:1;font-size:9px;letter-spacing:0;text-align:center}
body.battle-mode .pocket-battle .hand-rack .cardhead .card-rank{font-size:9px;line-height:14px}
body.battle-mode .pocket-battle .hand-rack .card-art{height:26%;min-height:52px;margin:2px 0 0;width:100%;border:1px solid var(--type-edge)}
body.battle-mode .pocket-battle .hand-rack .cardbody{display:flex;flex-direction:column;flex:1;min-height:0;padding:0;margin:0;background:#f4eddc;color:#14222c;overflow:auto;touch-action:none}
body.battle-mode .pocket-battle .hand-rack .cardbody h3{flex:none;display:block;min-height:35px;align-content:center;margin:0;padding:5px 2px;background:#061923;color:#fff8e5;font-size:13px;line-height:1.35;border-bottom:1px solid var(--type-edge);overflow-wrap:anywhere}
body.battle-mode .pocket-battle .hand-rack .cardbody p{display:block;margin:0;padding:5px 4px;color:#14222c;font-size:12px;line-height:1.55}
body.battle-mode .pocket-battle .hand-rack .condition{display:block;font-size:10px;padding:0 4px}
body.battle-mode .pocket-battle .hand-rack .cardslots{display:flex;flex:none;flex-wrap:wrap;justify-content:center;align-content:center;min-height:43px;padding:4px 1px;margin:0;background:#061923;border-top:1px solid var(--type-edge);gap:3px}
body.battle-mode .pocket-battle .hand-rack .cardslots small{font-size:10px;line-height:13px;color:#e7dab4}
body.battle-mode .pocket-battle .hand-rack .cardslots .module-orb{width:12px;height:12px}
body.battle-mode .fan-arrow{z-index:40}
@media(max-height:720px){body.battle-mode .pocket-battle,body.battle-mode .pocket-battle.core-battle{grid-template-rows:minmax(115px,1fr) 18px 250px 61px}}
body.battle-mode .pocket-battle .hand-rack{overflow:clip;user-select:none;-webkit-user-select:none}
body.battle-mode .pocket-battle .hand-rack .card:after{display:none}
body.battle-mode .drag-hint{bottom:calc(68px + clamp(250px,38vh,330px) + 18px)}
@media(max-height:720px){body.battle-mode .drag-hint{bottom:329px}}
/* A large focusing ring contracts onto the selected enemy. */
body.battle-mode .drop-target .lock-reticle{animation:lock-on-large .55s cubic-bezier(.15,.7,.2,1),reticle-pulse 1s .55s infinite;filter:drop-shadow(0 0 5px #6fd8ff)}
@keyframes lock-on-large{0%{transform:scale(4.5) rotate(55deg);opacity:.8}70%{opacity:1}100%{transform:scale(1);opacity:1}}
body.battle-mode .pocket-battle .hand-heading:empty{visibility:hidden}
body.battle-mode .pocket-battle .combat-actions .endturn{position:relative;isolation:isolate;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
body.battle-mode .pocket-battle .combat-actions .endturn:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#238958,#6be5a0);clip-path:inset(0 calc(100% - var(--hold-progress,0%)) 0 0);pointer-events:none}
body.battle-mode .pocket-battle .combat-actions .endturn.holding{color:#062818}
body.battle-mode .pocket-battle .combat-actions .endturn small{font-family:inherit!important;font-size:11px}

body.battle-mode .pocket-battle .hand-rack .cardbody{overflow:hidden}
body.battle-mode .pocket-battle .hand-rack .cardbody.reading-description{overflow-y:auto;overscroll-behavior:contain;box-shadow:inset 0 0 0 2px #6bc6df;scrollbar-width:thin;scrollbar-color:#367c91 #e8dfca;cursor:ns-resize}

/* Keep the entire final ring inside its SVG viewBox on mobile browsers. */
body.battle-mode .lock-reticle{width:160px;height:160px;margin-left:-80px;bottom:calc(15% - 40px);overflow:visible}
body.battle-mode .drop-target .lock-reticle{animation:lock-on-large .55s cubic-bezier(.15,.7,.2,1),reticle-pulse 1s .55s infinite}
@media(prefers-reduced-motion:reduce){body.battle-mode .drop-target .lock-reticle{animation:none}}
body.battle-mode .pocket-battle .hand-rack .cardbody p{font-size:13px;line-height:1.6}

/* Defeat must not desaturate labels or floating combat feedback. */
body.battle-mode .battle-stage .enemy.dead{filter:none}

/* 70 percent of current monster art; keep existing placement transforms. */
body.battle-mode .enemy:is([data-enemy-type="E027"],[data-enemy-type="E028"],[data-enemy-type="E016"]) .enemy-art img.illustrated-sprite{scale:.7;transform-origin:center bottom}

/* Hanaotoshi: 1.3x artwork, with the face kept below the action label. */
body.battle-mode .pocket-battle .enemies .enemy[data-enemy-type="E020"] .enemy-art img.illustrated-sprite{width:min(195cqw,162.5cqh);top:calc(12px - min(31.2cqw,26cqh));bottom:auto}

/* Fierce Petals: half the current artwork size, preserving encounter placement. */
body.battle-mode .enemy[data-enemy-type="E021"] .enemy-art img.illustrated-sprite{scale:.5;transform-origin:center bottom}

/* The final boss spans all three lanes, with full-width readable status UI. */
body.battle-mode .pocket-battle .enemies>.enemy.forest-core{grid-column:1/-1;width:100%;max-width:none;isolation:isolate}
body.battle-mode .pocket-battle .enemy.forest-core>h2,
body.battle-mode .pocket-battle .enemy.forest-core>.enemy-hp,
body.battle-mode .pocket-battle .enemy.forest-core>.enemybar,
body.battle-mode .pocket-battle .enemy.forest-core>.intent{position:relative;z-index:2;transform:none}
body.battle-mode .pocket-battle .enemy.forest-core>.enemybar{width:calc(100% - 6px)}
body.battle-mode .pocket-battle .enemy.forest-core>.intent{width:100%;box-sizing:border-box}
body.battle-mode .pocket-battle .enemy.forest-core .enemy-art{position:absolute;inset:45px -6px -180px;width:auto;height:auto;container-type:normal;pointer-events:none;z-index:0}
body.battle-mode .pocket-battle .enemies .enemy.forest-core .enemy-art img.illustrated-sprite{width:115%;height:auto;max-width:none;max-height:none;top:0;bottom:auto;left:50%;right:auto;transform:translateX(-50%);object-fit:contain}
