/* Tarot Protocol — black ground, single antique gold line, ivory text. */
:root {
  --ground: #0a0907;
  --ground-2: #13110d;
  --panel: rgba(16, 14, 10, .78);
  --panel-solid: #14120e;
  --gold: #c9a45c;
  --gold-hi: #e3c789;
  --gold-dim: rgba(201, 164, 92, .32);
  --gold-faint: rgba(201, 164, 92, .14);
  --ivory: #ece4d2;
  --muted: #a99f8b;
  --err: #e07a5f;
  --line: 1px solid var(--gold-dim);
  --r: 14px;
  /* Locally installed book faces are preferred; the Palatino family remains the shipped fallback (no font download). */
  --display: "Cormorant Garamond", "EB Garamond", "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 160ms; --t-mid: 320ms; --t-slow: 720ms;
  --mono: "Cascadia Mono", Consolas, "SF Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: min(1240px, 100% - 2 * clamp(16px, 4vw, 48px));
}
* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ivory); font: 16px/1.6 var(--body); -webkit-text-size-adjust: 100%; scrollbar-color: var(--gold-dim) var(--ground); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
body.has-dialog { overflow: hidden; }
::selection { background: rgba(201, 164, 92, .4); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 10px; border: 2px solid var(--ground); }
input, select, textarea, button { font: inherit; color: inherit; caret-color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; font-weight: 500; margin: 0 0 .5em; text-wrap: balance; }
h2 { font-family: var(--display); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); letter-spacing: .01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .9em; max-width: 70ch; }
.display { font-family: var(--display); font-weight: 400; font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.6rem); letter-spacing: -.01em; line-height: 1.04; }
.lede { font-size: 1.12rem; color: var(--ivory); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.big { font-size: 1.7rem; font-family: var(--display); }
.gold { color: var(--gold-hi); }
.gold-line { color: var(--gold); font-size: 1.2rem; font-family: var(--display); }
.tnum, td, dd { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .86em; word-break: break-all; }
.na { color: var(--muted); }
.r { text-align: right; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--gold); color: #120f09; padding: 8px 14px; border-radius: 999px; }

/* ---------- run19 typography: engraved display, small-caps labels, steadier reading rhythm ---------- */
html { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.display { font-feature-settings: "kern", "liga", "dlig"; font-kerning: normal; text-wrap: balance; }
.display span { display: block; }
.lede { line-height: 1.55; letter-spacing: .003em; max-width: 58ch; text-wrap: pretty; }
p { text-wrap: pretty; }
h2 { font-feature-settings: "kern", "liga"; }
.eyebrow { font: 600 .72rem/1.3 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 .45em; }
th, dt { letter-spacing: .02em; }
.big, .gold-line { font-feature-settings: "lnum", "tnum"; }

/* ---------- run19 motion (all disabled under prefers-reduced-motion) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -20% 0; } }
/* Value swap cue for an amount redrawn by a selector: fades in place, never moves the line. */
@keyframes tick { 0% { opacity: .35; } 100% { opacity: 1; } }
@keyframes glint { 0%, 100% { box-shadow: 0 0 0 0 rgba(227, 199, 137, 0); } 50% { box-shadow: 0 0 22px 2px rgba(227, 199, 137, .22); } }
.page-in > * { animation: rise var(--t-slow) var(--ease-out) both; }
.page-in > :nth-child(2) { animation-delay: 70ms; } .page-in > :nth-child(3) { animation-delay: 140ms; }
.page-in > :nth-child(4) { animation-delay: 210ms; } .page-in > :nth-child(n+5) { animation-delay: 280ms; }
/* Title sheen: the glyph fill is a repeating tile whose edges are the solid title colour, so every letter is filled at
   every phase (before, during, after) — no frame can leave a letter without paint. Unsupported clip keeps solid text. */
.page-in .hero .display span, .page-in .page-head .display { --sheen-base: var(--ivory); --sheen-hi: var(--gold-hi); color: var(--sheen-base); }
.page-in .hero .display span:last-child { --sheen-base: var(--gold-hi); --sheen-hi: #f7ecd2; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .page-in .hero .display span, .page-in .page-head .display { background: linear-gradient(100deg, var(--sheen-base) 40%, var(--sheen-hi) 50%, var(--sheen-base) 60%) 0 0 / 250% 100% repeat; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: sheen 1.6s var(--ease-out) .25s both; }
}
[data-amt] { display: inline-block; animation: tick var(--t-mid) var(--ease-out) both; }
.spread-card img, .wheel img, .cat-tile img { transition: transform var(--t-mid) var(--ease-out), filter var(--t-mid) var(--ease-out); }
.spread-card:hover img, .wheel:hover img, .cat-tile:hover img { transform: translateY(-6px) rotate(-.6deg); filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55)) brightness(1.06); }

