/* ============================================
   Enhancement Simulator — Step Wizard Styles
   ============================================ */

.enhance-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Utility ── */
.text-red   { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-gold  { color: var(--gold) !important; }

/* ── Adena Icon ── */
.adena-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  object-fit: contain;
}
.adena-icon.sm {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

/* ════════════════════════════════════
   Wizard Header
   ════════════════════════════════════ */
.wiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.adena-wallet {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.adena-wallet .adena-icon {
  width: 36px;
  height: 36px;
  font-size: 16px;
}
.adena-label {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}
.adena-amount {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.adena-code-btn {
  margin-top: 5px;
  padding: 3px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 10.5px;
  cursor: pointer;
}
.adena-code-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.step-bar {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
}
.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s;
  padding: 0 8px;
}
.step-node.active  { opacity: 1; }
.step-node.done    { opacity: 0.75; }
.step-node:hover   { opacity: 0.8; }
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  background: var(--bg-2);
  transition: all 0.2s;
}
.step-node.active .step-num {
  border-color: var(--gold);
  background: var(--gold);
  color: #0b0b14;
}
.step-node.done .step-num {
  border-color: var(--green);
  background: var(--green);
  color: #0b0b14;
}
.step-name {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.step-node.active .step-name { color: var(--gold); font-weight: 700; }
.step-node.done  .step-name  { color: var(--green); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 80px;
  transition: background 0.3s;
}
.step-line.done { background: var(--green); }

/* ════════════════════════════════════
   Wizard Panels (shared)
   ════════════════════════════════════ */
.wiz-panel {}

/* ════════════════════════════════════
   STEP 1 — 아이템 선택
   ════════════════════════════════════ */
.step1-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: start;
}

/* Item Browser */
.item-browser {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.browser-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.browser-count {
  font-size: 12px;
  color: var(--text-3);
}
.category-scroll {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.category-scroll::-webkit-scrollbar { height: 3px; }
.category-scroll button {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.category-scroll button:hover,
.category-scroll button.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.browser-search-wrap {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.browser-search {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  box-sizing: border-box;
}
.browser-search:focus { outline: none; border-color: var(--gold); }
.browser-list {
  max-height: 520px;
  overflow-y: auto;
  background: #0c0c14;
}
.browser-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(30,30,58,0.7);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  transition: background 0.12s;
}
.browser-row:hover,
.browser-row.active { background: rgba(201,168,76,0.07); }
.browser-row.active { box-shadow: inset 2px 0 0 var(--gold); }
.browser-row img {
  width: 36px; height: 36px;
  image-rendering: pixelated;
  object-fit: contain;
}
.browser-row strong { display: block; font-size: 13px; color: var(--text); }
.browser-row em { display: block; font-size: 11px; color: var(--text-3); font-style: normal; }
.browser-row .badge-cat {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.browser-row.is-muted { opacity: 0.55; }
.browser-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.browser-more {
  width: calc(100% - 28px);
  min-height: 40px;
  margin: 10px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.browser-more:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* Item Preview Panel */
.item-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 13px;
  padding: 40px;
}
.preview-content {
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 16px;
}
.preview-card.has-selection .preview-empty { display: none; }
.preview-card.has-selection .preview-content { display: flex; }
.preview-icon-wrap {
  display: flex;
  justify-content: center;
  position: relative;
  padding: 20px 0 10px;
}
.preview-icon-wrap img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 16px rgba(201,168,76,0.25));
}
.preview-enchant-badge {
  position: absolute;
  bottom: 8px; right: calc(50% - 50px);
  background: var(--bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  border-radius: 6px;
  padding: 2px 7px;
}
.preview-enchant-badge.badge-safe {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201,168,76,0.35);
  font-size: 15px;
}
.preview-info { text-align: center; }
.preview-info h2 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.preview-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.preview-safe-tag {
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
}
.preview-type-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* Safe toggle option */
.safe-option {
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(201,168,76,0.06);
}
.safe-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.toggle-info strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.toggle-info span   { font-size: 11.5px; color: var(--text-3); }
.toggle-switch {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-switch.on {
  background: rgba(201,168,76,0.2);
  border-color: var(--gold);
}
.toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-3);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch.on .toggle-knob {
  transform: translateX(18px);
  background: var(--gold);
}
.safe-cost-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(201,168,76,0.05);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  min-width: 0;
}
.safe-cost-row .adena-icon { flex-shrink: 0; width: 16px; height: 16px; }
.safe-cost-row > span:first-of-type {
  display: block;
  white-space: nowrap;
  line-height: 1.25;
}
.safe-cost-row strong {
  display: block;
  color: var(--gold);
  font-weight: 900;
  font-size: 20px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.safe-cost-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Item quantity panel */
.step1-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.item-qty-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.qty-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.qty-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.qty-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  justify-content: center;
}
.qty-btn {
  flex: 0 0 auto;
  min-width: 38px;
  height: 38px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
}
.qty-btn:hover { border-color: var(--gold); color: var(--gold); }
.qty-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
}
.qty-display strong { font-size: 16px; font-weight: 900; color: var(--text); }
.qty-display span { font-size: 12px; color: var(--text-3); }

.item-qty-panel .qty-section {
  align-items: stretch;
  width: 100%;
}
.item-qty-panel .qty-label {
  margin-bottom: 0;
  text-align: center;
}
.qty-row--simple {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 8px;
  width: 100%;
}
.qty-row--simple .qty-btn {
  width: 100%;
  height: 44px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
}
.qty-row--simple .qty-display {
  width: 100%;
  min-width: 72px;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12px;
  border-radius: 8px;
}
.qty-row--simple .qty-display strong { font-size: 18px; }
.qty-row--simple .qty-display span   { font-size: 13px; }


/* Next button */
.btn-next {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: #0b0b14;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-next:hover:not(:disabled) { background: var(--gold-light, #d4b060); }
.btn-next:active:not(:disabled) { transform: scale(0.99); }
.btn-next:disabled { opacity: 0.4; cursor: not-allowed; }

/* ════════════════════════════════════
   STEP 2 — 주문서 준비
   ════════════════════════════════════ */
.step2-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* Selected item summary */
.step2-item-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.summary-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.summary-item-row img {
  width: 48px; height: 48px;
  image-rendering: pixelated;
}
.summary-item-row strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.summary-item-row span   { font-size: 12px; color: var(--text-3); }
.summary-item-row .summary-enchant {
  font-size: 14px;
  font-weight: 900;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 6px;
  padding: 4px 10px;
  margin-left: auto;
}
.summary-info-rows { display: flex; flex-direction: column; gap: 6px; }
.summary-info-row  {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.summary-info-row span { color: var(--text-3); }
.summary-info-row strong { color: var(--text); }

/* Scroll picker */
.scroll-picker {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scroll-picker-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.scroll-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.scroll-card-btn {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: all 0.15s;
}
.scroll-card-btn:hover:not(:disabled) { border-color: var(--border-light); }
.scroll-card-btn.active {
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
}
.scroll-card-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.scroll-card-btn img {
  width: 40px; height: 40px;
  image-rendering: pixelated;
}
.scroll-card-title { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.scroll-card-desc  { display: block; font-size: 11px; color: var(--text-3); line-height: 1.4; }
.scroll-card-btn.active .scroll-card-title { color: var(--gold); }
.scroll-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  white-space: nowrap;
}
.scroll-price strong { font-size: 14px; font-weight: 700; color: var(--gold); }
.scroll-price span   { font-size: 10px; color: var(--text-3); }

/* Purchase panel */
.purchase-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.purchase-selected {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.purchase-scroll-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.purchase-scroll-type { font-size: 12px; color: var(--text-3); }

.qty-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.qty-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 6px;
  align-items: center;
}
.qty-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.12s;
}
.qty-btn:hover { border-color: var(--gold); color: var(--gold); }
.qty-display {
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 4px;
}
.qty-display strong { font-size: 18px; font-weight: 900; color: var(--text); }
.qty-display span   { font-size: 12px; color: var(--text-3); margin-left: 3px; }

.cost-breakdown {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}
.cost-row-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}
.cost-row-item span:first-child { color: var(--text-3); flex: 1; }
.cost-row-item strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cost-row-item.total {
  min-height: 52px;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.22);
}
.cost-row-item.total span:first-child {
  color: var(--gold);
  font-weight: 800;
}
.cost-row-item.total strong { color: var(--gold); font-size: 20px; }
.cost-note {
  margin: 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-align: left;
  padding-left: 2px;
}

.wallet-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(0,0,0,0.14);
}
.wallet-row span:first-child { color: var(--text-3); flex: 1; }
.wallet-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.wallet-row.after {
  border-color: rgba(76,175,122,0.22);
  background: rgba(76,175,122,0.06);
}
.wallet-row.after strong { color: var(--green); }
.wallet-row.after.danger strong { color: var(--red); }

