.battle-dialog{width:min(1280px,97vw);max-height:96vh;max-height:96dvh;padding:0;background:#04101f;color:#e4f5ff;border:2px solid #4b839d;border-radius:16px;box-shadow:0 20px 100px #000e;font:14px Segoe UI,Arial,sans-serif}
.battle-dialog::backdrop{background:#01070ed9;backdrop-filter:blur(5px)}
.field-collision-dialog.field-battle-floating{position:fixed;inset:auto 12px 12px auto;margin:0;width:min(760px,calc(100vw - 24px));max-height:min(70dvh,720px);z-index:1000}
@media(max-width:600px){.field-collision-dialog.field-battle-floating{inset:auto 8px 8px auto;width:min(340px,calc(100vw - 16px));max-height:58dvh}}
.battle-dialog header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:17px 22px;border-bottom:2px solid #2a87b3;background:#0d293d}
.battle-dialog h2{margin:0 0 6px;font-size:20px;color:#c4edff}.battle-dialog h3{margin:0 0 12px;color:#8fe4ff;font-size:16px}.battle-dialog small{color:#a5c2d5;font-size:11px}
.battle-dialog button,.battle-dialog select,.battle-dialog input{font:inherit;color:#e5f7ff;border:1px solid #397c9d;background:#10354e;border-radius:7px;padding:10px}.battle-dialog button{cursor:pointer}.battle-dialog button:disabled{opacity:.4;cursor:default}.battle-dialog button:hover:enabled{border-color:#9eeeff;background:#175775}
.battle-message{color:#ffcb8b;min-height:18px;padding:0 20px;margin:12px 0}.battle-content{padding:0 20px 20px}
.battle-formation-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px}.battle-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.battle-grid .battle-cell{min-height:130px;min-width:0;padding:8px;text-align:center;background:linear-gradient(145deg,#10374c99,#031020cc);border:1px solid #28546d;border-radius:11px;color:#dff5ff;overflow:hidden}
.battle-grid .battle-cell.selected{border:2px solid #ffce83}.battle-cell strong{display:block;font-size:13px;overflow-wrap:anywhere}.battle-cell svg{display:block;width:100%;height:70px;pointer-events:none}.battle-cell small{display:block;line-height:1.5}.battle-cell .quantity{color:#ffe29e;font-weight:bold;display:block;margin:3px 0}.battle-grid .empty{display:grid;place-content:center;color:#557e99;border-style:dashed}.battle-grid .empty span{font-size:28px}.battle-edit{padding:16px;background:#0b2337;border:1px solid #315b75;border-radius:12px;align-self:start}.battle-edit label{display:block;margin:14px 0 7px;color:#a8c8dc}.battle-edit input,.battle-edit select{width:100%}.battle-edit button{width:100%;margin-top:10px}.battle-start{background:#986123!important;border-color:#ddad6b!important;font-weight:700}.battle-edit p,.battle-rules{font-size:12px;color:#9bbdd2;line-height:1.7}.battle-rules{padding:13px;background:#091d2c;border-radius:8px;margin:12px 0}
.battle-arena{position:relative;padding:24px 16px;background:radial-gradient(ellipse at 65% 30%,#21455c77,transparent 40%),radial-gradient(ellipse at 20% 76%,#24375888,transparent 48%),radial-gradient(circle,#a2d7ff88 1px,transparent 1.6px) 0 0/101px 89px,#030c17;border:1px solid #294b65;border-radius:13px}.battle-teams{display:grid;grid-template-columns:1fr 1fr;gap:55px}.battle-team.enemy{padding-top:80px}.battle-team .battle-grid{gap:7px}.battle-team .battle-cell{min-height:150px}.battle-grid .active-unit{border:2px solid #ffdd87;box-shadow:0 0 17px #ffcf5533}.battle-grid .targetable{border-color:#ff9c88;cursor:crosshair}.battle-grid .targetable:hover{box-shadow:0 0 22px #ff674e66}.battle-cell.destroyed{opacity:.25;filter:grayscale(1)}.battle-cell progress{display:block;width:100%;height:6px;margin-top:5px;accent-color:#59d598}.battle-cell .shield-bar{accent-color:#46b8ec}.battle-score{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;margin-bottom:15px;color:#aee1f2}.battle-score b{color:#ffe09a}.battle-actions{display:flex;gap:9px;flex-wrap:wrap;margin:15px 0}.battle-actions .battle-auto.active{background:#206452}.battle-log{max-height:170px;overflow:auto;background:#071827;border:1px solid #24465f;border-radius:8px;padding:12px;color:#9fbbd0;font-size:12px;line-height:1.8}.battle-result{padding:16px;margin:15px 0;background:#102f3f;border:1px solid #47978e;border-radius:10px}.battle-result h3{color:#ffdf9d}.battle-result p{color:#aacddd;font-size:13px;line-height:1.7}.battle-loot{display:flex;gap:8px;flex-wrap:wrap}.battle-loot span{padding:9px;border:1px solid #45728b;border-radius:6px;background:#071c2b;color:#b0eaff;font-size:12px}.battle-turn{color:#ffdc9c;font-weight:600;margin:12px 0}.battle-grid-labels{display:flex;justify-content:space-between;color:#79abc8;font-size:11px;padding:8px 0}
.battle-team .battle-cell:disabled{opacity:1;cursor:default}.battle-team .battle-cell.destroyed:disabled{opacity:.25}
@media(max-width:800px){.battle-formation-layout{grid-template-columns:1fr}.battle-edit{display:block}.battle-teams{grid-template-columns:1fr;gap:22px}.battle-team.enemy{padding-top:0}.battle-cell svg{height:60px}.battle-grid .battle-cell{min-height:120px}.battle-content{padding:0 10px 15px}.battle-arena{padding:15px 8px}.battle-dialog h2{font-size:16px}}
@media(max-width:1100px){.battle-formation-layout{grid-template-columns:minmax(0,1fr) 260px}.battle-teams{gap:30px}.battle-team .battle-cell{min-height:130px}.battle-cell svg{height:64px}.battle-dialog header{padding:13px 16px}.battle-content{padding:0 14px 16px}}
@media(max-width:560px){.battle-dialog{width:100vw;max-height:98vh;max-height:98dvh;border-radius:0;border-left:0;border-right:0}.battle-dialog header{padding:11px 12px}.battle-dialog h2{font-size:14px}.battle-dialog small{font-size:10px}.battle-message{padding:0 12px}.battle-teams{gap:14px}.battle-team .battle-cell{min-height:96px;padding:6px}.battle-cell svg{height:52px}.battle-cell strong{font-size:11px}.battle-cell .quantity{font-size:13px}.battle-grid{gap:6px}.battle-edit{padding:12px}.battle-edit label{margin:10px 0 5px}.battle-actions button{flex:1;min-width:130px}.battle-log{max-height:120px;font-size:11px}.battle-result{padding:12px}.battle-score{gap:8px;font-size:12px}}

.battle-team.enemy svg{filter:hue-rotate(135deg)} .battle-grid .hit-unit{animation:battle-hit .5s ease-out} @keyframes battle-hit{from{box-shadow:inset 0 0 40px #ff9d6588}to{box-shadow:none}} @media(prefers-reduced-motion:reduce){.battle-grid .hit-unit{animation:none}}


.instance-unified{padding:12px;border:1px solid #286087;border-radius:8px;background:#071a2b;margin-bottom:12px}.instance-unified button[aria-pressed="true"]{background:#165679;border-color:#75e5ff;color:#fff}.instance-unified details{margin-top:8px;max-height:200px;overflow:auto}.instance-unified p{color:#bdd5e6;font-size:13px}
.instance-preparation .fleet-owner-picker nav{display:flex;gap:8px;overflow-x:auto;padding:8px 0}
.instance-preparation .fleet-owner-picker nav button{flex:0 0 135px;display:grid;justify-items:center;gap:4px}
.instance-preparation .fleet-owner-picker nav button[aria-pressed="true"]{border-color:#75e5ff;background:#165679}
.instance-preparation .fleet-owner-picker img,.instance-preparation .fleet-owner-picker svg{width:54px;height:54px;object-fit:contain}
.instance-preparation .fleet-command-strip{display:flex;align-items:center;gap:12px;margin:10px 0;flex-wrap:wrap}
.instance-preparation .fleet-command-strip>img,.instance-preparation .fleet-command-strip>svg{width:64px;height:64px;object-fit:contain}
.instance-preparation .fleet-command-strip strong,.instance-preparation .fleet-command-strip small{display:block}
.instance-preparation .fleet-hostile{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:12px}
.instance-preparation .fleet-hostile img{width:48px;height:48px}
.instance-preparation .fleet-editor-layout{display:grid;grid-template-columns:200px minmax(0,1fr) 240px;gap:14px;align-items:start}
.instance-preparation .fleet-overview{padding:12px;background:#0b2337;border-radius:10px}
.instance-preparation .fleet-overview input{width:100%;box-sizing:border-box;margin:8px 0}
.instance-preparation .fleet-overview dl{display:grid;grid-template-columns:1fr auto;gap:5px;margin:10px 0}
.instance-preparation .fleet-overview dd{margin:0;text-align:right}
.instance-preparation .fleet-overview button{width:100%;margin:4px 0}
.instance-preparation .fleet-overview [hidden]{display:none}
.instance-preparation .fleet-layout-tools{margin-top:12px}
.instance-preparation .fleet-palette{margin-top:14px}
.instance-preparation .fleet-palette>div{display:flex;gap:8px;overflow-x:auto}
.instance-preparation .fleet-palette button{flex:0 0 150px;display:grid;justify-items:center;gap:4px}
.instance-preparation .fleet-palette svg{width:95px;height:55px}
.instance-preparation .fleet-palette p,.instance-preparation .fleet-steps{font-size:12px;color:#bdd5e6}
.instance-deployment{margin:12px 0;padding:12px;border:1px solid #397c9d;border-radius:8px}
.instance-deployment>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;max-height:240px;overflow:auto}
.instance-deployment label{display:flex;align-items:center;gap:10px;background:#10354e;padding:8px;border-radius:6px}
.instance-deployment input{width:20px;height:20px;accent-color:#63d6ef;flex-shrink:0}
.instance-deployment strong,.instance-deployment small{display:block}
.instance-deployment .battle-start{min-width:160px;margin-top:10px}
/* The challenge chart leads; deployment remains beside it in the same flow. */
.instance-preparation{--instance-accent:#86dff0;--instance-gold:#f0c778;scrollbar-color:#326581 #071a2b}
.instance-preparation .instance-unified{padding:0;border:0;background:none;margin-bottom:32px}
.instance-preparation .instance-tabs{gap:8px;margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid #2c5068;flex-wrap:wrap}
.instance-preparation .instance-tabs button{min-height:44px;font-size:14px;background:#102d43;flex:1 1 120px}
.instance-preparation .instance-tabs button[aria-pressed=true]{background:#174a65;border-color:var(--instance-accent);color:#ecfbff}
.instance-command-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:28px;align-items:start}
.instance-map-panel,.instance-launch-panel{min-width:0}
.instance-preparation .instance-command-layout h3{font-size:21px;font-weight:600;color:#e0f5ff;margin:0 0 16px}
.instance-preparation .instance-chart{width:min(100%,560px);height:auto;aspect-ratio:500/560;margin-inline:auto;box-sizing:border-box;border:1px solid #31759c;border-radius:12px}
.instance-preparation .instance-chart.mode-trial{border-color:#8172b2}
.instance-preparation .instance-chart.mode-restricted{border-color:#a17c48}
.instance-preparation .instance-chart.mode-constellations{border-color:#4697bb}
.instance-preparation .instance-chart.mode-normal .instance-node{width:44px;height:44px;clip-path:none;background:none!important;isolation:isolate;filter:none;font-size:13px!important}
.instance-preparation .instance-chart.mode-normal .instance-node::after{content:none}
.instance-preparation .instance-chart.mode-normal .instance-node::before{inset:6px;clip-path:polygon(25% 0,75% 0,100% 25%,100% 75%,75% 100%,25% 100%,0 75%,0 25%);background:#123c55;border:1px solid #6bc7dc}
.instance-preparation .instance-chart.mode-normal .instance-node:hover::before{background:#235f78}
.instance-preparation .instance-chart.mode-normal .instance-node[aria-pressed=true]::before{background:#79552a;border:2px solid var(--instance-gold)}
.instance-preparation .instance-chart.mode-normal .instance-node[aria-pressed=true]{color:#fff1cf!important;font-weight:800!important;text-decoration:underline;text-underline-offset:3px}
.instance-preparation .instance-page{color:#a9cbdc;padding-top:12px;font-variant-numeric:tabular-nums}
.instance-preparation .instance-launch-panel>p{margin:0 0 20px;line-height:1.65}
.instance-preparation .instance-deployment{padding:0;border:0;margin:0 0 24px;min-width:0}
.instance-preparation .instance-deployment legend{font-size:15px;font-weight:600;padding:0 0 12px;color:#e0f5ff;font-variant-numeric:tabular-nums}
.instance-preparation .instance-deployment>div{display:block;max-height:340px;scrollbar-color:#326581 #071a2b}
.instance-preparation .instance-deployment label{min-height:52px;padding:10px 4px;background:none;border-bottom:1px solid #24435b;border-radius:0;box-sizing:border-box}
.instance-preparation .instance-deployment label:has(input:checked){background:#103449}
.instance-preparation .instance-deployment small{line-height:1.6;color:#b7d2e3;overflow-wrap:anywhere}
.instance-preparation .instance-deployment p{line-height:1.6;margin:12px 0}
.instance-preparation .instance-deployment .battle-start{display:block;width:100%;min-height:52px;margin:20px 0 0;background:#d7ad61!important;border-color:#f0d599!important;color:#152332;font-size:20px;letter-spacing:.04em}
.instance-preparation .instance-mission-rewards{padding-top:16px;border-top:1px solid #2c5068;max-height:280px;scrollbar-color:#326581 #071a2b}
.instance-preparation .instance-mission-rewards summary{min-height:44px;display:list-item;cursor:pointer;color:#d9eff9;font-size:14px}
.instance-preparation :focus-visible{outline:2px solid #f0c778;outline-offset:3px}
.instance-preparation ::selection{background:#275e7a;color:#fff}
.instance-preparation input{caret-color:#86dff0}
@media(max-width:800px){.instance-command-layout{grid-template-columns:minmax(0,1fr);gap:28px}.instance-preparation .instance-chart{max-width:500px}.instance-preparation .instance-tabs{gap:6px;margin-bottom:20px}.instance-preparation .instance-tabs button{flex-basis:40%;font-size:13px}.instance-preparation .instance-deployment>div{max-height:280px}}
@media(max-width:760px){.instance-preparation .instance-chart.mode-constellations .constellation-node{width:58px;height:66px;font-size:33px!important}}
@media(max-width:900px){.instance-preparation .fleet-editor-layout{grid-template-columns:minmax(0,1fr) 240px}.instance-preparation .fleet-overview{grid-column:1/-1}.instance-preparation .fleet-overview dl{grid-template-columns:repeat(3,1fr auto)}}
@media(max-width:600px){.instance-preparation .fleet-editor-layout{grid-template-columns:minmax(0,1fr)}.instance-preparation .fleet-overview dl{grid-template-columns:1fr auto}.instance-preparation .fleet-hostile{margin-left:0}.instance-preparation .fleet-owner-picker input{max-width:100%;box-sizing:border-box}}
