/* Phantasmal Flames — showcase styles. Tokens from brand/tokens.css. */
* { margin: 0; padding: 0; box-sizing: border-box; font-synthesis: none; /* Rolide is single-weight; no faux bold */ }
html, body { height: 100%; }
html { background: var(--stage); }
body {
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}
/* background stage: isolated stacking context with its own solid base, so
   the blended layers inside never recomposite against live page content.
   Motion comes from app.js's rAF loop, not CSS animation (frozen timelines). */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--stage);
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
}
.bg-grain {
  position: absolute;
  inset: -6%;
  /* fine film grain TILED 1:1 (lossless PNG) — stays crisp at any resolution / DPI,
     instead of a JPEG stretched to cover (which upscaled soft + blocky) */
  background: url('assets/grain.png') repeat;
  background-size: 300px 300px;
  mix-blend-mode: screen;
  opacity: 0.15;
  will-change: transform;
}
/* fractal glass: icy blue streaks on black — the navy tint of the void */
.bg-glass {
  position: absolute;
  inset: -8%;
  background: url('assets/glass-spectral.jpg') center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.3;
  will-change: transform;
}
/* lighting pass: a cool keylight from above, ember kicker from the lower right,
   and a faint phantom diagonal sweep — drifted by the rAF loop like the rest */
.bg-light {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(95% 72% at 50% -14%, rgba(127, 212, 244, 0.17) 0%, transparent 62%),
    radial-gradient(72% 95% at 106% 80%, rgba(240, 140, 30, 0.13) 0%, transparent 58%),
    linear-gradient(118deg, transparent 36%, rgba(196, 75, 173, 0.08) 50%, transparent 64%);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

/* ---------- Minimap (bottom arc dial, inset from the edges) ----------
   The heat-bar strip is bent into a shallow concave-up arc that tapers to
   nothing at both tips; a frosted dial rides the curve and tilts to its
   tangent. The whole shape is pure CSS off two per-element numbers — a
   tick's slot (--s) and the dial's 0..1 position (--td) — so it stays
   responsive with zero resize math. */
/* --td / --pop are plain custom props, NOT @property-registered: a registered
   <number> pins to its initial-value in this engine and ignores the inline
   updates JS writes each frame. Plain props resolve through calc() fine (the
   ticks prove it), so the dial reads its live --td correctly. */

.minimap {
  flex: none;
  padding-inline: clamp(110px, 14vw, 210px);
  --arc-depth: 20px;   /* how far the tapered tips lift above the centre */
  --arc-rot: 13deg;    /* fan angle of the outermost ticks */
}
.rail {
  position: relative;
  height: 96px;
  cursor: grab;
  touch-action: none;
  outline: none;
  perspective: 520px;            /* the depth — segments recede into z, not a flat tilt */
  perspective-origin: 50% 26%;   /* viewpoint sits above, so the arc reads as 3D */
}
.rail:active { cursor: grabbing; }
.ticks { display: none; } /* retired heat strip — element stays so JS is a no-op */

/* the dial: one bar per card on an arc that curves INTO the screen. Each bar is
   placed with translate3d; perspective shrinks the receding ends = real depth. */
.rail-arc { position: absolute; inset: 0; transform-style: preserve-3d; }
.dial-stage { position: absolute; left: 50%; bottom: 30px; transform-style: preserve-3d; transform: rotateX(12deg); }
.dtick {
  position: absolute; bottom: 0; left: 0; width: 3px; margin-left: -1.5px;
  border-radius: 2px 2px 0 0; transform-origin: bottom center;
  /* vertical gradient = the segment reads as a lit, rounded 3D pillar */
  background: linear-gradient(to top, rgba(61, 155, 224, 0.05), var(--spectral) 55%, var(--spectral-bright));
  box-shadow: 0 0 4px rgba(127, 212, 244, 0.5);
  transition: opacity 0.25s;
}
.rail:hover .dtick:not(.cur) { opacity: 0.7 !important; }
.dtick.cur {
  width: 4px; margin-left: -2px; opacity: 1 !important;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.35), #eafaff 60%, #fff);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 22px rgba(127, 212, 244, 0.85);
}
.dknob {
  position: absolute; bottom: 0; left: 0; width: 12px; height: 12px; margin: 0 0 -4px -6px;
  border-radius: 50%; transform-origin: center;
  background: radial-gradient(circle at 36% 30%, #fff, #d4eeff 48%, #5a9fd0);
  box-shadow: 0 0 13px rgba(127, 212, 244, 0.95), 0 2px 7px rgba(0, 0, 0, 0.55);
}
.rail:focus-visible { outline: 1px solid var(--spectral); outline-offset: 4px; border-radius: 8px; }

/* ---------- Header chrome ---------- */
.chrome {
  position: relative;
  z-index: 200; /* above the wheel's cards (their z tops out ~100) */
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) var(--s-5);
  min-height: 64px;
}
.lockup { display: flex; align-items: center; cursor: pointer; }
.lockup:hover { filter: brightness(1.15); }
/* the mark, for now: just the ember strike-X */
.logo-pokex { display: inline-flex; line-height: 1; user-select: none; }
.logo-pokex .lx {
  font-family: var(--font-logo-x);
  font-size: 50px;
  /* chromium blue: cold metallic gradient through the FLAMES ice palette */
  background: linear-gradient(178deg,
    #EAF7FF 6%, var(--spectral-bright) 28%, var(--spectral) 54%, #1B5E96 78%, #9FE2FF 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(61, 155, 224, 0.55)) drop-shadow(0 0 48px rgba(127, 212, 244, 0.28));
}

/* set selector: current set logo, dead center; opens an era-grouped menu */
.set-dropdown {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.set-btn {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--s-1) var(--s-3);
  transition: background var(--dur-fast);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.set-btn:hover, .set-btn:focus-visible { background: rgba(38, 35, 51, 0.55); }
.set-btn img { height: 42px; filter: drop-shadow(0 0 14px rgba(108, 46, 166, 0.55)); }
/* shown in place of the logo when a set has no logo asset (e.g. Temporal Forces) */
.set-btn-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 14px rgba(108, 46, 166, 0.55);
}
.set-btn-name[hidden] { display: none; }
.set-btn .caret { color: var(--text-dim); font-size: 11px; }
/* categorised, searchable picker: game tabs · filter · scrollable set list */
.set-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: clamp(300px, 33vw, 388px);
  display: flex;
  flex-direction: column;
  background: var(--stage-raise);
  border: 1px solid var(--stage-line);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}
