/* Holovault. Layout: top bar, one wide content column; cards sit in a dense
   grid, binders sit on a shelf. Ink navy with foil accents in dark, paper
   white with the same foil in light. Every color is a token. */
:root, [data-theme="dark"] {
  --bg: #0c0e19;
  --bg-2: #12152a;
  --panel: #161a2f;
  --panel-2: #1d2240;
  --line: #2a3053;
  --text: #eef0ff;
  --mid: #c3c7e8;
  --dim: #8f95bd;
  --accent: #8b7bff;
  --accent-ink: #ffffff;
  --good: #3ddc97;
  --bad: #ff6b81;
  --warn: #ffc857;
  --shelf: #4a3424;
  --shelf-2: #2c1e14;
  --page: #f1eef8;
  --page-2: #dcd6ea;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --foil: linear-gradient(115deg, #5ee7ff, #a78bfa 30%, #ff7ad9 55%, #ffd166 80%, #5ee7ff);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f2fb;
  --bg-2: #ebe7f8;
  --panel: #ffffff;
  --panel-2: #f3f0fb;
  --line: #ddd8ee;
  --text: #17152b;
  --mid: #3d3a5c;
  --dim: #635f82;
  --accent: #5b3fe0;
  --accent-ink: #ffffff;
  --good: #0f8a55;
  --bad: #c62845;
  --warn: #9a6400;
  --shelf: #8a6242;
  --shelf-2: #5c3f28;
  --page: #ffffff;
  --page-2: #ece8f6;
  --shadow: 0 16px 34px rgba(40, 30, 90, .14);
  color-scheme: light;
}
:root {
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1100px 600px at 80% -200px, var(--bg-2), transparent 70%), var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--body);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Top bar ── */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand b { font: 800 21px/1 var(--display); letter-spacing: -.02em; }
.brand b span { background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav button {
  border: 0; background: none; color: var(--mid);
  padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.nav button[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.bar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.worth { text-align: right; line-height: 1.1; }
.worth small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--dim); }
.worth b { font: 800 17px var(--display); color: var(--good); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--mid); display: grid; place-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--mid);
  border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 13px; white-space: nowrap;
}
.pill.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }

/* ── Page frame ── */
main { max-width: 1240px; margin: 0 auto; padding-inline: 22px; padding-block: 26px 70px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { font: 800 clamp(28px, 4vw, 40px)/1.05 var(--display); letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.head p { margin: 6px 0 0; color: var(--dim); max-width: 62ch; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.btn.foil { background: var(--foil); background-size: 200% 100%; color: #14112b; animation: foilSlide 6s linear infinite; }
@keyframes foilSlide { to { background-position: 200% 0; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.stat small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
.stat b { display: block; font: 800 26px/1.2 var(--display); }
.stat em { display: block; }
.stat em { font-style: normal; font-size: 12.5px; font-weight: 700; }
.up { color: var(--good); } .down { color: var(--bad); }

/* ── Time machine banner ── */
.tm-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}
.tm-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 310px; z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
}
.tm-pop input[type=range] { width: 100%; accent-color: var(--accent); }

/* ── Card grid + foil ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; display: grid; gap: 8px; cursor: pointer; text-align: left;
  transition: transform .18s ease, border-color .18s ease;
}
.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tile .meta { min-width: 0; }
.tile .name { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .val { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.tile .val b { font: 800 17px var(--display); }
.chip { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--mid); border: 1px solid var(--line); white-space: nowrap; }
.chip.foilchip { background: var(--foil); color: #17142e; border: 0; }

.card { position: relative; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.2%; overflow: hidden; background: var(--panel-2); box-shadow: 0 6px 16px rgba(0,0,0,.28); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; color: var(--dim); font-size: 12px; font-weight: 700; }
/* Foil: a rainbow sheen whose angle follows the pointer (--mx/--my set in JS) */
.card.is-foil::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .38;
  background:
    radial-gradient(circle at calc(var(--mx, .5) * 100%) calc(var(--my, .3) * 100%), rgba(255,255,255,.55), transparent 42%),
    linear-gradient(calc(110deg + var(--mx, .5) * 60deg), transparent 18%, #5ee7ff 32%, #a78bfa 44%, #ff7ad9 56%, #ffd166 68%, transparent 82%);
  background-size: 100% 100%, 220% 220%;
  background-position: center, calc(var(--mx, .5) * 100%) calc(var(--my, .5) * 100%);
  transition: opacity .2s;
}
.card.is-foil:hover::after { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .btn.foil { animation: none; } .tile { transition: none; } }

/* ── Search / add ── */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(6, 6, 18, .66); display: grid; place-items: start center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { width: min(680px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.modal h2 { font: 800 22px var(--display); margin: 0 0 14px; }
.suggest { position: relative; }
.suggest ul { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.suggest li { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--panel-2); }
.suggest li img { width: 36px; height: 50px; object-fit: cover; border-radius: 3px; flex-shrink: 0; background: var(--panel-2); }
.suggest li .t { min-width: 0; flex: 1; }
.suggest li .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest li .t span { font-size: 12px; color: var(--dim); }
.printings { display: flex; gap: 8px; flex-wrap: wrap; }
.printings button { border: 1.5px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 7px 13px; font-weight: 800; font-size: 13px; }
.printings button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.note { font-size: 12.5px; color: var(--dim); }

/* ── Binders: shelf of spines, then a 3x3 page spread ── */
.modes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.shelf { display: grid; gap: 22px; }
.shelf-row { position: relative; padding: 0 14px; }
.shelf-row .spines { display: flex; gap: 8px; align-items: flex-end; overflow-x: auto; padding-top: 18px; min-height: 236px; }
.shelf-row::after { content: ""; display: block; height: 14px; border-radius: 3px 3px 7px 7px; background: linear-gradient(var(--shelf), var(--shelf-2)); box-shadow: 0 8px 14px -6px rgba(0,0,0,.5); }
.spine {
  flex: 0 0 auto; width: 52px; height: 210px; border: 0; border-radius: 5px 5px 2px 2px; position: relative;
  background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 22%, transparent 78%, rgba(0,0,0,.3)), var(--c, #444);
  box-shadow: 0 10px 18px -8px rgba(0,0,0,.6); transition: transform .2s ease; color: #fff;
}
.spine:hover, .spine:focus-visible { transform: translateY(-14px); }
.spine .logo { position: absolute; top: 10px; left: 6px; right: 6px; height: 34px; display: grid; place-items: center; background: rgba(255,255,255,.92); border-radius: 4px; }
.spine .logo img { max-height: 28px; max-width: 100%; object-fit: contain; }
.spine .lbl { position: absolute; top: 54px; bottom: 34px; left: 0; right: 0; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.spine .cnt { position: absolute; bottom: 9px; left: 0; right: 0; text-align: center; font: 700 11px var(--mono); }
.book { max-width: 860px; margin: 0 auto; }
.book-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.book-head img { max-height: 46px; max-width: 170px; object-fit: contain; }
.spread { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 14px; overflow: hidden; background: var(--c, var(--accent)); padding: 4px; box-shadow: var(--shadow); }
.leaf { background: linear-gradient(120deg, var(--page), var(--page-2)); padding: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start; min-height: 420px; }
.leaf + .leaf { border-left: 3px dotted rgba(80, 60, 120, .3); }
.pocket { aspect-ratio: 63/88; border-radius: 6px; border: 1.5px dashed rgba(90, 70, 130, .35); background: rgba(255,255,255,.35); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: rgba(90, 70, 130, .55); }
.pocket .card { width: 100%; cursor: pointer; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 14px; }
@media (max-width: 640px) { .spread { grid-template-columns: 1fr; } .leaf + .leaf { border-left: 0; border-top: 3px dotted rgba(80,60,120,.3); } }

/* ── Card detail ── */
.detail { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 28px; align-items: start; }
.detail .card { max-width: 320px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--dim); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; }
.chart { width: 100%; height: 220px; display: block; }
.chart text { fill: var(--dim); font: 600 11px var(--body); }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } .detail .card { margin: 0 auto; } }

/* ── Landing ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; padding-block: 34px; }
.hero h1 { font: 800 clamp(40px, 6.4vw, 76px)/.98 var(--display); letter-spacing: -.035em; margin: 10px 0 16px; text-wrap: balance; }
.hero h1 em { font-style: normal; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--mid); max-width: 52ch; }
.fan { position: relative; height: 420px; }
.fan .card { position: absolute; width: 200px; left: 50%; top: 40px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 30px; }
.features .panel b { display: block; font: 800 17px var(--display); margin-bottom: 4px; }
.features .panel p { margin: 0; color: var(--dim); font-size: 14px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .fan { height: 340px; } .fan .card { width: 150px; } }

.empty { text-align: center; padding: 56px 20px; border: 1.5px dashed var(--line); border-radius: 18px; color: var(--mid); }
.empty b { display: block; font: 800 22px var(--display); color: var(--text); margin-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); }

/* Grading Lab */
@media (max-width: 900px) { .grade-grid { grid-template-columns: 1fr !important; } }


/* ════════ Home showcase (landing.js) ════════
   Each .lx-scene is tall; its .lx-stage sticks under the top bar while --p
   (0..1, written by landing.js) drives the motion below. */
main.wide { max-width: none; padding: 0; }
.lx { --bar: 61px; overflow-x: clip; }
.lx h1, .lx h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
.lx h2 { font-size: clamp(40px, 6.4vw, 86px); line-height: .98; }
.lx p { color: var(--mid); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; max-width: 46ch; }
.lx .eyebrow { margin-bottom: 14px; }
.lx-scene { position: relative; height: 240vh; }
.lx-stage { position: sticky; top: var(--bar); height: calc(100vh - var(--bar)); overflow: hidden; display: grid; place-items: center; padding-inline: clamp(16px, 5vw, 64px); }
.lx-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center; max-width: 1280px; margin: 0 auto; width: 100%; }
.lx-split > :first-child { justify-self: center; }
.lx-copy.center { text-align: center; display: grid; justify-items: center; }
.lx .card { box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .55); }
.rise { opacity: 0; transform: translateY(30px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.rise.in { opacity: 1; transform: none; }

/* Hero: headline lifts away while the three cards spread and grow */
.lx-hero .lx-stage { grid-template-rows: auto 1fr; padding-top: clamp(28px, 6vh, 70px); }
.lx-hero-copy { text-align: center; display: grid; justify-items: center; gap: 4px;
  opacity: calc(1 - var(--p, 0) * 2.4); transform: translateY(calc(var(--p, 0) * -90px)) scale(calc(1 - var(--p, 0) * .08)); }
.lx-hero-copy h1 { font-size: clamp(48px, 8.6vw, 124px); line-height: .95; }
.lx-hero-copy h1 em { font-style: normal; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lx-hero-copy p { margin: 18px auto 24px; text-align: center; }
.lx-hero-fan { position: relative; width: 100%; height: 100%; }
.lx-hero-card { position: absolute; left: 50%; top: 12%; width: clamp(150px, 19vw, 280px);
  --s: var(--p, 0);
  transform: translate(-50%, calc(var(--s) * -24vh))
             translateX(calc(var(--i) * (clamp(110px, 13vw, 190px) + var(--s) * clamp(40px, 9vw, 150px))))
             rotate(calc(var(--i) * (13deg - var(--s) * 13deg)))
             translateY(calc((1 - var(--s)) * abs(var(--i)) * 26px))
             scale(calc(1 + var(--s) * .32));
  z-index: calc(2 - abs(var(--i))); }
.lx-hero-card:nth-child(2) { z-index: 3; }
.lx-scroll-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); opacity: calc(1 - var(--p, 0) * 6); }
.lx-scroll-hint::after { content: ""; display: block; width: 1.5px; height: 34px; margin: 8px auto 0; background: linear-gradient(var(--dim), transparent); animation: lxHint 1.8s ease-in-out infinite; }
@keyframes lxHint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Printings: the card turns while price and printing tick through */
.lx-print-card { width: clamp(220px, 28vw, 380px); transform: perspective(1200px) rotateY(calc((var(--p, 0) - .5) * 34deg)) rotateX(6deg); transition: transform .1s linear; }
.lx-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 18px; }
.lx-chip { padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 800; font-size: 14px; color: var(--dim); transition: all .35s ease; }
.lx-chip.on { color: #17142e; border-color: transparent; background: var(--foil); transform: translateY(-3px); box-shadow: 0 10px 24px -8px rgba(167, 139, 250, .6); }
.lx-price-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.lx-chip-now { font-weight: 800; color: var(--dim); font-size: 15px; }
.lx-big-num { font: 800 clamp(48px, 6.5vw, 92px)/1 var(--display); letter-spacing: -.03em; color: var(--good); }

/* Binders: cards drop into the pockets one after another */
.lx-binder { width: min(100%, 520px); background: linear-gradient(135deg, #5b3fe0, #2c1f7a); padding: 10px; border-radius: 18px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
  transform: perspective(1400px) rotateX(calc((1 - var(--p, 0)) * 18deg)) rotateZ(calc((1 - var(--p, 0)) * -4deg)); }
.lx-page { background: linear-gradient(120deg, var(--page), var(--page-2)); border-radius: 12px; padding: clamp(10px, 2vw, 22px); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1.2vw, 12px); }
.lx-pocket { aspect-ratio: 63 / 88; border-radius: 6px; border: 1.5px dashed rgba(90, 70, 130, .35); background: rgba(255, 255, 255, .35); }
.lx-slot { --k: clamp(0, calc(var(--p, 0) * 13 - var(--i) - 1.2), 1);
  opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -46vh)) rotate(calc((1 - var(--k)) * (var(--i) * 7deg - 28deg))) scale(calc(1.25 - var(--k) * .25)); }
.lx-spines { display: flex; gap: 8px; margin-top: 26px; align-items: flex-end; }
.lx-spine { --k: clamp(0, calc(var(--p, 0) * 7 - var(--i) * .6), 1);
  width: 56px; height: 190px; border-radius: 5px 5px 2px 2px; position: relative; color: #fff;
  background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 22%, transparent 78%, rgba(0, 0, 0, .3)), var(--c);
  opacity: var(--k); transform: translateY(calc((1 - var(--k)) * 60px)); box-shadow: 0 14px 22px -10px rgba(0, 0, 0, .6); }
