/* Menu faces are the three button segments from Remake's MT_COMMANDBAR atlas.
   Slice the caps separately so the bevel survives narrow and translated labels. */
body.sw48-ui {
  --menu-normal: url("ui/remake-menu-normal.png");
  --menu-hover: url("ui/remake-menu-hover.png");
  --menu-pressed: url("ui/remake-menu-pressed.png");
  --menu-disabled: url("ui/remake-menu-disabled.png");
  --console-rim: #73818b;
  --console-highlight: #b3c5cf;
  --console-bevel: inset 0 1px 0 #ecf7ff25, inset 0 -1px 0 #0009;
  --console-glass: linear-gradient(135deg, rgb(29 37 41 / 74%), rgb(9 14 19 / 78%));
  --scope-blue: #87c7e9;
}

#sw48-lobby .lobby-sidebar {
  background: linear-gradient(100deg, rgb(9 15 19 / 42%), rgb(9 15 19 / 16%));
}
#sw48-lobby .lobby-nav-item { justify-content: center; text-align: center; }
#sw48-lobby .lobby-nav-arrow { display: none; }

body.sw48-ui #sw48-lobby :is(.lobby-nav-item, .mode-category, .mode-start),
body.sw48-ui :is(#sw48-lobby, #dialog_frame) .sw48-return-home,
#carrier-weapon-bar .carrier-wing-orders button {
  --menu-face: var(--menu-normal);
  background: transparent !important;
  border: 1px solid var(--console-rim) !important;
  border-image: var(--menu-face) 5 26 fill / 4px 15px / 0 stretch !important;
  border-radius: 0;
  box-shadow: none !important;
  color: white !important;
  text-shadow: 0 1px 2px #03070b;
}

body.sw48-ui :is(#sw48-lobby, #dialog_frame) .sw48-return-home {
  padding-inline: 1.15em;
}
body.sw48-ui :is(#sw48-lobby, #dialog_frame) .sw48-return-home:hover {
  text-decoration: none;
}
body.sw48-ui #sw48-lobby :is(.lobby-nav-item, .mode-category).selected,
#carrier-weapon-bar .carrier-wing-orders button[aria-pressed="true"] {
  --menu-face: var(--menu-hover);
  box-shadow: inset 0 -2px var(--console-highlight) !important;
}

@media (hover: hover) {
  body.sw48-ui #sw48-lobby :is(.lobby-nav-item, .mode-category, .mode-start):enabled:hover,
  body.sw48-ui :is(#sw48-lobby, #dialog_frame) .sw48-return-home:enabled:hover,
  #carrier-weapon-bar .carrier-wing-orders button:enabled:hover {
    --menu-face: var(--menu-hover);
  }
}
body.sw48-ui #sw48-lobby :is(.lobby-nav-item, .mode-category, .mode-start):enabled:active,
body.sw48-ui :is(#sw48-lobby, #dialog_frame) .sw48-return-home:enabled:active,
#carrier-weapon-bar .carrier-wing-orders button:enabled:active {
  --menu-face: var(--menu-pressed);
}
body.sw48-ui #sw48-lobby :is(.lobby-nav-item, .mode-category, .mode-start):disabled,
#carrier-weapon-bar .carrier-wing-orders button:disabled {
  --menu-face: var(--menu-disabled);
  opacity: .65;
  box-shadow: none !important;
}

#sw48-lobby .mode-card {
  background: rgb(12 19 24 / 44%);
  border-color: #73818b9c;
  border-radius: 1px;
}
#sw48-lobby .mode-card-footer {
  color: #fff;
  background: linear-gradient(180deg, #3842464f, #10171c73);
  border-top-color: var(--console-rim);
}
body.sw48-ui #dialog_frame:is(.sw48-menu-dialog, .sw48-help-dialog) {
  color: #fff;
  background: var(--console-glass) !important;
  border: 1px solid var(--console-rim) !important;
  border-radius: 1px !important;
  box-shadow: var(--console-bevel), 0 3px 12px #0005 !important;
}
body.sw48-ui #dialog_frame.sw48-menu-dialog .sw48-menu-footer {
  background: rgb(13 20 24 / 94%);
}
body.sw48-ui :is(#dialog_frame, #sw48-lobby) .sw48-menu-tabs .sw48-menu-tab {
  color: #fff !important;
}
body.sw48-ui :is(#dialog_frame, #sw48-lobby) .sw48-menu-tabs .sw48-menu-tab.active {
  border-bottom-color: var(--console-highlight) !important;
  box-shadow: inset 0 -1px var(--console-highlight) !important;
}
body.sw48-ui .lobby-settings select {
  border-color: var(--console-rim) !important;
  background: #192226 !important;
  color: #fff !important;
}

/* The instrument frame belongs to the panel, never to the ship or radar marks. */
body.sw48-ui #upgrade {
  background: var(--console-glass) !important;
  border-color: var(--console-rim) !important;
  box-shadow: var(--console-bevel) !important;
}
body.sw48-ui #upgrade h2 { color: #fff !important; }
body.sw48-ui :is(#upgrade, #respawn) .sw48-ship-card,
body.sw48-ui .deployment-unit,
#carrier-weapon-bar .carrier-wing-slot {
  color: #fff !important;
  background: linear-gradient(180deg, #3441486b, #0b141bb0) !important;
  border: 1px solid #71818d99 !important;
  border-radius: 1px;
}
body.sw48-ui #upgrade .sw48-ship-card:enabled:hover,
body.sw48-ui .deployment-unit.selected,
#carrier-weapon-bar .carrier-wing-slot[aria-pressed="true"] {
  background: linear-gradient(180deg, #344851ad, #16232bb8) !important;
  border-color: var(--scope-blue) !important;
}
#carrier-weapon-bar .carrier-wing-mark img { width: 19px; height: 14px; }
body.sw48-ui #sw48-minimap {
  border-color: #6c93a5;
  box-shadow: 0 0 0 1px #070c10, inset 0 0 0 1px #90d2ea4a;
}
body.sw48-ui #sw48-minimap:is(:hover, :focus-visible) { border-color: #b7ebff; }
#sw48-tactical-map header,
#sw48-hyperspace-map header {
  background: linear-gradient(90deg, #333e45d4, #0d171ebd);
  color: #fff;
  border-bottom-color: var(--console-rim);
}
#sw48-hyperspace-map #hyperspace-engage:enabled {
  color: #ffccd0;
  background: linear-gradient(180deg, #58342fbb, #251012b8);
  border-color: #d67b7e;
  box-shadow: var(--console-bevel);
}
#sw48-hyperspace-map #hyperspace-engage:enabled:active {
  background: #652f32;
  box-shadow: inset 0 2px 4px #19080a;
}

body.sw48-ui #sw48-lobby :is(.lobby-nav-item, .mode-category, .mode-start):focus-visible,
body.sw48-ui :is(#dialog_frame, #sw48-lobby) .sw48-return-home:focus-visible,
#carrier-weapon-bar button:focus-visible,
body.sw48-ui .deployment-unit:focus-visible,
#sw48-hyperspace-map #hyperspace-engage:focus-visible {
  outline: 2px solid #dbf3ff;
  outline-offset: 1px;
}
