:root {
  --bg: #0d0b0a;
  --ink: #e9e2d4;
  --muted: #9a917f;
  --faint: #5b5449;
  --brass: #c9a24d;
  --brass-2: #e7c877;
  --line: rgba(201,162,77,.22);
  --card: #151210;
  --card-2: #1d1916;
  --err: #d9695c;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ring: 0 0 0 3px rgba(201,162,77,.35);
  --ease: cubic-bezier(.2,0,0,1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--mono);
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
a { color: var(--brass); text-decoration: none; }
a:hover { color: var(--brass-2); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
h1, h2 { text-wrap: balance; }
p, li { text-wrap: pretty; }
b { font-weight: 600; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; color: var(--faint); font-family: var(--serif); font-style: italic; font-size: 18px; z-index: 2; pointer-events: none; transition: opacity .4s var(--ease); }
.loading.done { opacity: 0; }

/* price tags anchored to the model */
.tags { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%) translateY(-8px); pointer-events: auto; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: rgba(13,11,10,.82); border: 1px solid var(--line); color: var(--ink); font-size: 11px; line-height: 1.2;
  opacity: 0; transition: opacity .18s var(--ease), border-color .15s var(--ease); }
.tag.on { opacity: 1; }
.tag b { color: var(--brass-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.tag i { font-style: normal; color: var(--muted); }
.tag::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 5px; height: 5px; border-radius: 50%; background: var(--brass); transform: translateX(-50%); box-shadow: 0 0 6px var(--brass); }
.tag:hover, .tag.sold:hover { border-color: var(--brass); }
.tag.sold { border-color: rgba(201,162,77,.45); }
.vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 60%, rgba(0,0,0,0) 40%, rgba(0,0,0,.65) 100%); }
.corners i { position: fixed; width: 22px; height: 22px; border: 1px solid var(--line); pointer-events: none; }
.corners i:nth-child(1) { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.corners i:nth-child(2) { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.corners i:nth-child(3) { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.corners i:nth-child(4) { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* ——— HUD ——— */
.hud { position: fixed; z-index: 5; }
.hud p { margin: 0; }
.stats, .tip em, .row .p, .grave .p { font-variant-numeric: tabular-nums; }
.hud-tl { top: 32px; left: 36px; }
.hud-tr { top: 32px; right: 36px; text-align: right; }
.hud-bl { bottom: 32px; left: 36px; color: var(--muted); }
.hud-bc { bottom: 28px; left: 50%; transform: translateX(-50%); }
.hud-br { bottom: 32px; right: 36px; text-align: right; }
.stats .big { font: 500 30px/1 var(--mono); color: var(--brass-2); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.stats .big i { font: italic 500 16px var(--serif); color: var(--muted); letter-spacing: 0; }
.stats .stat-l { margin-top: 8px !important; font-size: 12px; color: var(--muted); }
.stats .stat-l span:first-child { color: var(--ink); }
.byline { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.hud-tr .byline { justify-content: flex-end; margin-bottom: 10px !important; text-align: left; }
.byline .avatar { width: 30px; height: 30px; font-size: 15px; }

/* graveyard strip */
.grave-strip { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 10px 12px; margin: -10px -12px; border-radius: 10px;
  transition: background-color .15s var(--ease), transform .12s var(--ease); }
.grave-strip:hover { background: rgba(21,18,16,.7); }
.grave-strip:active { transform: scale(.98); }
.grave-strip .label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.stones { display: flex; gap: 6px; min-height: 30px; align-items: flex-end; }
.stones .stone { width: 26px; height: 30px; border-radius: 13px 13px 3px 3px; background: linear-gradient(180deg,#3a3531,#211d1a); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; }
.stones .stone img { width: 16px; height: 16px; object-fit: contain; filter: grayscale(1) opacity(.75); }
.stones .stone span { font: 600 12px var(--serif); color: var(--faint); }
.stones .plot { width: 26px; height: 8px; border-radius: 2px; border: 1px dashed rgba(201,162,77,.3); }
.grave-strip .tiny { color: var(--muted); }

h1 { font: 500 clamp(30px, 4.2vw, 56px)/1 var(--serif); letter-spacing: -.01em; margin: 0 0 12px; max-width: 18ch; }
.sub { color: var(--ink); font-family: var(--serif); font-size: clamp(17px, 1.6vw, 22px); font-style: italic; opacity: .9; }
.meta { color: var(--brass); font-size: 12px; margin-top: 10px !important; }
.link { color: var(--brass); padding: 0; position: relative; transition: color .15s var(--ease); }
.link::after { content: ''; position: absolute; inset: -10px -6px; }   /* 40px-ish hit area */
.link:hover { color: var(--brass-2); text-decoration: underline; }
.tools { display: flex; gap: 8px; margin-top: 22px; }
.tool { width: 36px; height: 36px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
  transition: color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); }
.tool::after { content: ''; position: absolute; inset: -2px; }                /* 40px hit area */
.tool svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover, .tool[aria-pressed="true"] { color: var(--brass); border-color: var(--brass); }
.tool:active { transform: scale(.96); }


.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); margin-right: 8px; box-shadow: 0 0 8px var(--brass); }
.tiny { font-size: 11px; color: var(--muted); }
.center { text-align: center; }

.avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: radial-gradient(circle at 35% 30%, #3a2f27, #17120f); display: grid; place-items: center;
  font: 600 20px var(--serif); color: var(--brass); }

.cta {
  padding: 14px 28px; border-radius: 8px; font-weight: 700; letter-spacing: .02em;
  color: #1a1408; background: linear-gradient(180deg, var(--brass-2), var(--brass));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 10px 30px rgba(201,162,77,.25);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 14px 36px rgba(201,162,77,.35); }
.cta:active { transform: translateY(0) scale(.96); }
.cta.wide { display: block; width: 100%; text-align: center; }
.cta-price { font-weight: 500; opacity: .75; }
.cta-price:not(:empty)::before { content: '· '; }
.ghost { padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--brass); transition: border-color .15s var(--ease), transform .12s var(--ease); }
.ghost:hover { border-color: var(--brass); }
.ghost:active { transform: scale(.96); }

/* ——— vitals ——— */
.vitals { margin-left: auto; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(13,11,10,.55); backdrop-filter: blur(4px); width: 244px; }
.vitals-h { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.vitals-h #v-status { color: var(--brass-2); }
.vitals-h #v-status.spike { color: var(--err); }
.dot.live { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.ticker { color: var(--brass-2); font-size: 12px; margin-top: 4px !important; }
.stats .ticker { color: var(--ink); opacity: .85; }
.ticker.quiet { color: var(--muted); }
#ecg { display: block; width: 220px; height: 40px; margin: 6px 0 4px; }
.vitals-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.vitals-row b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ——— tooltip ——— */
.tip { position: fixed; z-index: 6; pointer-events: none; transform: translate(14px, 14px);
  background: rgba(21,18,16,.92); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
  display: grid; gap: 2px; min-width: 160px; backdrop-filter: blur(6px); }
.tip b { font-family: var(--serif); font-size: 16px; }
.tip span { font-size: 11px; color: var(--muted); }
.tip em { font-style: normal; color: var(--brass-2); font-size: 12px; }

/* ——— modals ——— */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(6,5,4,.6); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal:not([hidden]) { animation: fade-in .18s var(--ease); }
.modal:not([hidden]) .card { animation: card-in .22s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
.card { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font: 500 22px var(--serif); }
.x { font-size: 22px; color: var(--muted); line-height: 1; width: 40px; height: 40px; margin: -9px -12px -9px 0; display: grid; place-items: center; border-radius: 8px;
  transition: color .15s var(--ease), background-color .15s var(--ease); }
.x:hover { color: var(--ink); background: var(--card-2); }
.card-body { padding: 18px 22px; overflow: auto; }
.card-foot { padding: 14px 22px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.prose p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; }
.prose ul { margin: 0 0 12px; padding-left: 18px; }
.prose li { margin-bottom: 8px; font-size: 13.5px; line-height: 1.6; }
.disclaimer { color: var(--muted); border-left: 2px solid var(--brass); padding-left: 12px; font-size: 12.5px !important; }

/* picker rows */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 12px 8px; border-radius: 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.04); }
.row { transition: background-color .15s var(--ease); }
.row:hover { background: var(--card-2); }
.row:active { background: var(--bg); }
.row .l { display: grid; gap: 2px; }
.row .n { font-family: var(--serif); font-size: 17px; }
.row .s { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.row .s img { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; outline: 1px solid oklch(1 0 0 / .1); outline-offset: -1px; }
.row .p { color: var(--brass-2); font-weight: 500; white-space: nowrap; }
.group-h { margin: 14px 0 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.group-h:first-child { margin-top: 0; }
.badge { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--brass); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }

/* form */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.form .hint { font-size: 11px; color: var(--faint); }
.form input[type=text], .form input[type=url], .form input[type=number] {
  font: 14px var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; width: 100%; }
.form input { transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.form input:focus { outline: none; border-color: var(--brass); box-shadow: var(--ring); }
.amount:focus-within { border-color: var(--brass); box-shadow: var(--ring); }
.amount input:focus { box-shadow: none; }
.amount { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding-left: 12px; }
.amount span { color: var(--brass-2); font-size: 18px; }
.amount input { border: 0 !important; background: transparent !important; font-size: 20px !important; }
.buy-current { font-size: 12px; color: var(--muted); padding: 10px 12px; background: var(--card-2); border-radius: 6px; }
.chains { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; align-items: center; }
.chains legend { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.chains label { display: flex; flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
.chains input { accent-color: var(--brass); }
.wallets { display: grid; gap: 8px; }
.wallets .cta { width: 100%; }
.wallets .none { font-size: 12px; color: var(--muted); }
.manual summary { cursor: pointer; color: var(--brass); font-size: 12px; }
.manual { display: grid; gap: 8px; }
.manual code { display: block; font-size: 11px; word-break: break-all; padding: 8px 10px; background: var(--bg); border-radius: 6px; color: var(--brass-2); }
.err { color: var(--err); font-size: 12px; margin: 0; padding: 8px 10px; border: 1px solid rgba(217,105,92,.4); border-radius: 6px; }
.busy { opacity: .6; pointer-events: none; }

/* graveyard */
.grave { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid rgba(255,255,255,.04); }
.grave .stone { width: 48px; height: 56px; border-radius: 24px 24px 4px 4px; background: linear-gradient(180deg,#3a3531,#211d1a); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.grave .stone img { width: 32px; height: 32px; object-fit: contain; filter: grayscale(1) opacity(.7); outline: 1px solid oklch(1 0 0 / .1); outline-offset: -1px; }
.grave .stone span { font: 600 16px var(--serif); color: var(--faint); }
.grave .n { font-family: var(--serif); font-size: 17px; }
.grave .d { font-size: 11px; color: var(--muted); }
.grave .p { color: var(--faint); font-size: 12px; text-align: right; }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; font-family: var(--serif); font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  .dot.live, .modal:not([hidden]), .modal:not([hidden]) .card { animation: none; }
  .cta, .ghost, .tool { transition: none; }
}

@media (max-width: 720px) {
  .hud-tl { top: 30px; left: 16px; right: 16px; }
  .hud-tr { top: auto; bottom: 92px; right: 12px; }
  .hud-bl { display: none; }
  .hud-br { display: none; }
  .hud-bc { bottom: 16px; width: calc(100% - 32px); }
  .hud-bc .cta { width: 100%; }
  h1 { font-size: 28px; max-width: none; }
  .sub { font-size: 16px; }
  .meta { font-size: 11px; }
  .tag { font-size: 10px; padding: 3px 6px; }
  .vitals { width: 224px; padding: 8px 10px; }
  .vitals-row { font-size: 9px; }
  .vitals-row b { font-size: 12px; }
  #ecg { width: 204px; height: 30px; margin: 4px 0 2px; }
  .hud-tr .byline { display: none; }
  .card { max-height: calc(100dvh - 24px); }
  .modal { padding: 12px; }
  .tools { margin-top: 14px; }
}
