.forge { max-width: 1240px; margin: 0 auto; padding: 32px 40px 72px; display: flex; flex-direction: column; gap: 24px; }
.intro { display: flex; flex-direction: column; gap: 8px; }
.intro h1 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 38px; letter-spacing: 1px; color: var(--text-hi); }
.intro p { margin: 0; font-size: 16px; color: var(--text-body); }

.tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.tabs button { flex: 1 1 180px; min-height: 64px; padding: 8px 16px; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; color: var(--text); font: 800 18px var(--serif); letter-spacing: 1px; cursor: pointer; }
.tabs button span { display: block; font: 500 13px var(--sans); letter-spacing: 0; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--selection-fill); border-color: var(--gold); color: var(--gold); }
.tabs button:hover { filter: brightness(1.12); }

.bench { display: flex; flex-wrap: wrap; gap: 20px; }
.bench[hidden] { display: none; }
.main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 26px 28px; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.row > .label { margin-right: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.count { min-width: 220px; text-align: center; font-size: 16px; font-weight: 600; }
.small-count { min-width: 60px; font-size: 20px; }
.rule { flex: 1 1 260px; font-size: 15px; line-height: 1.5; color: var(--text-body); }
.small { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-body); }
.note { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-body); }

.slots { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.slot { aspect-ratio: 76 / 92; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 2px; background: var(--deep); border: 1px solid var(--line-soft); border-radius: 8px; min-width: 0; }
.slot.w { border-color: var(--line-gold); }
.slot img { width: 80%; height: auto; image-rendering: pixelated; }
.slot span { font-size: 11px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.slot.w span { color: var(--text-hi); }

.result { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.result-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; }
.res-name { font-family: var(--serif); font-weight: 800; font-size: 28px; color: var(--muted); }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.item { position: relative; flex: none; background: var(--deep); border-radius: 10px; }
.item.big { width: 150px; height: 150px; }
.item.huge { width: 176px; height: 176px; }
.item img { position: absolute; image-rendering: pixelated; }
.item .icon { inset: 14%; width: 72%; height: 72%; }
.item .frame { inset: 0; width: 100%; height: 100%; }
.item img[src=""], .item img:not([src]) { visibility: hidden; }
.item .plus { position: absolute; right: 12px; top: 8px; font-family: var(--serif); font-weight: 800; font-size: 26px; color: var(--text-hi); text-shadow: 0 2px 4px #000; }
.item.pop { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.86); filter: brightness(1.8); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .item.pop { animation: none; } }
.line { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.badge { width: 36px; height: 36px; image-rendering: pixelated; }
.badge[hidden] { display: none; }
.gs { font-size: 15px; color: var(--muted); }

.odds { display: flex; flex-direction: column; gap: 8px; }
.odds div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--panel); border-radius: 8px; font-size: 20px; font-weight: 600; }
.run { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.run dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 17px; font-weight: 600; }
.run dd { margin: 0; font-variant-numeric: tabular-nums; }

.steps { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.steps th { padding: 4px 10px; color: var(--muted); font-weight: 500; text-align: left; }
.steps td { padding: 8px 10px; background: var(--panel); }
.steps td:first-child { border-radius: 6px 0 0 6px; font-weight: 600; }
.steps td:last-child { border-radius: 0 6px 6px 0; }
.steps tr.on td { background: var(--selection-fill); }
.table-wrap { max-height: 560px; overflow: auto; }
.lv thead th { position: sticky; top: 0; background: var(--deep); }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text-body); }
.main .rules { font-size: 15px; }

.bench-title { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 24px; color: var(--c-green); }
.range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; }
.range label { display: flex; flex-direction: column; gap: 6px; }
.range input[type=number] { width: 96px; min-height: 48px; padding: 0 12px; background: var(--deep); color: var(--text); border: 1px solid var(--line-gold); border-radius: 8px; font: 600 18px var(--sans); }
.range input[type=range] { flex: 1 1 240px; min-height: 48px; accent-color: var(--gold); }
.costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cost { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--deep); border: 1px solid var(--line); border-radius: 10px; }
.cost img, .gold-dot, .bonus-dot { width: 44px; height: 44px; flex: none; }
.gold-dot { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff0b8, #f2c94c 40%, #9a6a1c); box-shadow: inset 0 0 0 3px #7a5014; transform: scale(.8); }
.bonus-dot { display: grid; place-items: center; border-radius: 8px; background: #1f3322; color: var(--c-green); font: 800 22px var(--serif); }
.cost span { display: flex; flex-direction: column; min-width: 0; }
.cost b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cost i { font-style: normal; font-size: 13px; color: var(--muted); }

.arrow { font-size: 30px; color: var(--gold); }
.gains { display: flex; flex-direction: column; gap: 10px; }
.gain { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.gain img { width: 60px; height: 60px; image-rendering: pixelated; }
.gain.no { color: var(--c-red); font-size: 16px; }
.data-note { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  .forge { padding: 24px 16px 56px; }
  .intro h1 { font-size: 28px; }
  .main, .side { padding: 20px 16px; flex-basis: 100%; }
  .slots { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .count { min-width: 0; flex: 1; }
  .tabs button { flex-basis: calc(50% - 6px); font-size: 16px; }
  .res-name { font-size: 22px; }
  .item.huge { width: 140px; height: 140px; }
}
.lv th, .lv td { padding: 6px 8px; }
.lv td:nth-child(n+2), .lv th:nth-child(n+2) { text-align: right; }
