/* Approved map v1 / battle v4. Scoped so story, results and cinematics retain their own layouts. */
.bridge-map,.bridge-battle { container-type:size; padding:0; font-family:var(--font-rounded-ja); --ui-cyan:#73e7ff; --ui-line:#6bc9ef70; }
.bridge-map img,.bridge-battle img,.bridge-battle canvas { image-rendering:auto; }
.bridge-map button:focus-visible,.bridge-battle button:focus-visible,.bridge-menu button:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.bridge-menu-button { min-width:44px; min-height:36px; border:1px solid #6391b780; border-radius:7px; background:#071528dc; color:#e5f6ff; padding:6px 14px; font-size:clamp(13px,1.2cqw,19px); cursor:pointer; }
.bridge-menu-button:hover { border-color:#91eaff; background:#143247; }
.bridge-menu { position:absolute; inset:0; z-index:150; display:grid; place-items:center; background:#010711ce; backdrop-filter:blur(12px); }
.bridge-menu>div { width:min(330px,80vw); padding:25px; border:1px solid #73d9ff8c; border-radius:14px; background:linear-gradient(135deg,#142d49,#060d1d); display:grid; gap:12px; }
.bridge-menu h2 { margin:0 0 10px; }.bridge-menu small { color:#80cce9; letter-spacing:.12em; font-size:11px; }
.bridge-menu .btn { min-height:44px; }
.bridge-icon { width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linejoin:round; stroke-linecap:round; flex-shrink:0; }

/* MAP — fixed three-lane grid, restrained labels, crisp vector route lines. */
.bridge-map .bridge-map-surface { position:absolute; inset:0; width:100%; height:100%; min-height:0; margin:0; overflow:hidden; border:0; border-radius:0; background-color:#020914; }
.bridge-map .space-map::after { pointer-events:none; background:linear-gradient(180deg,#02071380,transparent 34%,transparent 74%,#01071377); }
.bridge-map-heading { position:absolute; z-index:12; top:max(18px,env(safe-area-inset-top)); left:max(24px,env(safe-area-inset-left)); right:max(18px,env(safe-area-inset-right)); display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.map-heading-text { border-left:2px solid #6aebff; padding-left:16px; text-shadow:0 2px 9px #000; min-width:0; }
.map-heading-text small { color:#c0d5ed; font-size:clamp(12px,1.55cqw,23px); letter-spacing:.08em; }
.map-heading-text h1 { margin:8px 0 4px; font-size:clamp(18px,2.6cqw,39px); line-height:1.2; letter-spacing:.045em; }
.map-tools { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.bridge-map .map-status-window { position:static; display:flex; width:auto; min-width:0; padding:9px 16px; gap:17px; align-items:center; border-radius:40px; background:#041126b8; border:1px solid #6190b76b; box-shadow:none; }
.bridge-map .map-status-title { order:2; border:0; margin:0; padding:0 0 0 12px; border-left:1px solid #66819e; font-size:12px; }
.bridge-map .map-status-title>span { display:none; }.bridge-map .map-status-title small { font-size:13px; color:#c7eafa; }
.bridge-map .map-status-row { display:flex; align-items:center; gap:9px; font-size:clamp(12px,1.15cqw,18px); margin:0; padding:0; background:none; }
.bridge-map .map-status-row b { font-size:clamp(16px,1.55cqw,24px); font-style:italic; color:#e6f0ff; }
.bridge-map .focused-route { position:absolute; inset:12% 0 8%; width:100%; height:80%; display:block; min-width:0; padding:0; margin:0; transform:translate(0,0); z-index:4; }
.bridge-map .focused-route.route-moving { transform:translate(var(--route-x,0px),var(--route-y,0px)); transition:transform .7s cubic-bezier(.42,0,.18,1); }
.bridge-map .route-network { position:absolute; width:100%; height:100%; inset:0; overflow:visible; pointer-events:none; }
.route-network path { fill:none; vector-effect:non-scaling-stroke; stroke-width:1.5; }
.route-network .route-active { stroke:#8df2ff; filter:drop-shadow(0 0 5px #48d8ff); }
.route-network .route-future { stroke:#b1c8dc50; stroke-dasharray:2 7; stroke-linecap:round; }
.bridge-map .branch-cluster { position:absolute; inset:0; display:block; width:100%; height:100%; min-width:0; margin:0; transform:none; pointer-events:none; }
.bridge-map .node.current { --pad:clamp(62px,10cqw,150px); position:absolute; left:41%; top:var(--node-y); width:34%; min-width:0; height:var(--pad); margin:0; padding:0; transform:translateY(-50%); display:flex; align-items:center; gap:8px; border:0; background:none; box-shadow:none; border-radius:0; text-align:left; animation:none; overflow:visible; pointer-events:auto; }
.bridge-map .node::before,.bridge-map .node::after { content:none; }
.bridge-map .node.current:not(:focus-visible) { outline:none; }
.bridge-map .node.current { filter:none; }
.bridge-map .space-map::before { background:radial-gradient(ellipse at center,transparent 45%,#020a1770); }
.bridge-map .map-status-row { border:0; }
.bridge-map .node-anchor { position:relative; display:block; width:var(--pad,80px); height:var(--pad,80px); flex:0 0 var(--pad,80px); }
.orbit-pad { position:absolute; left:0; right:0; top:33%; height:34%; border:2px solid #77e8ff; border-radius:50%; background:radial-gradient(ellipse,#133856ad,#0b1f31c9); box-shadow:0 0 12px #62d9ff56,inset 0 0 15px #5edbff33; }
.bridge-map .map-mini-character { position:absolute; left:50%; top:auto; bottom:7%; width:95%; height:116%; max-width:none; max-height:none; object-fit:contain; object-position:center bottom; transform:translateX(-50%); filter:drop-shadow(0 3px 3px #000a); animation:none!important; }
.bridge-map .map-mini-character.silhouette-sprite { width:95%; height:116%; transform:translateX(-50%); animation:none!important; }
.bridge-map .node-anchor .map-mini-character { bottom:40%; width:112%; height:130%; }
.bridge-map .node.current .map-mini-character,.bridge-map .node.current .map-battle-enemy-icon { pointer-events:auto; }
.bridge-map .route-preview .map-mini-character { bottom:40%; width:100%; height:116%; }
.bridge-map .map-battle-enemy-icon { position:absolute; left:0; bottom:8%; top:auto; width:100%; height:110%; object-fit:contain; transform:none; filter:drop-shadow(0 0 5px #ff858550); }
.route-caption { flex:1; min-width:0; border-top:1px solid #62c8ee82; border-bottom:1px solid #62c8ee48; padding:7px 12px; background:linear-gradient(90deg,#031224e8,#061528b5 74%,transparent); }
.bridge-map .route-caption small { display:block; color:#8be8ff; font:600 clamp(11px,1.05cqw,16px)/1.2 var(--font-rounded-ja); letter-spacing:.12em; }
.bridge-map .route-caption strong { display:block; font-size:clamp(17px,2.05cqw,30px); line-height:1.35; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bridge-map .route-caption em { position:static; display:block; width:auto; margin-top:3px; padding:0; font:normal clamp(11px,1.1cqw,17px)/1.4 var(--font-rounded-ja); color:#d8e9f6; white-space:normal; overflow:hidden; max-height:2.8em; background:none; border:0; text-shadow:none; }
.bridge-map .route-caption em { transform:none; }
.bridge-map .route-caption em { text-align:left; }
.bridge-map .node:hover .orbit-pad,.bridge-map .route-selected .orbit-pad { background:#227895aa; border-color:white; box-shadow:0 0 20px #71eaff; }
.bridge-map .node:hover .route-caption { background:linear-gradient(90deg,#11334dea,transparent); }
.bridge-map .route-preview { --pad:clamp(45px,7cqw,105px); position:absolute; top:53%; transform:translate(-50%,-50%); width:var(--pad); text-align:center; color:#aebccc; opacity:.6; }
.bridge-map .route-preview>small { display:block; font-size:clamp(10px,1cqw,14px); letter-spacing:.08em; }
.bridge-map .route-preview>b { display:block; font-size:clamp(13px,1.3cqw,19px); }
.bridge-map .route-preview .orbit-pad { border-color:#abb7c8; box-shadow:none; }
.bridge-map .route-preview .map-mini-character { opacity:.65; filter:grayscale(1); }
.bridge-map .route-preview.battle { color:#ff9caa; }.bridge-map .route-preview.battle .orbit-pad { border-color:#df869e; }
.bridge-map .route-cleared { left:7%; border:0; background:none; box-shadow:none; padding:0; height:auto; border-radius:0; filter:grayscale(1); }
.route-check { position:absolute; inset:20% 0 auto; font-size:clamp(24px,3.5cqw,48px); line-height:1; }
.bridge-map .map-player-ship { position:absolute; z-index:6; left:var(--ship-x); top:54.4%; width:clamp(78px,16cqw,255px); height:clamp(30px,7cqw,100px); transform:translate(-50%,-50%); animation:none; border:0; background:none; box-shadow:none; padding:0; pointer-events:none; }
.bridge-map .map-player-ship .map-ship-art { left:0; top:0; width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 0 8px #fae4b866); animation:none; transform:none; }
.bridge-map .map-player-ship>span { position:absolute; left:0; right:0; bottom:-22px; color:#ffebaf; text-align:center; font-size:clamp(12px,1.4cqw,19px); text-shadow:0 2px 4px #000; }
.map-progress { position:absolute; left:3%; bottom:3%; z-index:5; display:flex; gap:10px; align-items:center; color:#b8cfe5; font-size:clamp(13px,1.5cqw,22px); }
.map-progress>b { color:#87e4ff; }.map-progress>div { margin-left:10px; width:19cqw; height:4px; background:#68809b88; border-radius:3px; }
.map-progress i { display:block; height:100%; background:#78e4ff; box-shadow:0 0 8px #43c9ff; border-radius:3px; }

/* BATTLE — four independent systems above a single main-weapon instrument. */
.bridge-battle { --weapon:#66d8ff; --weapon-bright:#d7faff; --weapon-glow:#4ab6ff70; --portrait-w:20%; position:relative; overflow:hidden; background:#030a17; }
.bridge-battle-heading { position:absolute; top:0; left:0; right:0; height:5.5%; min-height:26px; z-index:12; display:flex; align-items:center; justify-content:space-between; padding:0 max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left)); background:linear-gradient(90deg,#041221ee,#03112288); border-bottom:1px solid #4ddcff77; }
.bridge-battle-heading>span { border-left:2px solid #5de8ff; padding-left:10px; font-size:clamp(13px,1.25cqw,20px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bridge-battle-heading>div { display:flex; align-items:center; gap:18px; }.bridge-battle-heading time { font:600 clamp(15px,1.8cqw,27px) var(--font-rounded-ja); font-variant-numeric:tabular-nums; }
.bridge-battle-heading .bridge-menu-button { min-height:24px; height:4cqh; padding:0 8px; }
.bridge-battle .battle-stage { position:absolute; inset:0; margin:0; min-height:0; border:0; border-radius:0; overflow:hidden; }
.bridge-battle #battleCanvas { width:100%; height:100%; }
.bridge-battle .battle-hud { position:absolute; top:6%; left:1%; right:1%; width:auto; height:9.5%; min-height:50px; padding:0; display:grid; grid-template-columns:3fr 1fr; gap:5px; border:0; background:none; box-shadow:none; }
.bridge-battle .allied-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.bridge-battle .force { position:relative; display:grid; grid-template-columns:17% auto 1fr auto; grid-template-rows:46% 19% 35%; gap:0 6px; align-items:center; min-width:0; padding:4px 10px 2px; margin:0; border:1px solid #55bcdb8a; background:linear-gradient(120deg,#041529ed,#031222aa); border-radius:2px; font-size:clamp(12px,1.2cqw,20px); }
.bridge-battle .force>.bridge-icon { grid-column:1; grid-row:1/4; width:100%; height:80%; color:#acdfff; fill:#569bc344; stroke-width:1; }
.bridge-battle .force>b { min-width:0; width:auto; color:#e3f1ff; font-size:inherit; white-space:nowrap; }
.bridge-battle .force>b,.bridge-battle .force>small { position:static; width:auto; transform:none; font-style:normal; }
.bridge-battle .force>span { width:auto; text-align:right; font:700 clamp(15px,1.8cqw,28px)/1 var(--font-rounded-ja); font-variant-numeric:tabular-nums; color:#effaff; }
.bridge-battle .force>small { padding:1px 6px; font-size:clamp(11px,1.1cqw,16px); border:1px solid #64e7fc8a; border-radius:2px; color:#76e8ff; white-space:nowrap; }
.bridge-battle .force>.bar { grid-column:2/5; width:100%; max-width:none; height:100%; min-height:7px; transform:none; border:1px solid #338dab; border-radius:0; padding:1px; background:#010a18; box-shadow:none; }
.bridge-battle .force .bar i { height:100%; transform:none; background:linear-gradient(90deg,#23b6e4,#ccffff); box-shadow:0 0 8px #63ddff; }
.bridge-battle .force>em { grid-column:2/5; font:normal clamp(10px,.9cqw,14px)/1.2 var(--font-rounded-ja); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#9cb8ce; }
.bridge-battle .force[data-damage="1"]>small,.bridge-battle .force[data-damage="1"]>em { color:#ffda78; border-color:#ffca54; }
.bridge-battle .force[data-damage="2"]>small,.bridge-battle .force[data-damage="3"]>small,.bridge-battle .force[data-damage="2"]>em,.bridge-battle .force[data-damage="3"]>em { color:#ff9289; border-color:#ff756d; }
.bridge-battle .force.enemy { grid-template-columns:22% 1fr; border-color:#b8637870; }
.bridge-battle .force.enemy>b { grid-column:2; width:auto; color:#ff9aaa; font-size:clamp(12px,1.2cqw,18px); }
.bridge-battle .force.enemy .bar { grid-column:2; grid-row:2; justify-content:flex-end; border-color:#c1617b; }
.bridge-battle .force.enemy .bar i { background:linear-gradient(90deg,#ffe6d4,#ff766b); box-shadow:0 0 7px #ff565e; }
.bridge-battle .force.enemy>.bridge-icon { color:#ff9e96; fill:#af506944; }
.bridge-battle .battle-top-layer { position:absolute; top:17%; left:1%; right:1%; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; pointer-events:none; }
.bridge-battle .report-feed { width:53%; max-width:none; position:relative; left:auto; top:auto; }
.bridge-battle .operator-report { height:clamp(62px,12cqh,102px); min-height:0; display:grid; grid-template-columns:clamp(62px,8cqw,120px) 1fr; gap:0; border:0; border-radius:0; overflow:visible; background:none; box-shadow:none; backdrop-filter:none; }
.bridge-battle .operator-report { animation:none; opacity:1; transform:none; }
.bridge-battle .operator-portrait { position:relative; width:100%; height:100%; border:1px solid #53dfff; border-radius:6px 0 9px 0; overflow:hidden; background:linear-gradient(140deg,#24415c,#082237); box-shadow:0 0 14px #209bbb30; }
.bridge-battle .operator-portrait img { position:absolute; width:212%; height:auto; max-width:none; left:-56%; top:-6%; transform:none; }
/* TERRA's full-length art needs its own face crop, not Luka's bust crop.
   Use a stable identity key even when the player has renamed the AI. */
.bridge-battle .operator-report[data-speaker="terra"] .operator-portrait img { width:155%; left:-39%; top:-8%; }
.bridge-battle .operator-message { align-self:start; min-width:0; padding:0 10px 6px; border-bottom:1px solid #53b5d485; background:linear-gradient(90deg,#031529ed,#071b30d9 90%,transparent); }
.bridge-battle .operator-name { font-size:clamp(12px,1.05cqw,16px); color:#62eaff; margin:0; }
.bridge-battle .operator-message p { margin:3px 0 0; font-size:clamp(13px,1.35cqw,21px); line-height:1.5; -webkit-line-clamp:3; text-shadow:0 1px 2px #000; }
.bridge-battle .operator-report.major-alert { width:150%; height:auto; }.bridge-battle .major-alert .operator-message p { font-size:clamp(26px,2.7cqw,42px); }
.bridge-battle .enemy-intent { position:relative; display:grid; grid-template-columns:auto auto; gap:2px 9px; align-items:center; padding:6px 12px; width:auto; max-width:42%; min-height:0; margin:4px 0 0; border:1px solid #fc8c89; border-radius:5px; background:#300d1ddb; color:#ffd4cf; box-shadow:0 0 15px #da556344; font-size:clamp(13px,1.3cqw,21px); }
.bridge-battle .enemy-intent>b { display:flex; align-items:center; gap:6px; grid-row:1/3; color:#ff9696; font-size:clamp(11px,1cqw,16px); }.bridge-battle .enemy-intent .bridge-icon { width:23px; height:23px; }
.bridge-battle .enemy-intent>small { grid-column:2; font-size:clamp(13px,1.3cqw,21px); color:#ffe0dd; text-align:right; font-variant-numeric:tabular-nums; }
.bridge-battle .status-effect-strip { display:none; }
.bridge-menu .menu-damage-details { display:grid; gap:6px; max-height:25vh; overflow:auto; padding:9px; background:#021021; border:1px solid #416280; font-size:12px; }
.bridge-menu .menu-damage-details b { color:#b3eaff; }.bridge-menu .menu-damage-details p { margin:0; color:#ffcb8b; }
.bridge-battle .command-result-overlay { top:46%; bottom:auto; left:50%; right:auto; width:min(560px,76cqw); transform:translate(-50%,-50%); animation:bridge-result-enter .22s ease-out both; }
/* Position and entrance animation share the same anchor, from the first frame. */
@keyframes bridge-result-enter { from { opacity:0; transform:translate(-50%,-50%) scale(.86); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }
.bridge-battle>.flagship-crack-overlay { z-index:100; isolation:isolate; pointer-events:none; }

/* The portrait sits in front of the housing, never on top of charge text or touch targets. */
.bridge-battle .battle-bottom { position:absolute; inset:auto 0 0; z-index:20; height:36%; min-height:0; padding:0; display:block; border:0; border-radius:0; background:linear-gradient(0deg,#020a19fa 0%,#06172ade 43%,transparent 96%); --weapon:#66d8ff; --weapon-bright:#d7faff; --weapon-glow:#4ab6ff70; }
.bridge-battle .battle-bottom[data-stage="2"] { --weapon:#ffe27b; --weapon-bright:#fff7d2; --weapon-glow:#f7b8478c; }
.bridge-battle .battle-bottom[data-stage="3"] { --weapon:#c9ffff; --weapon-bright:#fff; --weapon-glow:#69ffffa0; }
.bridge-battle .battle-bottom[data-stage="4"] { --weapon:#a29aff; --weapon-bright:#a5ffff; --weapon-glow:#9662ffa0; }
.bridge-battle .weapon-housing { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; filter:drop-shadow(0 0 4px var(--weapon-glow)); }
.weapon-housing path { fill:#061b36e8; stroke:var(--weapon); stroke-width:2; vector-effect:non-scaling-stroke; }
.bridge-battle .tc-captain { position:absolute; left:0; bottom:0; width:20%; height:38cqh; max-height:none; margin:0; z-index:4; pointer-events:none; background:none; border:0; filter:drop-shadow(2px -2px 5px #071225); }
.bridge-battle .tc-captain-frame { position:absolute; inset:0; width:100%; height:100%; border:0; clip-path:none; border-radius:0; background:none; box-shadow:none; overflow:hidden; }
.bridge-battle .tc-captain-frame img { position:absolute; width:180%; height:auto; max-width:none; max-height:none; left:-38%; top:-2%; object-fit:contain; object-position:top; transform:none; }
.bridge-battle #tcCaptainName { position:absolute; bottom:12%; left:10%; right:7%; font-size:clamp(14px,1.5cqw,24px); padding:4px 9px; width:auto; background:linear-gradient(90deg,#06162eee,#122847bb,transparent); border-left:2px solid #74e7ff; text-shadow:0 1px 4px #000; }
.bridge-battle .tc-hull { position:absolute; left:2%; bottom:3%; width:17%; z-index:5; border:0; background:none; display:flex; gap:7px; align-items:center; padding:0; font-size:clamp(10px,.95cqw,15px); }
.bridge-battle .tc-hull b { font-size:inherit; color:#c8e3f7; }.bridge-battle .tc-hull span { font-size:inherit; color:#a9c8df; }
.bridge-battle .charge-console { position:absolute; left:18%; right:23%; top:1.8cqh; height:auto; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); grid-template-rows:auto 4cqh auto; gap:.6cqh 8px; align-items:center; padding:0; min-width:0; border:0; box-shadow:none; background:none; pointer-events:none; }
.bridge-battle .charge-console { backdrop-filter:none; }
.bridge-battle .charge-label { display:contents; color:#d6edff; font-size:clamp(12px,1.2cqw,18px); }
.bridge-battle .charge-label>span { grid-area:1/1; white-space:nowrap; }
.bridge-battle .charge-phase { grid-area:1/3; justify-self:end; white-space:nowrap; font-family:var(--font-rounded-ja); font-size:clamp(12px,1.2cqw,18px); color:#daedff; }
.bridge-battle .charge-readout { position:relative; inset:auto; width:auto; grid-area:1/2; display:flex; justify-content:center; align-items:baseline; gap:6px; color:var(--weapon-bright); }
.bridge-battle .charge-readout b { font:900 clamp(24px,3cqw,42px)/1.15 var(--font-tech); font-variant-numeric:tabular-nums; letter-spacing:.02em; transform:skewX(-8deg); text-shadow:0 2px 2px #071326,0 0 12px var(--weapon),0 0 24px var(--weapon-glow); }
.bridge-battle .charge-readout small { font:800 clamp(13px,1.4cqw,21px)/1 var(--font-tech); transform:skewX(-8deg); color:var(--weapon-bright); text-shadow:0 0 10px var(--weapon); }
.bridge-battle [data-stage="4"] .charge-readout b { animation:bridge-number-energy 1.3s ease-in-out infinite alternate; }
@keyframes bridge-number-energy { to { text-shadow:0 2px 2px #071326,0 0 14px #fff,0 0 26px #af7aff,0 0 38px #57eaff; } }
.bridge-battle .charge-bar { position:relative; inset:auto; grid-area:2/1/3/-1; width:100%; height:100%; min-height:13px; padding:3px; background:repeating-linear-gradient(90deg,#04101fee 0,#04101fee 15px,#315579aa 16px,#04101fee 17px); border:2px solid var(--weapon); border-radius:5px; transform:none; box-shadow:0 0 10px var(--weapon-glow),inset 0 0 8px #000; overflow:hidden; }
.bridge-battle .charge-bar i { position:relative; display:block; height:100%; width:var(--value); background:linear-gradient(90deg,#1274ad,var(--weapon),var(--weapon-bright)); box-shadow:0 0 14px var(--weapon); transition:width .08s linear; transform:none; border-radius:1px; overflow:hidden; }
.bridge-battle .charge-bar i::before { content:""; position:absolute; inset:0; background:linear-gradient(110deg,transparent 22%,#fff8 45%,#fff 50%,transparent 70%); transform:translateX(-110%); animation:bridge-energy-sweep 2s linear infinite; }
.bridge-battle .charge-bar i::after { content:""; position:absolute; inset:0; background:linear-gradient(0deg,transparent 15%,#ffffff70 48%,#fff 52%,transparent 85%); }
.bridge-battle [data-stage="2"] .charge-bar { box-shadow:0 0 15px var(--weapon-glow),0 0 4px var(--weapon); }
.bridge-battle [data-stage="2"] .charge-bar i { background:linear-gradient(90deg,#cb740c,#ffcd45,#fff5c1); }
.bridge-battle [data-stage="3"] .charge-bar { box-shadow:0 0 22px var(--weapon-glow),0 0 6px var(--weapon); }
.bridge-battle [data-stage="3"] .charge-bar i { background:linear-gradient(90deg,#1284df,#6afaff,#fff,#41c8ff); background-size:200% 100%; animation:bridge-energy-flow 1.4s linear infinite; }
.bridge-battle [data-stage="4"] .charge-bar { box-shadow:0 0 8px #e4d4ff,0 0 25px #9972ffc0,0 0 40px #63eaff50; }
.bridge-battle [data-stage="4"] .charge-bar i { background:linear-gradient(90deg,#8a4cf6,#c881ff,#fff,#8cffff,#8067f3); background-size:240% 100%; box-shadow:0 0 20px #d4b6ff; animation:bridge-energy-flow .8s linear infinite; }
.bridge-battle [data-stage="3"] .charge-bar i::before { animation-duration:1.2s; }.bridge-battle [data-stage="4"] .charge-bar i::before { animation-duration:.7s; }
@keyframes bridge-energy-sweep { to { transform:translateX(110%); } }
@keyframes bridge-energy-flow { to { background-position:240% 0; } }
.charge-milestones { position:relative; inset:auto; grid-area:3/1/4/-1; display:flex; align-items:center; justify-content:space-between; padding:0 3%; color:#667d9e; font-size:clamp(12px,1.3cqw,20px); line-height:1; }
.charge-milestones>span.reached { color:var(--weapon-bright); text-shadow:0 0 6px var(--weapon); }.charge-milestones small { font-size:clamp(11px,1cqw,16px); color:#b3c9e5; }
.charge-milestones.single-stage>span { visibility:hidden; }
.bridge-battle .fire-btn { position:absolute; right:2%; top:0; width:29cqh; height:29cqh; min-width:0; min-height:0; max-width:21cqw; max-height:21cqw; margin:0; padding:0; display:flex; flex-direction:column; gap:1px; justify-content:center; align-items:center; border:3px solid var(--weapon); border-radius:50%; background:radial-gradient(circle at 50% 38%,#172e65,#071631 64%,#061127); box-shadow:inset 0 0 0 5px #071322,inset 0 0 0 7px var(--weapon),0 0 8px var(--weapon-glow),inset 0 0 35px var(--weapon-glow); color:#f1fcff; filter:none; transform:none; overflow:visible; animation:none!important; z-index:3; }
.bridge-battle .fire-btn:not(:disabled):hover { filter:brightness(1.2); }.bridge-battle .fire-btn:not(:disabled):active { transform:scale(.98); }
.bridge-battle .fire-btn { top:-3cqh; }
.bridge-battle .fire-btn:disabled { --weapon:#728397; --weapon-glow:#536c8744; --weapon-bright:#adc2d4; opacity:1; background:radial-gradient(circle,#233342,#0c1928); color:#b3c3d1; box-shadow:inset 0 0 0 5px #101c28,inset 0 0 0 7px #6f819c,0 0 5px #546f8422; filter:none; cursor:default; }
.bridge-battle .fire-btn #fireButtonIcon { display:none; }
.bridge-battle .fire-btn strong { position:relative; font-size:clamp(19px,2.4cqw,37px); line-height:1.1; z-index:2; letter-spacing:.02em; }
.bridge-battle .fire-btn #fireButtonState { position:relative; border:1px solid currentColor; border-radius:20px; padding:2px 8px; margin-top:4px; font:600 clamp(10px,1.1cqw,18px)/1.25 var(--font-rounded-ja); color:var(--weapon-bright); background:#04142ccc; z-index:2; }
.bridge-battle .fire-btn .weapon-emblem { position:relative; inset:auto; display:block; font-size:clamp(20px,3cqw,44px); color:var(--weapon-bright); line-height:1; text-shadow:0 0 12px var(--weapon); z-index:2; }
.bridge-battle .fire-btn { background-image:radial-gradient(circle at 50% 38%,#172e65,#071631 64%,#061127)!important; }
.bridge-battle .fire-btn:disabled { background-image:radial-gradient(circle,#233342,#0c1928)!important; }
.bridge-battle .fire-btn:not(:disabled) { box-shadow:inset 0 0 0 5px #071322,inset 0 0 0 7px var(--weapon),0 0 14px var(--weapon),0 0 32px var(--weapon-glow),inset 0 0 35px var(--weapon-glow); }
.bridge-battle .fire-btn:not(:disabled) strong { text-shadow:0 2px 4px #061127,0 0 12px var(--weapon); }
/* Independent rotate/transform tracks preserve the breathing motion while
   electricity completes continuous clockwise turns; button text stays still. */
.bridge-battle .fire-btn .fire-button-charge-effect { position:absolute; z-index:1; inset:-14%; width:128%; height:128%; max-width:none; opacity:.75; animation:bridge-electric-orbit 1.8s ease-in-out infinite alternate,bridge-electric-spin 8s linear infinite; mix-blend-mode:screen; pointer-events:none; border-radius:50%; mask-image:radial-gradient(circle,transparent 30%,#000 42%,#000 60%,transparent 70%); }
.bridge-battle .fire-btn[data-stage="2"] .fire-button-charge-effect { opacity:.85; animation-duration:1.3s,6s; }
.bridge-battle .fire-btn[data-stage="3"] .fire-button-charge-effect { opacity:1; animation-duration:.95s,5s; filter:brightness(1.2); }
.bridge-battle .fire-btn[data-stage="4"] .fire-button-charge-effect { opacity:1; animation-duration:.65s,4s; filter:brightness(1.5) drop-shadow(0 0 6px #91dbff); }
.bridge-battle .fire-btn[data-stage="4"] .fire-counter-charge-effect { inset:-18%; width:136%; height:136%; opacity:.65; animation-duration:.95s,5s; animation-direction:alternate,reverse; filter:brightness(1.1) drop-shadow(0 0 5px #64dfff); }
.bridge-battle .fire-btn .fire-ready-halo { display:block; inset:-7%; width:114%; height:114%; border:1px solid var(--weapon); border-left:3px solid var(--weapon-bright); border-right:3px solid var(--weapon-bright); box-shadow:0 0 12px var(--weapon-glow),inset 0 0 12px var(--weapon-glow); }
.bridge-battle .fire-btn:not(:disabled) .fire-ready-halo { opacity:1; animation:bridge-ring-orbit 7s linear infinite; }
.bridge-battle .fire-btn .fire-charge-ring { display:block; inset:4%; width:92%; height:92%; background:conic-gradient(from -90deg,var(--weapon-bright),var(--weapon) calc(var(--charge,100) * 1%),transparent 0); filter:drop-shadow(0 0 5px var(--weapon)); }
.bridge-battle .fire-btn[data-stage="3"] .fire-ready-halo { border-width:2px; animation-duration:5s; box-shadow:0 0 22px var(--weapon-glow); }
.bridge-battle .fire-btn[data-stage="4"] .fire-ready-halo { border-width:3px; animation-duration:3s; box-shadow:0 0 14px #b8dfff,0 0 30px #9662ffa0,inset 0 0 16px #c691ff; }
.bridge-battle .fire-btn .fire-shock-wave { display:block; }
.bridge-battle .fire-btn:disabled .fire-ready-halo,.bridge-battle .fire-btn:disabled .fire-charge-ring { display:none; animation:none; }
@keyframes bridge-ring-orbit { to { transform:rotate(360deg); } }
@keyframes bridge-electric-orbit { from { transform:rotate(-3deg) scale(.98); } to { transform:rotate(3deg) scale(1.04); } }
@keyframes bridge-electric-spin { from { rotate:0deg; } to { rotate:360deg; } }
.bridge-battle .no-captain .charge-console { left:7%; }.bridge-battle .no-captain .command-dock { left:7%; }.bridge-battle .no-captain .tc-hull { left:2%; bottom:0; width:auto; }

/* Orders remain on the instrument deck: three decisions, no screen-covering modal. */
.bridge-battle .command-dock { position:absolute; left:22%; right:23%; top:17cqh; bottom:max(4px,env(safe-area-inset-bottom)); pointer-events:auto; }
.bridge-battle .command-overlay { position:absolute; inset:0; width:100%; height:100%; display:block; padding:0; background:none; backdrop-filter:none; z-index:1; }
.bridge-battle .command-panel { width:100%; height:100%; padding:0; border:0; border-radius:0; background:none; box-shadow:none; display:flex; flex-direction:column; gap:3px; }
.bridge-battle .command-head { display:flex; justify-content:space-between; align-items:center; padding:0; margin:0; min-height:20px; }
.bridge-battle #commandStepTitle { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); margin:0; }
.bridge-battle .command-progress { display:flex; align-items:center; gap:10px; font-size:clamp(12px,1.25cqw,19px); color:#8f9cbb; margin:0; }
.bridge-battle .command-progress span.active { color:#6eebff; }.bridge-battle .command-progress span.complete { color:#d9effc; }.bridge-battle .command-progress i { font-style:normal; color:#5c98c1; }
.bridge-battle .command-head .timer { font-size:clamp(17px,1.9cqw,28px); color:#63edff; padding:0; border:0; min-width:0; background:none; line-height:1; font-variant-numeric:tabular-nums; }
.bridge-battle .command-head .timer small { font-size:clamp(11px,1cqw,16px); color:#d2e4f5; }
.bridge-battle .command-step { display:grid; grid-auto-columns:minmax(0,1fr); grid-auto-flow:column; grid-template-columns:none; gap:6px; padding:0; flex:1; min-height:38px; }
.bridge-battle .command-card { display:grid; grid-template-columns:auto 1fr; grid-template-rows:1fr auto; gap:0 6px; align-content:center; align-items:center; min-width:0; min-height:38px; padding:3px 8px; border:1px solid #609dc980; border-radius:4px; background:linear-gradient(135deg,#102d49e8,#071324e8); box-shadow:inset 0 1px 0 #87c5e455; text-align:left; }
.bridge-battle .command-card:hover { border-color:#8df4ff; background:#164362; box-shadow:inset 0 0 8px #5bcdf35c,0 0 9px #60e3ff6b; }
.bridge-battle .command-card .bridge-icon { grid-row:1/3; width:clamp(20px,2.4cqw,34px); height:clamp(20px,2.4cqw,34px); color:#b1edff; }
.bridge-battle .command-card strong { font-size:clamp(13px,1.5cqw,23px); line-height:1.2; white-space:nowrap; }
.bridge-battle .command-card small { display:block; font-size:clamp(10px,.9cqw,14px); line-height:1.25; color:#afc8dd; }
.bridge-battle .command-step[data-group="commitment"] .command-card { grid-template-columns:1fr; text-align:center; }
.bridge-battle .command-step[data-group="target"] .command-card .bridge-icon { display:none; }
.bridge-battle .command-step[data-group="target"] .command-card { grid-template-columns:1fr; text-align:center; }
.bridge-battle .command-breadcrumb { height:16px; font-size:clamp(10px,.85cqw,13px); line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#93b4cd; padding:0; margin:0; }
.bridge-battle .command-breadcrumb { border:0; background:none; }
.bridge-battle .command-standby { height:100%; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:3px; border-top:1px solid #4b7fa65c; color:#a2c1da; background:linear-gradient(90deg,transparent,#0b2139aa,transparent); font-size:clamp(12px,1.3cqw,20px); }
.bridge-battle .command-standby>span { color:#69dfff; letter-spacing:.18em; font-size:clamp(11px,1cqw,15px); }.bridge-battle .command-standby small { font-size:clamp(11px,1cqw,15px); }
.bridge-battle .hidden,.bridge-map .hidden { display:none!important; }
.bridge-battle .battle-hud,.bridge-battle .battle-top-layer { left:max(1%,env(safe-area-inset-left)); right:max(1%,env(safe-area-inset-right)); }
.bridge-battle .battle-bottom { left:env(safe-area-inset-left); right:env(safe-area-inset-right); }
@media (max-height:520px) {
  .bridge-map-heading { top:max(10px,env(safe-area-inset-top)); left:max(15px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right)); }
  .map-heading-text { padding-left:10px; }.map-heading-text h1 { margin:4px 0; }
  .bridge-map .map-status-window { padding:6px 10px; gap:10px; }.bridge-map .map-status-row { gap:5px; }.bridge-map .map-status-title { display:none; }
  .bridge-map .map-status-row span { font-size:11px; }.bridge-menu-button { padding:4px 9px; }
  .bridge-map .node.current { --pad:clamp(56px,10cqw,95px); }.bridge-map .route-caption { padding:4px 8px; }
  .bridge-map .route-caption strong { font-size:clamp(16px,2cqw,22px); }.bridge-map .route-caption em { font-size:11px; line-height:1.3; }
  .bridge-battle .force { padding:2px 5px; gap:0 4px; grid-template-columns:12% auto 1fr auto; }.bridge-battle .force>small { padding:1px 3px; }
  .bridge-battle .battle-top-layer { top:21%; }.bridge-battle .battle-hud { top:7%; height:13%; min-height:45px; }
  .bridge-battle .operator-report { height:58px; grid-template-columns:61px 1fr; }.bridge-battle .operator-message { padding:0 6px 3px; }
  .bridge-battle .operator-message p { font-size:13px; line-height:1.35; -webkit-line-clamp:3; }.bridge-battle .operator-name { font-size:11px; }
  .bridge-battle .enemy-intent { padding:4px 7px; gap:1px 6px; }.bridge-battle .enemy-intent>b { font-size:11px; }.bridge-battle .enemy-intent .bridge-icon { display:none; }
  .bridge-battle .battle-bottom { height:40%; }.bridge-battle .command-dock { top:21cqh; left:21%; right:22%; }.bridge-battle .charge-console { left:19%; right:22%; top:1.8cqh; }
  .bridge-battle .charge-readout b { font-size:clamp(22px,3cqw,28px); }.bridge-battle .charge-bar { padding:2px; }
  .bridge-battle .fire-btn { top:-4cqh; width:30cqh; height:30cqh; right:2%; }.bridge-battle .fire-btn strong { font-size:clamp(19px,2.4cqw,25px); }
  .bridge-battle .command-progress { gap:5px; font-size:12px; }.bridge-battle .command-card { padding:3px 5px; gap:0 3px; }.bridge-battle .command-card strong { font-size:13px; }.bridge-battle .command-card small { font-size:10px; }
  .bridge-battle .command-breadcrumb { display:none; }.bridge-battle .command-head { min-height:19px; }.bridge-battle .command-step { min-height:40px; }.bridge-battle .command-panel { gap:3px; }
  .bridge-battle .charge-label>span,.bridge-battle .charge-phase { font-size:11px; }.bridge-battle .tc-captain { height:39cqh; }.bridge-battle #tcCaptainName { font-size:14px; }
}
@media (max-width:680px) {
  .bridge-map .map-status-row span { display:none; }.map-heading-text small { font-size:11px; }.map-heading-text h1 { font-size:17px; }
  .bridge-map .map-status-window { gap:9px; }.bridge-map .map-tools { gap:5px; }.bridge-map .bridge-menu-button span { display:none; }
  .bridge-map .route-caption em { display:none; }.bridge-map .route-caption strong { font-size:15px; }.bridge-map .route-caption small { font-size:10px; }
  .bridge-battle .force>.bridge-icon { display:none; }.bridge-battle .force { grid-template-columns:0 auto 1fr auto; gap:0 2px; }
  .bridge-battle .force.enemy { grid-template-columns:0 1fr; }.bridge-battle .force>span { font-size:15px; }.bridge-battle .force>b { font-size:11px; }
}
@media (prefers-reduced-motion:reduce) {
  .bridge-map .focused-route.route-moving { transition-duration:.1s; }
  .bridge-battle .charge-bar i { transition:none; }
  .bridge-battle .charge-bar i,.bridge-battle .charge-bar i::before,.bridge-battle .charge-readout b,.bridge-battle .fire-btn .fire-button-charge-effect,.bridge-battle .fire-btn .fire-ready-halo,.bridge-battle .command-result-overlay { animation:none!important; }
}
