:root {
  color-scheme: dark;
  --bg: #09110d;
  --bg-2: #060a08;
  --panel: #111c16;
  --panel-2: #16241c;
  --ink: #edf0e7;
  --muted: #aab3a8;
  --muted-2: #7f8b7d;
  --rule: rgba(169, 200, 163, 0.22);
  --rule-strong: rgba(213, 174, 84, 0.48);
  --gold: #d5ae54;
  --gold-soft: rgba(213, 174, 84, 0.16);
  --sage: #a9c8a3;
  --charcoal-red: #7e2f26;
  --grain: #c9b56b;
  --soil: #3a2618;
  --acid: #a9ff4f;
  --purple: #7c3ea0;
  --ivory: #efe4ca;
  --black: #050605;
  --cyan: #79d8e6;
  --steel: #8aa2ad;
  --lapis: #315aa6;
  --clay: #b66b43;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 14% 8%, rgba(213, 174, 84, 0.09), transparent 32rem),
    radial-gradient(circle at 88% 22%, rgba(121, 216, 230, 0.07), transparent 25rem),
    radial-gradient(circle at 62% 76%, rgba(169, 255, 79, 0.045), transparent 29rem),
    linear-gradient(180deg, #0d1711 0%, #060a08 100%);
  color: var(--ink);
  font-family: "Source Sans 3", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button {
  font: inherit;
}

a {
  color: var(--sage);
}

.nc-minilab-nav a:last-child {
  background: rgba(249, 251, 249, 0.92);
  border-color: rgba(74, 103, 65, 0.26);
  color: #101812;
}

.nc-minilab-nav a:last-child:hover {
  background: #dde5dd;
  border-color: rgba(74, 103, 65, 0.42);
  color: #101812;
}

.nc-minilab-nav a[aria-current="location"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #101812;
}

.nc-minilab-nav a[aria-current="location"]:hover {
  background: #c9a44a;
  border-color: #c9a44a;
  color: #101812;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.lab-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 30px;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.kicker,
.eyebrow,
.chip,
.microcopy,
.prototype-state {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-row {
  display: flex;
  gap: 6px;
}

.tag-row span {
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid rgba(169, 200, 163, 0.38);
  border-radius: 999px;
  color: var(--sage);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 5.6rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.94;
}

.subtitle {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.2rem;
}

.period-badge {
  display: grid;
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(17, 28, 22, 0.78);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.period-badge strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.period-badge span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stage {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.stage > *,
.content-stack,
.panel {
  min-width: 0;
}

.card-wrap {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.tech-card {
  width: min(100%, 380px);
  aspect-ratio: 2.5 / 3.5;
  padding: 14px;
  border: 1px solid rgba(213, 174, 84, 0.55);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 50% 6%, rgba(213, 174, 84, 0.17), transparent 15rem),
    linear-gradient(180deg, #25341f, #11190f 58%, #080d08);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.42),
    inset 0 0 0 2px rgba(0, 0, 0, 0.36);
}

.card-inner {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  height: 100%;
  padding: 12px;
  border: 1px solid rgba(169, 200, 163, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 12, 9, 0.5), rgba(7, 12, 9, 0.86)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 4px
    );
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.card-title {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 2rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.card-type {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-align: right;
  text-transform: uppercase;
}

.era-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.art-frame {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(213, 174, 84, 0.46);
  border-radius: 8px;
  background: #0b120d;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.32);
}

svg {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

figure {
  margin: 0;
}

.art-frame,
.mini-art,
.choice-pixel,
.catalog-pixel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(213, 174, 84, 0.36);
  border-radius: 8px;
  background: #0b120d;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.38),
    inset 0 0 0 3px rgba(237, 240, 231, 0.035);
}

.art-frame::after,
.mini-art::after,
.choice-pixel::after,
.catalog-pixel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 18%, transparent 82%, rgba(5, 6, 5, 0.22)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
}

.choice-pixel,
.catalog-pixel {
  aspect-ratio: 160 / 88;
}

.choice-pixel svg,
.catalog-pixel svg {
  height: 100%;
}

.effects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 800;
}

.effects li {
  min-height: 32px;
  padding: 7px 8px;
  border: 1px solid rgba(169, 200, 163, 0.21);
  border-radius: 8px;
  background: rgba(169, 200, 163, 0.07);
  color: var(--sage);
}

.effects .cost {
  border-color: rgba(182, 91, 69, 0.35);
  background: rgba(182, 91, 69, 0.1);
  color: #efb09f;
}

.synergy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.synergy-row span {
  padding: 4px 6px;
  border: 1px solid rgba(213, 174, 84, 0.28);
  border-radius: 999px;
  color: rgba(237, 240, 231, 0.78);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.flavor {
  margin: 9px 0 0;
  color: rgba(237, 240, 231, 0.78);
  font: italic 0.94rem Georgia, "Times New Roman", serif;
  line-height: 1.34;
}

.prototype-state {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.content-stack {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(17, 28, 22, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.panel-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel h2 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.95rem;
  letter-spacing: 0;
  line-height: 1.08;
}

.panel-body {
  padding: 17px 18px 20px;
}

.panel-body p {
  margin: 0;
  color: var(--muted);
}

.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.rule {
  min-height: 120px;
  padding: 13px;
  border: 1px solid rgba(169, 200, 163, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.42);
}

.rule strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.rule span {
  color: var(--muted);
  font-size: 0.94rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 7px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.time-step {
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(169, 200, 163, 0.17);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.44);
}

.time-step .date {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.time-step .name {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.15;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.swatch {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid rgba(169, 200, 163, 0.17);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.4);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.swatch:hover,
.swatch:focus-visible,
.swatch.is-active {
  border-color: rgba(213, 174, 84, 0.6);
  outline: none;
}

.swatch.is-active {
  background: rgba(213, 174, 84, 0.1);
}

.swatch-chip {
  width: 44px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.26);
}

.fire {
  background: linear-gradient(135deg, #ffffff, var(--ivory) 34%, var(--gold) 68%, var(--charcoal-red));
}

.food {
  background: linear-gradient(135deg, var(--sage), var(--grain), var(--soil));
}

.mobility {
  background: linear-gradient(135deg, #d97745, #7a2e1d);
}

.microbes {
  background: linear-gradient(135deg, var(--purple), var(--acid));
}

.institutions {
  background: linear-gradient(135deg, var(--ivory), var(--black));
}

.myths {
  background: linear-gradient(135deg, var(--cyan), var(--steel));
}

.writing {
  background: linear-gradient(135deg, var(--lapis), var(--clay));
}

.swatch strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.swatch span span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.family-note {
  min-height: 48px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(213, 174, 84, 0.24);
  border-radius: 8px;
  background: rgba(213, 174, 84, 0.08);
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reset-game {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(213, 174, 84, 0.42);
  border-radius: 8px;
  background: rgba(213, 174, 84, 0.1);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.reset-game:hover,
.reset-game:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.game-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.game-status div,
.game-readout,
.history-strip,
.chronicle-box {
  border: 1px solid rgba(169, 200, 163, 0.17);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.4);
}

.game-status div {
  min-height: 72px;
  padding: 11px;
}

.game-status span,
.meter-label,
.choice-era,
.event-log {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.game-status span {
  display: block;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game-status strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.meters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.meter {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(169, 200, 163, 0.16);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.32);
}

.meter.is-warning {
  border-color: rgba(213, 174, 84, 0.52);
  background: rgba(213, 174, 84, 0.08);
}

.meter.is-danger {
  border-color: rgba(182, 91, 69, 0.62);
  background: rgba(182, 91, 69, 0.11);
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meter-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(237, 240, 231, 0.1);
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--gold));
}

.meter.is-warning .meter-fill {
  background: linear-gradient(90deg, var(--gold), #efb09f);
}

.meter.is-danger .meter-fill {
  background: linear-gradient(90deg, #b65b45, #efb09f);
}

.value-0 {
  width: 0;
}

.value-1 {
  width: 16.666%;
}

.value-2 {
  width: 33.333%;
}

.value-3 {
  width: 50%;
}

.value-4 {
  width: 66.666%;
}

.value-5 {
  width: 83.333%;
}

.value-6 {
  width: 100%;
}

.game-readout {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.game-readout p {
  margin: 0;
}

#unlock-message {
  color: rgba(213, 174, 84, 0.86);
  font-size: 0.92rem;
}

.risk-message {
  padding-left: 10px;
  border-left: 3px solid rgba(169, 200, 163, 0.36);
  color: var(--muted);
  font-size: 0.92rem;
}

.risk-message.is-warning {
  border-color: var(--gold);
  color: #e8c879;
}

.risk-message.is-danger {
  border-color: #b65b45;
  color: #efb09f;
}

.risk-message.is-stable {
  border-color: rgba(169, 200, 163, 0.42);
}

.history-strip {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-header strong {
  color: var(--gold);
  white-space: nowrap;
}

.history-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-slot {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  border: 1px solid rgba(169, 200, 163, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 36%),
    rgba(7, 12, 9, 0.54);
  overflow: hidden;
}

.history-slot::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--sage);
}

.history-slot strong {
  align-self: end;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.02;
}

.history-slot em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 750;
  line-height: 1.1;
}

.history-turn {
  color: var(--gold);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.history-slot.is-empty {
  border-style: dashed;
  background: rgba(7, 12, 9, 0.26);
}

.history-slot.is-empty::before {
  background: rgba(169, 200, 163, 0.22);
}

.history-slot.is-empty strong,
.history-slot.is-empty em {
  color: var(--muted-2);
}

.history-slot.is-current {
  border-color: rgba(213, 174, 84, 0.58);
  background: rgba(213, 174, 84, 0.08);
}

.history-slot.is-current::before {
  background: var(--gold);
}

.history-slot.family-fire::before {
  background: var(--ivory);
}

.history-slot.family-food::before {
  background: var(--grain);
}

.history-slot.family-mobility::before {
  background: #d97745;
}

.history-slot.family-microbes::before {
  background: var(--acid);
}

.history-slot.family-institutions::before {
  background: var(--ivory);
}

.history-slot.family-myths::before {
  background: var(--cyan);
}

.history-slot.family-writing::before,
.history-slot.is-writing::before {
  background: var(--lapis);
}

.history-slot.is-writing {
  border-color: rgba(49, 90, 166, 0.58);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.choice-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 8px;
  min-width: 0;
  min-height: 330px;
  padding: 12px;
  border: 1px solid rgba(169, 200, 163, 0.2);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.48);
  color: var(--ink);
  text-align: left;
}

.choice-card h3 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1.05;
}

.choice-era {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.choice-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.choice-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-effects li {
  padding: 4px 6px;
  border: 1px solid rgba(169, 200, 163, 0.17);
  border-radius: 999px;
  color: var(--sage);
  font-size: 0.68rem;
  font-weight: 800;
}

.choice-effects .negative {
  border-color: rgba(182, 91, 69, 0.32);
  color: #efb09f;
}

.choose-card {
  min-height: 34px;
  border: 1px solid rgba(213, 174, 84, 0.48);
  border-radius: 8px;
  background: rgba(213, 174, 84, 0.14);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.choose-card:hover,
.choose-card:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.choice-card.is-writing {
  border-color: rgba(49, 90, 166, 0.62);
  box-shadow: inset 0 0 0 1px rgba(49, 90, 166, 0.22);
}

.chronicle-box {
  margin-top: 12px;
  padding: 14px;
}

.chronicle-box h3 {
  margin: 0 0 12px;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.28rem;
}

.chronicle-text,
.endgame-summary {
  display: grid;
  gap: 12px;
}

.endgame-result {
  padding: 12px 12px 12px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: rgba(213, 174, 84, 0.08);
}

.endgame-summary.is-won .endgame-result {
  border-color: var(--lapis);
  background: rgba(49, 90, 166, 0.14);
}

.endgame-summary.is-lost .endgame-result {
  border-color: #b65b45;
  background: rgba(182, 91, 69, 0.12);
}

.endgame-result span,
.endgame-details dt {
  color: var(--gold);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.endgame-result strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.48rem;
  line-height: 1.02;
}

.endgame-result p {
  margin: 7px 0 0;
  color: var(--muted);
}

.endgame-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.endgame-details div {
  min-width: 0;
  padding: 11px 0 0;
  border-top: 1px solid rgba(169, 200, 163, 0.18);
}

.endgame-details dd {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.38;
}

.event-log {
  display: grid;
  gap: 7px;
  max-height: 220px;
  margin: 12px 0 0;
  overflow: auto;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.78rem;
}

.event-log li::marker {
  color: var(--gold);
}

.mechanic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.mechanic-card {
  min-height: 118px;
  padding: 12px;
  border: 1px solid rgba(169, 200, 163, 0.17);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.4);
}

.mechanic-card strong,
.mechanic-flow h3 {
  display: block;
  color: var(--ink);
}

.mechanic-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

.mechanic-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mechanic-flow div {
  padding: 13px;
  border: 1px solid rgba(213, 174, 84, 0.18);
  border-radius: 8px;
  background: rgba(213, 174, 84, 0.06);
}

.mechanic-flow h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.05;
}

.mechanic-flow ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.full-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.full-deck-header strong {
  color: var(--gold);
  white-space: nowrap;
}

.full-deck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.catalog-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 8px;
  min-width: 0;
  min-height: 292px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(169, 200, 163, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 34%),
    rgba(7, 12, 9, 0.48);
}

.catalog-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--sage);
}

.catalog-card.family-fire::before {
  background: var(--ivory);
}

.catalog-card.family-food::before {
  background: var(--grain);
}

.catalog-card.family-mobility::before {
  background: #d97745;
}

.catalog-card.family-microbes::before {
  background: var(--acid);
}

.catalog-card.family-institutions::before {
  background: var(--ivory);
}

.catalog-card.family-myths::before {
  background: var(--cyan);
}

.catalog-card.family-writing::before {
  background: var(--lapis);
}

.catalog-card.is-final {
  border-color: rgba(49, 90, 166, 0.58);
  background:
    linear-gradient(145deg, rgba(49, 90, 166, 0.18), transparent 38%),
    rgba(7, 12, 9, 0.5);
}

.catalog-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-left: 2px;
  color: var(--gold);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-card-top em {
  color: var(--muted-2);
  font-style: normal;
  text-align: right;
}

.catalog-card h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.24rem;
  line-height: 1.02;
}

.catalog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.34;
}

.catalog-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-effects li {
  padding: 4px 6px;
  border: 1px solid rgba(169, 200, 163, 0.18);
  border-radius: 999px;
  color: var(--sage);
  font-size: 0.66rem;
  font-weight: 800;
}

.catalog-effects .negative {
  border-color: rgba(182, 91, 69, 0.34);
  color: #efb09f;
}

.mini-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(169, 200, 163, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 12, 9, 0.38), rgba(7, 12, 9, 0.76)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
}

.mini-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
}

.mini-card h3 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1;
}

.mini-card-top span,
.mini-era {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

.mini-era {
  text-align: left;
}

.mini-art {
  border-color: rgba(213, 174, 84, 0.34);
}

.mini-effects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-effects li {
  min-height: 30px;
  padding: 7px 8px;
  border: 1px solid rgba(169, 200, 163, 0.2);
  border-radius: 8px;
  background: rgba(169, 200, 163, 0.07);
  color: var(--sage);
}

.mini-effects .cost {
  border-color: rgba(182, 91, 69, 0.34);
  background: rgba(182, 91, 69, 0.1);
  color: #efb09f;
}

.card-clay {
  border-color: rgba(182, 107, 67, 0.42);
}

.card-food {
  border-color: rgba(169, 200, 163, 0.34);
}

.card-institution {
  border-color: rgba(239, 228, 202, 0.36);
}

.card-myth {
  border-color: rgba(121, 216, 230, 0.34);
}

.card-writing {
  border-color: rgba(49, 90, 166, 0.52);
}

.artifact-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.artifact-notes div {
  padding: 12px;
  border: 1px solid rgba(169, 200, 163, 0.17);
  border-radius: 8px;
  background: rgba(7, 12, 9, 0.38);
}

.artifact-notes strong {
  display: block;
  margin-bottom: 5px;
}

.artifact-notes span {
  color: var(--muted);
  font-size: 0.92rem;
}

.microcopy {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 4rem;
  }

  .period-badge {
    width: fit-content;
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .card-wrap {
    position: static;
  }

  .tech-card {
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .nc-minilab-nav {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100vw - 20px);
  }

  .nc-minilab-nav a {
    flex: 0 0 auto;
  }

  .lab-shell {
    width: min(100% - 22px, 1160px);
    padding-top: 118px;
  }

  .header-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  h1 {
    font-size: 2.8rem;
    line-height: 1;
  }

  .subtitle {
    font-size: 1.04rem;
  }

  .rules,
  .palette-grid,
  .game-status,
  .meters-grid,
  .choice-grid,
  .endgame-details,
  .full-deck-grid,
  .mechanic-grid,
  .mechanic-flow,
  .deck-grid,
  .artifact-notes {
    grid-template-columns: 1fr;
  }

  .tech-card {
    width: 100%;
    padding: 10px;
  }

  .card-inner {
    padding: 10px;
  }

  .card-title {
    font-size: 1.72rem;
  }

  .history-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media print {
  html,
  body {
    background: #fff;
    color: #000;
  }

  .lab-shell {
    width: auto;
    padding: 0;
  }

  .panel,
  .tech-card {
    box-shadow: none;
  }
}
