/* Approved battle composition. These rules apply only during combat. */
body[data-screen=battle] .console,body[data-screen=witch-team] .console{grid-template-columns:minmax(0,1fr)}
body[data-screen=battle] .journal,body[data-screen=witch-team] .journal{display:none}
body[data-screen=battle] .play-column{grid-template-rows:26px minmax(0,1fr) auto}
body[data-screen=battle] .viewport{background:var(--theme-accent)}
body[data-screen=battle] #world{opacity:0}
body[data-screen=battle] .dialog{position:relative;z-index:8;padding:12px 18px 13px;background:var(--theme-paper);border-top:2px solid var(--theme-line);color:var(--theme-ink)}
body[data-screen=battle] .dialog>.dialog-label{display:none}
body[data-screen=battle] .battle-scene{display:block;padding:0;background-size:cover;background-position:center;color:#164a51}
body[data-screen=battle] .battle-scene[data-region=City]{background-image:linear-gradient(#091e3008,#091e3020),url('assets/battle-city-v1.webp')}
body[data-screen=battle] .battle-scene:after{background:linear-gradient(#07172525,transparent 30%,#16202910);opacity:1}
body[data-screen=battle] .battle-top{display:flex;position:absolute;inset:15px 20px auto;gap:20px;align-items:flex-start;justify-content:space-between;z-index:6}
body[data-screen=battle] .combat-card{width:min(40%,560px);padding:12px 17px 10px;background:rgb(var(--theme-paper-rgb) / 0.9608);border:2px solid var(--theme-line);border-radius:18px;box-shadow:0 0 0 3px rgb(var(--theme-shadow-rgb) / 0.7020),0 10px 25px rgb(var(--theme-shadow-rgb) / 0.2510);min-width:0}
body[data-screen=battle] .pawn-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}
body[data-screen=battle] .combat-card h2{font:800 clamp(20px,2.2vw,34px)/1.08 Georgia,serif;color:var(--theme-ink);overflow-wrap:anywhere;margin:0 0 3px}
body[data-screen=battle] .combat-card p{font-size:11px;margin:0;color:var(--theme-ink);line-height:1.3}
body[data-screen=battle] .hp-readout{flex:0 0 auto;text-align:right}
body[data-screen=battle] .hp-readout span{display:block;font:700 8px/1.2 'Segoe UI',sans-serif;letter-spacing:1.1px;color:var(--theme-muted);margin-bottom:4px}
body[data-screen=battle] .hp-readout strong{display:block;font:800 clamp(16px,1.8vw,27px)/1.1 Georgia,serif;white-space:nowrap;color:var(--theme-ink)}
body[data-screen=battle] .combat-card .bar{height:12px;margin:9px 0 0;padding:0;background:#c9c7b6;border:1px solid #739b91;border-radius:7px;overflow:hidden}
body[data-screen=battle] .combat-card .bar>span{background:linear-gradient(#1da29e,#087b83)}
body[data-screen=battle] .combat-card.capture-ready #enemy-bar{background:var(--theme-accent)}
body[data-screen=battle] .combat-card.capture-ready #enemy-hp{color:var(--theme-muted)}
body[data-screen=battle] .battle-art{position:absolute;inset:104px 3% 8px;width:auto;height:auto;min-height:0}
body[data-screen=battle] .battle-art:before{display:none}
body[data-screen=battle] .battle-art .ally-sprite,body[data-screen=battle] .battle-art .enemy-sprite{height:calc(100% - 30px);width:43%;bottom:0;aspect-ratio:auto;filter:drop-shadow(0 13px 9px #09172866) drop-shadow(0 -2px 4px #ffe3a328);object-fit:contain;image-rendering:auto}
body[data-screen=battle] .battle-art .ally-sprite{left:1%;right:auto}
body[data-screen=battle] .battle-art .enemy-sprite{right:1%;left:auto}
body[data-screen=battle] .move-caption{top:0;background:rgb(var(--theme-accent-rgb) / 0.8118);border:1px solid rgb(var(--theme-line-rgb) / 0.4000);color:var(--theme-paper);font-size:11px;letter-spacing:.5px;padding:5px 12px;max-width:42%}
body[data-screen=battle] .battle-ground{position:absolute;bottom:7px;left:0;right:0;text-align:center;color:var(--theme-paper);font-size:9px;text-shadow:0 1px 3px var(--theme-shadow);min-height:0}
.battle-dock{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr) minmax(190px,.8fr);gap:18px;align-items:start;min-width:0}
.battle-dock h2{font:700 10px/1.25 'Segoe UI',sans-serif;text-transform:uppercase;letter-spacing:1.7px;color:var(--theme-ink);margin:0 0 10px}
.typing-bubble{position:relative;background:var(--theme-paper);border:1.5px solid var(--theme-line);border-radius:15px;padding:11px 14px 9px;box-shadow:0 3px 8px rgb(var(--theme-shadow-rgb) / 0.0706);min-width:0}
.typing-bubble:before{content:'';position:absolute;left:32px;top:-9px;width:16px;height:16px;border-left:1.5px solid var(--theme-line);border-top:1.5px solid var(--theme-line);background:var(--theme-paper);transform:rotate(45deg)}
.bubble-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.bubble-heading h2{margin:0}
.send-button{padding:3px 5px;color:var(--theme-ink);background:transparent;border:0;font-size:9px;white-space:nowrap}
.send-button kbd{font-size:8px;padding:2px 4px;min-width:0;margin-right:4px}
body[data-screen=battle] .typing-prompt,body[data-screen=battle] .typing-prompt.story{font:600 clamp(15px,1.6vw,22px)/1.45 Georgia,serif;color:var(--theme-ink);white-space:pre-wrap;min-height:34px;max-height:92px;overflow:auto;letter-spacing:0;overflow-wrap:normal}
body[data-screen=battle] .typing-prompt span{white-space:pre-wrap}
body[data-screen=battle] .typing-prompt .correct{color:#197974}
body[data-screen=battle] .typing-prompt .caret{border-bottom:2px solid var(--theme-line)}
body[data-screen=battle] .typing-prompt .wrong{background:#b73b3c;color:#fff9e9;border-bottom-color:#9c2b30}
body[data-screen=battle] .input-display{font:10px/1.35 Consolas,monospace;white-space:pre-wrap;overflow:auto;max-height:30px;min-height:13px;color:var(--theme-ink);margin:5px 0 0}
body[data-screen=battle] #battle-notice{font-size:10px;line-height:1.3;min-height:0;margin-top:4px;color:var(--theme-muted)}.opponent-moves{padding-top:3px;min-width:0}
.opponent-moves{padding-left:16px;border-left:1px solid var(--theme-line)}
.opponent-move{margin-bottom:6px}
.opponent-move>strong{display:block;font:700 15px/1.15 Georgia,serif;color:var(--theme-ink);overflow-wrap:anywhere}
.opponent-move>span{font:10px/1.3 'Segoe UI',sans-serif;color:var(--theme-ink)}
.opponent-move b{color:var(--theme-ink);font-size:12px}
body[data-screen=battle] .battle-actions{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 3px}
body[data-screen=battle] .battle-actions button{font-size:10px;padding:5px 8px;border:1px solid var(--theme-line);border-radius:6px;background:var(--theme-paper);color:var(--theme-ink);min-height:29px}
body[data-screen=battle] .battle-actions button.active{background:var(--theme-accent);color:var(--theme-paper);border-color:var(--theme-accent);box-shadow:0 0 0 2px rgb(var(--theme-shadow-rgb) / 0.3333)}
body[data-screen=battle] .battle-actions button:disabled{background:var(--theme-surface);color:var(--theme-muted);opacity:.8;border-color:var(--theme-line);cursor:default}
body[data-screen=battle] #capture-status{font:9px/1.3 'Segoe UI',sans-serif;min-height:0;margin:3px 0;color:var(--theme-ink)}
@media(max-width:1100px){.battle-dock{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) minmax(180px,.8fr);gap:12px}.opponent-moves{padding-left:11px}body[data-screen=battle] .dialog{padding:10px 12px}.typing-bubble{padding:9px 10px}.battle-dock h2{font-size:9px;letter-spacing:1.1px}}
@media(max-width:800px){.battle-dock{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:10px}.opponent-moves{grid-column:1/-1;display:grid;grid-template-columns:1fr auto;gap:5px 12px;border-left:0;border-top:1px solid var(--theme-line);padding:7px 0 0}.opponent-moves h2{grid-column:1;margin:0}.opponent-move{grid-column:1;display:inline-block;margin:0}.opponent-move>strong{display:inline;font-size:12px;margin-right:6px}.opponent-move>span{font-size:9px}.opponent-moves .battle-actions{grid-column:2;grid-row:1/4;margin:0;align-self:center}.opponent-moves #capture-status{grid-column:1/-1;margin:0}body[data-screen=battle] .combat-card{padding:9px 11px;width:44%;border-radius:12px}body[data-screen=battle] .battle-top{inset:11px 13px auto;gap:15px}body[data-screen=battle] .pawn-heading{gap:7px}body[data-screen=battle] .combat-card h2{font-size:20px}body[data-screen=battle] .hp-readout strong{font-size:18px}body[data-screen=battle] .battle-art{inset:95px 2% 8px}}
@media(max-height:700px) and (min-width:801px){body[data-screen=battle] .masthead{min-height:30px}body[data-screen=battle] .brand-logo{width:136px;height:auto}body[data-screen=battle] .masthead h1{font-size:18px}body[data-screen=battle] .edition{display:none}body[data-screen=battle] .run-hud{padding:6px 14px}body[data-screen=battle] #run-time{font-size:24px}body[data-screen=battle] .dialog{padding:8px 14px}.typing-bubble{padding:8px 11px}body[data-screen=battle] .typing-prompt,body[data-screen=battle] .typing-prompt.story{font-size:17px;max-height:77px}body[data-screen=battle] .battle-top{inset:10px 16px auto}body[data-screen=battle] .combat-card{padding:9px 13px 8px}body[data-screen=battle] .combat-card h2{font-size:23px}body[data-screen=battle] .battle-art{inset:87px 3% 8px}}

/* Long rare-opponent sentences wrap and scroll inside the typing bubble. */
.typing-prompt{overflow-wrap:anywhere;max-height:clamp(110px,20vh,200px);overflow-y:auto;scrollbar-gutter:stable}
.capture-choice #defeated-portrait{text-align:center}.capture-choice #defeated-portrait canvas{max-width:100%;height:auto}

.capture-progress{font:12px/1.5 system-ui;color:var(--theme-ink);margin:5px 0}.capture-full-story{font:12px/1.6 system-ui;margin:6px 0}.capture-full-story summary{cursor:pointer;color:var(--theme-ink)}.capture-full-story p{max-height:160px;overflow-y:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0}

.attack-result{position:absolute;z-index:7;left:50%;top:36px;transform:translateX(-50%);display:grid;justify-items:center;gap:2px;min-width:108px;padding:9px 17px;border:1px solid var(--theme-line);border-radius:12px;color:var(--theme-ink);background:rgb(var(--theme-paper-rgb) / 0.9373);box-shadow:0 4px 16px rgb(var(--theme-shadow-rgb) / 0.1882);pointer-events:none}.attack-result strong{font:800 32px/1 Georgia,serif}.attack-result span{font:600 10px/1.4 system-ui}.attack-result.miss{color:var(--theme-ink);border-color:var(--theme-line)}.attack-result.fresh{animation:attack-result-pop 380ms ease-out}.attack-result[hidden]{display:none}@keyframes attack-result-pop{0%{opacity:0;transform:translateX(-50%) scale(.82)}45%{opacity:1;transform:translateX(-50%) scale(1.08)}100%{opacity:1;transform:translateX(-50%) scale(1)}}@media(prefers-reduced-motion:reduce){.attack-result.fresh{animation:none}} 

.regional-villain-portrait{width:144px;height:144px;display:block;margin:0 auto 12px;image-rendering:auto}

body[data-screen=battle] .battle-owner-portrait{position:absolute;left:2%;bottom:1%;width:58px;height:58px;z-index:5;pointer-events:none;image-rendering:auto}body[data-screen=battle] .move-caption{padding-left:0;text-transform:none}

.lesson-cue{font-size:.8rem;line-height:1.4;margin:.35rem 0;color:#536455}.lesson-cue strong{font-weight:700}
