:root {
	--ink: #1a1a1a;
	--fire: #c0392b;
	--bg: #f7f5f0;
	--rule: #d8d2c4;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	color: var(--ink);
	background: var(--bg);
}

.site-header,
.site-main,
.site-footer {
	max-width: 960px;
	margin: 0 auto;
	padding: 1rem 1.25rem;
}

.site-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.site-header h1 { margin: 0; font-size: 1.5rem; }
.site-header a { color: var(--fire); text-decoration: none; }
.site-nav { display: flex; gap: 1rem; }
.site-nav a { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { color: var(--fire); }

.page-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

table.games-list { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.games-list th, table.games-list td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); }
table.games-list th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #777; }
table.games-list tbody tr:hover { background: #fff; }

.status { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.1em 0.5em; border-radius: 3px; border: 1px solid var(--rule); }
.status-setup     { color: #8a6d1f; border-color: #e0d3a6; }
.status-active    { color: #1b7a3d; border-color: #b6dcc2; }
.status-finished  { color: #555; }
.status-abandoned { color: #999; }

.lede { font-size: 1.1rem; }
code { background: #fff; padding: 0.1em 0.35em; border: 1px solid var(--rule); border-radius: 3px; }

table.campaigns { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.campaigns th,
table.campaigns td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--rule); }
table.campaigns th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #777; }

.site-footer { color: #888; font-size: 0.85rem; border-top: 1px solid var(--rule); margin-top: 2rem; }

.cta { color: var(--fire); font-weight: 600; text-decoration: none; }
.error { background: #fdecea; border: 1px solid #f5c6cb; color: #842029; padding: 0.6rem 0.8rem; border-radius: 4px; }

form.new-game { max-width: 640px; }
.field { display: block; margin: 0 0 1rem; }
.field > span { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field input[type="text"], .field select { width: 100%; padding: 0.45rem 0.5rem; border: 1px solid var(--rule); border-radius: 4px; font: inherit; background: #fff; }
.field small { color: #777; }

fieldset.options, details.options { border: 1px solid var(--rule); border-radius: 4px; padding: 0.75rem 1rem; margin: 0 0 1rem; background: #fff; }
fieldset.options legend, details.options summary { font-weight: 600; padding: 0 0.4rem; cursor: pointer; }
.opt { display: block; padding: 0.15rem 0; font-size: 0.95rem; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.1rem 1rem; margin-top: 0.5rem; }

button[type="submit"] { background: var(--fire); color: #fff; border: 0; padding: 0.6rem 1.2rem; border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; }

table.kv { border-collapse: collapse; }
table.kv th { text-align: left; padding: 0.3rem 1rem 0.3rem 0; color: #777; font-weight: 600; vertical-align: top; }
table.kv td { padding: 0.3rem 0; }

/* ── New-game wizard ───────────────────────────────────────────── */
.wizard-steps { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: step; }
.wizard-steps li { counter-increment: step; color: #999; font-size: 0.9rem; font-weight: 600; padding: 0.3rem 0.8rem; border-bottom: 3px solid var(--rule); flex: 1; }
.wizard-steps li::before { content: counter(step) ". "; }
.wizard-steps li.current { color: var(--fire); border-bottom-color: var(--fire); }
.wizard-steps li.done { color: var(--ink); border-bottom-color: #b9b1a0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card { display: block; padding: 1rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: var(--fire); box-shadow: 0 2px 8px rgba(192,57,43,.12); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.card-head h3 { margin: 0; font-size: 1.1rem; }
.badge { font-size: 0.7rem; color: #777; background: var(--bg); border: 1px solid var(--rule); border-radius: 3px; padding: 0.1em 0.4em; white-space: nowrap; }
.card-meta { color: #777; font-size: 0.85rem; margin: 0.3rem 0; }
.card-desc { font-size: 0.9rem; margin: 0.4rem 0 0; }
.note { color: #888; font-size: 0.85rem; font-style: italic; }

.opt-group-title { margin: 1.4rem 0 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rule); }
.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.6rem; }
.opt-card { display: flex; gap: 0.6rem; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 5px; background: #fff; cursor: pointer; }
.opt-card:hover:not(.disabled) { border-color: var(--fire); }
.opt-card.disabled { opacity: 0.55; cursor: not-allowed; background: #faf9f6; }
.opt-card input { margin-top: 0.2rem; }
.opt-body { display: flex; flex-direction: column; gap: 0.15rem; }
.opt-name { font-weight: 600; font-size: 0.92rem; }
.opt-desc { font-size: 0.82rem; color: #555; }
.opt-reason { font-size: 0.78rem; color: var(--fire); font-style: italic; }
.rec { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.03em; color: #777; border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.3em; margin-left: 0.3em; vertical-align: middle; }
.rec-always .rec { color: #1b7a3d; border-color: #b6dcc2; }
.rec-often .rec  { color: #8a6d1f; border-color: #e0d3a6; }

.actions { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.5rem; }

.flow-panel { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.flow-panel form { margin: 0; }
.flow-panel button { background: #fff; color: var(--ink); border: 1px solid var(--rule); padding: 0.45rem 0.9rem; border-radius: 4px; font: inherit; cursor: pointer; }
.flow-panel button:hover { border-color: var(--fire); color: var(--fire); }

.muted { color: #888; font-size: 0.9em; }
.opt-list { list-style: none; padding: 0.5rem 0 0; margin: 0; columns: 2; }
.opt-list li { padding: 0.1rem 0; break-inside: avoid; }

.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.2rem 0 0.3rem; }
.presets-label { font-weight: 600; margin-right: 0.2rem; }
.presets button { background: #fff; color: var(--ink); border: 1px solid var(--rule); padding: 0.4rem 0.8rem; border-radius: 4px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.presets button:hover { border-color: var(--fire); }
.presets button.active { background: var(--fire); color: #fff; border-color: var(--fire); }

.opt-num { display: inline-block; min-width: 1.6em; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: #555; background: var(--bg); border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.25em; margin-right: 0.35em; }
.rec-sometimes .rec { color: #6c6c6c; }