/* ---------- market condition filter and bid target ---------- */
.cond-filter { margin: 0 0 1.25rem; }
.cond-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cond-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 14px 4px 6px; border: var(--line); border-radius: 999px; background: rgba(10, 9, 7, .55); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.cond-chip > span:first-child:not(.chip-art) { padding-left: 8px; }
.cond-chip:hover { border-color: var(--gold); }
.cond-chip:active { transform: scale(.97); }
.cond-chip[aria-pressed="true"] { border-color: var(--gold-hi); background: var(--gold-faint); color: var(--gold-hi); }
.chip-art { width: 24px; height: 36px; overflow: hidden; border-radius: 4px; flex: none; }
.chip-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cond-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.cond-note p { margin: 0; color: var(--muted); }
.target { display: flex; gap: 14px; align-items: flex-start; margin: 12px 0; padding: 12px 14px; border: var(--line); border-radius: 12px; background: rgba(201, 164, 92, .06); }
.target p { margin: 0 0 .35em; }
.target-art { width: 56px; flex: none; animation: glint 2.4s ease-in-out 1; border-radius: 6px; }
.target-art img { display: block; width: 100%; height: auto; border-radius: 6px; }
.target-fan { position: relative; width: 84px; height: 72px; flex: none; }
.target-fan > span { position: absolute; left: calc(var(--i) * 12px); top: 0; width: 40px; transform: rotate(calc((var(--i) - 2) * 7deg)); transform-origin: 50% 100%; }
.target-fan img { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.ladder { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 8px 0; }
.ladder li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 8px; border: 1px solid transparent; transition: opacity var(--t-mid), border-color var(--t-mid); }
.ladder li.on { border-color: var(--gold-dim); background: var(--gold-faint); }
.ladder li.off { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  .page-in > *, [data-amt], .target-art { animation: none !important; }
  .page-in .hero .display span, .page-in .page-head .display { animation: none !important; background: none; -webkit-text-fill-color: currentColor; color: var(--sheen-base); }
  .spread-card img, .wheel img, .cat-tile img, .cond-chip, .ladder li { transition: none !important; }
  .spread-card:hover img, .wheel:hover img, .cat-tile:hover img { transform: none; }
}
.skip:focus { top: 12px; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---------- background star chart ---------- */
.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; fill: none; stroke: var(--gold); stroke-width: 1; opacity: .5; }
.sky .dots { stroke-dasharray: 1 7; stroke-linecap: round; stroke-width: 1.6; }
.sky .dash { stroke-dasharray: 2 10; opacity: .7; }
.sky .fill { fill: var(--gold); stroke: none; opacity: .7; }
.sky .stars use { fill: var(--gold); stroke: none; opacity: .75; }
.sky .sky-frames rect { stroke-dasharray: 3 6; opacity: .45; }
.sky .axis { opacity: .12; stroke-dasharray: 1 9; }
.orbit { transform-box: view-box; transform-origin: 1040px 380px; }
.orbit-a { animation: spin 240s linear infinite; }
.orbit-b { animation: spin 360s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
html:not(.intro-done) .sky circle, html:not(.intro-done) .sky ellipse { animation: draw 1.4s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 900; opacity: 0; } to { opacity: 1; } }
.still .orbit, .still .sky * { animation: none !important; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 14px clamp(16px, 3vw, 40px); background: linear-gradient(var(--ground), rgba(10, 9, 7, .82)); backdrop-filter: blur(8px); border-bottom: 1px solid var(--gold-faint); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; font-size: 1.02rem; white-space: nowrap; }
.logo-mark { width: 34px; height: 34px; fill: none; stroke: var(--gold); stroke-width: 1.2; }
.logo-mark path:first-of-type { fill: var(--gold); stroke: none; }
.logo-moon { fill: var(--ground) !important; stroke: var(--gold) !important; }
.nav ul { display: flex; justify-content: center; gap: clamp(8px, 1.6vw, 26px); list-style: none; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--ivory); opacity: .82; padding: 6px 2px; white-space: nowrap; font-size: .95rem; }
.nav a:hover { opacity: 1; color: var(--gold-hi); }
.nav a[aria-current="page"] { color: var(--gold-hi); opacity: 1; box-shadow: inset 0 -1px 0 var(--gold); }
.head-tools { display: flex; gap: 8px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: transparent; border: var(--line); cursor: pointer; color: var(--gold); }
.icon-btn:hover { border-color: var(--gold); }
/* Narrow screens: brand + tools on one row, navigation wraps beneath inside the viewport (no clipped controls). */
@media (max-width: 760px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 10px 14px; }
  .brand { min-width: 0; letter-spacing: .08em; font-size: .92rem; }
  .brand span { overflow: hidden; text-overflow: ellipsis; }
  .logo-mark { width: 28px; height: 28px; }
  .nav { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .nav ul { flex-wrap: wrap; justify-content: flex-start; gap: 2px 14px; }
  .nav a { display: inline-block; padding: 10px 0; font-size: .9rem; }
  .head-tools { gap: 6px; }
  .head-tools .icon-btn { width: 40px; height: 40px; }
  .btn-wallet { padding: 8px 12px; max-width: 46vw; }
  .btn-wallet span { overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- buttons, links, pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold-hi); cursor: pointer; text-decoration: none; transition: background .25s var(--ease), color .25s var(--ease), border-color .25s; white-space: nowrap; }