.set-menu[hidden] { display: none; }
.sm-tabs { display: flex; gap: 4px; padding: 8px 8px 0; }
.sm-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--text-dim); background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 3px; cursor: pointer; white-space: nowrap;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.sm-tab-ic { display: block; line-height: 0; opacity: 0.85; }
.sm-tab-ic svg { width: 17px; height: 17px; display: block; }
.sm-tab:hover { color: var(--text); }
.sm-tab.active { color: #fff; background: rgba(127, 212, 244, 0.14); border-color: color-mix(in srgb, var(--spectral) 42%, transparent); }
.sm-tab.active .sm-tab-ic { opacity: 1; color: var(--spectral); }
.sm-search-wrap { padding: 8px; }
.sm-search {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: rgba(20, 18, 29, 0.72); border: 1px solid var(--stage-line); border-radius: 8px;
  padding: 9px 12px; outline: none;
}
.sm-search:focus { border-color: var(--spectral); }
.sm-search::placeholder { color: var(--text-faint); }
.sm-list { max-height: 52vh; overflow-y: auto; scrollbar-width: thin; padding: 0 6px 8px; }
.sm-set {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; background: transparent; border: none; border-radius: 8px;
  padding: 10px 12px; cursor: pointer; text-align: left;
  transition: background var(--dur-fast);
}
.sm-set:hover, .sm-set:focus-visible { background: rgba(38, 35, 51, 0.85); outline: none; }
.sm-set-mark {
  flex: none; width: 34px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}
.sm-set-mark img.logo { max-width: 34px; max-height: 26px; object-fit: contain; }
.sm-set-mark img.sym { width: 18px; height: 18px; object-fit: contain; filter: invert(1) brightness(1.15); opacity: 0.92; }
.sm-set-mark svg { width: 18px; height: 18px; }
/* Lorcana chapter sigil — a small gold-ringed medallion with the chapter number */
.sm-set-mark .lor-sigil {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.3px solid #cda44e; color: #f0d488;
  font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: -0.02em;
  box-shadow: inset 0 0 6px rgba(240, 212, 136, 0.18);
}
.sm-set.active .sm-set-mark .lor-sigil { border-color: #f0d488; color: #ffe9a8; }
.sm-set.active .sm-set-mark { color: var(--ember); }
.sm-set-name { flex: 1; font-family: var(--font-display); font-size: 13px; color: var(--text); }
.sm-set-count {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); flex: none;
  background: rgba(255, 255, 255, 0.05); padding: 2px 8px; border-radius: 999px;
}
.sm-set.active { background: rgba(240, 140, 30, 0.12); }
.sm-set.active .sm-set-name { color: var(--ember); }
.sm-empty { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); padding: 20px; text-align: center; }

/* ---- header control system: one quiet language; brand colour only on intent ---- */
.chrome-right { display: flex; align-items: center; gap: 5px; }
.ctrl-div { width: 1px; height: 17px; background: var(--stage-line); opacity: 0.7; margin: 0 4px; flex: none; }
/* shared control: recessive at rest, soft surface + accent on hover */
.ctrl {
  display: inline-flex; align-items: center; gap: 7px; box-sizing: border-box;
  height: 34px; padding: 0 11px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-dim);
  text-decoration: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.ctrl:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--stage-line); color: var(--text); }
.ctrl:focus-visible { outline: none; border-color: var(--spectral); box-shadow: 0 0 0 1px color-mix(in srgb, var(--spectral) 40%, transparent); }
.ctrl-ic { width: 15px; height: 15px; flex: none; color: var(--text-faint); transition: color var(--dur-fast); }
.ctrl:hover .ctrl-ic { color: currentColor; }

/* search — same height/radius as the cluster; widens + lights spectral on focus */
.search {
  box-sizing: border-box; height: 34px; width: 152px; padding: 0 13px 0 33px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text);
  background: rgba(20, 18, 29, 0.5)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8398' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E")
    no-repeat 12px center / 14px;
  border: 1px solid var(--stage-line); border-radius: 10px; outline: none;
  transition: border-color var(--dur-fast), width var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search::placeholder { color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.search:hover { border-color: var(--text-faint); }
.search:focus {
  border-color: var(--spectral); width: 208px; background-color: rgba(38, 35, 51, 0.5);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--spectral) 35%, transparent), 0 0 18px color-mix(in srgb, var(--spectral) 20%, transparent);
}
/* sealed / binder feature buttons — each lights its own brand hue */
#sealedBtn:hover { color: var(--ember-glint); border-color: color-mix(in srgb, var(--ember) 42%, transparent); }
#binderBtn:hover { color: var(--spectral-bright); border-color: color-mix(in srgb, var(--spectral) 42%, transparent); }

/* counter — a whisper-quiet position readout, set apart from the controls */
.counter {
  font-family: var(--font-mono); font-size: var(--type-small); color: var(--text-faint);
  letter-spacing: 0.05em; font-variant-numeric: tabular-nums; margin-left: 6px;
}
.counter span { opacity: 0.6; }

/* ---------- Stage ---------- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  min-height: 0;
}
.stage-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(46vh 46vh at 50% 44%, var(--glow-color, rgba(108,46,166,0.20)) 0%, transparent 70%),
    var(--vignette);
}
/* the original gradient breathes via the rAF loop (see app.js tick) */
.stage-glow { will-change: transform, opacity; }

/* ---------- Wheel ---------- */
.wheel {
  position: relative;
  height: 60vh;
  min-height: 280px;
  touch-action: pan-y;
  cursor: grab;
}
.wheel.dragging { cursor: grabbing; }
.track { position: absolute; inset: 0; perspective: 1500px; }
.card {
  position: absolute;
  left: 50%;
  top: 50%;
  height: var(--wheel-card-h, 70%); /* pinned in layout-constants.js */
  aspect-ratio: var(--card-aspect, 734 / 1024); /* 734/1024 — pinned in layout-constants.js */
  will-change: transform, filter;
  border-radius: var(--card-radius);
  visibility: hidden;
}
.card img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  /* face-down card while the scan loads */
  background: var(--stage-raise) url('assets/card-back-phantasmal.svg') center / cover no-repeat;
  pointer-events: none;
  transition: box-shadow var(--dur-fast) var(--ease-snap);
}
.card { cursor: pointer; }
.card:hover img { box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--stage-line); }
.card.center:hover img { box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7), var(--glow-phantom); }
.card:focus-visible { outline: 2px solid var(--spectral); outline-offset: 6px; }
.card .ph {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: var(--s-4);
  border-radius: inherit;
  background: url('assets/card-back-phantasmal.svg') center / cover no-repeat;
  color: var(--text-dim);
  font-size: var(--type-small);
}
.card .ph::after { content: ' · image unavailable'; color: var(--text-faint); }
.card.noimg img { visibility: hidden; }
.card.noimg .ph { display: flex; }
/* sealed products are transparent cut-out renders — float them frameless with a
   soft drop-shadow, no white box behind them, like the holographic singles. */
