/* jarlings.xyz — a clean specimen catalogue.
   Cool lab-paper ground, white specimen cards, one fluid-green accent. The pixel art is the colour;
   everything around it stays quiet. Shared by the main site and the mining page. */
@font-face {
  font-family: 'Bricolage Grotesque'; src: url('../fonts/Bricolage.woff') format('woff');
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
:root {
  --paper: #eef1ee;      /* page ground: lab-bench paper */
  --surface: #ffffff;    /* cards, drawers, bars */
  --sunk: #e4e9e5;       /* wells, tracks, image backing */
  --ink: #17201c;
  --ink-2: #5c6862;
  --line: #d6ddd8;
  --accent: #12936a;     /* jar fluid */
  --accent-ink: #ffffff;
  --accent-soft: #dcf1e8;
  --accent-text: #0c7552;
  --danger: #c63d27;
  --danger-soft: #fbe6e1;
  --focus: #2f6fdb;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-img: 10px;
  --r-card: 16px;
  --shadow: 0 1px 2px rgba(23, 32, 28, 0.06), 0 8px 24px rgba(23, 32, 28, 0.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #121815; --surface: #19211d; --sunk: #222c27; --ink: #e8eeea; --ink-2: #9aa8a1; --line: #2b3631;
    --accent: #2fc48f; --accent-ink: #06261a; --accent-soft: #173a2c; --accent-text: #5fdcab;
    --danger: #ef6b52; --danger-soft: #3a1d17; --focus: #8db4ff; --shadow: 0 8px 28px rgba(0, 0, 0, 0.45); color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #121815; --surface: #19211d; --sunk: #222c27; --ink: #e8eeea; --ink-2: #9aa8a1; --line: #2b3631;
  --accent: #2fc48f; --accent-ink: #06261a; --accent-soft: #173a2c; --accent-text: #5fdcab;
  --danger: #ef6b52; --danger-soft: #3a1d17; --focus: #8db4ff; --shadow: 0 8px 28px rgba(0, 0, 0, 0.45); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--paper); font-variation-settings: 'opsz' 16; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ------------------------------------------------------------------ type */
h1, h2, h3 { font-stretch: 76%; font-weight: 760; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 5.6vw, 4.8rem); line-height: 0.92; font-variation-settings: 'opsz' 96; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1; font-variation-settings: 'opsz' 72; }
h3 { font-size: 1.25rem; line-height: 1.15; font-variation-settings: 'opsz' 36; }
p { margin: 0; max-width: 64ch; }
.lede { font-size: 1.15rem; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 0.88rem; }

/* ------------------------------------------------------------------ top bar */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 62px; }
.mark { font-size: 1.55rem; font-weight: 780; font-stretch: 72%; text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.mark img { width: 30px; height: 30px; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 560; font-size: 0.95rem; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.navtoggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font: inherit; font-weight: 600; padding: 6px 14px; cursor: pointer; }

/* ------------------------------------------------------------------ buttons */
.btn {
  font: inherit; font-weight: 640; font-size: 0.97rem; line-height: 1.2; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.08s;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.brass { background: var(--ink); color: var(--paper); }
.btn.goo { background: var(--accent); color: var(--accent-ink); }
.btn.goo:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost, .btn.ghost.light { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); background: var(--surface); }
.btn.small { padding: 7px 13px; font-size: 0.88rem; }
.wallet-btn { white-space: nowrap; background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.wallet-btn:hover { border-color: var(--ink-2) !important; }

/* ------------------------------------------------------------------ specimens: image + label */
.cabinet { background: none; padding: 0; }
.cubby { position: relative; display: block; }
.cubby img, .cubby .sheet-thumb, .cubby .placeholder { width: 100%; height: auto; display: block; border-radius: var(--r-img); aspect-ratio: 1; background: var(--sunk); }
.plate { display: block; margin-top: 7px; font-size: 0.86rem; font-weight: 600; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate small { font-weight: 450; color: var(--ink-2); }
.tag { position: absolute; top: 8px; left: 8px; z-index: 1; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--ink); font-size: 0.72rem; font-weight: 680; padding: 2px 8px; border-radius: 999px; }
.tag.new { background: var(--accent); color: var(--accent-ink); }
.sheet-thumb { background-image: url('../art/genesis-sheet.png'); background-size: 4000% 2500%; }
.meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; font-size: 0.8rem; color: var(--ink-2); }
.meta .g { color: var(--accent-text); font-weight: 650; }
.cap { font-size: 0.82rem; margin-top: 2px; color: var(--ink-2); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 18px 12px; }
.card { background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; display: block; width: 100%; }
.card .cubby img, .card .cubby .sheet-thumb { transition: box-shadow 0.15s, transform 0.15s; }
.card:hover .cubby img, .card:hover .cubby .sheet-thumb { box-shadow: 0 0 0 2px var(--ink); }
.card[aria-pressed='true'] .cubby img { box-shadow: 0 0 0 3px var(--accent); }
.card.off { opacity: 0.4; }

/* ------------------------------------------------------------------ landing */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 22px; }
.hero-copy .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cab { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hero-cab .feature { grid-column: span 2; grid-row: span 2; }
.hero-cab .plate { font-size: 0.78rem; margin-top: 4px; }
.hero-cab .feature .plate { font-size: 0.9rem; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink-2); font-size: 0.95rem; }
.facts b { color: var(--ink); font-weight: 720; font-variant-numeric: tabular-nums; }

.band { padding: 72px 0; border-top: 1px solid var(--line); }
.band.panel { background: var(--surface); }
.band-head { display: grid; gap: 12px; margin-bottom: 32px; max-width: 720px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: step; }
.step { display: grid; gap: 12px; align-content: start; }
.step .cubby { width: 160px; }
.step h3::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 0.9rem; vertical-align: 3px; }
.shelf-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; }
.foot { padding: 36px 0 48px; color: var(--ink-2); font-size: 0.92rem; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

/* ------------------------------------------------------------------ app pages */
.page { padding: 36px 0 88px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.page-head .lede { margin-top: 10px; }
.ph { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.sh { font-size: 1.45rem; margin: 40px 0 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.sh .muted { font-stretch: 100%; font-weight: 450; font-size: 0.92rem; letter-spacing: 0; }
.demo-note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: 0.93rem; color: var(--ink-2); }
.demo-note button { font: inherit; font-weight: 620; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); cursor: pointer; padding: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 30px; }
.stat { padding-left: 12px; border-left: 2px solid var(--line); min-width: 90px; }
.stat b { display: block; font-size: 1.45rem; font-weight: 720; font-stretch: 80%; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 0.85rem; }
.stat.goo { border-left-color: var(--accent); }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-card); padding: 32px; display: grid; gap: 12px; justify-items: start; }
.empty h2 { font-size: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 22px; }
.field { display: grid; gap: 4px; font-size: 0.85rem; color: var(--ink-2); }
select, input[type='number'], input[type='text'], input[type='search'] {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; min-width: 0;
}
select:hover, input:hover { border-color: var(--ink-2); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 0.93rem; padding-bottom: 8px; }
input[type='checkbox'], input[type='range'] { accent-color: var(--accent); }