.btn:hover { background: var(--gold-faint); }
.btn-primary { background: var(--gold); color: #17130b; border-color: var(--gold); font-weight: 600; }
.btn-primary:hover { background: var(--gold-hi); }
.btn-ghost { border-color: var(--gold-dim); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn-wide { width: 100%; }
.btn-wallet { border-color: var(--gold-dim); min-height: 40px; padding: 8px 16px; }
.btn[disabled], .pill[disabled] { cursor: not-allowed; opacity: .55; }
.btn-primary[disabled] { background: rgba(201, 164, 92, .38); color: rgba(23, 19, 11, .85); border-color: transparent; opacity: 1; }
.btn-link, .link { background: none; border: 0; padding: 0; color: var(--gold-hi); text-decoration: underline; text-decoration-color: var(--gold-dim); text-underline-offset: 4px; cursor: pointer; }
.btn-link:hover, .link:hover { text-decoration-color: var(--gold-hi); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 8px; padding: 4px; border-radius: 999px; border: 1px solid var(--gold-faint); background: rgba(10, 9, 7, .5); margin: 8px 0 14px; }
.pill { min-height: 40px; min-width: 44px; padding: 6px 18px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ivory); }
.pill:hover:not([disabled]) { border-color: var(--gold-dim); }
.pill[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-hi); background: rgba(201, 164, 92, .12); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--gold-dim); font-size: .82rem; color: var(--gold); background: rgba(10, 9, 7, .6); }
.chip-wait { color: var(--muted); border-color: var(--gold-faint); }
.chip-err { color: var(--err); border-color: rgba(224, 122, 95, .45); }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--gold-dim); border-radius: 6px; font-size: .75rem; color: var(--gold); margin-left: 8px; }