.card.sealed { background: none; box-shadow: none; overflow: visible; }
.card.sealed img,
.card.sealed:hover img,
.card.sealed.center:hover img {
  object-fit: contain;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.6));
}
.card.sealed::after { display: none; }  /* no plastic-frame sheen on a floating render */
.tilt-card.sealed { background: none; box-shadow: none; }
.tilt-card.sealed .face-front img { object-fit: contain; box-shadow: none; filter: drop-shadow(0 26px 44px rgba(0, 0, 0, 0.55)); }
.tilt-card.sealed .face-back { display: none; }
/* inspect affordance: a bracket UNDER the focused card, card-edge to
   card-edge, just tall enough for the word; clicks still hit the card */
.inspect-tag {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 8px;
  height: 26px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text); /* crisp at rest — no blur-glow */
  border-left: 1px solid rgba(237, 234, 244, 0.5);
  border-right: 1px solid rgba(237, 234, 244, 0.5);
  border-bottom: 1px solid rgba(237, 234, 244, 0.5);
  transition: opacity var(--dur-fast) var(--ease-snap), transform var(--dur-fast) var(--ease-snap),
    color var(--dur-fast), border-color var(--dur-fast), text-shadow var(--dur-fast);
}
.card.center .inspect-tag {
  opacity: 1;
  transform: none;
  pointer-events: auto; /* the focused card's bracket IS the inspect button */
  cursor: pointer;
}
.card.center:hover .inspect-tag,
.card.center .inspect-tag:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(237, 234, 244, 0.06);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7); /* tight glow only on hover */
}

/* depth dim: composited overlay driven per-frame by --dim (cheaper than filter) */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #05040A;
  opacity: var(--dim, 0);
  pointer-events: none;
}

/* ---------- Caption ---------- */
/* even rhythm: this top gap (INSPECT bracket → name) matches the name → price
   gap below (.cap-price-row margin-top). P wanted the name dropped lower. */
