/* Visual identity of the mod (docs/identity.md): a dark forge, charcoal, anvil steel, glowing bronze, flames.
   One look only, like the world of the mod, so every color is set explicitly. */
:root {
  --coal: #131315;
  --coal-deep: #0b0b0c;
  --panel: #212124;
  --line: #343438;
  --text: #ddd5cd;
  --muted: #9a9089;
  --bronze: #e8a55f;
  --bronze-light: #f3bc82;
  --flame: #e87824;
  --flame-light: #f5b250;
  --ember: #78240a;
  --f-pixel: "Pixelify Sans", "Courier New", monospace;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--coal-deep); }
body {
  margin: 0;
  background: var(--coal);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
}

/* Banner: enlarged without smoothing so the pixels stay sharp. */
.hero { background: var(--coal-deep); }
.banner {
  display: block;
  width: 100%;
  max-width: 1280px;
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}

/* Navigation and the strip of flames under it. */
.nav { background: var(--coal-deep); border-top: 1px solid var(--line); }
.nav ul {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.nav li { margin: 0; }
.nav a {
  display: block;
  padding: 12px 14px;
  font-family: var(--f-pixel);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--bronze-light); border-bottom-color: var(--ember); }
.nav a[aria-current="page"] { color: var(--bronze); border-bottom-color: var(--flame); }
.nav .lang { margin-left: auto; }
.nav .lang a { color: var(--muted); font-size: .95rem; }
.nav .lang a:hover { color: var(--bronze-light); }
.flames {
  height: 6px;
  background: linear-gradient(90deg, var(--ember), #be4612 20%, var(--flame) 40%, var(--flame-light) 50%, var(--flame) 60%, #be4612 80%, var(--ember));
}

/* The page. */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  min-width: 0;
}
h1, h2, h3 { font-family: var(--f-pixel); font-weight: 700; line-height: 1.2; text-wrap: balance; }
h1 { margin: 0 0 16px; font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--bronze-light); }
h2 { margin: 40px 0 14px; padding-bottom: 6px; font-size: 1.6rem; color: var(--bronze); border-bottom: 2px solid var(--ember); }
h3 { margin: 28px 0 8px; font-size: 1.25rem; color: var(--flame-light); }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 4px; }
strong { color: #f1e9e1; font-weight: 600; }
a { color: var(--flame-light); text-underline-offset: 3px; }
a:hover { color: #fce2a0; }
a:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; }

blockquote {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--panel);
  border-left: 4px solid var(--flame);
  border-radius: 2px;
}
blockquote p:last-child { margin-bottom: 0; }

/* Tables scroll inside themselves on a narrow screen. */
table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 18px;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: .95rem;
}
th, td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--coal-deep); color: var(--bronze); font-family: var(--f-pixel); font-weight: 500; font-size: 1rem; white-space: nowrap; }
.craft-grid thead { display: none; } /* the crafting grid has an empty header row */
tbody tr:last-child td { border-bottom: 0; }
td em { color: var(--muted); }