/* ---------- surfaces ---------- */
.page { width: var(--wrap); margin: 0 auto; padding: clamp(28px, 5vw, 64px) 0 80px; outline: none; }
.frame { position: relative; border: var(--line); border-radius: var(--r); background: var(--panel); backdrop-filter: blur(3px); }
.frame::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--gold-faint); border-radius: calc(var(--r) - 5px); pointer-events: none; }
.pad { padding: clamp(18px, 2.4vw, 28px); }
.row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.strip { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border: 1px solid var(--gold-faint); border-radius: 999px; background: rgba(10, 9, 7, .72); color: var(--muted); font-size: .9rem; width: fit-content; max-width: 100%; }
.strip .ico { color: var(--gold); }
.h-icon { display: flex; align-items: center; gap: 12px; }
.h-icon .ico { color: var(--gold); width: 1em; height: 1em; }
.page-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px; margin: 28px 0; }
.ruled { border-top: var(--line); border-bottom: var(--line); padding: 28px 0; gap: 0; }
.ruled > :first-child { padding-right: clamp(0px, 3vw, 40px); border-right: var(--line); }
.ruled > :last-child { padding-left: clamp(0px, 3vw, 40px); }
.panel-plain { padding: 8px 0; }
.block { margin: 40px 0; padding-top: 28px; border-top: var(--line); }

/* ---------- data states ---------- */
.state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px; color: var(--muted); border: 1px dashed var(--gold-faint); border-radius: 10px; background: rgba(10, 9, 7, .55); }
.state.compact { padding: 10px 12px; }
.state-wait .ico { color: var(--gold); }
.state-error { color: var(--ivory); border-color: rgba(224, 122, 95, .45); }
.state-error .ico { color: var(--err); }
.boot, .boot-error { margin: 15vh auto; width: fit-content; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--gold-dim); border-top-color: var(--gold-hi); animation: spin 1s linear infinite; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center; min-height: calc(100vh - 170px); }
.hero .display span { display: block; }
.hero .display span:last-child { color: var(--gold-hi); }
.spread { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 1.4vw, 18px); padding: 10px; }
.spread-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; transform: translateY(calc((var(--i) - 2) * (var(--i) - 2) * 3px - (var(--i) / 5) * 0px)); transition: transform .45s var(--ease); }
.spread-card:nth-child(n+6) { transform: translateY(calc((var(--i) - 7) * (var(--i) - 7) * 3px)); }
.spread-card:hover, .spread-card:focus-visible { transform: translateY(-8px); }
.spread-name { font-size: .78rem; color: var(--muted); text-align: center; letter-spacing: .02em; }
.spread-card:hover .spread-name { color: var(--gold-hi); }
html:not(.intro-done):not(.still) .spread-card { animation: deal .9s var(--ease) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes deal { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
.card-img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; border-radius: 10px; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 1px var(--gold-faint); }
.card-xs { max-width: 72px; border-radius: 6px; }
.card-sm { max-width: 190px; }
.card-lg { max-width: 460px; }
.band { margin: clamp(56px, 9vw, 120px) 0; }
.band-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(28px, 5vw, 72px); align-items: start; }
.band-head { max-width: 760px; margin-bottom: 28px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; padding: 10px 22px; }
.facts > div { padding: 12px 0; border-bottom: 1px solid var(--gold-faint); display: flex; justify-content: space-between; gap: 12px; }
.facts > div:nth-child(odd) { padding-right: 18px; }
.facts > div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--gold-faint); }
.facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-size: 1.1rem; }
.rites { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 28px); }
.rite { margin: 0; padding: 18px; border: var(--line); border-radius: var(--r); background: var(--panel); text-align: center; }
.rite-name { font-family: var(--display); font-size: 1.3rem; color: var(--gold-hi); letter-spacing: .06em; }
.rite-cores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 10px; }
.rite-core { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); }
.rite-core .card-xs { max-width: 100%; }
.rite-plus { display: flex; align-items: center; gap: 10px; color: var(--muted); justify-content: center; }
.rite-plus::before, .rite-plus::after { content: ""; height: 1px; flex: 1; background: repeating-linear-gradient(90deg, var(--gold-dim) 0 2px, transparent 2px 7px); }
.fool-note { display: flex; gap: 16px; align-items: center; padding: 14px 18px; margin-top: 22px; max-width: 640px; }
.fool-note p { margin: 0; }
.aside-line { margin-top: 18px; color: var(--muted); }
.wheels { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 28px); }
.wheel { text-decoration: none; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.wheel .card-sm { max-width: 240px; }
.wheel-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.rarity { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-hi); font-size: .8rem; letter-spacing: .06em; vertical-align: middle; }
.rarity svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 1.2; }
.rarity b { font-weight: 600; }

