/* A folding war banner, in the same ink, timber and gilt as the rest of the realm. */
#wars-panel.duel-banner{position:fixed;top:auto;right:18px;bottom:138px;width:286px;max-height:calc(100dvh - 300px);overflow:auto;padding:0;color:#e8dcc0;background:linear-gradient(125deg,#382b18,#21190f);border:1px solid #9a793c;border-top:3px solid #d4b563;border-radius:3px;box-shadow:0 5px 24px #0009;pointer-events:auto;font:14px 'Source Sans 3',sans-serif;z-index:120;}
.duel-heading{display:grid;width:100%;gap:4px;text-align:left;padding:12px 15px;background:none;color:inherit;border:0;cursor:pointer;}
.duel-heading>span{font-size:10px;letter-spacing:2px;color:#baa377;}.duel-heading b{font:600 19px Cinzel,serif;color:#f0cb68;overflow-wrap:anywhere;}.duel-heading small{font-size:13px;color:#e4d4b4;}.duel-heading:hover,.duel-heading:focus-visible{background:#bda36918;outline:1px solid #edcc78;outline-offset:-3px;}
.duel-detail{padding:0 14px 14px;border-top:1px solid #8b703944;}.duel-detail[hidden],.duel-actions[hidden]{display:none;}.duel-detail p{margin:10px 0;line-height:1.4;}.duel-keep{display:flex;align-items:center;gap:10px;margin-top:12px;}.duel-keep meter{flex:1;min-width:0;height:13px;accent-color:#c7a45d;}.duel-actions{display:flex;flex-wrap:wrap;gap:6px;}.duel-banner button:not(.duel-heading){padding:7px 9px;background:#4b3920;border:1px solid #a38448;border-radius:3px;color:#f3e4bd;font:600 13px 'Source Sans 3',sans-serif;cursor:pointer;}.duel-banner button:disabled{opacity:.5;cursor:default;}.duel-banner button:not(:disabled):hover{background:#624b28;}.duel-banner input{min-width:0;width:100%;background:#17120c;border:1px solid #8d7140;color:#f1e5ce;padding:8px;font:14px 'Source Sans 3',sans-serif;}.duel-chat label{display:block;font-size:12px;margin:9px 0 5px;color:#cfb788;}.duel-chat>div{display:flex;gap:5px;}.duel-messages{white-space:pre-wrap;overflow-wrap:anywhere;max-height:110px;overflow:auto;font-size:13px;line-height:1.5;color:#d9ccac;}.duel-messages:not(:empty){margin-top:12px;border-top:1px solid #8b703944;padding-top:8px;}
@media(max-width:900px){#wars-panel.duel-banner{right:10px;bottom:112px;width:248px;max-height:calc(100dvh - 245px);}.duel-heading{padding:8px 12px;}.duel-heading b{font-size:16px;}}
.duel-keep meter::-webkit-meter-bar{background:#17120c;border:1px solid #947641;border-radius:0}.duel-keep meter::-webkit-meter-optimum-value{background:linear-gradient(#e5cd8d,#b38b44)}.duel-keep meter::-moz-meter-bar{background:#ceb071}

/* One measured lane: the room controls, folding war banner, then realm matters.
   Detail scrolls inside the available space; it never sits on the building dock. */
#ui #wars-panel.duel-banner[aria-label] {
  position:absolute;top:calc(var(--hud-top,72px) + var(--mp-top-h,45px) + 8px);
  right:12px;left:auto;bottom:auto;width:272px;max-width:calc(100% - 24px);
  max-height:max(76px,calc(var(--ui-h,100dvh) - var(--hud-top,72px) - var(--mp-top-h,45px) - var(--right-clear,150px) - 24px));
  display:flex;flex-direction:column;overflow:hidden;
  border-top-width:2px;box-shadow:0 3px 14px #0008;
}
#ui #wars-panel.duel-banner[hidden] {display:none}
#ui #wars-panel.duel-banner[aria-label]:has(.duel-heading[aria-expanded=true]) {
  max-height:max(76px,calc(var(--ui-h,100dvh) - var(--hud-top,72px) - var(--mp-top-h,45px) - var(--hud-bottom,100px) - 24px));
}
#ui:has(#wars-panel.duel-banner:not([hidden]) .duel-heading[aria-expanded=true]) #minimap-wrap {visibility:hidden;pointer-events:none}
#ui #wars-panel.duel-banner .duel-heading {position:relative;flex-shrink:0;gap:3px;padding:9px 30px 10px 12px;min-height:72px}
#ui #wars-panel.duel-banner .duel-heading::after {content:'';position:absolute;right:13px;top:18px;width:6px;height:6px;border-right:1.5px solid #d5b570;border-bottom:1.5px solid #d5b570;transform:rotate(45deg)}
#ui #wars-panel.duel-banner .duel-heading[aria-expanded=true]::after {transform:rotate(225deg);top:21px}
#ui #wars-panel.duel-banner .duel-heading b {font-size:17px;line-height:1.25}
#ui #wars-panel.duel-banner .duel-heading small {font-size:12px;line-height:1.3}
#ui #wars-panel.duel-banner .duel-detail {min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 11px 12px}
#ui #wars-panel.duel-banner .duel-ruler[data-incoming] {border-left:2px solid #c6a357;padding-left:8px}
#ui #wars-panel.duel-banner .duel-offer {flex-basis:100%;color:#dac190;font-size:12px;line-height:1.3}
/* Both shared modes already have a room-status lane. Read the same pause state
   as single player, and keep its duplicate central plate out of that lane. */
#ui:has(#mp-bar.mp-top) #paused-note {visibility:hidden}
#ui:has(#paused-note:not(.hidden)) #mp-bar.mp-top #mpb-status::before {content:'Paused';display:block;color:#f0ce77;font-weight:700;font-size:10px;line-height:1.1;letter-spacing:.4px}
#ui #wars-panel.duel-banner button:focus-visible,#ui #wars-panel.duel-banner input:focus-visible {outline:2px solid #edcc78;outline-offset:2px}
#ui:has(#wars-panel.duel-banner[aria-label]:not([hidden])) #governance-action {top:calc(var(--hud-top,72px) + var(--mp-top-h,45px) + var(--pvp-banner-h,76px) + 16px)}
#ui:has(#wars-panel.duel-banner .duel-heading[aria-expanded=true]) #governance-action,
#ui:has(#mpb-rulers[aria-expanded=true]) #wars-panel.duel-banner {visibility:hidden;pointer-events:none}
@media(max-width:700px) {
  #ui #wars-panel.duel-banner[aria-label] {left:8px;right:8px;width:auto;max-width:none;max-height:max(76px,calc(var(--ui-h,100dvh) - var(--hud-top,72px) - var(--mp-top-h,59px) - var(--hud-bottom,100px) - 24px))}
  #ui #wars-panel.duel-banner .duel-heading {min-height:65px;padding-top:7px;padding-bottom:8px}
  #ui #wars-panel.duel-banner .duel-heading>span {font-size:9px}
  #ui #wars-panel.duel-banner .duel-heading b {font-size:15px}
}
