#boss-layer { position:absolute; inset:0; pointer-events:none; z-index:7; overflow:hidden; }
#boss-routes { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
#boss-routes polyline { fill:none; stroke-width:2; stroke-dasharray:5 4; opacity:.85; }
.boss-unit { --boss-size:88px; position:absolute; width:calc(var(--boss-size)*.9773); height:calc(var(--boss-size) + 40px); min-width:44px; min-height:44px; transform:translate(-50%,calc(-100% + 26px)); background:transparent; padding:0; color:#fff5d8; pointer-events:auto; border:0; isolation:isolate; touch-action:none; }
.boss-unit[data-boss="creator"] { --boss-foot-padding:.022222; }
.boss-unit[data-boss="undead_god"] { --boss-foot-padding:.030556; }
.boss-unit[data-boss="slime_emperor"] { --boss-foot-padding:.021803; }
.boss-unit img { position:absolute; height:var(--boss-size); width:calc(var(--boss-size)*.9545); object-fit:contain; object-position:center bottom; bottom:26px; left:50%; transform:translate(-50%,calc(var(--boss-size)*var(--boss-foot-padding))); pointer-events:none; }
.boss-ground { position:absolute; width:calc(var(--boss-size)*.523); height:16px; bottom:18px; left:50%; transform:translateX(-50%); background:#182b3055; border:1px solid var(--boss-color); border-radius:50%; pointer-events:none; }
.boss-name { position:absolute; left:-15px; right:-15px; top:0; font-size:10px; text-align:center; white-space:nowrap; text-shadow:0 1px 3px #071b25,0 0 3px #071b25; pointer-events:none; }
.boss-health,.boss-shield { position:absolute; display:block; left:calc(50% - 40px); width:80px; height:5px; bottom:15px; background:#172f35; border:1px solid #e9d4a1; pointer-events:none; }
.boss-health i,.boss-shield i { display:block; height:100%; background:#d65f4c; }
.boss-shield { bottom:21px; height:4px; border-color:#f1dd88; }
.boss-shield i { background:#ffe89c; }
.boss-number { position:absolute; bottom:0; left:-10px; right:-10px; font:600 10px/1.4 system-ui,sans-serif; color:#fff4cf; text-shadow:0 1px 2px #10262b; pointer-events:none; }
.boss-heal { position:absolute; bottom:34px; right:-34px; padding:3px 5px; border-radius:3px; background:#153e32ee; color:#cbffab; font:600 11px/1.4 system-ui,sans-serif; white-space:nowrap; pointer-events:none; }
.boss-unit.legal-target .boss-ground,.boss-unit.is-inspected .boss-ground { box-shadow:0 0 0 3px #f3d17788; }
.boss-unit[data-phase="warning"] img { opacity:.45; }
.boss-unit[data-phase="reviving"] img { opacity:.5; }
.boss-unit:focus-visible { outline:2px solid #ffe7a7; outline-offset:2px; }
#boss-alert { position:absolute; top:62px; left:18px; max-width:310px; min-height:46px; display:grid; grid-template-columns:1fr 24px; padding:7px 12px; gap:2px 8px; background:#273c41f5; color:#f8e8bf; border:1px solid #c2a16b; border-left:3px solid #dbac54; border-radius:3px; z-index:14; text-align:left; }
#boss-alert b { font-size:12px; }
#boss-alert span { grid-row:2; font-size:10px; color:#d6d9c6; }
#boss-alert i { grid-column:2; grid-row:1/3; align-self:center; font-size:22px; font-style:normal; }
#boss-intel-button { position:static; z-index:14; min-height:44px; min-width:80px; padding:0 10px; background:#173c40; border:1px solid #bc9b64; border-radius:3px; color:#f0dfb5; font-size:12px; }
#boss-intel { position:absolute; top:64px; right:18px; z-index:30; width:min(360px,calc(100% - 36px)); max-height:calc(100% - 155px); overflow:auto; padding:10px; border:1px solid #bc9b64; border-radius:4px; background:#17373bf5; color:#eee4c8; box-shadow:0 8px 28px #061d2777; }
#boss-intel header { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:13px; }
#boss-intel header button { min-width:44px; min-height:44px; background:#284d4b; border-radius:3px; font-size:22px; }
.boss-intel-row { display:flex; gap:10px; min-height:76px; width:100%; padding:8px 2px; background:transparent; border-bottom:1px solid #a0b2a033; text-align:left; }
.boss-intel-row.is-inspected { background:#375951; box-shadow:inset 3px 0 #e9cc80; padding-left:8px; }
.boss-intel-row img { width:42px; height:56px; object-fit:cover; border-radius:2px; }
.boss-intel-row span { min-width:0; }
.boss-intel-row b,.boss-intel-row small { display:block; font-size:12px; }
.boss-intel-row small { margin-top:4px; font-size:10px; color:#bfccbb; line-height:1.4; }
#boss-intel p { padding:12px 4px; font-size:12px; }
#boss-buffs { position:absolute; top:53px; right:18px; z-index:12; display:flex; gap:4px; pointer-events:none; }
#boss-buffs span { padding:4px 7px; background:#28463de8; border:1px solid #b5a16a; color:#f5e6b7; font-size:10px; border-radius:2px; }
#battle-screen .trait-toast { width:max-content; max-width:min(320px,calc(100vw - 32px)); white-space:normal; word-break:normal; overflow-wrap:normal; }
#battle-screen:has(#boss-alert:not([hidden])) .trait-toast { display:none; }
#battle-screen:has(.boss-unit.is-inspected:not([hidden])) .trait-trigger-effect { display:none; }
.building.allegiance-boss .town-flag { background:#443363; }
.building.allegiance-boss .building-owner-mark { color:#fff0cd; background:#514063; }
.boss-result { padding:10px 0; font-size:12px; color:#d6c38c; line-height:1.5; }
@media(max-width:580px) and (orientation:portrait) {
  #battle-screen .trait-toast { left:12px; right:auto; transform:none; max-width:calc(100vw - 152px); }
  #boss-alert { top:108px; left:12px; max-width:calc(100% - 24px); }
  #boss-intel { top:160px; }
  #boss-buffs { top:90px; right:12px; }
  #boss-intel-button { right:64px; top:4px; min-width:70px; }
}