/* ---------- mint ---------- */
.mint-head { align-items: flex-start; }
.split-note { max-width: 340px; font-size: .9rem; padding-top: 12px; }
.split-note p { margin: 0 0 6px; }
.mint-supply { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 56px); margin: 30px 0 8px; align-items: start; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress { height: 6px; border-radius: 6px; background: rgba(201, 164, 92, .12); margin: 10px 0; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--gold-faint); text-align: left; }
.table thead th { color: var(--muted); font-weight: 400; font-size: .85rem; }
.table tbody th { font-weight: 400; }
.table small { color: var(--gold); font-size: .72rem; letter-spacing: .04em; }
.qty-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.prompt { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .86rem; line-height: 1.6; background: rgba(5, 5, 4, .82); border: 1px solid var(--gold-faint); border-radius: 12px; padding: 16px 18px; margin: 14px 0; color: var(--ivory); max-width: 70ch; }
.quote-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gold-faint); }
.quote-row > div { display: flex; flex-direction: column; }
.quote-row .big { font-size: 1.25rem; }
.wallet-mint { max-width: 640px; margin-top: 36px; }
.steps { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: center; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold-dim); color: var(--gold); font-size: .85rem; flex: none; }
.op-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; min-height: 32px; }
.elig { padding: 16px 20px; margin-top: 18px; }
.kv { margin: 10px 0; display: grid; gap: 6px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px solid var(--gold-faint); }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; text-align: right; }

/* ---------- catalogue / detail ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; margin: 18px 0 44px; }
.cat-grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cat-tile { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.cat-tile:hover .card-img { box-shadow: 0 12px 34px rgba(0, 0, 0, .6), 0 0 0 1px var(--gold); }
.cat-name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-detail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.card-stage { display: grid; place-items: center; padding: 20px; }
.roman { font-family: var(--display); letter-spacing: .2em; margin: 0; }
.card-info .facts { grid-template-columns: 1fr; }
.card-info .facts > div { padding-left: 0 !important; padding-right: 0; border-left: 0 !important; border-bottom: 1px solid var(--gold-faint) !important; }
.card-info .facts > div:last-child { border-bottom: 0 !important; }
.pager { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

/* ---------- rules ---------- */
.rules-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.toc { position: sticky; top: 96px; align-self: start; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--gold-hi); }
.prose section { padding: 8px 0 28px; border-bottom: 1px solid var(--gold-faint); margin-bottom: 26px; outline: none; }
.prose .table { max-width: 520px; }
.rite-list { padding-left: 1.2em; }
.rite-list li { margin: 6px 0; }
.intents { display: grid; gap: 4px; margin: 0; }
.intents > div { display: grid; grid-template-columns: 200px 1fr; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--gold-faint); }
.intents dt { color: var(--gold); }
.intents dd { margin: 0; }