.step2-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.btn-back {
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-back:hover { border-color: var(--gold); color: var(--gold); }
.btn-buy-start {
  padding: 12px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #0b0b14;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-buy-start:hover { background: #d4b060; }
.btn-buy-start:disabled { opacity: 0.4; cursor: not-allowed; }

/* ════════════════════════════════════
   STEP 3 — 강화 진행
   ════════════════════════════════════ */
.sim-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(360px, 1fr) minmax(280px, 300px);
  gap: 16px;
  align-items: start;
}

/* Left aside */
.sim-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.sim-item-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.sii-row { min-width: 0; }
.sii-img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  justify-self: center;
}
.sii-text {
  text-align: left;
  min-width: 0;
}
.sii-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sii-meta { font-size: 11px; color: var(--text-3); }
.sii-change {
  font-size: 11px;
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  padding: 0;
  justify-self: center;
  white-space: nowrap;
}
.sii-change:hover { color: var(--gold-light, #d4b060); }

.sim-scroll-stock {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stock-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.stock-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stock-display img { width: 36px; height: 36px; image-rendering: pixelated; }
.stock-display strong { display: block; font-size: 12px; color: var(--text); margin-bottom: 4px; }
.stock-qty { font-size: 22px; font-weight: 900; color: var(--gold); }
.stock-qty-unit { font-size: 12px; color: var(--text-3); margin-left: 2px; vertical-align: baseline; }
.stock-buy-btn {
  width: 30px;
  height: 30px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.55);
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.stock-buy-btn:hover {
  background: var(--gold);
  color: #111018;
}
.scroll-type-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.scroll-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.scroll-tab:hover { border-color: var(--gold); }
.scroll-tab.active {
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
}
.scroll-tab-label { font-size: 11px; font-weight: 700; color: var(--text); }
.scroll-tab-qty   { font-size: 13px; font-weight: 900; color: var(--gold); }
.scroll-tab-price { font-size: 10px; color: var(--text-3); }
.sim-adena-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.sim-adena-row strong { color: var(--gold); font-variant-numeric: tabular-nums; }

.btn-restart {
  width: 100%;
  padding: 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-restart:hover { border-color: var(--gold); color: var(--gold); }

/* Center stage */
.sim-center {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.item-stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}
.stage-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.4s;
}
.stage-glow.success { background: radial-gradient(ellipse at center, rgba(76,175,122,0.18) 0%, transparent 70%); }
.stage-glow.fail    { background: radial-gradient(ellipse at center, rgba(224,85,85,0.15) 0%, transparent 70%); }
.stage-glow.destroy { background: radial-gradient(ellipse at center, rgba(224,85,85,0.35) 0%, transparent 60%); }
.stage-glow.safe    { background: radial-gradient(ellipse at center, rgba(201,168,76,0.12) 0%, transparent 70%); }

.stage-img-wrap {
  position: relative;
  display: inline-block;
}
.stage-img {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  display: block;
  filter: drop-shadow(0 4px 20px rgba(201,168,76,0.2));
}
.stage-img.shake        { animation: shake 0.3s ease; }
.stage-img.glow-anim    { animation: glowPulse 0.5s ease; }
.stage-img.destroy-anim { animation: destroyAnim 0.55s ease forwards; }

.stage-enchant {
  position: absolute;
  bottom: -6px; right: -12px;
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(201,168,76,0.6);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  line-height: 1.4;
}
.stage-enchant.has-enchant { color: var(--gold); border-color: var(--gold); }
.stage-enchant.destroyed   { color: var(--red);  border-color: var(--red); background: rgba(180,50,50,0.12); }
.stage-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  min-height: 24px;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}
.stage-status {
  font-size: 13px;
  font-weight: 600;
  min-height: 22px;
  text-align: center;
}
.status-ready   { color: var(--text-3); }
.status-success { color: var(--green); }
.status-fail    { color: var(--red); }
.status-destroy { color: var(--red); font-weight: 900; }
.status-safe    { color: var(--gold); }

@keyframes shake {
  0%,100% { transform: translate(0); }
  20% { transform: translate(-5px, 0); }
  40% { transform: translate(5px, 0); }
  60% { transform: translate(-3px, 0); }
  80% { transform: translate(3px, 0); }
}
@keyframes glowPulse {
  0%   { filter: brightness(1) drop-shadow(0 4px 20px rgba(201,168,76,0.2)); }
  50%  { filter: brightness(2.2) drop-shadow(0 0 20px var(--gold)); }
  100% { filter: brightness(1) drop-shadow(0 4px 20px rgba(201,168,76,0.2)); }
}
@keyframes destroyAnim {
  0%   { transform: scale(1); opacity: 1; }
  40%  { transform: scale(1.3); opacity: 0.7; filter: brightness(3) saturate(4); }
  100% { transform: scale(0); opacity: 0; }
}

/* Enhance action buttons */
.enhance-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.enhance-main-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.btn-enhance-main,
.btn-keep-main {
  padding: 10px 12px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #0b0b14;
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: background 0.15s;
  min-height: 64px;
  height: 64px;
  justify-content: center;
  overflow: hidden;
}
.btn-keep-main {
  background: var(--bg-2);
  border: 1px solid rgba(201,168,76,0.35);
  color: var(--gold);
}
.btn-enhance-main:hover:not(:disabled) { background: #d4b060; }
.btn-keep-main:hover:not(:disabled) { border-color: var(--gold); background: rgba(201,168,76,0.1); }
.btn-enhance-main:active:not(:disabled) { transform: scale(0.99); }
.btn-keep-main:active:not(:disabled) { transform: scale(0.99); }
.btn-enhance-main:disabled,
.btn-keep-main:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-enhance-main.is-retry {
  background: var(--red);
  animation: retryPulse 1.4s ease-in-out infinite;
}
.btn-enhance-main.is-retry:hover { background: #c04040; }
@keyframes retryPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(200,60,60,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(200,60,60,0); }
}
.btn-enhance-text {
  font-size: 16px;
  line-height: 1.2;
  min-height: 19px;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}
.btn-enhance-cost {
  font-size: 11px;
  line-height: 1.2;
  min-height: 14px;
  opacity: 0.75;
  text-align: center;
  overflow-wrap: anywhere;
}

.btn-sub {
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-sub:hover { border-color: var(--gold); color: var(--gold); }
.btn-sub:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-3);
}
.stock-bulk-btn {
  width: 100%;
  margin-top: 10px;
}

.vault-panel {
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.vault-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
}
.vault-header strong {
  color: var(--gold);
  font-size: 12px;
}
.vault-list {
  height: 320px;
  min-height: 320px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 46px;
  gap: 6px;
  background: #0c0c14;
}
.vault-empty {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  padding: 28px 8px;
}
.vault-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 46px;
  min-width: 0;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
}
.vault-item:focus { outline: none; }
.vault-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.vault-item:hover { border-color: var(--gold); }
.vault-item.is-active {
  background: #20202a;
  border-color: #5a5a66;
  opacity: 0.72;
  filter: grayscale(0.55);
}
.vault-item.is-active:hover { border-color: var(--gold); opacity: 0.85; }
.vault-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
.vault-item span { min-width: 0; }
.vault-item strong {
  display: block;
  font-size: 11px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Log panel */
.game-log-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-height: 112px;
  display: flex;
  flex-direction: column;
}
.log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-clear-log {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font);
}
.btn-clear-log:hover { color: var(--gold); }
.log-latest {
  min-height: 38px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.018);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.log-latest.is-success { color: var(--green); }