.caption { text-align: center; padding: clamp(20px, 3vh, 40px) var(--s-5) 0; min-height: 104px; }
.cap-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--type-card);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-wrap: balance;
}
/* card NAMES are always WHITE (P's call) — only the price/rarity carry colour */
.cap-name { color: #fff; }
.cap-name.hot {
  color: #fff;
  text-shadow: 0 0 26px rgba(127, 212, 244, 0.28);
}
/* the valuable-card flourish stays on the panel price header, not the name */
.zoom-panel h2.hot {
  color: var(--hot-color, var(--ember));
  text-shadow: 0 0 26px color-mix(in srgb, var(--hot-color, var(--ember)) 55%, transparent);
}
/* the sub-row under the name: a share button + your ♥◆ marks */
.cap-sub { display: flex; align-items: center; justify-content: center; gap: var(--s-3); margin-top: 6px; min-height: 0; }
.cap-sub:empty { display: none; }
/* share rides the TOP of the focused card now (P) */
.cap-share-top {
  position: absolute; left: 50%; top: clamp(4px, 4.5%, 5vh); transform: translateX(-50%);
  z-index: 6; background: rgba(8, 7, 12, 0.5); border-color: rgba(237, 234, 244, 0.16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cap-share {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 4px 11px; cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.cap-share svg { width: 14px; height: 14px; }
.cap-share:hover { color: var(--spectral-bright); background: rgba(255, 255, 255, 0.05); border-color: color-mix(in srgb, var(--spectral) 38%, transparent); }
.cap-share.copied { color: var(--money); border-color: color-mix(in srgb, var(--money) 45%, transparent); }
.cap-share:focus-visible { outline: none; border-color: var(--spectral); box-shadow: 0 0 0 1px color-mix(in srgb, var(--spectral) 40%, transparent); }
.cap-meta {
  font-family: var(--font-mono);
  font-size: var(--type-small);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  display: inline-flex;
  gap: var(--s-3);
  align-items: center;
}
.cap-meta:empty { display: none; }
/* rarity headline above the wheel — colored per rarity by JS */
.cap-rarity-top {
  text-align: center;
  padding: 0 0 4px;
  font-family: var(--font-mono);
  font-size: var(--type-small);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  min-height: 20px;
  text-shadow: 0 0 18px color-mix(in srgb, currentColor 45%, transparent);
}
/* card number, directly under the rarity — quiet, mono, tabular */
.cap-number-top {
  text-align: center;
  padding: 0 0 var(--s-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}
/* the price — the dopamine hit: large, money-green, glowing on the chase tier */
/* the money number — a living green: gradient sheen + glow (a little dopamine) */
.cap-price {
  font-family: var(--font-price);
  font-weight: 600;
  font-size: clamp(29px, 3.2vw, 44px); /* P: a touch larger */
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #45c97f 0%, #b9ffd0 48%, #45c97f 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--money) 45%, transparent));
  animation: moneySheen 4.5s linear infinite;
}
@keyframes moneySheen { to { background-position: 220% 0; } }
.cap-price.t5 {
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--money) 70%, transparent))
          drop-shadow(0 0 46px color-mix(in srgb, var(--money) 32%, transparent));
}
.cap-price.none {
  background: none;
  -webkit-text-fill-color: var(--text-faint);
  color: var(--text-faint);
  filter: none;
  animation: none;
}
/* price centred on its own line; the trend stamp sits BELOW so it never shifts it */
.cap-price-row {
  margin-top: clamp(18px, 2.6vh, 36px); /* even gap with INSPECT→name above */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
/* trending stamp — a flame (tiered) or snowflake glyph + the %, no harsh glow */
.cap-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.cap-trend[hidden] { display: none; }
.cap-trend .cap-trend-pct {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: currentColor;
}
/* legibility: the small grey text in the inspect panel now reads near-white */
.zoom .zoom-panel .z-credit,
.zoom .zoom-panel .z-price .src,
.zoom .zoom-panel .z-quick .q .v .sub,
.zoom .zoom-panel .z-quick .q .k,
.zoom .zoom-panel .z-table .row span,
.zoom .zoom-panel .z-table .row.head { color: #d8d4e4; }
.zoom .zoom-panel .z-table .row .vname { color: #fff; }
.zoom .zoom-panel .z-table .row .mkt { color: var(--money); }

/* tucked under the price — tiny, white, soft glow */
.hint {
  margin-top: var(--s-2);
  text-align: center;
  font-size: 9px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.8;
  text-shadow:
    0 0 10px rgba(237, 234, 244, 0.55),
    0 0 24px rgba(127, 212, 244, 0.3);
}

/* ---------- Zoom dialog ---------- */
.zoom {
  border: none;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  padding: 0;
  color: var(--text);
}
.zoom { isolation: isolate; }
/* the backdrop pseudo can't be WAAPI-animated, so it stays transparent and the
   .zoom-bg layer (which CAN fade) carries the scrim — the open never hard-pops */
.zoom::backdrop { background: transparent; }
.zoom-bg {
  position: fixed;
  inset: -56px; /* oversized past the ±26px parallax drift so the grain/vignette
                   edges never slide into view (the layer moves, not the viewport) */
  overflow: hidden;
  pointer-events: none;
  z-index: 0; /* over the holo canvas (also z0, earlier in DOM) but transparent */
  background: transparent;
}
.zoom-bg img:first-child {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  opacity: 0.26; /* faint — the animated holo shimmers through behind it */
  filter: blur(80px) saturate(1.3) brightness(0.55);
}
/* per-card animation layer: crossfades in over the blurred art after the reveal.
   Full prominence — the animation IS the backdrop; the scrim protects text. */
.zoom-video {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(1.15);
}
.zoom-grain {
  position: absolute;
  inset: 0;
  background: url('assets/grain-2.jpg') center / cover no-repeat;
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.zoom-bg::after { content: ''; position: absolute; inset: 0; background: var(--vignette); }
/* animated three.js holographic backdrop (canvas) — under everything */
.holo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* THE NAME — big editorial header at the TOP, full width, NEVER clipped and
   NEVER behind the card. (Epic extended display.) */
.z-header {
  position: relative;
  z-index: 3;
  flex: none;
  width: 100%;
  max-width: 1100px;
  text-align: center;
  margin-top: clamp(16px, 5vh, 60px);  /* P: title sat too high — drop it down */
  margin-bottom: clamp(6px, 1.4vh, 18px);
  pointer-events: none;
}
.z-title {
  font-family: var(--font-epic);
  font-weight: 400;           /* Epic Pro is single-weight */
  font-size: clamp(28px, 5.8vh, 78px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-wrap: balance;
  text-shadow:
    0 2px 28px rgba(0, 0, 0, 0.7),
    0 0 calc(50px + var(--name-flare, 0) * 64px) var(--name-glow, rgba(127, 212, 244, 0.3));
  perspective: 620px;         /* depth for the per-letter drop-in */
}
.z-title .wd { display: inline-block; white-space: nowrap; transform-style: preserve-3d; }
.z-title .ch { display: inline-block; transform-origin: 50% 100%; will-change: transform, opacity, filter; }
/* rarity as TEXT (no badge), in its signature color, under the name */
.z-rarity-line {
  margin-top: clamp(4px, 0.8vh, 10px);
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.3vh, 13px);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rarity-color, var(--text-dim));
  text-shadow: 0 0 20px color-mix(in srgb, var(--rarity-color, transparent) 55%, transparent), 0 1px 6px rgba(0, 0, 0, 0.8);
}
/* card number under the rarity — big, pitch white */
.z-number {
  margin-top: clamp(5px, 1vh, 12px);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(18px, 2.6vh, 28px);
  letter-spacing: 0.06em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85);
}
.z-number:empty { display: none; }
/* Lorcana subtitle — the "— Title" epithet, shown dash-free on its own line */
.z-subtitle {
  display: block;
  margin-top: clamp(3px, 0.9vh, 10px);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(13px, 2.1vh, 23px);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-dim);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.78);
}

/* special rarities wear their own character — iridescent / metallic clipped
   text. -webkit-text-fill-color keeps the var(--rarity-color) as a fallback. */
.rar-enchanted, .rar-iconic, .rar-ultra-rare,
.rar-special-illustration-rare, .rar-hyper-rare, .rar-mega-hyper-rare {
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 100% 100%;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.82); /* legibility; colored glow dropped */
}
.rar-enchanted { background-image: linear-gradient(95deg, #ffb3da, #ffe6a8 26%, #b6ff9e 50%, #9ec9ff 74%, #d6b3ff); }
.rar-iconic { background-image: linear-gradient(95deg, #e9b955, #fff3c8 30%, #d89a2e 52%, #fff3c8 74%, #e9b955); }
.rar-ultra-rare { background-image: linear-gradient(95deg, #cdd6e8, #ffffff 30%, #9fabc6 55%, #ffffff 78%, #cdd6e8); }
.rar-special-illustration-rare { background-image: linear-gradient(95deg, #ff9fd0, #ffd877 28%, #8dffca 52%, #74d2ff 76%, #c8a0ff); }
.rar-hyper-rare { background-image: linear-gradient(95deg, #ffd27a, #ff9ec7 35%, #c4a0ff 65%, #8ad8ff); }
.rar-mega-hyper-rare { background-image: linear-gradient(95deg, #ff7a59, #ffd166 30%, #ff7ab8 55%, #c08cff 80%, #ff7a59); }

.zoom-body {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* asymmetric padding (less top, more bottom) floats the whole stack up a touch
     — P: the card, panel, rarity/number and buttons sat a little low */
  padding: clamp(8px, 1.6vh, 20px) clamp(20px, 4vw, 60px) clamp(22px, 5.5vh, 60px);
}
/* soft dark scrim between the animated holo (edges) and the content (centre) —
   the backdrop stays visibly alive at the periphery, text reads over the middle */
.zoom-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(62% 58% at 50% 52%,
    rgba(5, 4, 9, 0.66) 0%, rgba(5, 4, 9, 0.34) 42%, rgba(5, 4, 9, 0) 76%);
}
/* card centred, data panel beside it */
.z-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  flex: 1 1 auto;     /* fill the height so the absolute gallery has real room */
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--stage-gap, clamp(22px, 4vw, 70px));
  transform: translateY(clamp(-26px, -2.6vh, -14px)); /* P: lift the card + panel up a touch */
}
.card-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(11px, 1.8vh, 20px);
  flex: none;
}

/* elegant, simple action row — clean segmented control, capped to the card width */
/* action row — three clean editorial buttons, capped to the card width */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  max-width: var(--featured-card-w, 360px); /* JS pins this = the card's width */
  gap: 8px;
  position: relative;
  z-index: 3; /* ABOVE the card's drop-shadow (.tilt-zone is z2) so they never dim */
}
/* UIverse "milegelu" button — one hue each (pink / amber / teal) */
.card-actions button, .card-actions a {
  --bezier: cubic-bezier(0.22, 0.61, 0.36, 1);
  --edge-light: hsla(0, 0%, 62%, 0.85);
  --text-light: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 0.6em;
  border-radius: 0.55em;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  color: hsla(0, 0%, 96%, 1);
  border: 0;
  background: linear-gradient(140deg,
    hsla(var(--back-color), 56%, 1) min(2em, 22%),
    hsla(var(--back-color), 46%, 0.92) min(8em, 100%));
  box-shadow: inset 0.4px 1px 4px var(--edge-light);
  cursor: pointer;
  transition: all 0.12s var(--bezier);
}
.card-actions #wishBtn  { --back-color: 322, 62%; } /* pink  */
.card-actions #collBtn  { --back-color: 34, 72%; }  /* amber */
.card-actions #shareBtn { --back-color: 162, 50%; } /* teal  */
.card-actions .ic { font-size: 18px; line-height: 1; }
.card-actions .lb { white-space: nowrap; }
.card-actions button:hover, .card-actions a:hover {
  --edge-light: hsla(0, 0%, 72%, 1);
  text-shadow: 0 0 10px var(--text-light);
  box-shadow: inset 0.4px 1px 4px var(--edge-light), 2px 4px 10px hsla(0, 0%, 0%, 0.35);
  transform: translateY(-1px) scale(1.04);
}
.card-actions button:active, .card-actions a:active {
  --text-light: rgba(255, 255, 255, 1);
  box-shadow: inset 0.4px 1px 8px var(--edge-light), 0 0 9px hsla(var(--back-color), 50%, 0.6);
  color: #fff; letter-spacing: 0.08em; transform: scale(1);
}
.card-actions button:focus-visible, .card-actions a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.card-actions #wishBtn[aria-pressed="true"] { --back-color: 322, 82%; box-shadow: inset 0.4px 1px 6px var(--edge-light), 0 0 15px hsla(322, 72%, 55%, 0.65); }
.card-actions #collBtn[aria-pressed="true"] { --back-color: 34, 90%; box-shadow: inset 0.4px 1px 6px var(--edge-light), 0 0 15px hsla(34, 82%, 55%, 0.65); }
.card-actions #shareBtn.copied { --back-color: 150, 72%; box-shadow: inset 0.4px 1px 6px var(--edge-light), 0 0 15px hsla(150, 72%, 50%, 0.65); }

/* "More <species> cards" — an arrow link AT THE PANEL, not a chunky button */
.more-cards-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  margin-top: var(--s-2);
  padding: 12px 4px 4px;
  border: none;
  border-top: 1px solid rgba(237, 234, 244, 0.12);
  background: none;
  text-align: left;
  cursor: pointer;
}
/* three overlapping card thumbnails preview the gallery */
.mc-thumbs { display: inline-flex; flex: none; }
.mc-thumbs img {
  width: 34px; aspect-ratio: 734 / 1024; object-fit: cover;
  border-radius: 4px; border: 1px solid rgba(237, 234, 244, 0.18);
  background: #14121d; box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  position: relative; transform-origin: bottom center;
  transition: transform var(--dur-fast) var(--ease-snap);
}
.mc-thumbs img + img { margin-left: -14px; }
/* explicit stacking so a transformed sibling can't reorder the fan — keep the
   order they sit in (1 back, 2 middle, 3 front); the middle stays the middle */
.mc-thumbs img:nth-child(1) { z-index: 1; }
.mc-thumbs img:nth-child(2) { z-index: 2; }
.mc-thumbs img:nth-child(3) { z-index: 3; }
.more-cards-link:hover .mc-thumbs img:nth-child(1) { transform: translateX(-6px) rotate(-5deg); }
.more-cards-link:hover .mc-thumbs img:nth-child(2) { transform: translateY(-3px); }
.more-cards-link:hover .mc-thumbs img:nth-child(3) { transform: translateX(6px) rotate(5deg); }
.mc-label {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--dur-fast);
}
.mc-arrow { flex: none; font-size: 16px; color: var(--text-dim);
  transition: transform var(--dur-fast) var(--ease-snap), color var(--dur-fast); }
.more-cards-link:hover .mc-label { color: var(--text); }
.more-cards-link:hover .mc-arrow { color: var(--text); transform: translateX(5px); }
.more-cards-link:focus-visible { outline: 1px solid var(--spectral); outline-offset: 3px; }
.more-cards-link[hidden] { display: none; }

/* the "more cards" GALLERY — replaces the stage with big card rows */
.z-gallery {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.z-gallery[hidden] { display: none; }
.gallery-head { display: flex; align-items: center; gap: var(--s-4); flex: none; }
.gallery-back {
  font-family: var(--font-ui); font-size: 13px; color: var(--text);
  background: rgba(237, 234, 244, 0.06); border: 1px solid rgba(237, 234, 244, 0.18);
  border-radius: 10px; padding: 9px 16px; cursor: pointer;
  transition: background var(--dur-fast);
}
.gallery-back:hover { background: rgba(237, 234, 244, 0.12); }
.gallery-title { font-family: var(--font-hero); font-size: clamp(16px, 2.4vh, 26px); color: var(--text); }
.gallery-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-4);
  align-content: start;
  padding: 2px 4px;
  scrollbar-width: thin;
}
.gallery-card {
  display: flex; flex-direction: column; gap: 8px;
  background: none; border: none; padding: 0; cursor: pointer; color: var(--text);
  transition: transform var(--dur-fast) var(--ease-snap);
}
.gallery-card img {
  width: 100%; aspect-ratio: var(--card-aspect, 734 / 1024); object-fit: cover;
  border-radius: 8px; border: 1px solid var(--stage-line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  background: var(--stage-raise) url('assets/card-back-phantasmal.svg') center / cover no-repeat;
  transition: box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.gallery-card:hover { transform: translateY(-4px); }
.gallery-card:hover img { border-color: var(--spectral); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6); }
.gallery-card:focus-visible { outline: 2px solid var(--spectral); outline-offset: 3px; }
.gallery-card .gc-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gallery-card .gc-set { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-card .gc-price { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--money); }
/* card stacks ABOVE the panel so the spec sheet reveals from behind it */
.tilt-zone { position: relative; z-index: 2; }
.tilt-card { z-index: 1; }
.zoom-close {
  position: fixed;
  top: var(--s-4);
  right: var(--s-5);
  z-index: 4; /* above the poster layer */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--stage-line);
  background: var(--stage-raise);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-snap), box-shadow var(--dur-fast) var(--ease-snap);
}
.zoom-close:hover, .zoom-close:focus-visible { border-color: var(--phantom); box-shadow: var(--glow-phantom); }
/* a real Back button (besides the X) — top-left */
.zoom-back {
  position: fixed;
  top: var(--s-4);
  left: var(--s-5);
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--stage-line);
  background: var(--stage-raise);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-snap), box-shadow var(--dur-fast) var(--ease-snap), transform var(--dur-fast) var(--ease-snap);
}
.zoom-back:hover, .zoom-back:focus-visible { border-color: var(--spectral); box-shadow: 0 0 0 1px var(--spectral), 0 6px 18px rgba(0,0,0,0.4); transform: translateX(-2px); }
.tilt-zone { perspective: 1200px; }
.tilt-card {
  position: relative;
  height: var(--tilt-card-h, min(58vh, 60vw)); /* pinned in layout-constants.js */
  aspect-ratio: var(--card-aspect, 734 / 1024); /* 734/1024 — pinned in layout-constants.js */
  border-radius: var(--card-radius);
  transform-style: preserve-3d;
  will-change: transform;
  cursor: zoom-in;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}
/* Magic/Lorcana scans are square-corner JPGs — round the frame so the corners
   don't read as sharp (Pokemon PNGs already carry their own rounded corners) */
.tilt-card.ext-card,
.tilt-card.ext-card .face,
.tilt-card.ext-card img { border-radius: clamp(15px, 4.6%, 30px); }
.tilt-card.rotating { cursor: grabbing; }
.tilt-card.mag { cursor: zoom-out; }
.tilt-card.mag .shine { display: none; }
/* the two-sided card: front scan + printed back, flipped by hold-drag */
.card-faces {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden; /* loupe clips inside the card shape */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* isolate so .card-fx's screen blend composites against the card, not the page
   (otherwise the dark frame centre renders as a black hole over the art) */
.face-front { isolation: isolate; }
.face-back {
  transform: rotateY(180deg);
  background: var(--stage-raise) url('assets/card-back-phantasmal.svg') center / cover no-repeat;
}
.tilt-card img { transition: transform 140ms ease-out; transform-origin: 0 0; }
.tilt-card img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
.shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: color-dodge;
  background: radial-gradient(60% 45% at var(--mx, 50%) var(--my, 50%),
    rgba(231, 99, 198, calc(0.28 * var(--shine-k, 0))) 0%,
    rgba(127, 212, 244, calc(0.16 * var(--shine-k, 0))) 38%,
    transparent 70%);
}
/* per-card holographic energy frame (e.g. Froakie/Greninja). The art has a dark
   centre, so `screen` drops the centre and composites only the glowing border
   over the card. JS sets background-image + un-hides it for cards in CARD_FX. */
.card-fx {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  opacity: 0; /* faded in by JS once the card lands (or shown instantly if reduced-motion) */
  z-index: 4; /* above the scan + the shine */
}
.card-fx[hidden] { display: none; }

/* the data, EDITORIAL: no boxes — a clean typographic column beside the card.
   Hairline rules separate sections; the price is the hero. */
.zoom-panel {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 7px rgba(5, 4, 9, 0.72); /* base halo so all data reads over the holo */
  flex: 0 1 var(--panel-basis, 440px); /* all pinned in layout-constants.js (with fallbacks) */
  min-width: var(--panel-min, 290px);
  max-width: var(--panel-max, 500px);
  max-height: var(--panel-max-h, 78vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap, clamp(12px, 2vh, 22px));
  background: none;
  border: none;
  padding: 2px;
  scrollbar-width: none;
}
.zoom-panel::-webkit-scrollbar { display: none; }
.zoom-panel > * { will-change: transform, opacity; }

/* HERO price — huge, no box, money green */
.z-price { display: flex; flex-direction: column; }
.z-price .amt {
  font-family: var(--font-price);
  font-weight: 600;
  font-size: clamp(42px, 7.6vh, 80px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  /* clean SOLID money-green — no clipped gradient (it read as a "satin" overlay) */
  color: var(--money);
  text-shadow: 0 2px 14px rgba(5, 4, 9, 0.9), 0 0 30px color-mix(in srgb, var(--money) 26%, transparent);
}
.z-price .amt.none { color: var(--text-faint); text-shadow: 0 2px 12px rgba(5, 4, 9, 0.9); }
/* the variant (Holofoil) — clear, with breathing room from the price */
.z-price .lbl {
  margin-top: clamp(8px, 1.4vh, 14px);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 1px 8px rgba(5, 4, 9, 0.85);
}
/* holofoil / reverse-holo variants read as the foil itself — iridescent text */
.z-price .lbl.holo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  background-image: linear-gradient(
    100deg,
    #ff8fcf 0%, #c08bff 18%, #7ad7ff 36%,
    #74f9c8 54%, #ffe98a 72%, #ff9ecb 90%, #c08bff 100%);
  background-size: 220% 100%;
  text-shadow: none;
  filter: drop-shadow(0 1px 9px rgba(5, 4, 9, 0.9));
}
/* the foil chip — a little prism dot before the label */
.z-price .lbl.holo::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
  background: conic-gradient(from 0deg, #ff8fcf, #7ad7ff, #74f9c8, #ffe98a, #ff8fcf);
  box-shadow: 0 0 10px rgba(180, 160, 255, 0.55), inset 0 0 4px rgba(255, 255, 255, 0.6);
  -webkit-background-clip: border-box;
  background-clip: border-box;
}
.z-price .src {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-shadow: 0 1px 6px rgba(5, 4, 9, 0.8);
}

/* quick stats: clean rows, hairline-separated, no boxes */
.z-quick { display: flex; flex-direction: column; }
.z-quick:empty { display: none; }
.z-quick .q {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding: clamp(7px, 1.3vh, 13px) 0;
  border-top: 1px solid rgba(237, 234, 244, 0.12);
}
.z-quick .q .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(5, 4, 9, 0.85);
}
.z-quick .q .v {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: clamp(16px, 2.3vh, 23px);
  color: var(--text);
  text-align: right;
  line-height: 1.05;
  text-shadow: 0 1px 10px rgba(5, 4, 9, 0.9); /* reads over the holo */
}
.z-quick .q .v .sub {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 2px;
}
.z-quick .q .v .delta { font-size: 0.6em; margin-left: 8px; }
/* (wishlist/collection/share moved to the .zoom-actions dock at dialog bottom) */
/* wishlist + collection counts — extends .ctrl; the phantom/ember tints are the
   one "moment of meaning" at rest, the glow blooms on hover */
.list-counts { gap: 13px; padding: 0 13px; }
.lc-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 0; text-transform: none;
}
.lc-ic { width: 14px; height: 14px; display: block; flex: none; transition: filter var(--dur-fast); }
.lc-wish .lc-ic { color: var(--phantom); }
.lc-coll .lc-ic { color: var(--ember); }
.list-counts:hover .lc-wish .lc-ic { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--phantom) 55%, transparent)); }
.list-counts:hover .lc-coll .lc-ic { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ember) 55%, transparent)); }
.cap-marks { letter-spacing: 0.1em; }
.cap-marks .mk-wish { color: var(--phantom-bright); }
.cap-marks .mk-coll { color: var(--ember); }

