.boss-encounter { width:min(430px,calc(100vw - 28px)); padding:7px 12px 6px; border:1px solid #a48556; background:linear-gradient(110deg,rgba(22,17,21,.92),rgba(29,23,20,.88)); box-shadow:0 2px 12px #0008; color:#f2e4c8; }
.boss-heading { display:flex; justify-content:space-between; align-items:baseline; gap:12px; font:13px/1.3 var(--serif); letter-spacing:.045em; }
.boss-heading span { color:#e7c393; font:11px/1.3 monospace; }
.boss-health { height:5px; margin:4px 0 6px; background:#241820; border:1px solid #705143; }
.boss-health i,.boss-cast i { display:block; width:100%; height:100%; transform-origin:left; }
.boss-health i { background:linear-gradient(90deg,#702c39,#c96756); }
.boss-instruction { display:flex; align-items:baseline; justify-content:space-between; gap:10px; font:12px/1.35 var(--serif); }
.boss-instruction strong { color:#ffca84; font-weight:600; }
.boss-instruction span { color:#f3e9d4; text-align:right; }
.boss-cast { height:3px; margin-top:5px; background:#49382a; visibility:hidden; }
.boss-cast i { background:#ffbe6a; transform:scaleX(0); }
.boss-cast-response { min-height:1.1em; margin-top:3px; color:#dfc79f; font:10px/1.3 sans-serif; letter-spacing:.025em; }
.boss-encounter[data-interruptible=true] .boss-cast-response { color:#e4c5ff; }
.boss-encounter[data-interruptible=true] .boss-cast i { background:#c3a1eb; }
.boss-encounter[data-stage=windup] .boss-cast { visibility:visible; }
.boss-encounter[data-stage=active] { border-color:#ee8f66; }
.boss-encounter[data-stage=recovery] .boss-instruction span { color:#bfe4c5; }
@media(max-width:600px) { .boss-encounter { padding:6px 9px 5px; }.boss-heading { font-size:12px; }.boss-instruction { gap:3px; flex-direction:column; align-items:center; font-size:11px; }.boss-instruction span { text-align:center; } }

.enemy-cast { flex:none; align-self:center; width:min(330px,100%); margin-bottom:4px; padding:6px 9px; border:1px solid #9c805b; background:linear-gradient(110deg,#15151bec,#211b1aeb); box-shadow:0 2px 10px #0007; color:#eee3cd; pointer-events:none; }
.enemy-cast-heading,.enemy-cast-meta { display:flex; justify-content:space-between; align-items:baseline; gap:9px; }
.enemy-cast-heading strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font:600 12px/1.4 var(--serif); color:#f2c994; }
.enemy-cast-heading>span { flex-shrink:0; font:11px/1.4 monospace; font-variant-numeric:tabular-nums; }
.enemy-cast-meta { margin-top:1px; font:10px/1.4 sans-serif; }
.enemy-cast-meta>span:first-child { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#bbae99; }
.enemy-cast-response { flex-shrink:0; color:#e1c19e; }
.enemy-cast-track { height:4px; margin-top:5px; background:#443829; }
.enemy-cast-track i { display:block; width:100%; height:100%; transform:scaleX(0); transform-origin:left; background:#e2a66a; }
.enemy-cast-cue { margin-top:3px; font:10px/1.4 sans-serif; color:#dfd5bf; }
.enemy-cast-cue:empty { display:none; }
.enemy-cast[data-interruptible=true] { border-color:#b29acb; }
.enemy-cast[data-interruptible=true] .enemy-cast-response { color:#e4c5ff; }
.enemy-cast[data-interruptible=true] .enemy-cast-track i { background:#c3a1eb; }
.enemy-cast[data-stage=recovery] .enemy-cast-response { color:#bfe4c5; }
@media(max-width:600px) { .enemy-cast { width:min(300px,calc(100% - 28px)); }.enemy-cast-meta { align-items:flex-start; }.enemy-cast-response { max-width:70%; white-space:normal; text-align:right; } }
.touch-ui .enemy-cast { position:fixed; top:calc(50% + 40px); left:50%; transform:translateX(-50%); width:min(300px,calc(100% - 28px)); }
@media(max-height:520px) {
  #hud.enemy-cast-active .depth-label,#hud.enemy-cast-active .floor-objective { display:none; }
  #hud.enemy-cast-active .status { min-height:18px; }
  #hud.enemy-cast-active .status:empty { display:none; }
  #hud.enemy-cast-active .status .st { width:18px; height:18px; }
  #hud.enemy-cast-active .spellbar { flex-wrap:nowrap; overflow-x:auto; max-width:100%; scrollbar-width:none; }
  #hud.enemy-cast-active .spellbar::-webkit-scrollbar { display:none; }
  #hud.enemy-cast-active .enemy-cast { padding:4px 8px; }
  #hud.enemy-cast-active .enemy-cast-heading strong { font-size:11px; line-height:1.25; }
  #hud.enemy-cast-active .enemy-cast-meta,#hud.enemy-cast-active .enemy-cast-cue { font-size:9.5px; line-height:1.25; }
  #hud.enemy-cast-active .boss-encounter { padding:4px 10px; }
  #hud.enemy-cast-active .boss-heading { font-size:12px; }
  #hud.enemy-cast-active .boss-health { margin:3px 0 4px; }
  #hud.enemy-cast-active .boss-instruction { font-size:11px; line-height:1.25; }
  #hud.enemy-cast-active .boss-cast-response { min-height:0; margin-top:2px; font-size:9.5px; }
  .touch-ui .enemy-cast { top:auto; bottom:140px; }
}

/* Combat feedback uses the side gutter, leaving both warning panels readable.
   The newest message takes priority over earlier short-lived toasts. */
@media(min-width:700px) {
  .seatui:has(#hud .boss-encounter:not(.hidden))>.toasts { top:50%; right:max(14px,env(safe-area-inset-right)); left:auto; transform:none; width:min(220px,calc((100% - 470px)/2)); align-items:stretch; }
  .seatui:has(#hud .boss-encounter:not(.hidden))>.toasts .toast { padding:5px 8px; font:11px/1.35 var(--serif); text-align:left; overflow-wrap:anywhere; }
  .seatui:has(#hud .boss-encounter:not(.hidden))>.toasts .toast:not(:last-child) { display:none; }
}
