/* DarkOrbit classic Refining / Upgrade UI (#wu-refining-forge) */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #121212;
}

#wu-refining-forge {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  font: bold 12px Arial, Helvetica, sans-serif;
  color: #fff;
  background: #1a1a1a;
  border: 1px solid #4a8ab0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.85);
  user-select: none;
}

#wu-refining-forge.hidden { display: none !important; }

#wu-refining-forge .ru-window-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  background: linear-gradient(180deg, #4f7f92 0%, #2d5568 55%, #243f4f 100%);
  border-bottom: 1px solid #6aa8c8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#wu-refining-forge .ru-window-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, transparent 42%, #c8dce8 42%, #c8dce8 58%, transparent 58%),
    linear-gradient(45deg, transparent 42%, #c8dce8 42%, #c8dce8 58%, transparent 58%);
  opacity: 0.9;
}

#wu-refining-forge .ru-window-title {
  font: bold 13px Arial, sans-serif;
  color: #e8f4fc;
}

#wu-refining-forge .ru-shell,
#wu-refining-forge .ru-forge,
#wu-refining-forge .ru-forge-chrome {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#wu-refining-forge .ru-forge-chrome {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 3px
    ),
    #141414;
}

#wu-refining-forge .ru-forge-tabs {
  flex: 0 0 auto;
  padding: 6px 8px 0;
  background: #1a1a1a;
}

#wu-refining-forge .ru-tabs {
  display: flex;
  gap: 2px;
  align-items: stretch;
}

#wu-refining-forge .ru-tab {
  flex: 1;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #3a3a3a;
  border-bottom: none;
  background: linear-gradient(180deg, #2e2e2e, #1c1c1c);
  color: #9a9a9a;
  font: bold 12px Arial, sans-serif;
  cursor: pointer;
}

#wu-refining-forge .ru-tab:hover:not(.active) {
  color: #d0d0d0;
  background: linear-gradient(180deg, #3a3a3a, #242424);
}

#wu-refining-forge .ru-tab.active {
  color: #111;
  background: linear-gradient(180deg, #d4d4d4, #a8a8a8);
  border-color: #888;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#wu-refining-forge .ru-tab-sell {
  flex: 0.65;
  font-size: 11px;
}

#wu-refining-forge .ru-forge-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
  border-top: 1px solid #333;
}

#wu-refining-forge .ru-forge-body::-webkit-scrollbar { width: 8px; }
#wu-refining-forge .ru-forge-body::-webkit-scrollbar-thumb { background: #555; }

#wu-refining-forge .ru-forge-section-label {
  margin: 0 0 8px 4px;
  font: bold 12px Arial, sans-serif;
  color: #e0e0e0;
}

#wu-refining-forge .ru-forge-drag-hint {
  margin: 10px 4px 12px;
  text-align: center;
  font: 12px Arial, sans-serif;
  color: #c8c8c8;
  line-height: 1.35;
}

#wu-refining-forge .ru-forge-row,
#wu-refining-forge .ru-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

#wu-refining-forge .ru-forge-equip { margin-top: 4px; }

#wu-refining-forge .ru-forge-slot,
#wu-refining-forge button.ru-forge-slot {
  width: 88px;
  margin: 0 2px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
  color: inherit;
  font: inherit;
}

#wu-refining-forge button.ru-forge-slot { cursor: pointer; }

#wu-refining-forge .ru-forge-slot .ru-title {
  height: 18px;
  line-height: 18px;
  padding: 0 4px;
  background: #000;
  border: 1px solid #555;
  border-bottom: none;
  font: bold 11px Arial, sans-serif;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#wu-refining-forge .ru-forge-slot .ru-img {
  position: relative;
  height: 64px;
  padding: 4px;
  background:
    repeating-linear-gradient(
      -45deg,
      #3a3a3a 0,
      #3a3a3a 4px,
      #2a2a2a 4px,
      #2a2a2a 8px
    );
  border: 1px solid #555;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#wu-refining-forge .ru-forge-slot .ru-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  pointer-events: none;
}

#wu-refining-forge .ru-forge-slot .ru-count {
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: #000;
  border: 1px solid #555;
  font: bold 12px Arial, sans-serif;
  color: #fff;
}

#wu-refining-forge .ru-forge-slot.ru-empty { opacity: 0.45; }

#wu-refining-forge .ru-forge-slot.ru-active-buff .ru-img {
  border-color: #8ab4d0;
  box-shadow: inset 0 0 12px rgba(120, 180, 220, 0.25);
}

#wu-refining-forge .ru-forge-slot .ru-applied {
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 22px;
  height: 22px;
  background: #000;
  border: 1px solid #666;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#wu-refining-forge .ru-forge-slot .ru-applied img {
  max-width: 18px;
  max-height: 18px;
}

#wu-refining-forge .ru-forge-slot .ru-applied.empty {
  opacity: 0;
  pointer-events: none;
}

#wu-refining-forge .ru-target-card .ru-img img:not(.ru-applied img) {
  max-width: 70%;
  max-height: 70%;
}

#wu-refining-forge .ru-refine-tree { padding: 4px 0 8px; }

#wu-refining-forge .ru-refine-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#wu-refining-forge .ru-refine-tree .ru-lines {
  position: relative;
  width: 100%;
  height: 14px;
  margin: 0;
}