/* trend graph — a clean editorial line+area chart, no box */
.z-charts { display: block; }
.z-charts:empty { display: none; }
.chart { margin: 0; }
.chart figcaption {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.delta { font-weight: 600; text-transform: none; letter-spacing: 0; }
.delta.up { color: var(--money); }
.delta.down { color: var(--ember-hot); }
.spark { width: 100%; height: auto; max-height: 17vh; display: block; overflow: visible; cursor: crosshair; touch-action: none; }
/* interactive crosshair + highlighted point that track the cursor */
.spark-cross { stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 3; transition: opacity 0.12s; pointer-events: none; }
.spark-hot { fill: var(--stage); stroke-width: 2.5; transition: opacity 0.12s; pointer-events: none; }
.spark-grid { stroke: rgba(237, 234, 244, 0.07); stroke-width: 1; pointer-events: none; } /* weekly time marks */
.chart { position: relative; }
.spark-tip {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 10px;
  background: rgba(8, 7, 12, 0.94);
  border: 1px solid rgba(237, 234, 244, 0.18);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.spark-tip[hidden] { display: none; }
.spark-tip .tip-val { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--money); }
.spark-tip .tip-sub { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.spark-val {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(5, 4, 9, 0.85);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.spark-lab {
  fill: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* TCGplayer variant table — clean hairline rows, no box */
.z-table:empty { display: none; }
.z-table .row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--s-3);
  padding: clamp(5px, 0.9vh, 9px) 0;
  border-top: 1px solid rgba(237, 234, 244, 0.10);
  font-size: var(--type-small);
  align-items: baseline;
}
.z-table .row.head { color: var(--text-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; border-top: none; }
.z-table .row span { font-family: var(--font-mono); text-align: right; min-width: 52px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.z-table .row .vname { font-family: var(--font-ui); color: var(--text); text-align: left; }
.z-table .row .mkt { font-weight: 600; color: var(--money); }

/* a small editorial section label */
.z-hd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* pull rates live behind a disclosure so they're never out in the open */
.z-disclosure { margin-top: var(--s-2); }
.z-disclosure[hidden] { display: none; }
.disc-sum {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 11px 4px 9px; border-top: 1px solid rgba(237, 234, 244, 0.12);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); transition: color var(--dur-fast);
}
.disc-sum::-webkit-details-marker { display: none; }
.disc-sum:hover { color: var(--text); }
.z-disclosure:focus-within .disc-sum { color: var(--text); }
.disc-caret { font-size: 12px; transition: transform var(--dur-fast) var(--ease-snap); }
.z-disclosure[open] .disc-caret { transform: rotate(180deg); }
.z-disclosure[open] .disc-sum { color: var(--text); }
.z-pulls { padding-top: 2px; }

/* pull-rate ladder — clean hairline rows, current rarity lit */
.z-pulls:empty { display: none; }
.pull-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: clamp(4px, 0.8vh, 7px) 0;
  border-top: 1px solid rgba(237, 234, 244, 0.10);
  font-size: var(--type-small);
}
.pull-rar { font-weight: 600; letter-spacing: 0.02em; }
.pull-odds { font-family: var(--font-mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pull-row.cur .pull-rar { color: var(--ember-glint); }
.pull-row.cur .pull-odds { color: var(--text); }

/* "Other <species>" — thumbnail strip, no box */
.z-family:empty { display: none; }
.family-strip {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  padding-bottom: var(--s-2);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.family-strip::-webkit-scrollbar { display: none; }
.family-card {
  flex: 0 0 auto;
  width: 54px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform var(--dur-fast) var(--ease-snap);
}
.family-card img {
  width: 100%;
  aspect-ratio: var(--card-aspect, 734 / 1024); /* 734/1024 — pinned in layout-constants.js */
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(237, 234, 244, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  background: var(--stage-raise) url('assets/card-back-phantasmal.svg') center / cover no-repeat;
  transition: box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.family-card:hover { transform: translateY(-4px); }
.family-card:hover img { border-color: var(--text-faint); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--spectral); }
.family-card:focus-visible { outline: 2px solid var(--spectral); outline-offset: 3px; }
.family-card.noimg img { visibility: visible; }
.family-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--money);
}

/* the only credit line: illustrator · number · refresh date */
.z-credit {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ---------- Sealed price tracker ---------- */
.sealed-dlg {
  margin: auto;
  width: min(92vw, 1060px);
  max-height: 86vh;
  overflow-y: auto;
  border: 1px solid var(--stage-line);
  background: linear-gradient(168deg, rgba(16, 14, 24, 0.92), rgba(11, 10, 16, 0.96));
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
  color: var(--text);
  padding: var(--s-5);
  scrollbar-width: thin;
}
.sealed-dlg::backdrop { background: rgba(5, 4, 9, 0.8); }
.sealed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-4); }
.sealed-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sealed-x { position: static; }
.sealed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-4);
}
.sealed-tile {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  border: 1px solid var(--stage-line);
  background:
    radial-gradient(80% 55% at 50% 30%, rgba(127, 212, 244, 0.07) 0%, transparent 70%),
    rgba(20, 18, 29, 0.6);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  padding: var(--s-4);
}
.sealed-tile img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6));
  margin-bottom: var(--s-2);
}
.sp-name { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.sp-detail { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.sp-price { font-family: var(--font-mono); font-size: 19px; font-weight: 600; color: var(--money); margin-top: var(--s-1); }
.sp-price.pending { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.sp-src { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); }
.sp-note { font-size: 11px; color: var(--ember-glint); margin-top: var(--s-1); line-height: 1.4; }
.sealed-empty { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); padding: var(--s-5) 0; text-align: center; }
.sealed-cap { margin-top: var(--s-4); font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); }

