/* The map is the surface. Controls live only in its corners. */
body.edge-to-edge-map{--hud-inset:20px;--hud-gap:8px;--hud-slot:84px;--hud-slot-height:calc(var(--hud-slot)*1.5 + 10px);--hud-surface:#14271ff2;--hud-edge:#a48d5a;--hud-ink:#f2e6c9;overflow:hidden}
.edge-to-edge-map #world-viewport{inset:0;background:#12251d}
.edge-to-edge-map .app.immersive{padding:0;min-height:0;max-width:none}
.edge-to-edge-map .map-hud{position:fixed;inset:max(var(--hud-inset),env(safe-area-inset-top)) max(var(--hud-inset),env(safe-area-inset-right)) auto max(var(--hud-inset),env(safe-area-inset-left));z-index:22;display:flex;align-items:start;justify-content:space-between;gap:12px;pointer-events:none}
.edge-to-edge-map :is(.map-hud-resources,.map-restart,.map-squad-dock,.map-quest-dock){pointer-events:auto}
.map-hud-resources{display:flex;align-items:center;gap:4px;margin:0;padding:4px 8px;border:1px solid #b8a17280;border-radius:12px;background:var(--hud-surface);color:var(--hud-ink);font-variant-numeric:tabular-nums}
.map-hud-resource{display:flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:4px 12px;font-size:21px;font-weight:650;white-space:nowrap}
.map-hud-resource .icon{width:20px;height:20px;stroke-width:1.8}
.map-hud-resource[data-resource=points]>.icon{color:#a1e3cf}.map-hud-resource[data-resource=gold]>.icon{color:#e8c266}.map-hud-resource[data-resource=victory]>.icon{color:#acd6ef}
.map-hud-resource small{font-size:12px;align-self:center;color:#bed0bf;font-weight:500}
button.map-hud-resource{font:inherit;font-size:21px;font-weight:650;color:#f7d78a;border:0;border-radius:8px;background:#4d452a;cursor:pointer}
.edge-to-edge-map .map-restart{width:48px;height:48px;padding:0;background:var(--hud-surface);border:1px solid #b8a17280;border-radius:12px;color:var(--hud-ink)}
.edge-to-edge-map :is(.map-squad-dock,.map-quest-dock){position:fixed;z-index:22;bottom:max(var(--hud-inset),env(safe-area-inset-bottom));display:flex;align-items:end}
.map-squad-dock{left:max(var(--hud-inset),env(safe-area-inset-left));gap:14px}
.map-squad-slots{display:flex;gap:var(--hud-gap)}
.hud-squad-slot{position:relative;display:grid;place-items:center;width:var(--hud-slot);height:var(--hud-slot-height);padding:2px 2px 10px;border:1px solid #aa986985;border-radius:12px;background:var(--hud-surface);overflow:hidden;color:#d9ccaa;cursor:pointer}
.hud-squad-slot.is-filled{border-color:var(--slot-rarity,#b9a678);background:color-mix(in srgb,var(--slot-clan) 16%,#17271e)}
.hud-squad-slot:disabled{opacity:.65;cursor:default}
.hud-slot-number{position:absolute;z-index:2;left:6px;top:4px;font-size:10px;line-height:16px;color:#e9d7ad;text-shadow:0 1px 3px #101d18}
.hud-slot-plus .icon{width:26px;height:26px;stroke-width:1.4;color:#c6c8ae}
.hud-fighter-art{display:block;width:100%;height:100%;border-radius:7px;overflow:hidden}
.hud-fighter-art img{display:block;width:100%;height:100%;object-fit:contain}
.hud-fighter-health{position:absolute;bottom:4px;left:7px;right:7px;height:3px;background:#403d2c;border-radius:2px;overflow:hidden}
.hud-fighter-health i{display:block;height:100%;background:#a4c98f}
.map-quest-dock{right:max(var(--hud-inset),env(safe-area-inset-right))}
.edge-to-edge-map .button:is(.hud-inventory,.hud-quests){background:var(--hud-surface);border:1px solid #b8a17280;color:var(--hud-ink);border-radius:12px;min-width:48px;min-height:48px}
.edge-to-edge-map .button.hud-inventory{width:48px;padding:0}
.edge-to-edge-map .button.hud-quests{position:relative;gap:10px;padding:12px 16px}
.hud-quest-ready{display:grid;place-items:center;position:absolute;right:-4px;top:-6px;min-width:20px;height:20px;border-radius:50%;background:#e7ce87;color:#23331f;font-size:11px;font-weight:700;padding:2px}
.edge-to-edge-map :is(.hud-squad-slot,.map-restart,.hud-inventory,.hud-quests):hover:not(:disabled){border-color:#f0d295;background:#283c2d}
.edge-to-edge-map :is(.hud-squad-slot,.map-restart,.hud-inventory,.hud-quests,.map-hud-resource):focus-visible{outline:2px solid #fff0bd;outline-offset:4px}
.edge-to-edge-map .app.immersive .event-sheet{bottom:calc(var(--hud-inset) + 64px);right:var(--hud-inset);max-height:calc(100dvh - 172px)}
/* Release the legacy top anchor so a bottom-aligned toast hugs its text. */
.edge-to-edge-map .app.immersive .game-toast{top:auto;bottom:calc(var(--hud-inset) + var(--hud-slot-height) + 14px)}
.edge-to-edge-map dialog.quest-journal-dialog{top:82px;bottom:auto;right:var(--hud-inset);max-height:calc(100dvh - 166px)}
.edge-to-edge-map dialog.squad-picker-dialog{width:min(1020px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);background:#16271f;padding:24px;scrollbar-color:#8e9877 #16271f}
.squad-picker-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:4px 0 24px;color:#c6d4bd;font-size:14px}
.squad-picker-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin:0;gap:20px}
.squad-picker-grid .fighter-card-action .button{width:100%}
.squad-picker-empty{display:grid;justify-items:center;gap:14px;padding:40px 20px;color:#b9cbb9;text-align:center}
.squad-picker-empty h3{font-size:21px;color:#efe4cb}.squad-picker-empty p{max-width:35ch;font-size:15px;line-height:1.6}.squad-picker-empty .icon{width:36px;height:36px}
.restart-dialog p{font-size:15px;line-height:1.6;color:#c7d6c1;margin-bottom:24px}.restart-dialog .utility-row{justify-content:end}
.edge-to-edge-map.autobattle-open :is(.map-hud,.map-squad-dock,.map-quest-dock){visibility:hidden;pointer-events:none}
.edge-to-edge-map:has(.app.finished){overflow:hidden}
.edge-to-edge-map .app.finished{position:fixed;inset:0;max-width:none;min-height:0;padding:0;background:transparent;pointer-events:none}
@media(max-width:700px){
 body.edge-to-edge-map{--hud-inset:12px;--hud-slot:60px;--hud-gap:6px}
 .map-hud-resources{padding:3px;gap:0;border-radius:10px}.map-hud-resource{font-size:17px;min-height:38px;padding:3px 9px;gap:5px}.map-hud-resource small{font-size:10px}.map-hud-resource .icon{width:17px;height:17px}
 .edge-to-edge-map .map-restart{width:44px;height:44px;min-height:44px;border-radius:10px}
 .map-squad-dock{gap:10px}.edge-to-edge-map .button:is(.hud-inventory,.hud-quests){width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:10px}
 .hud-quest-label{display:none}.hud-squad-slot{border-radius:10px}
 .edge-to-edge-map .app.immersive .event-sheet{bottom:calc(var(--hud-inset) + var(--hud-slot-height) + 12px);left:10px;right:10px;max-height:calc(100dvh - var(--hud-slot-height) - 98px)}
 .edge-to-edge-map dialog.quest-journal-dialog{inset:auto 10px calc(var(--hud-inset) + 56px);max-height:46dvh}
 .edge-to-edge-map dialog.squad-picker-dialog{padding:18px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 .squad-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.squad-picker-grid .fighter-card-body{padding:12px;gap:12px}.squad-picker-grid .fighter-card-heading h3{font-size:16px}
 .squad-picker-heading{align-items:start;font-size:13px;gap:12px}
}
@media(max-width:370px){body.edge-to-edge-map{--hud-inset:8px;--hud-slot:50px;--hud-gap:5px}.map-hud-resource{padding-inline:7px}.map-squad-dock{gap:8px}.squad-picker-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.hud-squad-slot{transition:none}}