#wu-refining-forge .ru-refine-tree .ru-lines.l1::before {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 2px;
  background: #d8d8d8;
  transform: translateY(-50%);
}

#wu-refining-forge .ru-refine-tree .ru-lines.l2::before {
  content: '';
  position: absolute;
  left: 22%;
  width: 2px;
  height: 100%;
  top: 0;
  background: #d8d8d8;
}

#wu-refining-forge .ru-refine-tree .ru-lines.l2::after {
  content: '';
  position: absolute;
  right: 22%;
  width: 2px;
  height: 100%;
  top: 0;
  background: #d8d8d8;
}

#wu-refining-forge .ru-refine-tree .ru-lines.l3::before {
  content: '';
  position: absolute;
  left: 50%;
  width: 2px;
  height: 100%;
  top: 0;
  margin-left: -1px;
  background: #d8d8d8;
}

#wu-refining-forge .ru-tree-spacer {
  width: 88px;
  margin: 0 2px;
}

#wu-refining-forge .ru-btn {
  min-width: 80px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #555;
  background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
  color: #fff;
  font: bold 11px Arial, sans-serif;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#wu-refining-forge .ru-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #5a5a5a, #353535);
  border-color: #777;
}

#wu-refining-forge .ru-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#wu-refining-forge .ru-btn-forge,
#wu-refining-forge .ru-btn-refine { min-width: 88px; }

#wu-refining-forge .ru-btn-max {
  min-width: 48px;
  background: linear-gradient(180deg, #5a5a5a, #333);
}

#wu-refining-forge .ru-btn-sell,
#wu-refining-forge .ru-btn-sell-all {
  background: linear-gradient(180deg, #6a5a40, #3a3020);
  border-color: #8a7a50;
}

#wu-refining-forge .ru-btn-cancel {
  background: linear-gradient(180deg, #444, #2a2a2a);
  color: #ccc;
}

#wu-refining-forge .ru-target-card[data-ru-drop].drag-over .ru-img {
  border-color: #b8d878 !important;
  box-shadow: inset 0 0 14px rgba(180, 220, 100, 0.35) !important;
}

#wu-refining-forge .ru-sell-board { height: auto; }

#wu-refining-forge .ru-sell-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 10px;
  align-items: start;
}

#wu-refining-forge .ru-forge-panel {
  border: 1px solid #444;
  background: #111;
  padding: 8px;
}

#wu-refining-forge .ru-sell-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

#wu-refining-forge .ru-sell-slot { width: 100%; margin: 0; }

#wu-refining-forge .ru-sell-slot.selected .ru-img {
  border-color: #8ab4d0 !important;
}

#wu-refining-forge .ru-sell-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#wu-refining-forge .ru-sell-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

#wu-refining-forge .ru-sell-preview img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

#wu-refining-forge .ru-sell-preview-meta strong {
  color: #fff;
  font-size: 13px;
}

#wu-refining-forge .ru-sell-owned { color: #aaa; font: 11px Arial; }

#wu-refining-forge .ru-sell-rate {
  color: #ccc;
  margin-bottom: 6px;
  font: 12px Arial;
}

#wu-refining-forge .ru-sell-receive {
  color: #e8e8e8;
  margin-bottom: 8px;
  font: bold 12px Arial;
}

#wu-refining-forge .ru-sell-qty-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

#wu-refining-forge .ru-sell-qty-row input,
#wu-refining-forge .ru-dialog-qty-row input {
  width: 88px;
  height: 26px;
  text-align: center;
  background: #000;
  border: 1px solid #555;
  color: #fff;
  font: bold 13px Arial;
}

#wu-refining-forge .ru-sell-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#wu-refining-forge .ru-popup-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
}

#wu-refining-forge .ru-popup-overlay.show { display: flex; }

#wu-refining-forge .ru-popup.ru-forge-popup {
  width: 300px;
  max-width: calc(100% - 24px);
  padding: 14px 16px;
  border: 1px solid #6aa8c8;
  background: linear-gradient(180deg, #2a3a44, #141820);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

#wu-refining-forge .ru-dialog-head {
  color: #e8f4fc;
  font: bold 12px Arial;
  text-transform: uppercase;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

#wu-refining-forge .ru-dialog-qty-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

#wu-refining-forge .ru-dialog-actions {
  display: flex;
  gap: 8px;
}

#wu-refining-forge .ru-dialog-actions .ru-btn {
  flex: 1;
  height: 30px;
}

#wu-refining-forge .ru-status-msg {
  margin-top: 8px;
  min-height: 14px;
  text-align: center;
  font: 11px Arial;
  color: #aaa;
}

#wu-refining-forge .ru-status-msg.ok { color: #8ad878; }
#wu-refining-forge .ru-status-msg.err { color: #ff6b6b; }

@media (max-width: 620px) {
  #wu-refining-forge .ru-sell-split { grid-template-columns: 1fr; }
  #wu-refining-forge .ru-sell-matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #wu-refining-forge .ru-forge-slot,
  #wu-refining-forge button.ru-forge-slot { width: 76px; }
  #wu-refining-forge .ru-tree-spacer { width: 76px; }
}