.lx-spine-logo { position: absolute; top: 10px; left: 6px; right: 6px; height: 34px; display: grid; place-items: center; background: rgba(255, 255, 255, .94); border-radius: 4px; }
.lx-spine-logo img { max-height: 28px; max-width: 100%; object-fit: contain; }
.lx-spine-name { position: absolute; top: 54px; bottom: 12px; left: 0; right: 0; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; white-space: nowrap; }

/* Time machine: the line draws itself as the date runs forward */
.lx-tm .lx-stage { grid-template-rows: auto auto 1fr; align-content: center; gap: 18px; }
.lx-tm-readout { text-align: center; }
.lx-tm-date { font: 800 clamp(18px, 2vw, 24px) var(--display); color: var(--dim); }
.lx-tm-chart { width: min(100%, 960px); height: auto; max-height: 34vh; overflow: visible; }
.lx-tm-line { stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 10px rgba(167, 139, 250, .5)); }
.lx-tm-dot { filter: drop-shadow(0 0 10px #fff); }

/* Grading: measuring lines slide in, then the slab label lands */
.lx-grade-card { position: relative; width: clamp(220px, 26vw, 360px); transform: perspective(1200px) rotateY(calc((.5 - var(--p, 0)) * 24deg)); }
.lx-gl { --k: clamp(0, calc(var(--p, 0) * 3 - .5), 1); position: absolute; background: #facc15; box-shadow: 0 0 10px #facc15; opacity: var(--k); }
.lx-gl.l, .lx-gl.r { top: -6%; bottom: -6%; width: 2px; } .lx-gl.t, .lx-gl.b { left: -6%; right: -6%; height: 2px; }
.lx-gl.l { left: 6.5%; transform: translateX(calc((1 - var(--k)) * -60px)); } .lx-gl.r { right: 6.5%; transform: translateX(calc((1 - var(--k)) * 60px)); }
.lx-gl.t { top: 6%; transform: translateY(calc((1 - var(--k)) * -60px)); } .lx-gl.b { bottom: 6%; transform: translateY(calc((1 - var(--k)) * 60px)); }
.lx-slab-label { --k: clamp(0, calc(var(--p, 0) * 4 - 2.4), 1); position: absolute; left: -4%; right: -4%; top: -15%; height: 12%; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #fff;
  background: linear-gradient(90deg, #c8102e, #e23b52); box-shadow: 0 12px 30px -8px rgba(200, 16, 46, .6);
  opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -40px)); }
.lx-slab-label b { font: 800 clamp(18px, 2vw, 26px) var(--display); } .lx-slab-label span { font-weight: 800; font-size: 12px; letter-spacing: .14em; }
.lx-stats { display: flex; gap: clamp(18px, 3vw, 40px); margin-top: 26px; flex-wrap: wrap; }
.lx-stats b { display: block; font: 800 clamp(28px, 3.4vw, 46px)/1 var(--display); background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lx-stats span { font-size: 13px; color: var(--dim); font-weight: 700; }

/* Room: a wall in perspective that swings around as you scroll */
.lx-room .lx-stage { grid-template-rows: auto 1fr; align-content: center; gap: 20px; }
.lx-room-view { perspective: 1300px; width: min(100%, 980px); height: min(52vh, 460px); position: relative; }
.lx-room-wall { position: absolute; inset: 0 6% 18%; border-radius: 6px; background: linear-gradient(180deg, #3a3350, #2b2540); display: grid; grid-template-columns: repeat(3, 1fr); gap: 4% 9%; padding: 4% 12%; align-content: center;
  transform: rotateY(calc((.5 - var(--p, 0)) * 46deg)) rotateX(4deg); transform-origin: 50% 50%; box-shadow: inset 0 0 80px rgba(0, 0, 0, .45); }
.lx-frame { --k: clamp(0, calc(var(--p, 0) * 9 - var(--i) * .7 - .5), 1); background: #14101a; padding: 6px; border-radius: 3px; box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .7); opacity: var(--k); transform: translateZ(calc((1 - var(--k)) * 260px)); }
.lx-frame .card { box-shadow: none; border-radius: 2px; }
.lx-room-floor { position: absolute; left: -10%; right: -10%; bottom: 0; height: 22%; background: repeating-linear-gradient(90deg, #6e4a2f 0 70px, #5d3e27 70px 72px); transform: rotateX(68deg); transform-origin: bottom; border-radius: 4px; opacity: .85; }

/* Packs: the crimp tears off, the wrapper drops, the pulls fan out */
.lx-pack-zone { position: relative; width: clamp(240px, 26vw, 340px); aspect-ratio: 220 / 380; }
.lx-pack { position: absolute; inset: 0; }
.lx-pack-body, .lx-pack-top { position: absolute; left: 0; right: 0; border-radius: 10px; background: linear-gradient(135deg, hsl(345 70% 45%), hsl(40 85% 70%) 50%, hsl(345 65% 32%)); }
.lx-pack-top { --k: clamp(0, calc(var(--p, 0) * 4 - .4), 1); top: 0; height: 12%; border-radius: 10px 10px 0 0; transform: translate(calc(var(--k) * 70px), calc(var(--k) * -120px)) rotate(calc(var(--k) * 26deg)); opacity: calc(1 - var(--k) * .9);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 3px, rgba(0, 0, 0, .18) 3px 6px), linear-gradient(135deg, hsl(345 70% 45%), hsl(40 85% 70%)); }
.lx-pack-body { --k: clamp(0, calc(var(--p, 0) * 4 - 1.3), 1); top: 12%; bottom: 0; border-radius: 0 0 10px 10px; display: grid; place-items: center; padding: 18%; transform: translateY(calc(var(--k) * 70vh)); }
.lx-pack-body img { width: 100%; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.lx-pulls { position: absolute; inset: 6%; }
.lx-pull { --k: clamp(0, calc(var(--p, 0) * 3 - 1.2), 1); position: absolute; inset: 0;
  transform: translateX(calc(var(--i) * var(--k) * clamp(70px, 9vw, 130px))) translateY(calc(abs(var(--i)) * var(--k) * 18px - var(--k) * 30px)) rotate(calc(var(--i) * var(--k) * 9deg)); }

/* Finale */
.lx-finale { min-height: 80vh; display: grid; place-items: center; align-content: center; text-align: center; gap: 18px; padding: 80px 20px 120px; }
.lx-finale h2 { font-size: clamp(40px, 6vw, 84px); }
.lx-finale p { margin: 0 auto; }

@media (max-width: 860px) {
  .lx-scene { height: 210vh; }
  .lx-split { grid-template-columns: 1fr; gap: 22px; align-content: center; }
  .lx-split.rev > :first-child { order: 2; }
  .lx-split .lx-copy { text-align: center; display: grid; justify-items: center; }
  .lx .lx-split p { font-size: 15px; }
  .lx h2 { font-size: clamp(34px, 10vw, 54px); }
  .lx-print-card, .lx-grade-card { width: min(46vw, 230px); }
  .lx-binder { width: min(80vw, 360px); }
  .lx-spines, .lx-stats, .lx-chips { justify-content: center; }
  .lx-spine { width: 44px; height: 140px; }
  .lx-pack-zone { width: min(44vw, 200px); }
  .lx-hero-card { width: min(34vw, 170px); top: 18%; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .lx-scroll-hint::after { animation: none; }
}

/* ════════ App shell: sidebar + content ════════ */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 61px); }
.shell main { width: 100%; }
.side { position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 55%, transparent); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; }
.side-worth { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 2px; position: relative; overflow: hidden; }
.side-worth::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--foil); }
.side-worth small { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.side-worth b { font: 800 26px/1.15 var(--display); }
.side-worth span { font-size: 12.5px; font-weight: 700; }
.side-add { justify-content: center; }
.side-group { display: grid; gap: 2px; margin-bottom: 10px; }
.side-label { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 4px 10px; }
.side-nav button, .side-foot button, .side-foot a {
  display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; text-align: left;
  padding: 9px 10px; border-radius: 10px; color: var(--mid); font-weight: 700; font-size: 14px; text-decoration: none; }
.side-nav button:hover, .side-foot button:hover, .side-foot a:hover { background: var(--panel-2); color: var(--text); }
.side-nav button[aria-current="page"] { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav button[aria-current="page"] svg { color: var(--accent); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 2px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 61px; z-index: 20; height: auto; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
  .side-worth, .side-label, .side-foot { display: none; }
  .side-add { flex-shrink: 0; padding: 8px 14px; }
  .side-nav { display: flex; gap: 4px; }
  .side-group { display: flex; margin: 0; gap: 4px; }
  .side-nav button { width: auto; white-space: nowrap; padding: 8px 11px; }
}

/* ════════ Bookcase: wooden carcass, planks, spines standing on them ════════ */
.bookcase { --wood: #6b4429; --wood-2: #4a2d1a; --wood-3: #8a5a37;
  background: linear-gradient(90deg, var(--wood-2), var(--wood) 3%, var(--wood) 97%, var(--wood-2));
  border-radius: 10px; padding: 14px 18px 4px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7), inset 0 0 0 2px rgba(0,0,0,.25); }
.bookcase .shelf-row { position: relative; padding: 0; margin-bottom: 14px;
  background: linear-gradient(180deg, #24150c, #3a2415 70%, #2a190e); border-radius: 4px 4px 0 0; box-shadow: inset 0 14px 24px -10px rgba(0,0,0,.8), inset 0 -2px 0 rgba(0,0,0,.4); }
.bookcase .shelf-row::after { content: ""; display: block; height: 16px; margin: 0 -10px; border-radius: 2px 2px 4px 4px;
  background: linear-gradient(180deg, var(--wood-3), var(--wood) 45%, var(--wood-2)); box-shadow: 0 8px 12px -6px rgba(0,0,0,.7); }
.shelf-tag { position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; align-items: baseline;
  background: linear-gradient(180deg, #d9c39a, #b89a6a); color: #3a2614; padding: 2px 12px; border-radius: 3px; font-size: 11px; box-shadow: 0 1px 2px rgba(0,0,0,.5); white-space: nowrap; }
.shelf-tag b { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; } .shelf-tag span { font: 700 10.5px var(--mono); }
.bookcase .spines { display: flex; gap: 5px; align-items: flex-end; overflow-x: auto; padding: 22px 14px 0; min-height: 250px; scrollbar-width: thin; }
.bookcase .spine { height: 218px; }
.bookcase .spine:nth-child(3n) { height: 210px; } .bookcase .spine:nth-child(5n) { height: 224px; }
.spine.empty { filter: saturate(.35) brightness(.75); }
.spine.empty .logo { opacity: .55; }
.spine.empty:hover, .spine.empty:focus-visible { filter: none; }
[data-theme="light"] .bookcase { --wood: #a8784e; --wood-2: #7e5634; --wood-3: #c4936a; }
[data-theme="light"] .bookcase .shelf-row { background: linear-gradient(180deg, #5a3a22, #6e4a2e 70%, #5d3d24); }

/* ════════ Market Watch, watchlist board, sealed ════════ */
.market-hero { margin-bottom: 16px; display: grid; gap: 14px; }
.range-tabs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.range-tabs button { border: 0; background: none; color: var(--dim); font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.range-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.movers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.mover { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 8px; border-radius: 10px; }
.mover:hover { background: var(--panel-2); }
.mover b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; }
table.tick { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.tick th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.tick td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tick tbody tr { cursor: pointer; transition: background .15s; }
.tick tbody tr:hover { background: var(--panel-2); }
.tick tr.hit { background: color-mix(in srgb, var(--good) 10%, transparent); }
.tick td b { font-size: 14px; } .tick td .note { font-size: 12px; }
.tick .mono { font-size: 12.5px; color: var(--mid); }
.th-sort { border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 0; }
.th-sort.on { color: var(--text); }
.spark { display: block; }
.sealed-art { --hue: 260; position: relative; border-radius: 10px; display: grid; place-items: center; padding: 18px 16px 30px; aspect-ratio: 4 / 3; overflow: hidden;
  background: linear-gradient(150deg, hsl(var(--hue) 55% 46%), hsl(calc(var(--hue) + 35) 60% 26%)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 14px 26px -14px rgba(0,0,0,.7); }
.sealed-art img { max-height: 62%; max-width: 86%; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); }
.sealed-art b { color: #fff; font: 800 18px var(--display); text-align: center; }
.sealed-art span { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: rgba(255,255,255,.92); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sealed-art.k-pack, .sealed-art.k-blister { aspect-ratio: 3 / 4; width: 62%; justify-self: center; background: linear-gradient(135deg, hsl(var(--hue) 70% 45%), hsl(calc(var(--hue) + 40) 85% 70%) 50%, hsl(var(--hue) 65% 32%)); }
.sealed-art.k-pack::before, .sealed-art.k-pack::after { content: ""; position: absolute; left: 0; right: 0; height: 7%; background: repeating-linear-gradient(90deg, rgba(255,255,255,.4) 0 3px, rgba(0,0,0,.18) 3px 6px); }
.sealed-art.k-pack::before { top: 0; } .sealed-art.k-pack::after { bottom: 0; }
.sealed-art.k-tin { border-radius: 50% / 14%; background: radial-gradient(circle at 50% 40%, hsl(var(--hue) 55% 50%), hsl(var(--hue) 50% 28%) 62%, #9aa3b2 63%, #5b6474); }
.sealed-art.k-etb { aspect-ratio: 5 / 6; width: 80%; justify-self: center; }
.sealed-art.k-case { background: #b08a5a; } .sealed-art.k-case::before { content: ""; position: absolute; left: 0; right: 0; top: 44%; height: 12%; background: rgba(214,186,140,.9); }
.sealed-art.k-case img { filter: sepia(.5) drop-shadow(0 2px 4px rgba(0,0,0,.4)); opacity: .85; }

/* Add a card: results as a grid of real card scans */
.results { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; max-height: 52vh; overflow-y: auto; }
.results li { display: grid; gap: 4px; padding: 6px; border-radius: 12px; cursor: pointer; border: 1.5px solid transparent; transition: transform .15s, border-color .15s; }
.results li:hover, .results li[aria-selected="true"] { border-color: var(--accent); background: var(--panel-2); transform: translateY(-3px); }
.results .rcard { aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; background: var(--panel-2); box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.results .rcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.results .t b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .t span { font-size: 11px; color: var(--dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .rprice { font-weight: 800; font-size: 12.5px; color: var(--good); }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 13px; padding: 0; }
.modal { width: min(820px, 100%); }
.results li { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.results .rcard { width: 100%; }
.results .rcard img { max-width: 100%; }
.bookcase .spine .lbl { font-size: 11.5px; }
@media (max-width: 900px) { .shell { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .bar { gap: 8px; padding: 10px 12px; }
  .bar .worth small, .bar a.icon-btn, .brand b { display: none; }
  .bar .pill { padding: 6px 10px; }
  main { padding-inline: 16px; }
}

/* Dex Progress */
.dex-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: center; }
.dex-gens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dex-gen { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; text-align: left; display: grid; }
.dex-gen b { font-size: 13px; } .dex-gen span { font-size: 11.5px; color: var(--dim); }
.dex-gen i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w); background: var(--foil); }
.dex-gen.on { border-color: var(--accent); }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.dex-grid.all { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 3px; }
.dex-cell { aspect-ratio: 1; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; padding: 0; overflow: hidden; }
.dex-cell span { font: 700 10px var(--mono); color: var(--dim); opacity: .6; }
.dex-grid.all .dex-cell span { display: none; }
.dex-cell.have { background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, var(--panel)), var(--panel)); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); cursor: pointer; }
.dex-cell.have img { width: 100%; image-rendering: pixelated; }
.set-prog { display: grid; gap: 10px; text-align: left; cursor: pointer; }
.bar-track { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--foil); border-radius: 99px; }
@media (max-width: 900px) { .dex-hero { grid-template-columns: auto 1fr; } .dex-gens { grid-column: 1 / -1; } }

/* Research Lab */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.lab-grid .panel { display: grid; gap: 12px; align-content: start; min-width: 0; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mid); font-weight: 700; }
.hbar-t { height: 12px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.hbar-t i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.hbar b { font-size: 13px; }
.daily { width: 100%; height: auto; }
.top10 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 16px; }
.top10-row { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 8px; border-radius: 10px; }
.top10-row:hover { background: var(--panel-2); }
.top10-row .rank { width: 22px; font-weight: 800; color: var(--dim); }
.top10-row b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side > * { flex-shrink: 0; }
.hbar { grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto; }

/* Trainer */
.side-rank { position: absolute; right: 12px; top: 14px; border: 0; background: var(--foil); color: #17142e; border-radius: 10px; padding: 4px 8px; display: grid; justify-items: center; line-height: 1; }
.side-rank b { font: 800 18px var(--display); } .side-rank span { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.trainer-card { --tc: #a45bc9; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 26px; border-radius: 22px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.22), transparent 40%), linear-gradient(135deg, var(--tc), color-mix(in srgb, var(--tc) 45%, #0c0e19)); box-shadow: var(--shadow); }
.trainer-card::after { content: ""; position: absolute; inset: 0; background: var(--foil); opacity: .12; mix-blend-mode: overlay; pointer-events: none; }
.tc-rank { position: relative; width: 150px; height: 150px; }
.tc-letter { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.tc-letter b { font: 800 54px/1 var(--display); } .tc-letter span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.tc-name { font: 800 clamp(28px, 4vw, 44px)/1.05 var(--display); letter-spacing: -.02em; margin: 4px 0 14px; }
.tc-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.tc-stats small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.tc-stats b { font: 800 20px var(--display); }
.tc-next { margin-top: 14px; font-weight: 700; font-size: 14px; opacity: .9; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.badge { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 4px; justify-items: center; text-align: center; opacity: .55; }
.badge.got { opacity: 1; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.badge-medal { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font: 800 22px var(--display); background: var(--panel-2); color: var(--dim); margin-bottom: 4px; }
.badge.got .badge-medal { background: var(--foil); color: #17142e; box-shadow: 0 8px 20px -6px rgba(167,139,250,.6); }
.badge b { font-size: 14px; } .badge span { font-size: 12px; color: var(--dim); }
@media (max-width: 640px) { .trainer-card { grid-template-columns: 1fr; justify-items: center; text-align: center; } .tc-stats { justify-content: center; } }
.side-rank { top: 10px; right: 10px; width: 34px; height: 34px; padding: 0; place-content: center; border-radius: 9px; }
.side-rank b { font-size: 15px; }

/* Decks */
.deckbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.deckdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dc, var(--accent)); margin-right: 2px; }
.pill.on .deckdot { box-shadow: 0 0 0 2px var(--panel); }

/* News */
.news-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stories { display: grid; }
.story { display: grid; gap: 3px; padding: 12px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); border-radius: 8px; }
.story:hover { background: var(--panel-2); }
.story b { font-size: 15px; line-height: 1.35; }
.story span { font-size: 12px; color: var(--dim); font-weight: 700; }
.stories.compact .story b { font-size: 13.5px; }
.releases { display: grid; gap: 10px; }
.release { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.release img { max-height: 34px; max-width: 90px; object-fit: contain; justify-self: center; }
.release b { display: block; font-size: 14px; } .release span { font-size: 12px; color: var(--dim); }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }

/* Pack Rip: pack wall + 3D stage */
.pack-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; }
.pack-tile { --h: 260; position: relative; aspect-ratio: 5 / 8; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; color: #fff; padding: 0;
  background: linear-gradient(135deg, hsl(var(--h) 72% 42%), hsl(calc(var(--h) + 30) 85% 62%) 40%, hsl(calc(var(--h) + 55) 90% 80%) 52%, hsl(calc(var(--h) + 30) 80% 58%) 64%, hsl(var(--h) 70% 30%));
  box-shadow: 0 14px 26px -12px rgba(0,0,0,.7); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.pack-tile:hover, .pack-tile:focus-visible { transform: translateY(-8px) rotate(-1.5deg) scale(1.03); box-shadow: 0 26px 40px -14px rgba(0,0,0,.75); }
.pack-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 48%, transparent 60%); transform: translateX(-60%); transition: transform .7s ease; }
.pack-tile:hover::after { transform: translateX(60%); }
.pt-crimp { position: absolute; left: 0; right: 0; top: 0; height: 7%; background: repeating-linear-gradient(90deg, rgba(255,255,255,.4) 0 3px, rgba(0,0,0,.2) 3px 6px); }
.pt-crimp.b { top: auto; bottom: 0; }
.pt-logo { position: absolute; left: 8%; right: 8%; top: 18%; height: 34%; display: grid; place-items: center; }
.pt-logo img { max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
.pack-tile > b { position: absolute; left: 8%; right: 8%; top: 26%; font: 800 15px var(--display); text-align: center; }
.pt-name { position: absolute; left: 6%; right: 6%; bottom: 17%; font-size: 11.5px; font-weight: 800; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); line-height: 1.2; }
.pt-year { position: absolute; left: 0; right: 0; bottom: 10%; font: 700 10.5px var(--mono); text-align: center; opacity: .85; }
.pack-zone { display: grid; }
.pack-stage { position: relative; height: min(64vh, 560px); min-height: 380px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 22%, var(--panel)), var(--bg) 70%); touch-action: none; }
.pack-hint { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: rgba(10,10,24,.72); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; pointer-events: none; animation: hintPulse 2.2s ease-in-out infinite; white-space: nowrap; }
@keyframes hintPulse { 50% { transform: translateX(-50%) translateY(-3px); } }
.pack-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-weight: 700; }
.card-back { aspect-ratio: 63 / 100; border: 0; border-radius: 12px; cursor: pointer; color: #fff; font-weight: 800; background: repeating-radial-gradient(ellipse at 50% 50%, #2a3480 0 10px, #3c1e6e 10px 20px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.7); }
.card-back:hover { transform: translateY(-4px); }
.pull.fresh { animation: pullIn .55s cubic-bezier(.2,.9,.3,1.15); }
@keyframes pullIn { from { transform: rotateY(90deg) scale(.9); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pack-hint, .pull.fresh { animation: none; } }

/* Market Watch terminal */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabbar button { border: 0; background: none; padding: 10px 14px; font-weight: 800; font-size: 14.5px; color: var(--dim); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabbar button.on { color: var(--text); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips .eyebrow { margin-right: 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--mid); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend b { color: var(--text); }
.mchart { height: auto; }
.tape { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.tape-run { display: inline-flex; gap: 28px; padding: 10px 0; animation: tape 60s linear infinite; font-size: 13px; }
.tape-run b { font-family: var(--mono); font-size: 12px; color: var(--mid); }
.tape:hover .tape-run { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-run { animation: none; } }
.sealed-mini { --hue: 260; aspect-ratio: 5 / 6; border-radius: 4px; background: linear-gradient(150deg, hsl(var(--hue) 55% 46%), hsl(calc(var(--hue) + 35) 60% 26%)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.results-mini { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; margin-top: 8px; }
.mini-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 0; background: var(--panel-2); border-radius: 10px; padding: 6px 10px; text-align: left; }
.mini-row:hover { outline: 1.5px solid var(--accent); }
.mini-row img { width: 34px; border-radius: 3px; }
.mini-row b { display: block; font-size: 14px; } .mini-row span { font-size: 12px; color: var(--dim); }
.proj-assume { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 16px; align-items: center; }
.report p { line-height: 1.6; }
@media (max-width: 760px) { .proj-assume { grid-template-columns: 1fr; } }

/* Holovault logo in the top bar */
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 14px -4px rgba(139,123,255,.6); }
.brand-by { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); align-self: flex-end; margin: 0 0 3px 2px; }
@media (max-width: 760px) { .brand-by { display: none; } }
