/* Immersive stage. Loaded after existing battle styles; all original control IDs remain live. */
#battle-screen.battle-stage{--stage-jade:#a9d6bd;--stage-gold:#e5c987;width:min(100%,1440px);height:auto;min-height:100dvh;max-height:none;padding:0 max(12px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"header" "field" "mission" "commands" "intel" "stories";align-content:start;gap:0;background:linear-gradient(180deg,#0a201f,#071817)}
#battle-screen.battle-stage>.battle-header{grid-area:header;height:auto;min-height:76px;padding:12px 0;gap:8px;align-items:center;flex-wrap:nowrap;z-index:5;border-bottom:1px solid #d8bd8030}
#battle-screen.battle-stage .battle-header>div:first-child{flex:1;min-width:0}.battle-stage .battle-header .eyebrow{font-size:10px;letter-spacing:.09em}
#battle-screen.battle-stage .battle-header h2{font-size:23px!important;line-height:1.3;letter-spacing:.08em;white-space:normal;overflow-wrap:anywhere;margin:5px 0 0}
#battle-screen.battle-stage .battle-tools{gap:4px;margin:0;flex:none;display:grid;grid-template-columns:repeat(4,44px)}
#battle-screen.battle-stage .battle-tools .icon-btn{height:44px;width:44px;min-width:44px;font:600 12px/1 system-ui;background:#16332e;border-color:#c6b47644;border-radius:50%}
#battle-screen.battle-stage>.arena{grid-area:field;position:relative;height:clamp(360px,49dvh,490px);min-height:360px;max-height:none;margin:0 -12px;padding:0;display:block;isolation:isolate;overflow:hidden;flex:none;border:0;border-bottom:1px solid #cdb67555;border-radius:0;background:#21463e;box-shadow:inset 0 -40px 50px #071b1bcc}
#battle-screen.battle-stage>.arena:before{content:"";position:absolute;inset:0;z-index:-3;background:url('./assets/battle-valley-v431.png') center 58%/cover no-repeat;opacity:1;filter:none;transform:none}
#battle-screen.battle-stage>.arena:after{content:"";position:absolute;inset:0;z-index:-1;height:auto;border-radius:0;transform:none;box-shadow:none;background:linear-gradient(180deg,#30271318,transparent 22%,transparent 86%,#291d1826);pointer-events:none}
#battle-screen.battle-stage[data-stage-theme="sea"]>.arena:before,#battle-screen.battle-stage[data-stage-theme="mist"]>.arena:before{filter:none}
#battle-screen.battle-stage[data-stage-theme="stone"]>.arena:before{filter:none}
.battle-stage .stage-ground{display:none}
#battle-screen.battle-stage .combat-row{position:absolute;inset:0;display:block;width:100%;height:100%;min-height:0;padding:0;margin:0;transform:none;pointer-events:none;z-index:2}
#battle-screen.battle-stage .combat-row:before{display:none}
#battle-screen.battle-stage .combat-card{position:absolute;width:27%;height:38%;min-height:126px;max-height:178px;padding:0;display:flex;flex-direction:column;justify-content:flex-end;gap:0;pointer-events:auto;touch-action:manipulation;border:0!important;border-radius:0;background:transparent!important;box-shadow:none!important;transform:none!important;overflow:visible;isolation:isolate;transition:opacity .18s!important}
#battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:19%;top:16%;z-index:3}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:45%;top:7%;z-index:2}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:71%;top:18%;z-index:4}
#battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:1%;top:56%;z-index:5}#battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:28%;top:45%;z-index:4}#battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:55%;top:57%;z-index:6}
#battle-screen.battle-stage .unit-motion{position:relative;width:126%;margin-left:-13%;height:calc(100% - 35px);min-height:90px;max-height:none;flex:1;pointer-events:none;transform-origin:50% 83%}
#battle-screen.battle-stage .unit-standee{position:absolute;inset:0;width:100%;height:100%;min-height:0;pointer-events:none}
#battle-screen.battle-stage .unit-standee img{inset:0;width:100%;height:100%;min-height:0;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 10px 5px #00140ecc) drop-shadow(0 0 9px #e7d49b2b);pointer-events:none}
#battle-screen.battle-stage .unit-shadow{left:20%;right:20%;bottom:-1px;height:18px;background:radial-gradient(ellipse,#00130de6,#00130d70 45%,transparent 72%);filter:blur(1px);transform:scaleY(.65);pointer-events:none}
#battle-screen.battle-stage .unit-aura{left:13%;right:13%;bottom:-3px;height:24px;pointer-events:none}
#battle-screen.battle-stage .unit-hud{width:100%;height:35px;min-height:35px;padding:2px 3px;background:linear-gradient(180deg,#102c2466,#09241ccf);border:0;border-radius:0;box-shadow:none;backdrop-filter:none;flex:none;pointer-events:none}
#battle-screen.battle-stage .unit-title{display:flex;align-items:center;justify-content:center;gap:3px;position:relative;min-height:14px}
#battle-screen.battle-stage .unit-phase{width:14px;height:14px;flex:none;font:9px/14px system-ui}
#battle-screen.battle-stage .combat-name{padding:0;font-size:12px!important;font-weight:600;line-height:16px;color:#f0e5c6;text-shadow:0 1px 4px #001810;overflow:visible;white-space:nowrap}
#battle-screen.battle-stage .badge{position:absolute;top:-21px;left:50%;transform:translateX(-50%);padding:2px 4px;border:0;background:#09211bcc;color:#bed5c7;font:9px/1.3 system-ui;white-space:nowrap;border-radius:2px}
#battle-screen.battle-stage .hp-line{height:4px;margin:3px 2px 1px;border:0;box-shadow:0 1px 3px #00190e;background:#0a201d}
#battle-screen.battle-stage .hp-text{font:8px/1.4 system-ui;padding:0;text-align:center;color:#d0ddd0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#battle-screen.battle-stage .combat-card.active .unit-hud{background:linear-gradient(180deg,#8b763512,#293f24ed);border-bottom:2px solid var(--stage-gold);box-shadow:none}
#battle-screen.battle-stage .combat-card.targetable .unit-hud{background:linear-gradient(180deg,#783f3110,#392d23d9);border-bottom:2px solid #ecad86;box-shadow:none}
#battle-screen.battle-stage .combat-card.active:after{content:"◆";position:absolute;left:calc(50% - 5px);top:0;color:#f4d688;font-size:13px;text-shadow:0 0 8px #eacf85;pointer-events:none}
#battle-screen.battle-stage .combat-card.targetable:after{content:"目标";position:absolute;top:1%;left:50%;transform:translateX(-50%);font:11px/1.6 system-ui;color:#ffdfba;background:#4b2d23bd;border:1px solid #e7ab7777;padding:0 6px;border-radius:2px;pointer-events:none}
#battle-screen.battle-stage .combat-card.defeated{opacity:.26!important}.battle-stage .combat-card.defeated:after{display:none!important}
#battle-screen.battle-stage .combat-card:focus-visible{outline:2px solid var(--stage-gold);outline-offset:2px;border-radius:8px}
#battle-screen.battle-stage .team-label{position:absolute;margin:0;padding:0;min-height:16px;max-width:64%;z-index:5;font:10px/1.5 system-ui;gap:8px;pointer-events:none;text-shadow:0 1px 4px #00170c}
#battle-screen.battle-stage .enemy-label{right:12px;top:10px;justify-content:flex-end;color:#eac09e}#battle-screen.battle-stage .enemy-label #enemy-intent{font:10px/1.5 system-ui;color:#f1ceb0}#battle-screen.battle-stage .enemy-label>span:first-child{display:none}#battle-screen.battle-stage .player-label{left:12px;bottom:8px;color:#c7e2ce}#battle-screen.battle-stage .versus{display:none}
.battle-stage .stage-touch-note{position:absolute;right:12px;bottom:8px;margin:0;font:9px/1.5 system-ui;color:#c8d0b8;pointer-events:none;z-index:5}
#battle-screen.battle-stage #battle-objective-hud{position:absolute;left:10px;top:9px;right:auto;width:46%;padding:6px 8px;min-height:0;display:grid;grid-template-columns:1fr 36px;gap:4px 8px;background:#0b231ccc;border:1px solid #d5bd7433;border-radius:3px;box-shadow:none;z-index:6;pointer-events:none}
#battle-screen.battle-stage #battle-objective-hud[hidden]{display:none}.battle-stage .objective-title{font-size:11px;white-space:normal}.battle-stage .objective-tip{display:none}.battle-stage .objective-kicker{font-size:8px}.battle-stage .objective-break{grid-column:1;grid-row:2}.battle-stage .objective-danger{grid-column:2;grid-row:1/span 2;min-height:32px}.battle-stage .objective-danger strong{font-size:17px}.battle-stage .objective-break>span{font-size:8px}.battle-stage .objective-break>i{height:4px}
#battle-screen.battle-stage>.action-panel{grid-area:commands;width:auto;margin:0;padding:10px 0 12px;border:0;background:linear-gradient(180deg,#122f29,#0b211f);border-radius:0;box-shadow:none;position:relative;min-width:0}
#battle-screen.battle-stage .battle-decision{min-height:44px;line-height:1.6;font-size:11px}.battle-stage .battle-decision button{min-width:66px;min-height:44px;padding:5px;font-size:11px;flex:none}
#battle-screen.battle-stage .active-info{gap:8px;margin:2px 0 0}#battle-screen.battle-stage #active-name{font-size:17px}#battle-screen.battle-stage #active-status{font-size:10px;max-width:50%;white-space:normal;text-align:right}
#battle-screen.battle-stage .resource-row{margin:6px 0 9px;gap:8px}#battle-screen.battle-stage .energy-bar{width:36px}#battle-screen.battle-stage .turn-tip{max-width:105px;font-size:10px}#battle-screen.battle-stage #story-hand-jump{min-height:44px;padding:6px;font-size:11px}
#battle-screen.battle-stage .skill-buttons{gap:8px}#battle-screen.battle-stage .skill-buttons .action-btn{min-height:74px;padding:10px 3px 6px;background:linear-gradient(145deg,#355440,#172f27);border-color:#dac07c66;border-radius:5px}#battle-screen.battle-stage .skill-buttons .action-btn>b{font-size:13px;white-space:normal}#battle-screen.battle-stage .skill-buttons .action-btn>span{display:none}#battle-screen.battle-stage .skill-short{font-size:10px}#battle-screen.battle-stage .skill-buttons .action-btn small{font-size:11px}
#battle-screen.battle-stage .utility-buttons{gap:8px;margin-top:8px}#battle-screen.battle-stage .utility-buttons .action-btn{min-height:48px;padding:7px 3px;border-color:#b0bf9766;gap:3px}#battle-screen.battle-stage .utility-buttons .action-btn small{font-size:10px}#battle-screen.battle-stage .utility-buttons .action-btn b{font-size:12px}#battle-screen.battle-stage .utility-buttons .action-btn span{display:none}
#battle-screen.battle-stage #expedition-objective{grid-area:mission;padding:10px 0;gap:8px;border:0;border-bottom:1px solid #d5ba7333;background:#13302b;z-index:3}.battle-stage #expedition-objective .eyebrow{font-size:9px}.battle-stage .tide-timeline li{padding-block:3px}.battle-stage .expedition-channel{padding-top:5px}.battle-stage .expedition-channel strong{font-size:11px}
#battle-screen.battle-stage>.battle-stage-intel{grid-area:intel;min-width:0;border-block:1px solid #d8bd8030;background:#0b231e;padding:0 12px;margin:0 -12px;color:#c9d7c6;font:12px/1.7 system-ui}
.battle-stage-intel>summary{min-height:48px;padding:13px 0;cursor:pointer;color:#e0c689;font:13px/1.7 system-ui;touch-action:manipulation}.battle-stage-intel>summary:focus-visible{outline:2px solid #e0c689;outline-offset:-2px}
#battle-screen.battle-stage .battle-stage-intel>.terrain-panel{margin:0;padding:12px 0;display:flex;min-height:60px;height:auto;border:0;border-bottom:1px solid #d8bd8022;background:none;gap:10px}.battle-stage-intel .terrain-panel p{display:block;font-size:12px;line-height:1.6;margin:5px 0}.battle-stage-intel .terrain-panel b{font-size:13px}.battle-stage-intel .terrain-favor{font-size:11px}.battle-stage-intel .terrain-sigil{flex:none}
#battle-screen.battle-stage .battle-stage-intel>.battle-log-wrap{padding:8px 0;margin:0;background:none}.battle-stage-intel .log-title{font-size:12px}.battle-stage-intel .log-title button{min-height:44px!important;min-width:44px;font-size:12px}.battle-stage-intel .battle-log{font-size:12px;line-height:1.8;max-height:220px}
#battle-screen.battle-stage>.story-hand-panel{grid-area:stories;min-width:0;margin-top:0;padding:18px 0}.battle-stage .story-hand{max-width:100%}
@media(max-width:359px){#battle-screen.battle-stage>.battle-header{min-height:108px;display:grid;grid-template-columns:1fr;gap:8px;padding-block:9px}#battle-screen.battle-stage .battle-tools{position:absolute;right:0;top:53px}#battle-screen.battle-stage .battle-header h2{font-size:21px!important;margin-top:3px}#battle-screen.battle-stage .battle-header>div:first-child{padding-bottom:44px}#battle-screen.battle-stage .combat-card{width:29%;height:36%;min-height:120px}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:15%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:42%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:70%}#battle-screen.battle-stage .combat-name{font-size:11px!important}#battle-screen.battle-stage .hp-text{font-size:7px}.battle-stage .stage-touch-note{font-size:8px}#battle-screen.battle-stage .battle-decision{font-size:10px}#battle-screen.battle-stage .skill-short{font-size:9px}}
@media(min-width:900px), (min-width:700px) and (max-height:550px){#battle-screen.battle-stage{padding:0 20px 20px;grid-template-columns:minmax(0,1fr) 310px;grid-template-rows:auto auto 1fr auto auto;grid-template-areas:"header header" "field mission" "field commands" "intel intel" "stories stories";column-gap:20px}#battle-screen.battle-stage>.battle-header{min-height:76px}#battle-screen.battle-stage>.arena{min-height:540px;height:calc(100dvh - 95px);max-height:850px;margin:0 0 18px -20px;border-bottom:0;border-right:1px solid #d4bd7340}#battle-screen.battle-stage>.action-panel{align-self:start;padding:16px 0 18px}#battle-screen.battle-stage:not(.with-expedition)>.action-panel{grid-row:2/span 2;padding-top:20px}#battle-screen.battle-stage #expedition-objective{align-self:start;padding:18px 0 10px}#battle-screen.battle-stage>.battle-stage-intel{margin:0 -20px;padding-inline:20px}#battle-screen.battle-stage .combat-card{width:25%;height:35%;max-height:250px;min-height:145px}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:44%;top:14%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:71%;top:27%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:63%;top:0%}#battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:1%;top:44%}#battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:22%;top:65%}#battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:34%;top:39%}#battle-screen.battle-stage .combat-name{font-size:15px!important}#battle-screen.battle-stage .unit-hud{height:42px;min-height:42px;padding:4px 8px}#battle-screen.battle-stage .hp-text{font-size:10px}#battle-screen.battle-stage .unit-phase{width:17px;height:17px;font-size:11px;line-height:17px}#battle-screen.battle-stage .hp-line{height:5px;margin-top:4px}#battle-screen.battle-stage .badge{font-size:11px;top:-24px}#battle-screen.battle-stage #battle-objective-hud{top:18px;left:20px;width:40%;padding:10px;max-width:340px}.battle-stage .objective-title{font-size:14px}.battle-stage .objective-kicker{font-size:10px}.battle-stage .objective-break>span{font-size:10px}#battle-screen.battle-stage .enemy-label{right:20px;top:14px}#battle-screen.battle-stage .player-label{left:20px;bottom:14px;font-size:12px}.battle-stage .stage-touch-note{right:20px;bottom:14px;font-size:11px}#battle-screen.battle-stage .active-info{flex-wrap:wrap;gap:5px}#battle-screen.battle-stage #active-status{max-width:100%;font-size:11px}#battle-screen.battle-stage .resource-row{flex-wrap:wrap}#battle-screen.battle-stage .skill-buttons{grid-template-columns:1fr;gap:8px}#battle-screen.battle-stage .skill-buttons .action-btn{min-height:72px;grid-template-columns:1fr auto;grid-template-rows:auto auto;align-items:center;padding:10px 12px;text-align:left;justify-items:start}#battle-screen.battle-stage .skill-buttons .action-btn>b{font-size:16px;grid-column:1;grid-row:1}#battle-screen.battle-stage .skill-buttons .action-btn small{grid-column:2;grid-row:1}#battle-screen.battle-stage .skill-short{grid-column:1/-1;grid-row:2;font-size:11px;text-align:left}#battle-screen.battle-stage .utility-buttons{grid-template-columns:1fr}.battle-stage .utility-buttons.with-carry{grid-template-columns:repeat(2,minmax(0,1fr))!important}#battle-screen.battle-stage .utility-buttons .action-btn{min-height:48px;padding:8px;justify-content:space-between}#battle-screen.battle-stage .utility-buttons .action-btn b{font-size:13px}#battle-screen.battle-stage .utility-buttons .action-btn small{font-size:11px}}
@media(min-width:700px) and (max-height:550px){#battle-screen.battle-stage{grid-template-columns:minmax(0,1fr) 268px;column-gap:12px;padding-inline:12px}#battle-screen.battle-stage>.battle-header{min-height:60px;padding-block:6px}#battle-screen.battle-stage .battle-header h2{font-size:20px!important}#battle-screen.battle-stage>.arena{height:calc(100dvh - 60px);min-height:315px;margin-left:-12px;margin-bottom:12px}#battle-screen.battle-stage .combat-card{width:26%;height:42%;min-height:120px;max-height:150px}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:40%;top:9%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:72%;top:24%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:68%;top:0%}#battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:0%;top:45%}#battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:21%;top:55%}#battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:34%;top:35%}#battle-screen.battle-stage .combat-name{font-size:11px!important}#battle-screen.battle-stage .hp-text{font-size:8px}#battle-screen.battle-stage .unit-hud{height:34px;min-height:34px;padding:2px}.battle-stage .objective-title{font-size:11px}#battle-screen.battle-stage #battle-objective-hud{left:10px;top:8px;padding:6px;width:39%}#battle-screen.battle-stage .enemy-label{right:10px;top:4px;max-width:55%}#battle-screen.battle-stage .enemy-label #enemy-intent{font-size:9px}.battle-stage .stage-touch-note{font-size:9px;right:8px;bottom:5px}#battle-screen.battle-stage .player-label{left:8px;bottom:5px;font-size:10px}#battle-screen.battle-stage .badge{font-size:9px;top:-20px}#battle-screen.battle-stage .skill-buttons{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}#battle-screen.battle-stage .skill-buttons .action-btn{display:flex;flex-direction:column;min-height:76px;align-items:center;justify-content:center;padding:6px 2px;gap:4px}#battle-screen.battle-stage .skill-buttons .action-btn>b{font-size:12px}#battle-screen.battle-stage .skill-short{font-size:9px;text-align:center}#battle-screen.battle-stage .skill-buttons .action-btn small{font-size:10px}#battle-screen.battle-stage .utility-buttons{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}#battle-screen.battle-stage .utility-buttons .action-btn{min-height:48px;padding:5px 2px;display:flex;flex-direction:column;justify-content:center}#battle-screen.battle-stage .utility-buttons .action-btn b{font-size:11px}#battle-screen.battle-stage .utility-buttons .action-btn small{font-size:9px}#battle-screen.battle-stage>.action-panel,#battle-screen.battle-stage:not(.with-expedition)>.action-panel{padding-top:4px}.battle-stage .battle-decision button{font-size:10px;min-width:60px}#battle-screen.battle-stage .battle-decision{font-size:10px}#battle-screen.battle-stage .active-info{flex-wrap:nowrap}#battle-screen.battle-stage #active-name{font-size:15px}#battle-screen.battle-stage #active-status{font-size:9px;max-width:50%}#battle-screen.battle-stage .resource-row{margin-block:3px 6px}#battle-screen.battle-stage #expedition-objective{padding-top:8px}}
@media(prefers-reduced-motion:reduce){#battle-screen.battle-stage .combat-card{transition:none!important}.battle-stage .stage-ground{animation:none}}
html[data-reduced-motion="true"] #battle-screen.battle-stage .combat-card{transition:none!important}
/* Reserve explicit HUD rows so HP and status never fall outside the nameplate. */
#battle-screen.battle-stage .unit-motion{min-height:0;height:auto;flex:1 1 auto}
#battle-screen.battle-stage .unit-hud{height:40px;min-height:40px;flex:0 0 40px;grid-template-rows:16px 4px 11px;gap:2px;padding:2px 3px;overflow:visible}
#battle-screen.battle-stage .hp-line{margin:0 2px;height:4px}
#battle-screen.battle-stage .hp-text{height:11px;line-height:11px}
#battle-screen.battle-stage .combat-card.stage-attacking{z-index:20!important}
#battle-screen.battle-stage .combat-row:has(.stage-attacking){z-index:15}
@media(max-width:359px){#battle-screen.battle-stage .battle-tools{right:12px}}
@media(min-width:900px){#battle-screen.battle-stage .unit-hud{height:48px;min-height:48px;flex-basis:48px;grid-template-rows:18px 5px 13px;gap:2px;padding:3px 8px}#battle-screen.battle-stage .hp-text{height:13px;line-height:13px}#battle-screen.battle-stage .hp-line{height:5px}}
@media(min-width:700px) and (max-height:550px){#battle-screen.battle-stage .combat-card{width:23%;height:38%;min-height:120px;max-height:140px}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:50%;top:3%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:76%;top:10%}#battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:65%;top:57%}#battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:0%;top:45%}#battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:24%;top:59%}#battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:24%;top:16%}#battle-screen.battle-stage .unit-hud{height:40px;min-height:40px;flex-basis:40px;grid-template-rows:16px 4px 11px;gap:2px;padding:2px 3px}#battle-screen.battle-stage .hp-text{height:11px;line-height:11px}#battle-screen.battle-stage .hp-line{height:4px}}
#battle-screen.battle-stage .battle-tools{grid-template-columns:56px repeat(3,44px)}
#battle-screen.battle-stage #battle-motion-btn{width:56px;min-width:56px;padding-inline:4px}
/* The inherited end alignment otherwise pushes the first expanded body beyond the left edge. */
#battle-screen.battle-stage #player-row .combat-card:first-child .unit-motion{align-self:flex-start;margin-left:0}

/* v4.3.1: painted valley, ground-based depth and separate information lanes. */
#battle-screen.battle-stage{--stage-gold:#ead09a;background:#162922}
#battle-screen.battle-stage>.battle-header{min-height:64px;padding-block:8px;background:#162922}
#battle-screen.battle-stage .battle-header h2{font-size:22px!important;margin-top:3px}
#battle-screen.battle-stage .battle-tools .icon-btn{background:#233c31;border-color:#b69b6055}
#battle-screen.battle-stage>.arena{height:clamp(300px,44dvh,398px);min-height:300px;background:#b9a783;box-shadow:none;border-bottom-color:#8f7546}
#battle-screen.battle-stage .combat-card{width:30%;height:37%;min-height:0;max-height:none;align-items:center!important}
#battle-screen.battle-stage #enemy-row .combat-card{width:27%;height:33%}
#battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:9%;top:24%;z-index:3}
#battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:39%;top:21%;z-index:2}
#battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:69%;top:26%;z-index:4}
#battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:2%;top:54%;z-index:5}
#battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:34%;top:59%;z-index:6}
#battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:66%;top:55%;z-index:5}
#battle-screen.battle-stage .combat-card .unit-motion,#battle-screen.battle-stage #player-row .combat-card:first-child .unit-motion{align-self:center;width:112%;margin:0;flex:1 1 auto;min-height:0}
#battle-screen.battle-stage .unit-shadow{left:24%;right:24%;height:12px;bottom:1px;background:radial-gradient(ellipse,#382a2290,transparent 70%);filter:blur(2px);transform:scaleY(.7)}
#battle-screen.battle-stage .unit-aura{height:14px;bottom:0;opacity:.55}
#battle-screen.battle-stage .unit-hud{width:88%;height:36px;min-height:36px;flex:0 0 36px;grid-template-rows:15px 4px 11px;gap:2px;padding:2px 4px;background:linear-gradient(90deg,transparent,#243d31d9 18%,#243d31d9 82%,transparent);border:0;border-radius:0}
#battle-screen.battle-stage .unit-title{min-height:15px;line-height:15px}
#battle-screen.battle-stage .combat-name{font-size:12px!important;line-height:15px;color:#fff4d9;text-shadow:0 1px 3px #2f211c}
#battle-screen.battle-stage .unit-phase{height:13px;width:13px;font-size:9px;line-height:13px}
#battle-screen.battle-stage .hp-line{height:4px;margin:0 3px;background:#211c1980;box-shadow:0 0 0 1px #f0dab126}
#battle-screen.battle-stage .hp-text{font-size:8px;height:11px;line-height:11px;color:#f0eadb}
#battle-screen.battle-stage .badge,#battle-screen.battle-stage .combat-card.active:after,#battle-screen.battle-stage .combat-card.targetable:after{display:none}
#battle-screen.battle-stage .combat-card.active .unit-hud{border-bottom:1px solid #ffe5aa;background:linear-gradient(90deg,transparent,#4f542add 18%,#4f542add 82%,transparent)}
#battle-screen.battle-stage .combat-card.targetable .unit-hud{border-bottom:1px solid #e9a381;background:linear-gradient(90deg,transparent,#563d30d9 18%,#563d30d9 82%,transparent)}
#battle-screen.battle-stage .player-label,.battle-stage .stage-touch-note{display:none}
#battle-screen.battle-stage .enemy-label{top:53px;left:12px;right:12px;max-width:none;justify-content:flex-end;font-size:9px;color:#443e29;text-shadow:0 1px 3px #fff7d4}
#battle-screen.battle-stage .enemy-label #enemy-intent{font-size:9px;color:#443e29}
#battle-screen.battle-stage #battle-objective-hud{top:8px;left:12px;width:calc(100% - 24px);max-width:none;height:38px;min-height:38px;display:grid;grid-template-columns:minmax(0,1fr) 72px 66px;gap:10px;padding:5px 9px;border:1px solid #69563145;border-radius:4px;background:#223a2bdc;color:#f7ebcf;box-shadow:0 2px 8px #513e2820}
#battle-screen.battle-stage .objective-copy{display:flex;flex-direction:column;justify-content:center;gap:1px}
#battle-screen.battle-stage .objective-kicker{font-size:7px;line-height:9px}
#battle-screen.battle-stage .objective-title{font-size:11px;line-height:14px}
#battle-screen.battle-stage .objective-tip{display:none}
#battle-screen.battle-stage .objective-break{grid-column:2;grid-row:1;align-self:center}
#battle-screen.battle-stage .objective-break>span{font-size:8px;line-height:11px}
#battle-screen.battle-stage .objective-break>i{height:3px;margin-top:3px}
#battle-screen.battle-stage .objective-danger{grid-column:3;grid-row:1;display:flex;align-items:center;justify-content:center;gap:4px;min-height:0;border:0;background:none}
#battle-screen.battle-stage .objective-danger strong{font-size:19px;line-height:23px}.battle-stage .objective-danger span,.battle-stage .objective-danger small{font-size:8px}
#battle-screen.battle-stage>.action-panel{padding:7px 0 10px;background:#162922}
#battle-screen.battle-stage .battle-decision{min-height:36px;font-size:11px;line-height:1.5}
#battle-screen.battle-stage .active-info{margin-top:0;min-height:22px}
#battle-screen.battle-stage #active-name{font-size:16px}
#battle-screen.battle-stage .resource-row{margin:4px 0 7px}
#battle-screen.battle-stage .skill-buttons .action-btn{min-height:62px;padding:8px 3px 5px;background:#2d4433;border-color:#cfb87866;box-shadow:inset 0 1px #efe0b413}
#battle-screen.battle-stage .utility-buttons{margin-top:7px}
#battle-screen.battle-stage .utility-buttons .action-btn{min-height:44px;padding:6px 3px;background:#20392e}
#battle-screen.battle-stage>.battle-stage-intel{background:#14271f;border-color:#c7b08033}
@media(max-width:359px){#battle-screen.battle-stage>.battle-header{min-height:104px;padding-block:8px}#battle-screen.battle-stage .battle-header>div:first-child{padding-bottom:42px}#battle-screen.battle-stage .battle-tools{top:50px;right:12px}#battle-screen.battle-stage .combat-name{font-size:11px!important}#battle-screen.battle-stage .unit-hud{width:92%;padding-inline:2px}#battle-screen.battle-stage .hp-text{font-size:7px}}
@media(min-width:900px){
 #battle-screen.battle-stage{grid-template-columns:minmax(0,1fr) 300px;column-gap:20px}
 #battle-screen.battle-stage>.arena{height:calc(100dvh - 80px);min-height:520px;max-height:780px;background-position:center 56%;border-color:#9c805344}
 #battle-screen.battle-stage .combat-card,#battle-screen.battle-stage #enemy-row .combat-card{width:25%;height:30%}
 #battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:47%;top:23%}
 #battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:71%;top:55%}
 #battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:70%;top:24%}
 #battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:2%;top:50%}
 #battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:25%;top:66%}
 #battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:28%;top:36%}
 #battle-screen.battle-stage #battle-objective-hud{width:44%;height:44px;top:14px;left:20px;grid-template-columns:minmax(0,1fr) 75px 66px}
 #battle-screen.battle-stage .enemy-label{left:50%;right:20px;top:21px;max-width:none}
 #battle-screen.battle-stage .combat-name{font-size:15px!important;line-height:18px}
 #battle-screen.battle-stage .unit-hud{max-width:154px;height:44px;min-height:44px;flex-basis:44px;grid-template-rows:18px 5px 13px;gap:2px;padding:3px 6px}
 #battle-screen.battle-stage .unit-title{min-height:18px}.battle-stage .unit-phase{width:16px;height:16px;line-height:16px}
 #battle-screen.battle-stage .hp-line{height:5px}#battle-screen.battle-stage .hp-text{font-size:10px;height:13px;line-height:13px}
 #battle-screen.battle-stage .skill-buttons .action-btn{min-height:74px;padding:10px 12px}#battle-screen.battle-stage .utility-buttons .action-btn{min-height:48px;padding:8px}
 #battle-screen.battle-stage>.action-panel,#battle-screen.battle-stage:not(.with-expedition)>.action-panel{padding-top:20px}
}
@media(min-width:700px) and (max-height:550px){
 #battle-screen.battle-stage>.battle-header{min-height:60px;padding-block:6px}
 #battle-screen.battle-stage>.arena{height:calc(100dvh - 60px);min-height:300px;max-height:none}
 #battle-screen.battle-stage .combat-card,#battle-screen.battle-stage #enemy-row .combat-card{width:23%;height:34%;min-height:0;max-height:none}
 #battle-screen.battle-stage #enemy-row .combat-card:nth-child(1){left:49%;top:24%}
 #battle-screen.battle-stage #enemy-row .combat-card:nth-child(2){left:75%;top:40%}
 #battle-screen.battle-stage #enemy-row .combat-card:nth-child(3){left:67%;top:65%}
 #battle-screen.battle-stage #player-row .combat-card:nth-child(1){left:2%;top:46%}
 #battle-screen.battle-stage #player-row .combat-card:nth-child(2){left:25%;top:65%}
 #battle-screen.battle-stage #player-row .combat-card:nth-child(3){left:24%;top:25%}
 #battle-screen.battle-stage #battle-objective-hud{top:6px;left:10px;width:48%;height:36px;min-height:36px;grid-template-columns:minmax(0,1fr) 52px 52px;gap:5px;padding:4px 6px}
 #battle-screen.battle-stage .enemy-label{left:51%;right:10px;top:8px;max-width:none;display:block;text-align:right}#battle-screen.battle-stage .enemy-label span{display:block}
 #battle-screen.battle-stage .combat-name{font-size:11px!important;line-height:14px}#battle-screen.battle-stage .unit-hud{height:34px;min-height:34px;flex-basis:34px;grid-template-rows:14px 4px 10px;gap:2px;padding:2px}
 #battle-screen.battle-stage .unit-title{min-height:14px}#battle-screen.battle-stage .hp-text{height:10px;line-height:10px;font-size:8px}
 #battle-screen.battle-stage .skill-buttons .action-btn{min-height:68px;padding:5px 2px}#battle-screen.battle-stage .utility-buttons .action-btn{min-height:44px;padding:4px 2px}
 #battle-screen.battle-stage>.action-panel,#battle-screen.battle-stage:not(.with-expedition)>.action-panel{padding-top:5px}
}

/* v4.3.2: readable health and explicit selection without covering beast artwork. */
#battle-screen.battle-stage .unit-hud{height:40px;min-height:40px;flex-basis:40px;grid-template-rows:15px 4px 13px;gap:2px;padding:2px 3px}
#battle-screen.battle-stage .unit-title{gap:3px}
#battle-screen.battle-stage .stage-unit-state{flex:none;padding:0 3px;border-radius:2px;background:#122a22;color:#f3e5c7;font:600 10px/15px system-ui;white-space:nowrap;text-shadow:none}
#battle-screen.battle-stage .stage-unit-state[hidden]{display:none}
#battle-screen.battle-stage [data-stage-unit-state="active"] .stage-unit-state{background:#f2d89f;color:#302714}
#battle-screen.battle-stage [data-stage-unit-state="target"] .stage-unit-state{background:#f1c8ad;color:#402619}
#battle-screen.battle-stage [data-stage-unit-state="spent"] .stage-unit-state{background:#34483b;color:#d7dfd0}
#battle-screen.battle-stage .combat-card.active .unit-hud{border-bottom:2px solid #ffe5aa;background:linear-gradient(90deg,transparent,#3e4924f0 12%,#3e4924f0 88%,transparent)}
#battle-screen.battle-stage .combat-card.targetable .unit-hud{border-bottom:2px solid #efb691;background:linear-gradient(90deg,transparent,#51372df0 12%,#51372df0 88%,transparent)}
#battle-screen.battle-stage .hp-text{display:flex;justify-content:center;align-items:center;gap:3px;font-size:11px;height:13px;line-height:13px;color:#fff3dc;font-variant-numeric:tabular-nums}
#battle-screen.battle-stage .stage-health-value{flex:none;white-space:nowrap}
#battle-screen.battle-stage .stage-health-status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#e5e8d8;font-size:10px}
#battle-screen.battle-stage .stage-health-status[hidden]{display:none}
@media(max-width:359px){
 #battle-screen.battle-stage>.battle-header{min-height:64px;display:flex;gap:4px;padding-block:7px}
 #battle-screen.battle-stage .battle-header>div:first-child{padding-bottom:0}
 #battle-screen.battle-stage .battle-header h2{font-size:20px!important;letter-spacing:.04em}
 #battle-screen.battle-stage .battle-header .eyebrow{font-size:9px;letter-spacing:0}
 #battle-screen.battle-stage .battle-tools{position:static;grid-template-columns:repeat(4,44px);gap:3px}
 #battle-screen.battle-stage #battle-motion-btn{width:44px;min-width:44px;padding-inline:0;font-size:11px}
 #battle-screen.battle-stage .unit-hud{width:96%;padding-inline:2px}
 #battle-screen.battle-stage .unit-title{gap:2px}
 #battle-screen.battle-stage .stage-unit-state{padding-inline:2px}
 #battle-screen.battle-stage .skill-buttons .action-btn{min-height:62px;padding:5px 2px;gap:2px}
 #battle-screen.battle-stage .skill-buttons .action-btn>b{line-height:18px}
 #battle-screen.battle-stage .skill-buttons .action-btn small{line-height:14px}
 #battle-screen.battle-stage .skill-short{line-height:12px}
 #battle-screen.battle-stage .utility-buttons{margin-top:6px}
 #battle-screen.battle-stage .utility-buttons .action-btn{min-height:44px;padding:4px 2px}
}
@media(max-width:359px) and (max-height:650px){
 #battle-screen.battle-stage>.arena{height:272px;min-height:272px}
 #battle-screen.battle-stage>.action-panel{padding-top:4px;padding-bottom:6px}
 #battle-screen.battle-stage .resource-row{margin-top:2px;margin-bottom:5px}
}
@media(min-width:900px){
 #battle-screen.battle-stage .unit-hud{height:46px;min-height:46px;flex-basis:46px;grid-template-rows:18px 5px 15px;padding:2px 5px}
 #battle-screen.battle-stage .stage-unit-state{font-size:11px;line-height:17px}
 #battle-screen.battle-stage .hp-text{font-size:12px;height:15px;line-height:15px}
}
