/* One Frontier window surface for native dialogs, navigation and floating battle windows. */
html[data-ui-theme="forged"] :is(dialog.dialog,.hud-menu,.battle-map-screen .battle-controls .battle-skill-picker,.battle-map-screen .battle-scene-editor.dialog-content,.battle-map-screen .battle-map-log){
 --window-padding:20px;
 background:#1e232b url(/assets/ui-forged/slate.svg) center/380px;
 border:8px solid transparent;border-image:url(/assets/ui-forged/bronze-frame.svg) 22 fill / 10px;
 border-radius:8px;box-shadow:0 5px 16px #0008,inset 0 0 0 1px #b59b5c33;
 color:var(--text);padding:var(--window-shell-padding,var(--window-padding));box-sizing:border-box;
 width:min(430px,calc(100vw - 32px));max-width:calc(100vw - 32px);
 max-height:calc(100dvh - 48px);overflow:hidden;
}
html[data-ui-theme="forged"] dialog.dialog{--window-shell-padding:0px;padding:0}
dialog.dialog[open]{display:flex;flex-direction:column}
html[data-ui-theme="forged"] dialog.dialog>.dialog-content{
 display:flex;flex-direction:column;min-height:0;max-height:calc(100dvh - 64px);
 padding:var(--window-padding);background:none;border:0;border-image:none;border-radius:0;box-shadow:none;overflow:hidden;
}
html[data-ui-theme="forged"] :is(.hud-menu,.battle-map-screen .battle-controls .battle-skill-picker,.battle-map-screen .battle-scene-editor,.battle-map-screen .battle-map-log){
 position:fixed;inset:auto;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;
 display:flex;flex-direction:column;gap:12px;z-index:80;pointer-events:auto;
 max-height:min(560px,calc(100dvh - 200px));
}
html[data-ui-theme="forged"] :is(.dialog-top,.battle-picker-heading){
 position:relative;display:flex;align-items:flex-start;justify-content:space-between;flex-shrink:0;
 min-height:36px;padding:0 38px 14px 0;margin:0 0 16px;gap:0;
 border:0;border-bottom:1px solid #9b80573d;text-align:left;
}
html[data-ui-theme="forged"] :is(.battle-skill-picker,.battle-map-log,.hud-menu) :is(.dialog-top,.battle-picker-heading){margin-bottom:0}
html[data-ui-theme="forged"] :is(.dialog-top h2,.battle-picker-heading strong,.battle-scene-editor .dialog-top h2){
 margin:0;font:500 21px/1.3 var(--font-body);letter-spacing:0;color:#ead7b3;overflow-wrap:anywhere;
}
html[data-ui-theme="forged"] :is(.dialog-top,.battle-picker-heading) small{display:block;margin-top:6px;color:var(--frontier-muted);font:11px/1.5 Arial,sans-serif;letter-spacing:0}
/* The close target is anchored to the top right, never vertically centered on a tall title. */
html[data-ui-theme="forged"] :is(.dialog-top,.battle-picker-heading)>.dialog-close,
html[data-ui-theme="forged"] .battle-picker-heading>button{
 position:absolute;top:-10px;right:-12px;width:40px;height:40px;min-height:40px;margin:0;padding:0;
 display:grid;place-items:center;background:none!important;border:0!important;border-image:none!important;
 border-radius:0;box-shadow:none!important;transform:none;filter:none;color:#decca6;opacity:1;
}
html[data-ui-theme="forged"] :is(.dialog-top,.battle-picker-heading)>.dialog-close:hover,
html[data-ui-theme="forged"] .battle-picker-heading>button:hover{color:#ffe0a2}
html[data-ui-theme="forged"] :is(.dialog-top,.battle-picker-heading)>.dialog-close rpg-icon,
html[data-ui-theme="forged"] .battle-picker-heading>button rpg-icon{width:19px;height:19px}
.ui-window-body,.hud-menu .screen-switch,.battle-map-log .battle-log{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#96784d #171e28}
.ui-window-body{padding:0 3px 2px 0}
.ui-window-body>:first-child{margin-top:0}
.battle-map-log .battle-log{margin:0;padding-left:20px}
.hud-menu .screen-switch{display:flex;flex-direction:column;align-items:stretch;gap:5px;font:14px Arial,sans-serif}
.hud-menu .screen-switch a{border:1px solid #96784d40;border-radius:6px;background:#1b222c;padding:13px 14px;color:#c4bca9}
.hud-menu .screen-switch a.active,.hud-menu .screen-switch a[aria-current="page"]{background:linear-gradient(100deg,#846a3a30,#202631);border-color:#b5995b88;color:#ead7b3}
.battle-controls .battle-skill-picker .skill-picker-list{flex:1;min-height:0}
@media(max-width:480px){html[data-ui-theme="forged"] :is(dialog.dialog,.hud-menu,.battle-map-screen .battle-controls .battle-skill-picker,.battle-map-screen .battle-scene-editor.dialog-content,.battle-map-screen .battle-map-log){--window-padding:16px}html[data-ui-theme="forged"] :is(.dialog-top h2,.battle-picker-heading strong,.battle-scene-editor .dialog-top h2){font-size:20px}}
