/* All visible menu artwork is generated raster art. Text and semantic controls
   remain real HTML so gauges, keyboard navigation and labels keep working. */
.battle-game {
  --ui-panel: url('../art/ui/painted-menus-v1/panel.png');
  --ui-normal: url('../art/ui/painted-menus-v1/button-normal.png');
  --ui-selected: url('../art/ui/painted-menus-v1/button-selected.png');
  --ui-disabled: url('../art/ui/painted-menus-v1/button-disabled.png');
  --ui-danger: url('../art/ui/painted-menus-v1/button-danger.png');
  --ui-ink: url('../art/ui/painted-menus-v1/navy-texture.png');
  --cream: #fff1d3;
  --muted: #c9d3db;
  --line: transparent;
  --amber: #ffdc91;
}
.battle-game :is(.party-window,.command-panel,.system-dialog,.result-card,.rail-card,.sprite-tracker,.party-editor-card,.catalog-entry,.reward-cell,.command-busy,.encounter-tag,.message-strip,.paused-badge,.actor-nameplate,.enemy-intel,.sprite-tracker-alert) {
  border: 0 solid transparent;
  border-radius: 0;
  background: none;
  border-image: var(--ui-panel) 100 fill / 10px / 0 stretch;
  box-shadow: none;
  color: var(--cream);
}
.battle-game .battle-hud { border: 0; background: var(--ui-ink) repeat; }
.battle-game .party-window { padding: 3px 8px 5px; }
.battle-game .party-window-heading { color: #c7c7be; letter-spacing: .12em; }
.battle-game .command-panel { padding: 5px 10px; }
.battle-game .command-panel:has(#submenu:not([hidden])):not([data-menu="target"]) {
  border: 0 solid transparent;
  border-radius: 0;
  background: none;
  border-image: var(--ui-panel) 100 fill / 12px / 0 stretch;
  box-shadow: none;
}
.battle-game :is(.command-heading,.party-window-heading,.detail-line,.dialog-header,.dialog-footer,.catalog-tabs,.catalog-toolbar,.tools-settings) {
  border: 0;
  background: var(--ui-ink) repeat;
  box-shadow: none;
}
.battle-game :is(.dialog-header,.dialog-footer) { border-image: var(--ui-panel) 100 fill / 8px / 0 stretch; background: none; }
.battle-game .system-dialog .dialog-header,
.battle-game .system-dialog .dialog-footer { background: var(--ui-ink) repeat; }
.battle-game .tools-dialog .dialog-header { background: var(--ui-ink) repeat; }
.battle-game :is(button,.top-button,.catalog-tab,input[type="search"],.status-pill,.entry-meta span,.entry-tag,.flow-track span,.raster-select-trigger,.raster-option) {
  border: 0 solid transparent;
  border-radius: 0;
  background: none;
  border-image: var(--ui-normal) 42 130 fill / 7px 13px / 0 stretch;
  box-shadow: none;
  color: var(--cream);
  text-shadow: 0 1px 1px #000;
}
.battle-game .topbar .top-button { background: none; border-image: var(--ui-normal) 42 130 fill / 7px 13px / 0 stretch; color: var(--cream); }
.battle-game .topbar .top-button.accent { background: none; border-image-source: var(--ui-selected); }
.battle-game :is(.top-button.accent,.primary-button,.catalog-tab.active,.combo-ready,.flow-track span.active,.party-editor-card.selected) {
  background: none;
  color: var(--cream);
  border-image-source: var(--ui-selected);
  box-shadow: none;
}
.battle-game .party-editor-card.selected { border-image: var(--ui-panel) 100 fill / 10px / 0 stretch; }
.battle-game :is(button,.top-button,.catalog-tab,.raster-select-trigger):hover:enabled,
.battle-game :is(button,.top-button,.catalog-tab,.raster-select-trigger):focus-visible,
.battle-game :is(.status-card.commanding,.target-button.selected-target,.raster-option[aria-selected="true"]) {
  border-image-source: var(--ui-selected);
  background: none;
  box-shadow: none;
  color: #fff3d7;
  outline: none;
}
.battle-game :is(button:disabled,.command-placeholder,.status-card.blocked,.status-card[aria-disabled="true"]) {
  border-image-source: var(--ui-disabled);
  background: none;
  opacity: .72;
}
.battle-game .status-card { border: 0 solid transparent; border-image: var(--ui-normal) 42 130 fill / 6px 11px / 0 stretch; padding: 4px 10px; }
.battle-game .status-card:last-child { border: 0 solid transparent; border-image: var(--ui-normal) 42 130 fill / 6px 11px / 0 stretch; }
.battle-game .status-card.ready { background: none; border-image-source: var(--ui-selected); }
.battle-game .status-card.commanding { background: none; border-image-source: var(--ui-selected); box-shadow: none; }
.battle-game .status-card.commanding::before { display: none; }
.battle-game .status-card.target-choice { background: none; border-image-source: var(--ui-selected); }
.battle-game .status-shortcut { color: #e8c784; }
.battle-game .status-ready-label { color: #c4d2da; }
.battle-game .ready .status-ready-label { color: #ffe095; }
.battle-game .status-pill { background: none; }
.battle-game .status-pill.negative { border-image-source: var(--ui-danger); color: #ffdfd1; }
.battle-game .status-pill.positive { border-image-source: var(--ui-selected); }
.battle-game :is(.hp-track,.mp-track,.atb-track,.enemy-hp-mini) {
  border: 0;
  border-radius: 0;
  background: url('../art/ui/painted-menus-v1/gauge-empty.png') 0 0 / 100% 100% no-repeat;
  box-shadow: none;
  overflow: hidden;
}
.battle-game :is(.hp-track i,.enemy-hp-mini i) { background: url('../art/ui/painted-menus-v1/gauge-hp.png') 0 0 / 100% 100% no-repeat; border-radius: 0; box-shadow: none; }
.battle-game .mp-track i { background: url('../art/ui/painted-menus-v1/gauge-mp.png') 0 0 / 100% 100% no-repeat; border-radius: 0; box-shadow: none; }
.battle-game .atb-track i,
.battle-game .status-card.ready .atb-track i { background: url('../art/ui/painted-menus-v1/gauge-atb.png') 0 0 / 100% 100% no-repeat; border-radius: 0; box-shadow: none; }
.battle-game .hp-track.low i { background: url('../art/ui/painted-menus-v1/gauge-hp.png') 0 0 / 100% 100% no-repeat; filter: hue-rotate(270deg) saturate(.8); }
.battle-game .command-button { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.battle-game .command-button::before {
  content: ''; display: block; width: 22px; height: 22px; flex: 0 0 22px;
  background: var(--command-icon) center / contain no-repeat;
}
.battle-game [data-command="attack"] { --command-icon: url('../art/ui/painted-menus-v1/icon-sword-96.png'); }
.battle-game [data-command="tech"] { --command-icon: url('../art/ui/painted-menus-v1/icon-clock-96.png'); }
.battle-game [data-command="combo"] { --command-icon: url('../art/ui/painted-menus-v1/icon-combo-96.png'); }
.battle-game [data-command="item"] { --command-icon: url('../art/ui/painted-menus-v1/icon-bottle-96.png'); }
.battle-game [data-command="defend"] { --command-icon: url('../art/ui/painted-menus-v1/icon-shield-96.png'); }
.battle-game [data-command="flee"] { --command-icon: url('../art/ui/painted-menus-v1/icon-flee-96.png'); }
.battle-game .command-button strong { flex: 1; }
.battle-game .command-button small { display: none; }
.battle-game :is(.command-button,.submenu-button,.target-button):hover:enabled { background: none; border-image-source: var(--ui-selected); }
.battle-game .submenu-button .cost { background: none; border: 0; color: #ffe099; }
.battle-game .target-button.selected-target { background: none; border-image-source: var(--ui-selected); box-shadow: none; }
.battle-game .message-icon { font-size: 0; width: 18px; height: 20px; background: url('../art/ui/painted-menus-v1/icon-clock-96.png') center / contain no-repeat; }
.battle-game .tag-dot { width: 18px; height: 18px; border-radius: 0; background: url('../art/ui/painted-menus-v1/icon-clock-96.png') center / contain no-repeat; box-shadow: none; }
.battle-game :is(.encounter-tag,.message-strip) { padding: 8px 14px; }
.battle-game .close-button { font-size: 0; min-width: 30px; min-height: 30px; position: relative; }
.battle-game .close-button::before { content: ''; position: absolute; inset: 7px; background: url('../art/ui/painted-menus-v1/icon-close-96.png') center / contain no-repeat; }
.battle-game :is(#toolsButton,#partyButton,#catalogButton)::before { content: ''; display: inline-block; width: 17px; height: 17px; margin-right: 5px; vertical-align: middle; background: var(--tool-icon) center / contain no-repeat; }
.battle-game #toolsButton { --tool-icon: url('../art/ui/painted-menus-v1/icon-gear-96.png'); }
.battle-game #partyButton { --tool-icon: url('../art/ui/painted-menus-v1/icon-party-96.png'); }
.battle-game #catalogButton { --tool-icon: url('../art/ui/painted-menus-v1/icon-book-96.png'); }
.battle-game .flow-track i { border: 0; background: url('../art/ui/painted-menus-v1/icon-arrow-96.png') center / contain no-repeat; height: 13px; }
.battle-game :is(.rail-heading,.battle-log li) { border: 0; background: none; }
.battle-game input[type="checkbox"] { appearance: none; width: 18px; height: 18px; margin: 0; background: var(--ui-disabled) center / 100% 100% no-repeat; border: 0; border-radius: 0; cursor: pointer; }
.battle-game input[type="checkbox"]:checked { background: url('../art/ui/painted-menus-v1/icon-arrow-96.png') center / contain no-repeat; }
.battle-game input[type="search"] { border-image: var(--ui-normal) 42 130 fill / 7px 13px / 0 stretch; padding-left: 14px; }
.battle-game .raster-select { position: relative; display: block; min-width: 0; }
.battle-game .raster-select-trigger { width: 100%; min-height: 32px; padding: 5px 25px 5px 12px; text-align: left; font: inherit; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.battle-game .raster-select-trigger::after { content: ''; position: absolute; right: 9px; top: 50%; width: 10px; height: 10px; transform: translateY(-50%); background: url('../art/ui/painted-menus-v1/icon-down-96.png') center / contain no-repeat; }
.battle-game .raster-select-menu { position: fixed; inset: auto; margin: 0; max-height: 260px; overflow: auto; padding: 8px; min-width: 180px; border: 0 solid transparent; border-image: var(--ui-panel) 100 fill / 9px / 0 stretch; background: none; color: var(--cream); }
.battle-game .raster-option { display: block; width: 100%; min-height: 31px; padding: 6px 12px; margin: 2px 0; text-align: left; font: inherit; font-size: 11px; cursor: pointer; }
.battle-game .raster-option:focus-visible { outline: none; border-image-source: var(--ui-selected); }
.battle-game .loadout-grid .raster-select-trigger { font-size: 10px; }
.battle-game .select-control .raster-select { min-width: 112px; }
.battle-game :is(.submenu,.catalog-tabs,.catalog-content,.party-editor,.system-dialog,.battle-log)::-webkit-scrollbar { width: 10px; height: 10px; }
.battle-game :is(.submenu,.catalog-tabs,.catalog-content,.party-editor,.system-dialog,.battle-log)::-webkit-scrollbar-track { background: url('../art/ui/painted-menus-v1/gauge-empty.png') center / 100% 100% no-repeat; }
.battle-game :is(.submenu,.catalog-tabs,.catalog-content,.party-editor,.system-dialog,.battle-log)::-webkit-scrollbar-thumb { background: url('../art/ui/painted-menus-v1/gauge-atb.png') center / 100% 100% no-repeat; border: 0; border-radius: 0; }
.battle-game :is(.submenu,.catalog-tabs,.catalog-content,.party-editor,.system-dialog,.battle-log) { scrollbar-width: auto; scrollbar-color: auto; }