/* ---------- Footer ---------- */
.site-foot {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-2) var(--s-5) var(--s-3);
}
.foot-right { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.foot-left { display: flex; gap: 14px; }
.foot-link { font-family: var(--font-mono); font-size: var(--type-micro); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); text-decoration: none; transition: color 0.16s; }
.foot-link:hover { color: var(--spectral-bright); }
.snapshot { font-family: var(--font-mono); font-size: var(--type-micro); color: var(--text-dim); }
.stale { font-family: var(--font-mono); font-size: var(--type-micro); color: var(--ember); }

/* ---------- Narrow viewports: zoom becomes column + bottom sheet ---------- */
@media (max-width: 1023px) {
  .minimap { padding-inline: var(--s-5); --arc-depth: 13px; --arc-rot: 10deg; }
  .search { display: none; }
  .zoom-body {
    flex-direction: column;
    gap: var(--s-4);
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: var(--s-8);
  }
  .tilt-card { height: auto; width: var(--tilt-card-w-narrow, min(78vw, 46vh)); } /* pinned in layout-constants.js */
  .zoom-panel {
    max-width: none;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0 0 72px; /* clear the fixed action dock */
  }
  .p-cols { grid-template-columns: 1fr; } /* tiles stack on small screens */
  .poster-type { display: none; } /* the sheet supplies its own title */
}
@media (max-width: 700px) {
  .chrome { padding-inline: var(--s-4); }
  .logo-pokex .lp { font-size: 28px; }
  .logo-pokex .lx { font-size: 38px; }
  .chrome-right { gap: var(--s-3); }
  .wheel { height: 52vh; }
}