/* ---------- my cards / ritual ---------- */
.connect-line { padding: 18px 0; color: var(--muted); }
.hold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.hold-card { display: flex; flex-direction: column; gap: 4px; align-items: center; background: none; border: 1px solid transparent; border-radius: 10px; padding: 8px; cursor: pointer; }
.hold-card:hover { border-color: var(--gold-dim); }
.ritual { padding: clamp(18px, 3vw, 34px); margin: 30px 0; }
.ritual-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.ritual-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.board { position: relative; padding: 10px 0 20px; }
.board-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--gold-dim); stroke-width: .3; pointer-events: none; }
.seats-core { display: grid; grid-template-columns: repeat(3, minmax(0, 96px)); justify-content: center; gap: 14px; position: relative; }
.seats-core .seat:nth-child(1) { grid-column: 2; grid-row: 1; }
.seats-core .seat:nth-child(2) { grid-column: 1; grid-row: 2; margin-top: -40px; }
.seats-core .seat:nth-child(3) { grid-column: 3; grid-row: 2; margin-top: -40px; }
.seats-outer { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 24px; position: relative; }
.seats-outer .seat { transform: translateY(calc((var(--n) - 6) * (var(--n) - 6) * -2px + 18px)); }
.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 10px; border: 1px dashed var(--gold-dim); background: rgba(10, 9, 7, .7); min-height: 120px; justify-content: center; font: inherit; color: inherit; }
.seat-core { border-style: solid; border-color: var(--gold-dim); }
.seat-full { border-style: solid; border-color: var(--gold); cursor: pointer; }
.seat-full:hover { background: rgba(201, 164, 92, .08); }
.seat .card-xs { max-width: 64px; }
.ghost-card { opacity: .28; filter: grayscale(.3); }
.seat-dot { color: var(--gold-dim); }
.seat-label { font-size: .7rem; color: var(--muted); text-align: center; line-height: 1.2; }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; }
.checks .ok .ico { color: var(--gold-hi); }
.checks .bad .ico { color: var(--err); }
.checks .note { color: var(--muted); }
.checks .note .ico { color: var(--gold); }
.odds ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.odds li { display: grid; grid-template-columns: 70px 70px 1fr; align-items: center; gap: 8px; }
.agent-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gold-faint); }
.practice { margin: 36px 0; padding: clamp(18px, 3vw, 30px); border: 1px dashed var(--gold-dim); border-radius: var(--r); background: rgba(10, 9, 7, .55); }
.practice-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.practice-head h2 { margin: 0; }
.practice .tag { font-size: .82rem; padding: 3px 10px; }
.practice-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(18px, 3vw, 40px); align-items: start; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.palette-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 1px solid transparent; border-radius: 10px; padding: 6px 2px; cursor: pointer; font-size: .72rem; color: var(--muted); }
.palette-card:hover:not([disabled]) { border-color: var(--gold-dim); color: var(--gold-hi); }
.palette-card[disabled] { opacity: .45; cursor: not-allowed; }
.form { display: grid; gap: 12px; }
.form label, .field, .inline-form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input, select { min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--gold-dim); background: rgba(5, 5, 4, .85); color: var(--ivory); width: 100%; }
input:focus, select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(201, 164, 92, .22); }
input::placeholder { color: #8b836f; }
.field-msg { font-size: .8rem; color: var(--muted); min-height: 1em; }
.field-msg.bad, .form .field-msg:not(:empty) { color: var(--err); }

/* ---------- market ---------- */
.tabs { display: flex; gap: 6px; border-bottom: var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 16px; cursor: pointer; color: var(--ivory); opacity: .8; white-space: nowrap; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--gold-hi); border-bottom-color: var(--gold); opacity: 1; }
.market-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.market-bar h2 { margin: 0 0 4px; }
.market-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.market-actions .pills { margin: 0; }
.stats-row { padding: 6px; margin: 16px 0 24px; }
.stat-cells { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.stat-cells > div { padding: 14px 18px; border-left: 1px solid var(--gold-faint); }
.stat-cells > div:first-child { border-left: 0; }
.stat-cells dt { color: var(--muted); font-size: .88rem; }
.stat-cells dd { margin: 4px 0 0; font-size: 1.6rem; font-family: var(--display); }
.stat-cells dd.small { font-size: .82rem; font-family: var(--body); }
.market-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 22px; align-items: start; }
.market-side { display: grid; gap: 22px; }
.quick { border-top-color: var(--gold); }
.levels td { padding: 8px 12px; }
/* Header and levels share one table; numeric columns shrink to their content so each value sits under its header. */
.levels .r { width: 1%; white-space: nowrap; }
.levels summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.levels summary::-webkit-details-marker { display: none; }
.bid-ids { list-style: none; padding: 6px 0 0 26px; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.levels summary { flex-wrap: wrap; }
.cond-tag { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: .85rem; color: var(--ivory); }
.cond-tag .chip-art { width: 18px; height: 27px; border-radius: 3px; }
.levels .cond-tag { margin-left: 4px; }
.lv-na .na { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.quick-target { margin: 2px 0 8px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.inline-form label { flex: 1 1 220px; }

/* ---------- agents ---------- */
.agents-head { align-items: flex-start; }
.lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: min(100%, 440px); }
.lookup .field-msg { grid-column: 1 / -1; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 200px; align-items: end; margin: 16px 0; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 70%; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 1px; }
.ops { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.state-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.state-list li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gold-faint); }
.state-list .mono { color: var(--gold); }

/* ---------- dialogs ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; }
.dialog-scrim { position: absolute; inset: 0; background: rgba(5, 4, 3, .74); backdrop-filter: blur(5px); }
.dialog { position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: clamp(20px, 3vw, 32px); background: var(--panel-solid); outline: none; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; translate: 0 12px; } }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 1; }
.dialog h2 { padding-right: 48px; }
.wallet-routes { display: grid; gap: 14px; margin: 16px 0; }
.route { padding: 16px 0 6px; border-top: 1px solid var(--gold-faint); }
.route h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc { padding: 8px 0; }

/* ---------- footer ---------- */
.site-footer { width: var(--wrap); margin: 0 auto; padding: 28px 0 48px; border-top: 1px solid var(--gold-faint); display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; justify-content: space-between; }
.site-footer p { margin: 0; display: flex; align-items: center; gap: 10px; }
.site-footer .logo-mark { width: 26px; height: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .site-header { grid-template-columns: auto auto; }
  .nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
  .nav ul { justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .market-grid, .ritual-body, .practice-body, .card-detail { grid-template-columns: 1fr; }
  .market-side { order: -1; }
  .rules-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 8px 16px; }
}
@media (max-width: 720px) {
  .brand span { font-size: .9rem; letter-spacing: .1em; }
  .spread { grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; }
  .spread-name { display: none; }
  .rites, .wheels { grid-template-columns: 1fr 1fr; }
  .rites { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts > div { padding: 10px 0 !important; border-left: 0 !important; border-bottom: 1px solid var(--gold-faint) !important; }
  .mint-supply { grid-template-columns: 1fr; }
  .ruled > :first-child { border-right: 0; padding-right: 0; border-bottom: var(--line); padding-bottom: 24px; }
  .ruled > :last-child { padding-left: 0; padding-top: 24px; }
  .stat-cells { grid-template-columns: 1fr 1fr; }
  .stat-cells > div:nth-child(3) { border-left: 0; }
  .stat-cells > div:nth-child(n+3) { border-top: 1px solid var(--gold-faint); }
  .seats-outer { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seats-outer .seat { transform: none; }
  .seat { min-height: 104px; }
  .palette { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .palette-card span { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .intents > div, .state-list li { grid-template-columns: 1fr; gap: 2px; }
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--gold-faint); }
  .table.stack td { border: 0; padding: 2px 0; text-align: left; }
  .table.stack td[data-l]::before { content: attr(data-l); display: block; color: var(--muted); font-size: .75rem; }
  .bars { gap: 2px; }
  .bar span { display: none; }
  .bar time { font-size: .6rem; writing-mode: vertical-rl; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