.log-latest.is-fail { color: #a7a9b8; }
.log-latest.is-destroy { color: var(--red); font-weight: 700; }
.log-latest.is-system { color: var(--text-3); }
.log-latest.is-safe { color: var(--gold); }
.log-body {
  min-height: 64px;
  max-height: 104px;
  overflow-y: auto;
  padding: 10px;
  background: #0c0c14;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}
.log-empty {
  width: 100%;
  padding: 12px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}
.log-row {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: help;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 1px 3px rgba(0,0,0,0.45);
  flex: 0 0 auto;
}
.log-row:hover {
  transform: translateY(-1px) scale(1.18);
  border-color: var(--gold);
}
.log-row.is-success { background: var(--green); }
.log-row.is-fail    { background: #7b7d8c; }
.log-row.is-destroy { background: var(--red); }
.log-row.is-system  { background: #4b4d5c; }
.log-row.is-safe    { background: var(--gold); }

/* Right aside */
.sim-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.stats-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-width: 0;
}
.stats-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.stats-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.stat-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 4px;
  text-align: center;
}
.stat-box span { display: block; font-size: 9.5px; color: var(--text-3); margin-bottom: 3px; }
.stat-box strong { font-size: 15px; font-weight: 900; color: var(--text); }
.stat-box.ok  strong { color: var(--green); }
.stat-box.bad strong { color: var(--red); }
.stat-box.gold strong { color: var(--gold); }

.honor-board {
  margin: 0 0 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 154px;
  max-height: 420px;
}
.honor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.honor-head span {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.honor-head strong {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}
.honor-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.honor-actions .btn-sub {
  padding: 6px 8px;
  font-size: 10px;
  white-space: nowrap;
}
@keyframes honor-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(201,168,76,0); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(201,168,76,0.35); }
}
.honor-save-pulse {
  animation: honor-pulse 1s ease-in-out infinite;
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}
.honor-list {
  min-height: 96px;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.honor-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}
.honor-entry {
  display: grid;
  grid-template-columns: 22px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  min-width: 0;
}
.honor-rank {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(207, 170, 79, 0.14);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}
.honor-entry img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.honor-copy {
  min-width: 0;
}
.honor-copy strong,
.honor-copy span,
.honor-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.honor-copy strong {
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 900;
}
.honor-copy span {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.honor-copy em {
  color: var(--text-3);
  font-size: 10px;
  font-style: normal;
  margin-top: 2px;
}
.honor-date {
  color: var(--text-3);
  font-size: 9.5px;
  opacity: 0.65;
}
.honor-week-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.honor-week-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.honor-week-dot:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.2);
}
.honor-week-dot.is-current { background: var(--gold); }
.honor-week-dot.is-selected {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 1px;
}
.honor-week-dot.is-current.is-selected { outline-color: var(--gold); }
.honor-week-dot::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e30;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 10px;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s;
  z-index: 10;
}
.honor-week-dot:hover::after { opacity: 1; }
.honor-week-dot:first-child::after { left: 0; transform: none; }
.honor-week-dot:last-child::after  { left: auto; right: 0; transform: none; }
.honor-week-label {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  white-space: nowrap;
}