/* ---------- Reduced motion ----------
   Driven by html.motion-reduced / html.motion-full set in JS (one resolved
   state for CSS and JS; ?motion=full overrides the OS preference for both). */
html.motion-reduced .ticks i,
html.motion-reduced .rail-thumb,
html.motion-reduced .zoom-close,
html.motion-reduced .stage-glow,
html.motion-reduced .card img { transition: none; }
html.motion-reduced .shine { display: none; }

/* ====================== HOME — the front door ====================== */
/* ---------- HOME: hero → "Get started" → "Pick one" 3D card spread ---------- */
.home { position: fixed; inset: 0; z-index: 50; background: radial-gradient(80% 60% at 50% 0%, rgba(127,212,244,0.06), transparent 64%), #07060c; }
.home[hidden] { display: none; }
body.home-open .chrome, body.home-open main, body.home-open .minimap, body.home-open .site-foot { visibility: hidden; }
.home-scroll { position: absolute; inset: 0; overflow: hidden; }
.home-stage { position: absolute; inset: 0; perspective: 1500px; }
.hv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8vh 6vw; box-sizing: border-box; transform-style: preserve-3d; }
.hv[hidden] { display: none; }

/* hero view */
.hero-glow { position: absolute; left: 0; right: 0; top: -6%; height: 72vh; pointer-events: none;
  background: radial-gradient(58% 70% at 50% 0%, rgba(127,212,244,0.20), rgba(196,75,173,0.10) 42%, transparent 72%); filter: blur(18px); }
