:root {
  --night: #101b29;
  --night-2: #182739;
  --ink: #1d2733;
  --muted: #5a6573;
  --gold: #d9a441;
  --gold-hi: #f4cf78;
  --gold-lo: #a8741f;
  --parch: #f5eedf;
  --paper: #fffbf2;
  --line: #e2d5b8;
  --teal: #2a7a80;
  --leaf: #4f8a3c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--parch); color: var(--ink); font: 17px/1.65 var(--sans); }
a { color: var(--teal); }
a:hover { color: var(--gold-lo); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; cursor: pointer; }

/* header */
.top { background: var(--night); border-bottom: 3px solid var(--gold-lo); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 1.15rem/1 var(--serif); letter-spacing: .01em; }
.brand:hover { color: var(--gold-hi); }
.brand-cube { width: 30px; height: 30px; }
.top-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.top-nav a { color: #c9d3de; text-decoration: none; font-size: .95rem; }
.top-nav a:hover { color: var(--gold-hi); }

/* hero */
.hero { background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); color: #e7edf3; }
.hero-in { max-width: 1120px; margin: 0 auto; padding: 26px 16px 92px; }
.eyebrow { margin: 0 0 6px; color: var(--gold-hi); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 0; font: 700 clamp(2rem, 6vw, 3.1rem)/1.1 var(--serif); color: #fff; }
.lede { max-width: 760px; margin: 12px 0 16px; color: #c9d3de; font-size: 1.05rem; }
.stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stats li { padding: 4px 12px; border: 1px solid #33465c; background: #13212f; font-size: .88rem; color: #aebccb; }
.stats b { color: var(--gold-hi); }

/* tool frame */
.forge-wrap { max-width: 1120px; margin: -76px auto 0; padding: 0 16px; }
.forge { position: relative; max-height: 600px; overflow-y: auto; background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--gold-lo); }
.forge-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 16px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 600; font-size: .95rem; }
.pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pill:hover { background: #fff; box-shadow: 3px 3px 0 var(--gold); }
.pill[data-gf-liked], .pill[aria-pressed="true"] { background: var(--gold); }
.pill[data-gf-liked] svg { fill: var(--ink); }
.pill-gold { background: var(--gold); }
.pill-msg { color: var(--muted); font-size: .9rem; }

/* reading area */
.read { max-width: 1120px; margin: 0 auto; padding: 28px 16px 40px; display: grid; gap: 28px; }
.toc { display: none; }
@media (min-width: 1000px) {
  .read { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: block; position: sticky; top: 20px; align-self: start; font-size: .92rem; }
  .toc p { margin: 0 0 6px; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; }
  .toc ol { margin: 0; padding-left: 18px; }
  .toc li { margin: 4px 0; }
  .toc a { color: var(--ink); text-decoration: none; }
  .toc a:hover { color: var(--teal); }
}
.read-main { min-width: 0; max-width: 780px; }
.guide { margin-bottom: 30px; }
.guide h2 { margin: 1.6em 0 .5em; font: 700 1.6rem/1.25 var(--serif); padding-bottom: 6px; border-bottom: 2px solid var(--line); scroll-margin-top: 16px; }
.guide > h2:first-child, .guide > :first-child h2 { margin-top: 0; }
.guide h3 { margin: 1.3em 0 .3em; font-size: 1.12rem; }
.guide p, .guide li { max-width: 72ch; }
.guide ol, .guide ul { padding-left: 1.3em; }
.guide li { margin: .3em 0; }
.guide code { background: #efe4cc; padding: 1px 5px; font-size: .92em; }
.scroll-x { overflow-x: auto; border: 2px solid var(--ink); background: var(--paper); }
.bench-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.bench-table th, .bench-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.bench-table thead th { background: var(--night); color: #fff; font-weight: 600; }
.bench-table tbody th { white-space: nowrap; }
.bench-table td:nth-child(2), .bench-table td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.qa dt { margin-top: 18px; font-weight: 700; font-size: 1.05rem; }
.qa dd { margin: 4px 0 0; color: #333d48; }

/* comments */
.talk-n { color: var(--muted); font-size: 1rem; font-family: var(--sans); font-weight: 400; }
.tform { display: grid; gap: 6px; padding: 16px; background: var(--paper); border: 2px solid var(--ink); }
.tform label { font-weight: 600; font-size: .92rem; }
.tform small { font-weight: 400; color: var(--muted); }
.tform input, .tform textarea { width: 100%; padding: 10px; border: 2px solid #b9ab8c; background: #fff; font: inherit; }
.tform input:focus, .tform textarea:focus { outline: 3px solid var(--gold-hi); border-color: var(--ink); }
.tform-reply { display: none; margin: 0; }
.tform[data-gf-replying] .tform-reply { display: block; }
.tform-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.tform-msg { color: var(--muted); font-size: .9rem; }
.textbtn { background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; font-size: .9rem; }
.tlist { list-style: none; margin: 16px 0 0; padding: 0; }
.tlist[data-gf-empty]::before { content: "No comments yet. If a recipe looks wrong after an update, tell us the item and what the game shows."; display: block; color: var(--muted); }
.tlist[data-gf-off] { display: none; }
.t { padding: 12px 0; border-bottom: 1px solid var(--line); }
.t-meta { margin: 0; font-size: .9rem; color: var(--muted); }
.t-meta b { color: var(--ink); }
.t-owner { display: none; padding: 1px 6px; background: var(--gold); color: var(--ink); font-size: .75rem; font-weight: 700; }
.t[data-gf-owner] > .t-meta .t-owner { display: inline-block; }
.t[data-gf-owner] { background: #fbf3dd; padding-left: 10px; border-left: 4px solid var(--gold); }
.t-text { margin: 4px 0; white-space: pre-wrap; }
.t-replies { list-style: none; margin: 6px 0 0 18px; padding: 0; }

/* plain pages */
.doc { max-width: 780px; margin: 0 auto; padding: 32px 16px 48px; }
.doc h1 { font: 700 2.1rem/1.2 var(--serif); margin: 0 0 6px; }
.doc-date { color: var(--muted); margin: 0 0 20px; }
.prose h2 { font: 700 1.35rem/1.3 var(--serif); margin: 1.5em 0 .4em; }

/* footer */
.foot { background: var(--night); color: #aebccb; border-top: 3px solid var(--gold-lo); }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 26px 16px; font-size: .9rem; }
.foot-brand { margin: 0 0 6px; color: #fff; font: 700 1.05rem var(--serif); }
.foot-note { max-width: 760px; margin: 0 0 12px; }
.foot a { color: var(--gold-hi); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot-copy { margin: 14px 0 0; color: #7d8c9c; }

/* ===== calculator (inside the iframe) ===== */
.calc { padding: 16px; max-width: 1080px; margin: 0 auto; }
.calc-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.fld { display: grid; gap: 4px; }
.fld label { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fld-item { position: relative; flex: 1 1 170px; }
.fld-item input { width: 100%; height: 48px; padding: 0 14px; border: 3px solid var(--ink); background: #fff; font: 600 1.05rem var(--sans); }
.fld input:focus { outline: 3px solid var(--gold-hi); outline-offset: 0; }
.sug { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin: 2px 0 0; padding: 0; list-style: none; background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--gold-lo); max-height: 320px; overflow-y: auto; }
.sug-i { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #efe6d2; }
.sug-i:hover, .sug-i[aria-selected="true"] { background: var(--gold-hi); }
.sug-none { padding: 10px 14px; color: var(--muted); }
.step { display: flex; height: 48px; border: 3px solid var(--ink); background: #fff; }
.step button { width: 44px; border: 0; background: var(--parch); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.step button:hover { background: var(--gold-hi); }
.step input { width: 76px; border: 0; border-left: 2px solid var(--line); border-right: 2px solid var(--line); text-align: center; font: 700 1.1rem var(--sans); -moz-appearance: textfield; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; }
.quick-l { color: var(--muted); font-size: .9rem; margin-right: 2px; }
.chip { padding: 5px 11px; border: 2px solid var(--ink); background: var(--parch); font-size: .88rem; font-weight: 600; color: var(--ink); }
.chip:hover { background: var(--gold-hi); }
.out { margin-top: 16px; border-top: 3px solid var(--ink); padding-top: 12px; }
.out-head h2 { margin: 0; font: 700 1.6rem/1.2 var(--serif); }
.o-line { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.src { font-size: .9rem; white-space: nowrap; }
.o-alts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0; }
.o-alts:empty { display: none; }
.alts-l { font-size: .88rem; color: var(--muted); }
.alt { padding: 4px 10px; border: 2px solid #b9ab8c; background: #fff; font-size: .82rem; text-align: left; color: var(--ink); }
.alt[aria-pressed="true"] { border-color: var(--ink); background: var(--gold-hi); }
.tabs { display: flex; gap: 0; margin: 14px 0 0; border-bottom: 3px solid var(--ink); overflow-x: auto; }
.tabs button { flex: 1 1 auto; padding: 9px 12px; border: 0; background: none; font-weight: 700; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--gold-hi); }
.pane-tip { margin: 10px 0; color: var(--muted); font-size: .9rem; }
.mats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 2px solid var(--line); }
.mat-n { min-width: 3.2em; padding: 3px 6px; background: var(--night); color: var(--gold-hi); text-align: center; font-variant-numeric: tabular-nums; }
.mat-t { flex: 1; font-weight: 600; line-height: 1.3; }
.mat-t small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.own { flex: 0 0 auto; padding: 3px 8px; border: 2px solid var(--ink); background: var(--parch); font-size: .78rem; font-weight: 600; color: var(--ink); }
.own:hover { background: var(--gold-hi); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.st { counter-increment: s; display: grid; gap: 2px; padding: 10px 12px 10px 48px; position: relative; background: #fff; border: 2px solid var(--line); }
.st::before { content: counter(s); position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; display: grid; place-items: center; background: var(--gold); font-weight: 700; font-size: .85rem; }
.st-h { font-size: 1rem; }
.st-b { color: var(--teal); font-size: .88rem; font-weight: 600; }
.st-in { font-size: .92rem; }
.st-x { font-size: .82rem; color: var(--leaf); }
.st .own { justify-self: start; margin-top: 4px; }
.needs { margin: 14px 0 0; padding: 10px 12px; background: var(--night); color: #dfe7ef; font-size: .92rem; }
.calc-foot { margin: 16px 0 0; color: var(--muted); font-size: .8rem; }
@media (min-width: 800px) { .forge { max-height: 660px; } }
@media (max-width: 599px) {
  .step button { width: 38px; }
  .step input { width: 54px; }
  .quick .chip:nth-of-type(n+4) { display: none; }
  .tabs button { padding: 9px 6px; font-size: .86rem; }
  .out-head h2 { font-size: 1.35rem; }
}
@media (max-width: 599px) {
  .eyebrow { display: none; }
  .hero-in { padding-top: 18px; }
  .lede { font-size: .97rem; margin: 8px 0 12px; }
  .stats { gap: 6px; }
  .stats li { padding: 2px 8px; font-size: .78rem; }
}
/* inner tool pages */
.crumb { margin: 0 0 6px; font-size: .85rem; color: #aebccb; }
.crumb a { color: var(--gold-hi); text-decoration: none; }
.read-one { grid-template-columns: minmax(0, 1fr) !important; }
.read-one .read-main { margin: 0 auto; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--night); color: #fff; font-weight: 600; white-space: nowrap; }
.data-table td:first-child { font-weight: 600; }
/* smelting calculator */
.fld-l { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fld-pick { flex: 1 1 200px; }
.fld select { height: 48px; padding: 0 10px; border: 3px solid var(--ink); background: #fff; font: 600 1rem var(--sans); color: var(--ink); width: 100%; }
.fld select:focus { outline: 3px solid var(--gold-hi); }
.seg { display: flex; height: 48px; border: 3px solid var(--ink); }
.seg button { padding: 0 14px; border: 0; background: #fff; font-weight: 700; color: var(--muted); }
.seg button + button { border-left: 2px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--gold-hi); }
.smelt-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 18px 0 0; }
.big { margin: 0; padding: 14px; background: var(--night); color: #c9d3de; display: grid; gap: 2px; }
.big b { color: var(--gold-hi); font: 700 1.7rem/1.15 var(--serif); }
.big span { font-size: .85rem; }
@media (max-width: 599px) {
  .top-nav { gap: 12px; }
  .top-nav a { font-size: .86rem; }
  .smelt-out { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .big { padding: 10px 8px; }
  .big b { font-size: 1.15rem; }
  .big span { font-size: .75rem; }
}
