:root {
	--bg: #f6f5f1;
	--panel: #ffffff;
	--text: #23252b;
	--muted: #5d6270;
	--line: #dfddd6;
	--accent: #2f8f46;
	--accent-soft: #e3f2e6;
	--gold: #b8860b;
	--warn: #9a5b00;
	--warn-soft: #fff1d6;
	--code: #f0eee8;
	--gui: #c6c6c6;
	--slot: #8b8b8b;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #17191e;
		--panel: #1f2228;
		--text: #e6e6e3;
		--muted: #a2a6b0;
		--line: #30343c;
		--accent: #5ccf74;
		--accent-soft: #1d3324;
		--gold: #e2b33c;
		--warn: #f0b552;
		--warn-soft: #3a2c12;
		--code: #2a2e36;
	}
}
* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }

.top { position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar { max-width: 900px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; }
.top > .bar { min-height: 56px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.gem { width: 14px; height: 14px; background: #3fbf5f; transform: rotate(45deg); box-shadow: inset -3px -3px 0 #1f7a37; }

/* top row: Welcome and the mods; second row: the items of the mod you're in */
.tabs { display: flex; align-self: stretch; overflow-x: auto; }
.tabs a {
	display: flex; align-items: center; padding: 0 14px; white-space: nowrap;
	color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a.here { color: var(--accent); border-bottom-color: var(--accent); }
.sub { border-top: 1px solid var(--line); background: var(--bg); }
.sub .bar { gap: 6px; padding-top: 8px; padding-bottom: 8px; overflow-x: auto; }
.sub a { padding: 3px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.sub a:hover { background: var(--accent-soft); color: var(--text); }
.sub a.here { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { max-width: 900px; margin: 0 auto; padding: 24px 20px 48px; }

h1 { font-size: 30px; line-height: 1.2; margin: 8px 0 16px; }
h2 { font-size: 22px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { font-size: 17px; margin: 24px 0 6px; }
p, ul, ol { margin: 0 0 12px; }
li { margin: 3px 0; }
code { background: var(--code); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }
pre { background: var(--code); padding: 10px 14px; border-radius: 8px; overflow-x: auto; margin: 0 0 14px; }
pre code { background: none; padding: 0; }
blockquote { margin: 0 0 14px; padding: 8px 14px; border-left: 3px solid var(--line); color: var(--muted); font-family: ui-monospace, monospace; font-size: 14px; }
kbd {
	background: var(--panel); border: 1px solid var(--line); border-bottom-width: 3px;
	border-radius: 5px; padding: 0 6px; font: 600 0.85em/1.6 ui-monospace, monospace; white-space: nowrap;
}
.table { overflow-x: auto; margin: 0 0 14px; }
table { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

.box { border-radius: 8px; padding: 12px 16px 2px; margin: 0 0 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.box.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.box.note { border-left-color: var(--muted); background: var(--code); }
.badge {
	display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px;
	font-size: 12px; font-weight: 600; line-height: 20px; vertical-align: middle;
	color: var(--warn); background: var(--warn-soft); border: 1px solid currentColor;
}
footer { margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* pictures of the blocks */
.gallery { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 16px; }
figure { margin: 0 0 18px; }
.picture { display: inline-block; text-align: center; }
.picture img {
	width: 240px; height: 240px; display: block;
	background: radial-gradient(circle at 50% 40%, var(--panel), var(--bg) 75%);
	border: 1px solid var(--line); border-radius: 12px;
}
figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* the standard top of an item page: picture, crafting grid under it, name and facts on the right */
.item {
	display: grid; grid-template-columns: 280px 1fr; grid-template-areas: "pic info" "craft info";
	gap: 18px 32px; align-items: start; margin: 8px 0 28px;
	padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.item-pic { grid-area: pic; }
.item-pic img {
	width: 280px; height: 280px; display: block; border-radius: 10px;
	background: radial-gradient(circle at 50% 40%, var(--bg), var(--panel) 75%);
}
.item-info { grid-area: info; min-width: 0; }
.item-info h1 { margin-top: 0; }
.item-summary { font-size: 18px; }
.item-craft { grid-area: craft; }
.item-craft .recipe { margin: 0; }
.label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px; }
.facts { border: 0; background: none; border-radius: 0; }
.facts th { width: 38%; padding: 7px 12px 7px 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.facts td { padding: 7px 0; }
.facts tr:last-child th { border-bottom: 0; }
.yes { color: var(--accent); font-weight: 600; }

/* crafting recipes, like the game's crafting table */
.recipe { display: inline-block; }
.craft {
	display: inline-flex; align-items: center; gap: 18px;
	background: var(--gui); padding: 14px 18px; border-radius: 4px;
	box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555;
}
.grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 2px; }
.slot {
	position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
	background: var(--slot); box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
}
.slot img { width: 32px; height: 32px; image-rendering: pixelated; }
.slot.result { width: 56px; height: 56px; }
.slot.result img { width: 44px; height: 44px; }
.arrow { font-size: 28px; color: #555; }
.inline-icon { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: -4px; }

/* the game's item tooltip, on hover or focus */
.tip {
	display: none; position: absolute; left: calc(100% + 6px); top: -6px; z-index: 3;
	min-width: max-content; padding: 4px 8px;
	background: #100010f0; border: 2px solid #2d0a63; border-radius: 3px;
	font: 14px/1.4 ui-monospace, monospace; text-align: left;
}
.slot:hover .tip, .slot:focus .tip { display: block; }
.t-name { display: block; color: #fff; font-weight: normal; }
.slot.result .t-name { color: #ffaa00; }
.t-lore { display: block; color: #aaa; }

@media (max-width: 760px) {
	.top > .bar { flex-wrap: wrap; gap: 0; padding-top: 10px; }
	.tabs { width: 100%; }
	.tabs a { padding: 10px 12px; }
	.bar { padding-left: 16px; padding-right: 16px; }
	main { padding: 16px; }
	.picture img { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1; }
	.item { grid-template-columns: 1fr; grid-template-areas: "pic" "info" "craft"; padding: 14px; gap: 14px; }
	.item-pic img { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1; margin: 0 auto; }
	.tip { left: 0; top: calc(100% + 4px); }
}