.hero-kicker { position: relative; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.42em; text-transform: uppercase; color: var(--spectral-bright); opacity: 0.9; margin-bottom: 20px; }
.hero-title { position: relative; font-family: var(--font-display); font-weight: 700; line-height: 0.92; font-size: clamp(46px, 9.4vw, 138px); letter-spacing: -0.02em; color: #fff; }
.hero-title span { display: block; }
.hero-title .ht2 { background: linear-gradient(100deg, var(--spectral-bright), var(--phantom), var(--ember-glint)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hero-sub { position: relative; margin-top: 24px; font-family: var(--font-ui); font-size: clamp(14px, 1.7vw, 19px); color: var(--text-dim); letter-spacing: 0.03em; }
.get-started { position: relative; margin-top: clamp(28px, 5vh, 54px); font-family: var(--font-ui); font-weight: 600; font-size: 16px; color: #06121a; background: linear-gradient(100deg, var(--spectral-bright), #c9b3ff); border: none; border-radius: 999px; padding: 15px 34px; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; box-shadow: 0 16px 40px rgba(127,212,244,0.3); transition: transform 0.2s, box-shadow 0.2s; }
.get-started span { transition: transform 0.2s; }
.get-started:hover { transform: translateY(-2px); box-shadow: 0 22px 52px rgba(127,212,244,0.46); }
.get-started:hover span { transform: translateX(4px); }

/* pick a universe — bare logos floating in 3D (no cards) */
/* pointer-events:none so the full-screen plane can NEVER intercept a logo that
   the parallax tilt has swung behind it — only the .pick-logo buttons are hit */
.hv-pick { perspective: 1300px; pointer-events: none; }
.pick-prompt { position: relative; font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 36px); letter-spacing: 0.01em; color: #fff; margin-bottom: clamp(30px, 6vh, 72px); }
.pick-logos { display: flex; gap: clamp(14px, 2.6vw, 66px); align-items: center; justify-content: center; flex-wrap: nowrap; transform-style: preserve-3d; pointer-events: none; }
.pick-logo {
  --z: 0px; position: relative; min-width: 0; pointer-events: auto; background: none; border: none; cursor: pointer; padding: clamp(10px, 1.3vw, 24px);
  display: flex; align-items: center; justify-content: center; transform-style: preserve-3d;
  will-change: transform, filter, opacity; animation: logoFloat 6.5s ease-in-out infinite;
}
/* depth arc kept fully in FRONT of the z=0 container plane, else the receded
   outer logos sit behind it and it eats their clicks (Pokémon/One Piece bug) */
.pick-logo:nth-child(1) { --z: 6px; } .pick-logo:nth-child(2) { --z: 54px; animation-delay: -1.6s; }
.pick-logo:nth-child(3) { --z: 54px; animation-delay: -3.2s; } .pick-logo:nth-child(4) { --z: 6px; animation-delay: -4.8s; }
@keyframes logoFloat { 0%, 100% { transform: translateZ(var(--z)) translateY(0); } 50% { transform: translateZ(var(--z)) translateY(-10px); } }
.pl-glow { position: absolute; inset: -22% -12%; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 68%); filter: blur(26px); }
.pick-logo img { width: clamp(120px, 14vw, 292px); max-height: clamp(72px, 11vh, 152px); object-fit: contain;
  filter: drop-shadow(0 12px 34px rgba(0,0,0,0.62)); transition: transform 0.32s var(--ease-snap), filter 0.32s; }
.pick-logo:hover img { transform: translateZ(60px) scale(1.09); filter: drop-shadow(0 22px 48px rgba(0,0,0,0.7)) drop-shadow(0 0 28px color-mix(in srgb, var(--accent) 65%, transparent)); }
.pick-logo:hover .pl-glow { opacity: 1; }
.pick-logo:focus-visible { outline: none; }
.pick-logo:focus-visible .pl-glow { opacity: 0.7; }

/* hallway intro: a real card per game flies out of the corridor and dissolves
   into its logo. Positioned on the logo centre; GSAP drives the 3D fly-in. */
.hall-card { position: absolute; left: 50%; top: 50%; width: clamp(124px, 12.5vw, 208px);
  aspect-ratio: 734 / 1024; object-fit: cover; border-radius: 11px; pointer-events: none;
  z-index: 6; backface-visibility: hidden; will-change: transform, opacity, filter;
  box-shadow: 0 38px 72px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 60px rgba(124, 92, 255, 0.12); }

/* set selector */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 12px; width: min(92vw, 1000px); max-height: 60vh; overflow-y: auto; padding: 4px; scrollbar-width: thin; }
.set-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
  padding: 15px 16px; border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stage-line);
  transition: background 0.16s, border-color 0.16s, transform 0.16s; }
.set-pick:hover { background: rgba(255, 255, 255, 0.06); border-color: color-mix(in srgb, var(--accent, var(--spectral)) 50%, transparent); transform: translateY(-2px); }
.sp-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); }
.set-pick:hover .sp-name { color: #fff; }
.sp-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); background: rgba(255, 255, 255, 0.05); padding: 2px 8px; border-radius: 999px; flex: none; }
.pick-back { position: relative; margin-top: clamp(22px, 4vh, 42px); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); background: none; border: none; cursor: pointer; }
.pick-back:hover { color: var(--text); }
@media (max-width: 640px) {
  .pick-logos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
  .pick-logo img { width: 34vw; max-height: 15vh; }
  .set-grid { grid-template-columns: 1fr 1fr; }
}
