/* MU7 window skin. The painted border is an outset, not layout space: bag,
   warehouse and Chaos Machine coordinates remain on their existing 34px grid. */
.muwin:not(.party-toast):not(.vip-badge) {
  --win-ink: #e7dcc4;
  --win-gold: #efd9a0;
  --win-btn: url('/client/assets/hud-v2/btn.webp');
  --win-btn-on: url('/client/assets/hud-v2/btn-active.webp');
  color: var(--win-ink);
  border: 1px solid transparent;
  /* frame.webp is a full inventory screenshot. Only its outer 8px rails are
     frame artwork; wider slices include slots and horizontal dividers, which
     stretch into broken vertical borders on tall scrollable windows. */
  border-image: url('/client/assets/hud-v2/frame.webp') 23 8 16 8 / 14px / 11px stretch;
  border-radius: 0;
  background: url('/client/assets/hud-v2/bg.webp') repeat, #0b0a09;
  box-shadow: 0 12px 28px #000b;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}
.muwin:not(.party-toast):not(.vip-badge) > .muwin-head {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 0 7px;
  border: solid transparent;
  border-width: 0 46px 0 40px;
  border-image: url('/client/assets/hud-v2/ribbon-custom.webp') 0 46 0 40 fill / 0 46px 0 40px stretch;
  background: none;
  color: #f1e0bb;
  font: 600 14px/38px 'Segoe UI', Roboto, Arial, sans-serif;
  letter-spacing: .5px;
  text-transform: none;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  cursor: grab;
}
.muwin > .muwin-head > span { min-width: 0; flex: 1; overflow: hidden; text-align: center; text-overflow: ellipsis; }
.muwin > .muwin-head:active { cursor: grabbing; }
.muwin > .muwin-head .muwin-x {
  top: 4px;
  right: -36px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  cursor: pointer;
}
.muwin > .muwin-head .muwin-x:hover { background: radial-gradient(#ffd89a55, transparent 70%); }
.muwin > .muwin-head.has-collapse .collapse-btn { right: 3px; }
.muwin > .muwin-head.has-collapse:not(:has(.muwin-x)) .collapse-btn { right: -28px; }
.muwin > .muwin-head:not(:has(.muwin-x))::after {
  content: '';
  position: absolute;
  top: 0;
  right: -46px;
  width: 46px;
  height: 38px;
  background: url('/client/assets/hud-v2/ribbon-custom.webp') left top / 313px 38px no-repeat;
  transform: scaleX(-1);
  pointer-events: none;
}
.muwin :is(button,input,select,textarea,[tabindex="0"]):focus-visible {
  outline: 2px solid #f3d8a0;
  outline-offset: 2px;
}
.muwin :is(h3,h4) { color: var(--win-gold); font-family: Georgia, 'Times New Roman', serif; font-weight: 400; text-transform: none; letter-spacing: .3px; }
.muwin :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea) {
  color: var(--win-ink);
  background: #0b0a09;
  border: 1px solid #4a4235;
  border-radius: 2px;
  box-shadow: inset 0 1px 3px #000;
}
.muwin input[type=checkbox] { accent-color: #b99a5d; }
.muwin input[type=range] { accent-color: #c9a45a; }
.muwin select option { color: var(--win-ink); background: #12100e; }
/* Keep cells, switches, cards and icon-only controls at their original geometry. */
.muwin button:not(.muwin-x):not(.collapse-btn):not(.settings-toggle):not(.doll-slot):not(.chaos-slot):not(.inv-item):not(.wh-item):not(.trade-item):not(.topup-pack):not(.topup-method):not([class*="slot"]):not([class*="cell"]) {
  min-height: 28px;
  padding: 3px 8px;
  color: #d6c9a8;
  border: 6px solid transparent;
  border-image: var(--win-btn) 8 fill / 6px stretch;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-shadow: 0 1px 2px #000;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.muwin button:not(.muwin-x):not(.collapse-btn):not(.settings-toggle):not(.doll-slot):not(.chaos-slot):not(.inv-item):not(.wh-item):not(.trade-item):not(.topup-pack):not(.topup-method):not([class*="slot"]):not([class*="cell"]):is(.on,.active,.primary,.sel,[aria-pressed="true"],[aria-selected="true"]) {
  color: #fff3d8;
  border-image-source: var(--win-btn-on);
}
.muwin button:not(.muwin-x):not(.collapse-btn):not(.settings-toggle):hover:not(:disabled) { filter: brightness(1.17); }
.muwin button:disabled { cursor: not-allowed; }
/* Gold instead of isolated purple styling; maintain existing button footprints. */
#inv-win .inv-muun { border: 6px solid transparent; border-image: var(--win-btn) 8 fill / 6px stretch; background: none; color: #d6c9a8; }
#inv-win .inv-muun:hover { color: #fff3d8; filter: brightness(1.17); background: none; }
#inv-win .inv-muun-copy b, .inv-foot b { color: var(--win-gold); }
/* Long translated labels need more horizontal space; the item grid itself stays 272px. */
#inv-win { width: 344px; }
#inv-win { max-height: calc(100dvh - 76px); }
.stats-window { right: 364px; width: 390px; }
#inv-win .inv-grid { margin-inline: auto; }
#inv-win .inv-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#inv-win .inv-actions button { min-width: 0; overflow-wrap: anywhere; }
#inv-win .inv-foot { gap: 8px; }
#inv-win .inv-foot > span { min-width: 0; overflow-wrap: anywhere; }
#inv-win .inv-foot > button { flex: none; }
/* Equipment tray: a framed, readable paper doll with native slot hit areas. */
#inv-win .inv-doll {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 58px 94px 72px 62px;
  gap: 6px;
  padding: 9px;
  border: 6px solid transparent;
  border-image: url('/client/assets/hud-v2/slot.webp') 6 fill / 6px stretch;
  background: none;
}
#inv-win .inv-doll::after {
  content: '✦';
  grid-column: 3;
  grid-row: 4;
  align-self: center;
  justify-self: center;
  color: #846b3c;
  font: 24px/1 Georgia, serif;
  text-shadow: 0 0 12px #d7ae6166;
  pointer-events: none;
}
#inv-win .doll-slot {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #715e3c;
  border-radius: 1px;
  background-color: #0b0a09;
  box-shadow: inset 0 0 0 2px #050505a6, inset 0 0 15px #000b;
  color: #c4af83;
}
#inv-win .doll-slot:not(.filled) { opacity: 1; background-size: auto 56%; background-position: center 36%; }
#inv-win .doll-slot:not(.filled)::after {
  content: attr(data-label);
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  overflow: hidden;
  color: #a99c80;
  font: 9px/1.1 'Segoe UI', Arial, sans-serif;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
#inv-win .doll-slot.filled { background: radial-gradient(ellipse at 50% 38%, #3a2d19, #0b0a09 75%); }
#inv-win .doll-slot.filled:hover { border-color: #d1ad62; box-shadow: inset 0 0 9px #e5b75e33, 0 0 7px #e5b75e44; }
#inv-win .doll-slot.exc { border-color: #46c888; }
#inv-win .doll-slot img { max-width: 92%; max-height: 88%; object-fit: contain; }
@media (max-height: 820px) { #inv-win { max-height: calc(100dvh - 16px); } }
.inv-actions .inv-chaos { color: #d6c9a8; }
.inv-actions .inv-chaos:hover:not(:disabled) { color: #fff3d8; }
.inv-pages, .wh-pages { border-color: #574a32; background: #0b0a09; }
.inv-grid, .chaos-slots { background-color: #090807; background-image: url('/client/assets/hud-v2/cell.webp'); background-size: 34px 34px; }
.wh-grid { background-color: #090807; background-image: url('/client/assets/hud-v2/cell.webp'); background-size: 28px 28px; }
.doll-slot { border-color: #5d513e; background-color: #0b0a09; }
.settings-row, .loot-row, .loot-quality, .social-row, .social-letter { border-color: #3a3328; background: #0b0a09; }
.chaos-recipes, .chaos-guide, .chaos-workbench { border-color: #5a4b30; background: url('/client/assets/hud-v2/bg.webp') repeat, #0b0a09; }
.muwin :is(.settings-body,.loot-body,.social-body,.stats-body,.topup-modal-body) { scrollbar-width: thin; scrollbar-color: #6e5d3f #0e0d0c; }
@media (max-width: 700px) {
  .muwin:not(.party-toast):not(.vip-badge) { border-image-outset: 5px; }
  .muwin:not(.party-toast):not(.vip-badge) > .muwin-head { height: 36px; min-height: 36px; font-size: 13px; line-height: 36px; }
  #inv-win .inv-doll { grid-template-rows: 50px 80px 62px 54px; gap: 4px; padding: 6px; }
}