/* inventory strip */
.inv { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.inv-item { display: flex; align-items: center; gap: 8px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px 3px 3px; font-size: 0.88rem; color: var(--ink-2); }
.inv-item img { width: 32px; height: 32px; border-radius: 50%; }
.inv-item b { font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.inv-item.none { opacity: 0.5; }

/* ------------------------------------------------------------------ detail drawer */
.scrim { position: fixed; inset: 0; background: rgba(12, 18, 15, 0.42); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { width: min(480px, 100%); height: 100%; overflow-y: auto; background: var(--surface); padding: 24px; display: grid; gap: 18px; align-content: start; box-shadow: var(--shadow); border-left: 1px solid var(--line); }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.drawer-head h2 { font-size: 1.9rem; }
.drawer .cubby { max-width: 360px; }
.drawer .plate { display: none; }
.close { font: inherit; font-weight: 600; font-size: 0.88rem; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; cursor: pointer; color: var(--ink); }
.close:hover { border-color: var(--ink-2); }
.traits { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; font-size: 0.93rem; border-top: 1px solid var(--line); }
.traits dt, .traits dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.traits dt { color: var(--ink-2); padding-right: 18px; }
.traits dd { margin: 0; font-weight: 600; }
.actions-col { display: grid; gap: 10px; justify-items: start; }
.actions-col > .btn { min-width: 220px; }
.box { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; width: 100%; }
.box h3 { font-size: 1.1rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
.nowrap { flex-wrap: nowrap; }
.full { width: 100%; margin-top: 8px; justify-content: center; }
.hammers { display: grid; gap: 8px; }
.hammer { display: flex; gap: 12px; align-items: center; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 6px 6px; cursor: pointer; }
.hammer:hover { border-color: var(--ink); }
.hammer img { width: 44px; height: 44px; border-radius: 8px; }
.hammer small { color: var(--ink-2); }

/* ------------------------------------------------------------------ breeding */
.breed { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: start; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.pair .plus { font-size: 2rem; font-weight: 700; color: var(--ink-2); }
.slot { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; text-align: left; width: 100%; }
.slot .placeholder { display: grid; place-items: center; color: var(--ink-2); font-weight: 560; text-align: center; padding: 10px; border: 1.5px dashed var(--line); background: var(--surface); }
.slot[aria-pressed='true'] .cubby img, .slot[aria-pressed='true'] .placeholder { box-shadow: 0 0 0 3px var(--accent); }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; display: grid; gap: 14px; align-content: start; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0; }
.summary dt, .summary dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; font-weight: 620; text-align: right; padding-left: 14px; }
.summary > .btn, .summary .row .btn { justify-self: start; }
.hint { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 10px 13px; font-size: 0.92rem; }
.warn { color: var(--danger); font-weight: 560; font-size: 0.92rem; }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; margin: 36px 0 14px; gap: 12px; flex-wrap: wrap; }
.pick-head h2 { font-size: 1.45rem; }

/* ------------------------------------------------------------------ moments: a jar being made or opened */
.moment { position: fixed; inset: 0; z-index: 50; background: rgba(12, 18, 15, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
.moment-card { width: min(440px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; color: var(--ink); margin: auto; background: var(--surface); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow); }
.moment-card .cubby { width: min(240px, 60vw); }
.moment-card .cubby .plate { display: none; }
.moment-card h2 { font-size: 2rem; }
.moment-card p { color: var(--ink-2); }
.moment-card .hint { color: var(--ink); }
.moment-card .traits { text-align: left; width: 100%; }
.shake { animation: shake 0.5s steps(4) infinite; }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 1px) rotate(-1deg); } 50% { transform: translate(2px, -1px); } 75% { transform: translate(3px, 1px) rotate(1deg); } }
.pop { animation: pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.flash { animation: flash 0.7s ease-out both; }
@keyframes flash { from { filter: brightness(2.6) saturate(0); } to { filter: none; } }
@media (prefers-reduced-motion: reduce) { .shake, .pop, .flash { animation: none; } }

/* ------------------------------------------------------------------ discoveries */
.recipes { display: grid; gap: 40px; }
.recipe-cat h2 { font-size: 1.3rem; margin-bottom: 14px; }
.recipe { display: grid; gap: 4px; }
.recipe.locked img { filter: grayscale(1) blur(3px) brightness(0.8); }
.recipe.locked .cubby { overflow: hidden; border-radius: var(--r-img); }
.recipe-text { padding: 0; }
.recipe p { font-size: 0.85rem; color: var(--ink-2); }
.recipe .who { font-size: 0.82rem; }
.recipes-grid, .recipes .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.firsts { display: flex; flex-wrap: wrap; gap: 8px; }
.firsts a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-decoration: none; font-size: 0.88rem; }

/* ------------------------------------------------------------------ items, forge, expeditions */
.loot { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.loot figure { margin: 0; width: 88px; }
.loot figcaption { font-size: 0.85rem; margin-top: 4px; }
.cubby.small { width: 88px; }
.moment-card .cubby.small { width: 88px; }
.durs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.dur { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; text-align: left; }
.dur:hover { border-color: var(--ink-2); }
.dur b { font-size: 1.1rem; font-stretch: 80%; }
.dur span { color: var(--ink-2); font-size: 0.88rem; }
.dur[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.odds { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.88rem; color: var(--ink-2); }
.odds span { display: inline-flex; align-items: center; gap: 6px; }
.odds img { width: 24px; height: 24px; border-radius: 6px; }
.forge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.forge-grid h3 { font-size: 1.3rem; }
.shelf-row.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.shelf-row.six, .grid.six-up { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.recycle-bar { position: sticky; bottom: 14px; margin-top: 16px; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.recycle-bar span { flex: 1; min-width: 12rem; }
.recycle-bar .btn.ghost { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }

/* ------------------------------------------------------------------ Legendaries: the one place the page gets loud */
.tag.legend { background: linear-gradient(90deg, #ffd23f, #ff9ad5, #8ad8ff); color: #241a33; }
.cubby.legendary img, .cubby.legendary .sheet-thumb { box-shadow: 0 0 0 2px #ffd23f, 0 0 0 5px color-mix(in srgb, #ff9ad5 45%, transparent); animation: legend-glow 3s ease-in-out infinite; }
@keyframes legend-glow { 50% { box-shadow: 0 0 0 2px #8ad8ff, 0 0 0 5px color-mix(in srgb, #ffd23f 45%, transparent); } }
@media (prefers-reduced-motion: reduce) { .cubby.legendary img, .cubby.legendary .sheet-thumb { animation: none; } }
.legend-box { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, #ffd23f, #ff9ad5, #8ad8ff) border-box; border: 1.5px solid transparent; }
.legend-box h3 { margin: 0; }
.legend-kicker { margin: 0; font-weight: 700; background: linear-gradient(90deg, #d9a400, #e2569e, #2f9fd8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.legend-card { display: block; color: inherit; text-decoration: none; }
.legend-card .cap { margin: 2px 0 0; }
.legends { margin-bottom: 12px; }
.sh + p { margin-bottom: 18px; }
.cubby img[src$='-shadow.png'] { background: var(--ink); }
.legend-band .cubby.legendary .plate { font-weight: 650; }

/* ------------------------------------------------------------------ toast + spinner */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; max-width: min(560px, 100% - 32px); box-shadow: var(--shadow); font-weight: 540; font-size: 0.95rem; }
.toast.err { background: var(--danger); color: #fff; border-radius: 14px; }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1080px) {
  .navtoggle { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; background: var(--surface); padding: 8px 16px 14px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav a[aria-current='page'] { box-shadow: inset 2px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
  .nav.open { display: flex; }
}
@media (max-width: 900px) {
  .hero .wrap, .breed, .forge-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 32px; }
  .steps { grid-template-columns: 1fr; }
  .shelf-row, .shelf-row.seven, .shelf-row.six, .grid.six-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top .wrap { gap: 10px; }
  .wallet-btn { padding: 7px 12px; font-size: 0.86rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .hero-cab { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-cab .feature { grid-column: span 3; grid-row: auto; }
  .shelf-row, .shelf-row.seven, .shelf-row.six, .grid.six-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .band { padding: 52px 0; }
}
@media (max-width: 480px) {
  .durs { grid-template-columns: 1fr; }
  .grid.six-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Lab items, the Workshop, fossils */
.ico { width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.labitems { border-top: 1px solid var(--line); padding-top: 12px; }
.labitems summary { cursor: pointer; font-weight: 650; margin-bottom: 8px; }
.labitems .check { display: flex; padding-bottom: 6px; }
.opt-row { align-items: end; margin: 6px 0; }
.opt-row .ico { margin-bottom: 8px; }
.kit { display: grid; gap: 2px; }
.kit h3 { font-size: 1rem; margin-bottom: 4px; }
.kit .check { padding-bottom: 4px; }
.drops { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-2); max-width: none; }
.drops img { width: 28px; height: 28px; border-radius: 6px; }
h3.sub { font-size: 1.05rem; margin: 22px 0 10px; }
.workshop { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.craft { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; align-content: start; }
.craft-head { display: flex; gap: 10px; align-items: start; }
.craft-head img { width: 48px; height: 48px; border-radius: 8px; flex: none; }
.craft-head p { margin-top: 2px; }
.needs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85rem; }
.needs span { display: inline-flex; align-items: center; gap: 4px; }
.needs img { width: 22px; height: 22px; border-radius: 5px; }
.needs .short { color: var(--danger); }
.fossil-lab { margin-bottom: 8px; }
.fossil-lab .btn { justify-self: start; }
.tag.extinct { background: #c98a2e; color: #fff; }
.cubby.extinct img { box-shadow: 0 0 0 2px #e0a040, 0 0 0 5px color-mix(in srgb, #e0a040 30%, transparent); }
.extinct-box { border: 1.5px solid #e0a040; background: color-mix(in srgb, #e0a040 10%, var(--surface)); }
.extinct-kicker { margin: 0; font-weight: 700; color: #b8761e; }

/* ---------------------------------------------------------------- family tree */
.tree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px 16px 20px; margin-bottom: 8px; }
.tgen { margin: 0 auto; max-width: 880px; }
.tlabel { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); text-align: center; margin: 0 0 8px; }
.trow { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0; }
.couple { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 4px 30px; }
.couple::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: 14px; height: 14px; border: 2px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; }
.couple::before { content: ''; position: absolute; left: calc(50% - 1px); bottom: 0; width: 2px; height: 14px; background: var(--line); }
.couple.none::after, .couple.none::before { display: none; }
.tnode { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); min-width: 0; border-radius: 12px; padding: 4px; }
.tnode:hover .tname, .tnode:focus-visible .tname { color: var(--accent-text); }
.tnode .cubby { width: min(100%, 120px); }
.tnode.mid .cubby { width: min(100%, 88px); }
.tnode.tiny .cubby { width: min(100%, 64px); }
.tnode.big .cubby { width: min(100%, 200px); }
.tnode.empty { visibility: hidden; }
.tnode.unknown .cubby { aspect-ratio: 1; background: var(--sunk); border-radius: var(--r-img); display: grid; place-items: center; color: var(--ink-2); font-weight: 700; }
.tcap { font-size: 0.82rem; line-height: 1.25; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tnode.tiny .tname { display: none; }
.tnode.big .tcap { font-size: 1.05rem; }
.tnode.me .cubby img { outline: 3px solid var(--accent); outline-offset: 3px; }
.tgen.focus { text-align: center; }
.tgen.focus .trow { justify-items: center; }
.tmeta { color: var(--ink-2); margin: 6px 0 12px; }
.tnote { text-align: center; margin: 0 0 16px; }
.tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.titem { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px 10px; }
.small-empty { padding: 20px; }
.share-row { gap: 8px; margin-top: 4px; }
@media (max-width: 560px) {
  .tree { padding: 18px 6px 16px; }
  .couple { gap: 2px; padding: 0 1px 26px; }
  .tnode { padding: 2px; }
  .tnode.mid .tname { display: none; }
  .tcap { font-size: 0.72rem; }
}
.small-empty { margin-top: 20px; }

/* ---------------------------------------------------------------- live mint dashboard */
.sim-note { background: #fff6dc; color: #5a4300; border: 1px solid #f0d98a; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
:root[data-theme='dark'] .sim-note { background: #2e2814; color: #f0dc9a; border-color: #5a4b1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .sim-note { background: #2e2814; color: #f0dc9a; border-color: #5a4b1c; } }
.live-status { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.live-status .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); }
.live-status.on .pulse { background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi > span { color: var(--ink-2); font-size: 0.86rem; font-weight: 600; }
.kpi b { font-size: 1.7rem; font-weight: 760; font-stretch: 80%; line-height: 1.1; }
.kpi.big b { font-size: 2.6rem; }
.kpi b.up { color: var(--accent-text); }
.kpi small { color: var(--ink-2); font-size: 0.8rem; line-height: 1.35; }
.kpi .bar { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.kpi .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.6s ease; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; min-width: 0; }
.panel-card.wide { grid-column: 1 / -1; }
.pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pc-head h2 { font-size: 1.15rem; margin: 0; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--accent); margin-left: 8px; }
.legend i.l-target { border-top: 2px dashed var(--ink-2); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick, .chart .tlabel-chart { fill: var(--ink-2); font: 500 12px var(--font); }
.chart .target { stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 6 6; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart .now { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.5; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.chart .pt { fill: var(--accent); opacity: 0.75; }
.feed, .leaders { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow: auto; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed li:first-child { animation: feed-in 0.6s ease; }
@keyframes feed-in { from { background: var(--accent-soft); } }
.feed img { width: 36px; height: 36px; border-radius: 8px; background: var(--sunk); flex: none; }
.feed small { display: block; color: var(--ink-2); font-size: 0.8rem; }
.feed a, .leaders a { color: var(--ink); font-variant-numeric: tabular-nums; }
.leaders li { display: grid; grid-template-columns: 28px 1fr auto; grid-template-areas: 'r a j' 'r s s'; column-gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.leaders .rank { grid-area: r; font-weight: 760; color: var(--ink-2); text-align: center; }
.leaders a { grid-area: a; font-weight: 600; }
.leaders .jars { grid-area: j; display: inline-flex; gap: 3px; align-items: center; font-weight: 700; }
.leaders .jars i { width: 8px; height: 12px; border-radius: 2px 2px 3px 3px; background: var(--accent); }
.leaders small { grid-area: s; color: var(--ink-2); font-size: 0.78rem; }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi.big, .kpi:last-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .dash-grid { grid-template-columns: 1fr; } .kpi b { font-size: 1.35rem; } .kpi.big b { font-size: 2.2rem; } .panel-card { padding: 14px; } }

/* ---------------------------------------------------------------- motion */
.fx-got { animation: fx-got 0.55s cubic-bezier(.3,1.6,.5,1); }
@keyframes fx-got { 0% { transform: scale(1); } 40% { transform: scale(1.14); background: var(--accent-soft); } 100% { transform: scale(1); } }
.moment .loot figure { animation: loot-in 0.45s cubic-bezier(.3,1.5,.5,1) both; }
.moment .loot figure:nth-child(2) { animation-delay: 0.08s; } .moment .loot figure:nth-child(3) { animation-delay: 0.16s; }
.moment .loot figure:nth-child(4) { animation-delay: 0.24s; } .moment .loot figure:nth-child(5) { animation-delay: 0.32s; }
.moment .loot figure:nth-child(n+6) { animation-delay: 0.4s; }
@keyframes loot-in { from { transform: translateY(14px) scale(0.6); opacity: 0; } }
.shake.hard { animation: shake-hard 0.32s linear infinite; }
@keyframes shake-hard { 0%, 100% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(-5px, 2px) rotate(-3deg); } 40% { transform: translate(4px, -2px) rotate(2deg); } 60% { transform: translate(-3px, -1px) rotate(-2deg); } 80% { transform: translate(5px, 2px) rotate(3deg); } }
.moment .crack { position: relative; }
.moment .crack::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-img); background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.95), rgba(255,255,255,0) 60%); animation: crack-flash 0.5s ease-out forwards; pointer-events: none; }
@keyframes crack-flash { from { opacity: 1; transform: scale(0.4); } to { opacity: 0; transform: scale(1.6); } }
.depart-out { animation: depart-out 0.7s cubic-bezier(.5,0,.8,.3) forwards; }
@keyframes depart-out { 30% { transform: translateY(-6px) rotate(-4deg); } to { transform: translateX(120vw) rotate(8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fx-got, .moment .loot figure, .shake.hard, .moment .crack::after, .depart-out { animation: none; }
}
.tgen.focus .tmeta { margin-left: auto; margin-right: auto; max-width: none; }

/* ---------------------------------------------------------------- scenes */
.scene-wrap { width: 100%; }
.scene { display: block; width: 100%; height: auto; aspect-ratio: 128 / 100; border-radius: 14px; background: #14151b; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.scene-body { display: grid; gap: 12px; justify-items: center; width: 100%; }
.scene-body.in > * { animation: scene-in 0.45s ease both; }
.scene-body.in > *:nth-child(2) { animation-delay: 0.06s; } .scene-body.in > *:nth-child(3) { animation-delay: 0.12s; } .scene-body.in > *:nth-child(n+4) { animation-delay: 0.18s; }
@keyframes scene-in { from { opacity: 0; transform: translateY(8px); } }
.moment-card:has(.scene) { width: min(460px, 100%); padding: 16px 16px 22px; }
.moment-card .scene-body h2 { font-size: 1.7rem; }
@media (prefers-reduced-motion: reduce) { .scene-body.in > * { animation: none; } }

/* ---------------------------------------------------------------- polish pass */
/* hero facts: a quiet four-up row */
.facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 34px; margin: 4px 0 0; }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { color: var(--ink-2); font-size: 0.85rem; }
.facts dd { margin: 0; font-size: 1.35rem; font-weight: 740; font-stretch: 82%; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
@media (max-width: 520px) { .facts { grid-template-columns: repeat(2, auto); gap: 12px 34px; } }

/* your supplies: one tidy panel, grouped */
.supplies { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 18px 8px; margin-bottom: 28px; }
.supplies-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.supplies-head h2 { font-size: 1.05rem; margin: 0; }
.supplies-head a { font-size: 0.88rem; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.supplies-head a:hover { text-decoration: underline; }
.inv-row { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.inv-row:first-of-type { border-top: 0; }
.inv-label { font-size: 0.85rem; color: var(--ink-2); font-weight: 600; padding-top: 7px; }
.inv-row .inv { margin: 0; gap: 6px; }
.inv-item { padding: 2px 12px 2px 2px; font-size: 0.86rem; gap: 7px; cursor: default; }
.inv-item img { width: 28px; height: 28px; }
.inv-item b { font-size: 0.95rem; }
@media (max-width: 640px) { .inv-row { grid-template-columns: 1fr; gap: 6px; } .inv-label { padding-top: 0; } }

/* workshop: "You have" as a small badge */
.have { display: inline-block; margin-left: 6px; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); background: var(--sunk); border-radius: 999px; padding: 1px 8px; vertical-align: 2px; }

/* undiscovered recipe traits: a coloured blur with a question mark, not a grey box */
.recipe.locked img { filter: blur(5px) saturate(0.7) brightness(0.92); transform: scale(1.08); }
.recipe.locked .cubby { position: relative; }
.recipe.locked .cubby::after { content: '?'; position: absolute; inset: 0 0 auto 0; aspect-ratio: 1; display: grid; place-items: center; font-size: 2.4rem; font-weight: 780; font-stretch: 75%; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }

/* footer */
.foot { padding: 44px 0 56px; }
.foot-grid { display: grid !important; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.foot-brand .mark { color: var(--ink); }
.foot-brand p { margin: 10px 0 0; max-width: 36ch; color: var(--ink-2); font-size: 0.92rem; }
.foot-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-nav h2 { font-size: 0.85rem; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.foot-nav a { display: block; color: var(--ink-2); text-decoration: none; font-size: 0.92rem; padding: 3px 0; }
.foot-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } .foot-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot .placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-style: dashed; }
.slot .placeholder .ph-plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); font-size: 1.6rem; font-weight: 500; line-height: 1; }
.slot[aria-pressed='true'] .placeholder .ph-plus { background: var(--accent-soft); color: var(--accent-text); }
.slot .plate.muted { color: var(--ink-2); font-weight: 500; }
.recipe .plate { color: var(--ink-2); }
.forge-grid .summary.wide { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- treasure pool */
.treasure-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.odds-table { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.odds-table div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.odds-table dt { font-size: 0.82rem; color: var(--ink-2); }
.odds-table dd { margin: 0; font-weight: 720; font-size: 1.1rem; }
.pool-card { background: linear-gradient(160deg, #2a2110, #3a2c10); color: #fff7dc; border-radius: var(--r-card); padding: 26px 24px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.pool-card span { font-size: 0.9rem; color: #f0d98a; font-weight: 600; }
.pool-card b { font-size: 2.6rem; font-weight: 780; font-stretch: 78%; color: #ffd23f; line-height: 1.05; }
.pool-card small { color: #e8dcb8; font-size: 0.88rem; }
.pool-strip { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; background: #fff6dc; border: 1px solid #f0d98a; border-radius: 12px; padding: 10px 16px; margin-bottom: 22px; color: #5a4300; }
.pool-strip b { color: #7a5300; }
.pool-strip .muted { color: #7a6a3a; font-size: 0.9rem; }
.treasure-note { background: #fff6dc; border: 1px solid #f0d98a; border-radius: 12px; padding: 10px 14px; color: #5a4300 !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .pool-strip, :root:not([data-theme='light']) .treasure-note { background: #2e2814; border-color: #5a4b1c; color: #f0dc9a !important; } :root:not([data-theme='light']) .pool-strip b { color: #ffd23f; } }
@media (max-width: 760px) { .treasure-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- crate mode on the mining page: amber, not green */
body.mode-crates { --accent: #d9821a; --accent-soft: #fdebd0; --accent-text: #9a5a0a; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) body.mode-crates { --accent: #f0a040; --accent-soft: #3a2a12; --accent-text: #ffc070; --accent-ink: #2a1a06; } }
body.mode-crates canvas#jar { background: #bfe6f5; }