.honor-share-btn {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.honor-share-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.made-levels {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.made-levels span {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  margin-bottom: 5px;
}
.made-levels strong {
  display: block;
  color: var(--gold);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  max-height: 42px;
  overflow-y: auto;
}

.records-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  min-height: 248px;
  display: flex;
  flex-direction: column;
}
.records-block[hidden] {
  display: none !important;
}
.records-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.record-list {
  height: 236px;
  min-height: 236px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overscroll-behavior: contain;
}
.record-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}
.record-entry {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.record-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.record-entry strong {
  font-size: 12.5px;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-entry span {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--gold);
}
.record-entry em,
.record-made {
  font-size: 10.5px;
  color: var(--text-3);
  font-style: normal;
}
.record-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.record-meta em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-made {
  overflow: hidden;
  white-space: normal;
  margin-top: 4px;
  line-height: 1.4;
  word-break: keep-all;
}
.record-more {
  padding: 8px;
  text-align: center;
  color: var(--text-3);
  font-size: 11px;
}

.prob-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
}
.prob-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.prob-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
  font-size: 10px;
  padding: 1px 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.prob-toggle-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.prob-scroll {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0c0c14;
  margin-bottom: 8px;
  overflow: visible;
  height: auto;
  max-height: none;
}
.prob-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  table-layout: fixed;
}
.prob-table th {
  background: var(--bg-2);
  color: var(--text-3);
  padding: 5px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.prob-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(30,30,58,0.6);
  text-align: center;
}
.prob-table tr:last-child td { border-bottom: none; }
.prob-table .pt-safe {
  color: var(--gold);
  font-weight: 700;
  min-width: 58px;
}
.prob-table .pt-safe strong {
  display: block;
  font-size: 11px;
}
.prob-table .pt-safe em {
  display: inline-flex;
  margin-top: 1px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
}
.prob-table .pt-high { color: var(--green); font-weight: 600; }
.prob-table .pt-chance { color: var(--green); font-weight: 700; }
.prob-table .pt-fail { color: var(--red); }
.prob-table .pt-cur td {
  background: rgba(201,168,76,0.12);
  box-shadow: none;
}
.prob-table .pt-safe-row td { background: rgba(76,175,122,0.035); }
.prob-table .pt-safe-row.pt-cur td { background: rgba(201,168,76,0.12); }
.pt-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 108px;
  line-height: 1.45;
}
.pt-result + .pt-result { margin-top: 3px; }
.pt-result strong {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.pt-result em {
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.prob-note { font-size: 11px; color: var(--text-3); }

/* ════════════════════════════════════
   Layout stability
   Keeps dynamic result text from resizing the simulator.
   ════════════════════════════════════ */
.wiz-header,
.wiz-panel,
.step1-layout,
.step2-layout,
.sim-layout,
.sim-left,
.sim-center,
.sim-right,
.item-stage,
.enhance-actions,
.game-log-panel,
.stats-block,
.prob-block,
.vault-panel,
.records-block {
  min-width: 0;
  box-sizing: border-box;
}

.wiz-header { min-height: 102px; }
.adena-wallet { width: 210px; max-width: 210px; }
.adena-amount {
  width: 132px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-node { width: 86px; max-width: 86px; }

.browser-row,
.scroll-card-btn,
.summary-item-row,
.stock-display,
.sii-row,
.record-main,
.wallet-row,
.cost-row-item {
  min-width: 0;
}

.browser-row strong,
.browser-row em,
.scroll-card-title,
.purchase-scroll-name,
.summary-item-row strong,
.sii-name,
.sii-meta,
.stock-display strong,
.scroll-tab-label,
.scroll-tab-price {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-preview-panel {
  min-width: 0;
  align-self: start;
}
.preview-card {
  min-height: 430px;
  height: auto;
  max-height: none;
  overflow: visible;
}
.preview-content {
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  overflow: visible;
}
.preview-info h2,
.preview-type-desc,
.toggle-info span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-info h2 { min-height: 40px; -webkit-line-clamp: 2; }
.preview-type-desc { min-height: 36px; -webkit-line-clamp: 2; }
.toggle-info span { min-height: 30px; -webkit-line-clamp: 2; }
.safe-cost-row {
  min-height: 84px;
  align-items: center;
}
.btn-next {
  min-height: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step2-item-summary,
.scroll-picker,
.purchase-panel {
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.summary-info-row strong,
.purchase-scroll-type,
.scroll-card-desc {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
.summary-info-row strong { -webkit-line-clamp: 1; }
.purchase-scroll-type { min-height: 36px; -webkit-line-clamp: 2; }
.scroll-card-desc { -webkit-line-clamp: 2; }
.qty-display,
.wallet-row strong,
.cost-row-item strong {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.purchase-panel {
  min-width: 320px;
  max-width: none;
}
.purchase-selected {
  min-height: 54px;
  overflow: visible;
}
.purchase-scroll-name,
.purchase-scroll-type {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}
.purchase-scroll-type {
  display: block;
  min-height: 18px;
  -webkit-line-clamp: unset;
}
.purchase-cost,
.cost-breakdown {
  min-width: 0;
  overflow: visible;
}
.cost-row-item,
.wallet-row {
  display: flex;
  align-items: center;
  column-gap: 7px;
  row-gap: 3px;
}
.cost-row-item span:first-child,
.wallet-row span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cost-row-item.total span:first-child {
  grid-column: auto;
}
.cost-row-item.total strong {
  grid-column: auto;
  justify-self: auto;
}
.cost-row-item.total .adena-icon {
  grid-column: auto;
}
.btn-back,
.btn-buy-start {
  min-height: 46px;
  white-space: normal;
  overflow: visible;
  line-height: 1.25;
}

@media (max-width: 1100px) {
  .purchase-panel { min-width: 0; }
  .cost-row-item.total span:first-child {
    grid-column: auto;
  }
  .cost-row-item.total strong {
    grid-column: auto;
    justify-self: auto;
  }
  .cost-row-item.total .adena-icon {
    grid-column: auto;
  }
}

.sim-left,
.sim-right {
  overflow: hidden;
}
.sim-item-info,
.sim-scroll-stock,
.prob-block,
.stats-block {
  width: 100%;
  max-width: 100%;
}
.sim-item-info { min-height: 94px; max-height: 112px; overflow: hidden; }
.sim-scroll-stock { min-height: 214px; max-height: 238px; overflow: hidden; }
.scroll-type-tabs { height: 58px; overflow: hidden; }
.scroll-tab { min-height: 58px; max-height: 58px; overflow: hidden; }
.stock-display {
  min-height: 48px;
  max-height: 48px;
  overflow: hidden;
}
.stock-display > div {
  min-width: 0;
  flex: 1;
}
.stock-qty {
  min-width: 54px;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sim-adena-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-stage {
  height: 270px;
  min-height: 270px;
  max-height: 270px;
  padding: 24px 20px;
}
.stage-img-wrap {
  width: 116px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.stage-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.stage-enchant {
  min-width: 42px;
  max-width: 64px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage-name {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stage-status {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage-status span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.enhance-actions {
  height: 354px;
  min-height: 354px;
  max-height: 354px;
  overflow: hidden;
}
.enhance-main-row {
  min-height: 64px;
  max-height: 64px;
}
.btn-enhance-main,
.btn-keep-main,
.btn-sub {
  min-width: 0;
}
.btn-enhance-text,
.btn-enhance-cost {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-enhance-text { -webkit-line-clamp: 1; }
.btn-enhance-cost { -webkit-line-clamp: 2; }

.vault-panel {
  height: 276px;
  min-height: 276px;
  max-height: 276px;
}
.vault-header { height: 42px; }
.vault-list {
  height: 232px;
  min-height: 232px;
  max-height: 232px;
}
.vault-empty {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-log-panel {
  min-height: 112px;
}

.stats-block {
  min-height: 704px;
  max-height: 704px;
  overflow: hidden;
}
.stat-box {
  min-height: 50px;
  max-height: 50px;
  overflow: hidden;
}
.stat-box strong {
  display: block;
  min-height: 22px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.made-levels {
  min-height: 88px;
  max-height: 88px;
  overflow: hidden;
}
.records-block {
  height: 340px;
  min-height: 340px;
  max-height: 340px;
}
.record-list {
  height: 288px;
  min-height: 288px;
  max-height: 288px;
}
.record-entry {
  min-height: 82px;
  max-height: 82px;
  overflow: hidden;
}

.prob-block {
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.prob-title {
  height: auto;
  min-height: 24px;
  margin-bottom: 10px;
}
.prob-body {
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.prob-scroll {
  height: auto;
  max-height: none;
  overflow: visible;
}
.prob-note {
  min-height: 0;
  max-height: none;
  overflow: visible;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ════════════════════════════════════
   Responsive
   ════════════════════════════════════ */
@media (max-width: 1100px) {
  .sim-layout { grid-template-columns: 240px 1fr; }
  .sim-right   { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .step2-layout { grid-template-columns: 1fr 320px; }
  .step2-item-summary { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .step1-layout  { grid-template-columns: 1fr; }
  .step2-layout  { grid-template-columns: 1fr; }
  .sim-layout    { grid-template-columns: 1fr; }
  .sim-right     { grid-template-columns: 1fr 1fr; }
  .wiz-header    { flex-direction: column; gap: 14px; }
  .step-bar      { width: 100%; }
  .step-line     { max-width: none; flex: 1; }
}
@media (max-width: 520px) {
  .sim-right    { grid-template-columns: 1fr; }
  .stats-grid   { grid-template-columns: repeat(3, 1fr); }
  .cost-breakdown,
  .wallet-summary {
    grid-template-columns: 1fr;
  }
  .cost-row-item.total {
    min-height: 52px;
  }
  .cost-row-item.total strong {
    font-size: 18px;
  }
  .step2-actions {
    flex-direction: column;
  }
  .vault-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vault-item {
    grid-template-columns: 1fr;
    justify-items: center;
    height: 62px;
    gap: 3px;
  }
  .vault-item img { width: 26px; height: 26px; }
  .vault-item span {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .vault-item strong {
    font-size: 9.5px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .step-name    { display: none; }
}

/* ════════════════════════════════════
   Final Step 3 layout reset
   The simulator shell must not be clipped; only long lists scroll.
   ════════════════════════════════════ */
.enhance-main {
  width: 100%;
  max-width: 1240px;
  padding: 22px 16px 64px;
  gap: 14px;
}

.wiz-header {
  padding: 12px 16px;
}

.item-browser,
.preview-card,
.purchase-panel,
.scroll-picker,
.step2-item-summary,
.sim-item-info,
.sim-scroll-stock,
.item-stage,
.enhance-actions,
.stats-block,
.prob-block {
  border-radius: 8px;
}

.browser-header {
  padding: 12px 14px;
}

.category-scroll {
  padding: 8px 12px;
  gap: 6px;
}

.category-scroll button {
  padding: 5px 10px;
  font-size: 11px;
}

.browser-search-wrap {
  padding: 8px 12px;
}

.browser-search {
  padding: 8px 10px;
  font-size: 12px;
}

.browser-list {
  max-height: 500px;
}

.browser-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 12px;
}

.browser-row img {
  width: 40px;
  height: 40px;
}

.browser-row strong {
  font-size: 13.5px;
}

.browser-row em,
.browser-row .badge-cat {
  font-size: 11px;
}

.browser-more {
  min-height: 36px;
  margin: 8px 12px 12px;
}

.honor-board {
  min-height: 154px;
  max-height: 420px;
}

.honor-list {
  min-height: 96px;
  max-height: 332px;
}

.sim-layout {
  min-width: 0;
}

.sim-left,
.sim-center,
.sim-right,
.sim-item-info,
.sim-scroll-stock,
.prob-block,
.item-stage,
.enhance-actions,
.vault-panel,
.game-log-panel,
.stats-block,
.records-block {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

/* Desktop layout areas */
@media (min-width: 861px) {
  .sim-layout {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(400px, 1fr) minmax(280px, 320px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: 
      "left center right"
      "prob center right";
    gap: 16px;
    align-items: stretch;
  }
  .sim-left   { grid-area: left; }
  .sim-center { grid-area: center; }
  .sim-right  { grid-area: right; }
  .prob-block { grid-area: prob; }

  .sim-center,
  .sim-right,
  .prob-block {
    height: 100%;
  }

  .sim-center,
  .sim-right {
    min-height: 100%;
  }

  .sim-center .enhance-actions,
  .sim-right .stats-block,
  .prob-block .prob-body {
    flex: 1 1 auto;
  }

  .sim-right .stats-block,
  .prob-block {
    display: flex;
    flex-direction: column;
  }
}

.sim-left,
.sim-center,
.sim-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-scroll-stock,
.prob-block,
.item-stage,
.enhance-actions,
.game-log-panel,
.stats-block {
  flex: 0 0 auto;
}

.scroll-type-tabs {
  height: auto;
  min-height: 58px;
  max-height: none;
  overflow: visible;
}
.scroll-tab {
  min-height: 58px;
  max-height: none;
}
.stock-display {
  min-height: 52px;
  max-height: none;
}

.item-stage {
  min-height: 270px;
  padding: 24px 20px;
}
.stage-name {
  min-height: 44px;
  height: auto;
}
.stage-status {
  min-height: 42px;
  height: auto;
}

.enhance-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vault-panel {
  min-height: 276px;
}
.vault-list {
  height: 232px;
  min-height: 232px;
  max-height: 232px;
  overflow-y: auto;
}

.game-log-panel {
  min-height: 112px;
}
.log-top {
  height: auto;
  min-height: 42px;
}
.log-body {
  height: auto;
  min-height: 64px;
  max-height: 104px;
  overflow-y: auto;
}
.log-row {
  min-height: 0;
  max-height: none;
}

.stats-block {
  padding: 14px;
}
.stat-box {
  min-height: 74px;
  max-height: none;
}
.made-levels {
  min-height: 88px;
  max-height: none;
}
.records-block {
  min-height: 340px;
}
.record-list {
  height: 288px;
  min-height: 288px;
  max-height: 288px;
  overflow-y: auto;
}
.record-entry {
  min-height: 82px;
  max-height: none;
}

.prob-block {
  min-height: 426px;
}
.prob-title {
  height: auto;
  min-height: 26px;
}
.prob-body {
  min-height: 362px;
  max-height: none;
  overflow: visible;
}
.prob-scroll {
  height: auto;
  max-height: none;
  overflow: visible;
}
.prob-note {
  min-height: 32px;
  max-height: none;
}

@media (max-width: 1024px) and (min-width: 861px) {
  .sim-layout {
    grid-template-columns: minmax(260px, 300px) minmax(380px, 1fr) minmax(260px, 300px);
    grid-template-areas:
      "left center right"
      "prob center right";
  }
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .sim-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .sim-right {
    grid-column: auto;
  }
  .prob-block {
    order: 10; /* Move to bottom of the column */
  }
  .sim-item-info {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .enhance-main {
    padding: 16px 10px 56px;
    gap: 12px;
  }
  .wiz-header {
    min-height: 0;
    padding: 12px;
    gap: 12px;
  }
  .adena-wallet {
    width: 100%;
    max-width: none;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
  }
  .adena-amount {
    width: auto;
    max-width: 170px;
  }
  .step-bar {
    justify-content: space-between;
    gap: 5px;
  }
  .step-node {
    width: auto;
    max-width: none;
    padding: 0;
    flex: 0 0 auto;
  }
  .step-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .step-line {
    min-width: 18px;
  }
  .item-stage {
    min-height: 230px;
    padding: 18px 12px;
  }
  .stage-img-wrap {
    width: 100px;
    height: 96px;
  }
  .stage-img {
    width: 82px;
    height: 82px;
  }
  .stage-name {
    min-height: 40px;
    font-size: 15px;
  }
  .stage-status {
    min-height: 38px;
    max-width: 100%;
    font-size: 12px;
  }
  .game-log-panel {
    min-height: 132px;
  }
  .log-top {
    min-height: 36px;
    padding: 8px 10px;
  }
  .log-latest {
    min-height: 54px;
    padding: 8px 10px;
    -webkit-line-clamp: 3;
    font-size: 11.5px;
  }
  .log-body {
    min-height: 48px;
    max-height: 86px;
    padding: 8px;
    gap: 7px;
  }
  .log-row {
    width: 16px;
    height: 16px;
  }
  .enhance-main-row {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: none;
  }
  .btn-enhance-main,
  .btn-keep-main {
    min-height: 54px;
    height: auto;
    padding: 9px 10px;
  }
  .btn-enhance-text {
    font-size: 15px;
  }
  .btn-enhance-cost {
    font-size: 10.5px;
  }
  .vault-panel {
    min-height: 232px;
  }
  .vault-list {
    height: 188px;
    min-height: 188px;
    max-height: 188px;
  }
}

/* Step 1 preview should grow with the selected item text instead of clipping it. */
.preview-card {
  min-height: 0;
  height: auto;
  overflow: visible;
}
.preview-card.has-selection .preview-content {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 0;
  height: auto;
  overflow: visible;
  padding: 18px;
}
.preview-icon-wrap {
  align-self: center;
  justify-content: center;
  padding: 0;
  min-width: 0;
}
.preview-info {
  min-width: 0;
  text-align: left;
}
.preview-info h2,
.preview-type-desc,
.toggle-info span {
  display: block;
  min-height: 0;
  max-height: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}
.preview-info h2 {
  margin-bottom: 7px;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.preview-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  line-height: 1.35;
}
.preview-type-desc {
  line-height: 1.5;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.safe-option {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0;
  overflow: visible;
}
.safe-toggle-row {
  align-items: flex-start;
  min-width: 0;
}
.toggle-info {
  min-width: 0;
}
.toggle-info strong,
.toggle-info span {
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.safe-cost-row {
  line-height: 1.35;
  padding: 10px 12px;
}

@media (max-width: 520px) {
  .preview-card.has-selection .preview-content {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }
  .preview-icon-wrap img {
    width: 60px;
    height: 60px;
  }
  .preview-enchant-badge {
    right: 0;
    bottom: -4px;
  }
  .safe-toggle-row {
    gap: 10px;
  }
  .toggle-switch {
    margin-top: 2px;
  }
}

/* ════════════════════════════════════
   Honor Share Modal
   ════════════════════════════════════ */
.hshare-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}
.hshare-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.hshare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hshare-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.hshare-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font);
}
.hshare-close:hover { color: var(--text); }
.hshare-img-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.hshare-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.hshare-url-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}
.hshare-copy-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.hshare-copy-btn:hover { border-color: var(--gold); color: var(--gold); }
.hshare-actions {
  display: flex;
  gap: 10px;
}
.hshare-dl-btn {
  flex: 1;
  padding: 12px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.hshare-dl-btn:hover { background: rgba(201,168,76,0.2); }
.hshare-refill-btn {
  flex: 1.5;
  padding: 12px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #0b0b14;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.hshare-refill-btn:hover:not(:disabled) { background: var(--gold-light, #d4b060); }
.hshare-refill-btn:disabled { opacity: 0.6; cursor: default; }
.hshare-refill-used {
  flex: 1.5;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 12px 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