.foot {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.foot p { margin: 8px 0 0; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .nav a { padding: 10px 9px; font-size: .95rem; }
  .nav .switch, .nav .lang { margin-left: 0; }
}

/* Version selector, next to the language link. */
.nav .switch { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.nav .switch + .lang { margin-left: 0; }
.nav .switch label { font-family: var(--f-pixel); font-size: .95rem; color: var(--muted); }
.nav select {
  font: 500 .95rem var(--f-pixel);
  color: var(--bronze);
  background: var(--panel);
  border: 1px solid var(--bronze);
  border-radius: 2px;
  padding: 6px 8px;
  min-height: 36px;
  cursor: pointer;
}
.nav select:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }
.nav noscript a { padding: 0 4px; display: inline; }

/* Shown on a version that is not the latest. */
.old {
  margin: 0;
  padding: 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--ember);
  color: #fbe3cf;
  text-align: center;
  font-size: .95rem;
}
.old a { color: #fff3e6; }

@media (max-width: 520px) {
  .nav .switch { margin-left: 0; padding-left: 9px; }
}

/* News list: a small label per kind of change (the word is always written, never color alone). */
.news { list-style: none; padding: 0; margin: 0 0 18px; }
.news li { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.news li:last-child { border-bottom: 0; }
.tag {
  display: inline-block;
  min-width: 5.2em;
  margin-right: 8px;
  padding: 1px 8px;
  font-family: var(--f-pixel);
  font-size: .85rem;
  text-align: center;
  color: var(--coal-deep);
  background: var(--bronze);
  border-radius: 2px;
}
.tag-changed { background: var(--flame-light); }
.tag-fixed { background: var(--text); }
.nav a[aria-current="true"] { color: var(--bronze); border-bottom-color: var(--ember); }
h2 small { font-family: var(--f-body); font-size: .9rem; font-weight: 400; color: var(--muted); }

/* Recipes shown as in-game interfaces. --s is the zoom of the 16 px icons and of the interface crops. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin: 0 0 22px; }
.cards-small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card { --s: 2; margin: 0; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 2px; text-align: center; }
.card figcaption { margin: 0 0 10px; font-family: var(--f-pixel); font-weight: 500; color: var(--bronze); }
.card-text { margin: 8px 0 0; font-size: .88rem; line-height: 1.4; color: var(--muted); }
.card-text .alloys { color: var(--flame-light); }
.heat { color: var(--text); font-family: var(--f-pixel); }
.gui {
  position: relative;
  display: inline-block;
  max-width: 100%;
  background-repeat: no-repeat;
  background-size: calc(256px * var(--s)) calc(256px * var(--s));
  image-rendering: pixelated;
}
.gui-craft {
  width: calc(132px * var(--s)); height: calc(60px * var(--s));
  background-image: url("gui/crafting_table.png");
  background-position: calc(-26px * var(--s)) calc(-13px * var(--s));
}
.gui-foundry {
  width: calc(146px * var(--s)); height: calc(64px * var(--s));
  background-image: url("gui/alloy_foundry.png");
  background-position: calc(-14px * var(--s)) calc(-11px * var(--s));
}
.slot {
  position: absolute;
  left: calc(var(--x) * var(--s) * 1px);
  top: calc(var(--y) * var(--s) * 1px);
  width: calc(16px * var(--s));
  height: calc(16px * var(--s));
}
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.slot .count {
  position: absolute;
  right: 0;
  bottom: 0;
  font: 700 calc(7px * var(--s)) / 1 var(--f-pixel);
  color: #fff;
  text-shadow: calc(.5px * var(--s)) calc(.5px * var(--s)) 0 #3f3f3f;
  pointer-events: none;
}
/* Several items for one slot: they take turns, like a tag does in the game. */
.slot.n2 img, .slot.n3 img, .slot.n4 img { opacity: 0; animation: 2s steps(1) infinite; animation-delay: calc(var(--i) * 2s); }
.slot.n2 img { animation-name: turn2; animation-duration: 4s; }
.slot.n3 img { animation-name: turn3; animation-duration: 6s; }
.slot.n4 img { animation-name: turn4; animation-duration: 8s; }
@keyframes turn2 { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes turn3 { 0% { opacity: 1; } 33.4% { opacity: 0; } }
@keyframes turn4 { 0% { opacity: 1; } 25% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .slot.n2 img, .slot.n3 img, .slot.n4 img { animation: none; opacity: 0; }
  .slot img:first-child { opacity: 1 !important; }
}
/* Smelting: two slots and an arrow, no interface behind them. */
.flow { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0; }
.flow .slot { position: relative; left: auto; top: auto; box-sizing: content-box; padding: calc(1px * var(--s)); background: #8b8b8b; box-shadow: inset calc(1px * var(--s)) calc(1px * var(--s)) #373737, inset calc(-1px * var(--s)) calc(-1px * var(--s)) #fff; }
.flow .arrow { font-size: 1.6rem; color: var(--muted); }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } .cards-small { grid-template-columns: 1fr 1fr; } }
