/* CardVault. Colours are tokens: light by default, dark when the device prefers it.
   A clean, modern base (cool neutrals, one violet accent) so the cards themselves are the colour.
   The holo edge (violet, cyan, pink) marks the trading-card things: cards, packs, highlights. */
:root {
  --bg: #f4f5fa;
  --bg-deep: #eceef6;
  --panel: #ffffff;
  --panel-2: #fbfbfe;
  --text: #12141c;
  --muted: #5d6275;
  --line: #e2e4ee;
  --accent: #6a46f5;
  --accent-text: #ffffff;
  --accent-soft: #efeaff;
  --edge-1: #8b6cff;
  --edge-2: #1fc2e8;
  --edge-3: #ff5fa8;
  --frame: linear-gradient(135deg, var(--edge-1), var(--edge-2) 50%, var(--edge-3));
  --glow-1: rgba(122, 92, 255, .16);
  --glow-2: rgba(31, 194, 232, .14);
  --mtg: #e2632a;
  --mtg-deep: #7a2508;
  --pokemon: #f2b705;
  --pokemon-deep: #d1352b;
  --price: #12805a;
  --error: #c4291c;
  --warn: #a55f00;
  --ok: #12805a;
  --foil-a: #ff9bd2;
  --foil-b: #8fd3ff;
  --foil-c: #ffe58f;
  --shadow: 0 1px 2px rgba(18, 20, 40, .05), 0 8px 24px rgba(18, 20, 40, .07);
  --radius: 14px;
  --title-font: "Outfit", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b13;
    --bg-deep: #06070d;
    --panel: #12151f;
    --panel-2: #161a26;
    --text: #eef0f7;
    --muted: #9298ad;
    --line: #232838;
    --accent: #9a82ff;
    --accent-text: #0b0a16;
    --accent-soft: #221d3d;
    --edge-1: #9a82ff;
    --edge-2: #3dd6f5;
    --edge-3: #ff6fb5;
    --glow-1: rgba(122, 92, 255, .22);
    --glow-2: rgba(31, 194, 232, .14);
    --mtg: #ff7a3d;
    --mtg-deep: #6d1f05;
    --pokemon: #ffc928;
    --pokemon-deep: #b8231b;
    --price: #4fe0a4;
    --error: #ff8a80;
    --warn: #ffc266;
    --ok: #4fe0a4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1 { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }

/* ----- Buttons ----- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  text-decoration: none; color: var(--text); font-weight: 500; line-height: 1.3;
}
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button.primary, .button.primary { border-color: transparent; background: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { border-color: transparent; background: var(--error); color: #fff; font-weight: 600; }
button.warn { border-color: var(--warn); color: var(--warn); }
.big { padding: 12px 22px; font-size: 16px; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
input:not([type=radio]), select {
  padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- Header ----- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px 18px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; flex: none; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 7px 11px; border-radius: 9px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--bg); }
.nav a.on { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.who { flex: none; }
.chip { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text); text-decoration: none; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .brand { order: 1; }
  .who { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -8px; }
}

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
main:focus { outline: none; }
section { margin: 0 0 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.section-head h1, .section-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 0 0 18px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 0 24px; }
.note { color: var(--muted); padding: 14px 16px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); margin: 0 0 14px; }
.note.error { color: var(--error); border-style: solid; }
.center-card { text-align: center; max-width: 520px; margin: 40px auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.mtg { background: var(--mtg); }
.dot.pokemon { background: var(--pokemon); }

/* ----- Home ----- */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 18px 0 8px; }
.hero h1 { font-size: clamp(26px, 4.4vw, 40px); line-height: 1.15; }
.hero p { color: var(--muted); max-width: 560px; font-size: 16px; }
.hero-art { display: flex; justify-content: center; gap: 18px; }
.pack-art {
  width: 120px; aspect-ratio: 5 / 8; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: var(--shadow); transform: rotate(-6deg); letter-spacing: .02em;
}
.pack-art + .pack-art { transform: rotate(6deg) translateY(14px); }
.pack-art.mtg { background: linear-gradient(160deg, var(--mtg), var(--mtg-deep)); }
.pack-art.pokemon { background: linear-gradient(160deg, var(--pokemon), var(--pokemon-deep)); }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* ----- Stat tiles ----- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 0 0 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); min-height: 88px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12.5px; }
.skeleton-line { background: linear-gradient(90deg, var(--panel), var(--line), var(--panel)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----- Filters / segmented controls ----- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); max-width: 100%; overflow-x: auto; }
.seg a { padding: 7px 12px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
.seg a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.tabs { margin: 0 0 18px; }

/* ----- Card grid & tiles ----- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tile {
  display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 0; border: 1px solid var(--line); width: 100%;
  background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-weight: 400;
  transition: transform .12s ease, border-color .12s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.tile .img { position: relative; aspect-ratio: 63 / 88; background: var(--bg); display: grid; place-items: center; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .noimg { color: var(--muted); font-size: 13px; padding: 8px; text-align: center; }
.tile .meta { padding: 8px 10px 10px; display: grid; gap: 2px; min-width: 0; }
.tile .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .set { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .line { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; font-size: 13px; min-width: 0; }
.tile .by { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.badges:empty { display: none; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; background: var(--accent-soft); color: var(--text); }
.badge.foil { background: linear-gradient(90deg, var(--foil-a), var(--foil-b), var(--foil-c)); color: #1b2233; }
.badge.serial { background: #1b2233; color: #ffe58f; }
.badge.special { background: var(--accent-soft); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); text-transform: none; }
.badge.bad { background: color-mix(in srgb, var(--error) 16%, transparent); color: var(--error); text-transform: none; }
.count-badge { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .72); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.tile.shiny .img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .55;
  background: linear-gradient(115deg, transparent 20%, var(--foil-a) 38%, var(--foil-b) 52%, var(--foil-c) 64%, transparent 80%);
}
.tile.serialized { border-color: #c9a227; box-shadow: 0 0 0 2px #c9a227, var(--shadow); }
.price { color: var(--price); font-weight: 600; }
.pull { display: grid; grid-template-rows: 1fr auto; gap: 4px; }
.grid > .tile, .pull > .tile, .flip .front .tile { height: 100%; }
.tile .meta { align-content: start; flex: 1; }
.pack-link { font-size: 12.5px; text-align: center; }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* ----- Opening packs ----- */
.opener { text-align: center; }
.game-pick { display: inline-flex; gap: 12px; margin: 12px 0; }
.game-option { position: relative; }
.game-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.game-option span { display: block; padding: 14px 28px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); font-weight: 700; font-size: 17px; }
.game-option.mtg input:checked + span { border-color: var(--mtg); background: color-mix(in srgb, var(--mtg) 14%, var(--panel)); }
.game-option.pokemon input:checked + span { border-color: var(--pokemon); background: color-mix(in srgb, var(--pokemon) 16%, var(--panel)); }
.game-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pack-status { margin: 8px 0 18px; }
.ready { font-size: 16px; }
.big-num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.odds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 auto 10px; max-width: 760px; }
.odds ul { list-style: none; margin: 0; padding: 0; }
.odds li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.odds li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sealed {
  width: 180px; aspect-ratio: 5 / 8; margin: 10px auto; border-radius: 14px; display: grid; place-content: center; gap: 6px; color: #fff;
  font-weight: 800; font-size: 22px; box-shadow: var(--shadow); animation: shake .5s ease-in-out infinite;
}
.sealed small { font-weight: 500; font-size: 13px; opacity: .85; }
.sealed.mtg { background: linear-gradient(160deg, var(--mtg), var(--mtg-deep)); }
.sealed.pokemon { background: linear-gradient(160deg, var(--pokemon), var(--pokemon-deep)); }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
/* The pack they're opening, once the server has said which: its set symbol and name, a bigger shake, then it tears open. */
.sealed.named { width: 200px; padding: 18px 14px; text-align: center; animation: shake-hard .42s ease-in-out infinite; }
.sealed-icon { width: 56px; height: 56px; justify-self: center; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.sealed-icon.mtg { filter: invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.sealed-name { font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.sealed.tearing { animation: tear .45s ease-in forwards; }
@media (prefers-reduced-motion: reduce) { .sealed.named, .sealed.tearing { animation: none; } }
@keyframes shake-hard { 0%, 100% { transform: rotate(0) scale(1.02); } 25% { transform: rotate(-5deg) scale(1.04); } 75% { transform: rotate(5deg) scale(1.04); } }
@keyframes tear { 0% { transform: scale(1.04); opacity: 1; clip-path: inset(0 0 0 0); } 40% { transform: scale(1.12) rotate(-2deg); } 100% { transform: scale(1.3) translateY(-30px); opacity: 0; clip-path: inset(12% 0 0 0); } }
.pack-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; text-align: left; margin: 0 0 8px; }
.pack-head h1, .pack-head h2 { margin: 0; }
.pack-head p { margin: 2px 0 0; }
.pack-value { display: grid; text-align: right; }
.pack-value .label, .pack-value .sub { color: var(--muted); font-size: 13px; }
.pack-value .value { font-size: 28px; font-weight: 800; color: var(--price); font-variant-numeric: tabular-nums; }
.reveal { text-align: left; }
.flip { border-radius: var(--radius); cursor: pointer; }
.flip.open { cursor: default; animation: flip-in .35s ease-out; }
.flip .back {
  aspect-ratio: 63 / 88; border-radius: var(--radius); display: grid; place-items: center; color: rgba(255, 255, 255, .85); font-weight: 800; font-size: 22px;
  box-shadow: var(--shadow); border: 3px solid rgba(255, 255, 255, .25); transition: transform .12s ease;
}
.flip:hover .back { transform: translateY(-3px); }
.flip .back.mtg { background: repeating-linear-gradient(45deg, var(--mtg-deep) 0 10px, var(--mtg) 10px 20px); }
.flip .back.pokemon { background: radial-gradient(circle at 50% 50%, #fff 0 14%, #222 14% 18%, transparent 18%), linear-gradient(180deg, #d93b3b 0 48%, #222 48% 52%, #f4f4f4 52%); color: transparent; }
.flip.hit .tile { box-shadow: 0 0 0 2px var(--foil-c), 0 0 22px color-mix(in srgb, var(--foil-a) 60%, transparent); }
@keyframes flip-in { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }

/* ----- Lists ----- */
.pack-list { display: grid; gap: 8px; }
.pack-row, .rank li > a, .li-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
}
.pack-row:hover, .rank li > a:hover { border-color: var(--accent); }
.pack-row img, .rank img { width: 44px; border-radius: 4px; flex: none; }
.img-gap { width: 44px; flex: none; }
.grow { flex: 1; min-width: 0; display: grid; }
.grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow .muted { font-size: 13px; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: rank; }
.rank li { counter-increment: rank; display: flex; align-items: center; gap: 8px; }
.rank li::before { content: counter(rank); width: 22px; text-align: right; font-weight: 700; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.rank li > a, .rank li > .li-row { flex: 1; min-width: 0; }

/* ----- Search ----- */
.search { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.search input { flex: 1 1 260px; }

/* ----- Account ----- */
.form-row { display: grid; gap: 6px; margin: 0 0 14px; }
.form-row .row { margin: 0; }
.form-row input { flex: 1 1 220px; max-width: 360px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: color-mix(in srgb, var(--error) 45%, var(--line)); }

/* ----- Tables & chart (admin) ----- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .mark { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .bar:hover .mark, .chart .bar:focus .mark { fill: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.chart .bar:hover .hit, .chart .bar:focus .hit { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.chart .bar:focus { outline: none; }

/* ----- Card details & dialogs ----- */
dialog {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); box-shadow: var(--shadow);
}
dialog.small { width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(8, 12, 24, .6); }
.pad { padding: 22px; }
.pad h2 { margin-right: 36px; }
.close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 0; background: var(--bg); font-size: 22px; line-height: 1; z-index: 1; }
.providers { display: grid; gap: 10px; margin: 16px 0; }
.provider { display: block; text-align: center; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; background: var(--bg); }
.provider:hover { border-color: var(--accent); }
.provider.facebook { background: #1877f2; color: #fff; border-color: transparent; }
.dev-login { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.dev-login label { display: grid; gap: 4px; font-size: 14px; }
#cf-input-label { display: grid; gap: 4px; margin: 0 0 8px; }
.ad-slot { aspect-ratio: 16 / 9; border-radius: 12px; background: repeating-linear-gradient(135deg, var(--bg) 0 12px, var(--panel) 12px 24px); border: 1px dashed var(--line); display: grid; place-content: center; text-align: center; color: var(--muted); position: relative; }
.ad-label { position: absolute; top: 8px; left: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
/* Display ad places (top / page / card). A placeholder shows where an ad goes before AdSense is set up. */
.ad-spot { position: relative; min-height: 100px; padding: 26px 10px 10px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; overflow: hidden; }
.ad-spot[hidden] { display: none; }
.ad-spot.wide { width: calc(100% - 32px); max-width: 1248px; margin: 12px auto; border: 1px solid var(--line); border-radius: 12px; }
.ad-spot.placeholder { display: grid; place-content: center; background: repeating-linear-gradient(135deg, var(--bg) 0 12px, var(--panel) 12px 24px); border-style: dashed; font-size: 13px; }
#card-dialog .ad-spot { margin: 0 24px 24px; }
.buy-box { margin: 14px 0 6px; }
.buy-box h3 { margin: 0 0 8px; font-size: 15px; }
.buy-box .row { flex-wrap: wrap; }
progress { width: 100%; height: 8px; margin: 14px 0 4px; accent-color: var(--accent); }
.detail { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; padding: 24px; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; padding: 16px; } .detail .big { max-width: 320px; margin: 0 auto; } }
.detail .big img { width: 100%; border-radius: 14px; display: block; }
.detail h2 { margin: 0 40px 4px 0; font-size: 24px; }
.detail .sub { color: var(--muted); margin: 0 0 14px; }
.detail .cost { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--muted); margin-left: 6px; }
.detail .text { white-space: pre-line; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.detail .flavor { font-style: italic; color: var(--muted); margin: 0 0 14px; white-space: pre-line; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.attacks { display: grid; gap: 10px; margin: 0 0 14px; }
.attack { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.attack b { display: flex; justify-content: space-between; gap: 8px; }
.attack .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); font-weight: 700; }
.attack p { margin: 4px 0 0; color: var(--muted); }
.source { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); text-decoration: none; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; }
.toast.error { background: var(--error); color: #fff; }

.foot { padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.foot p { margin: 4px auto; max-width: 900px; }
.foot .foot-fun { color: var(--text); font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton-line, .sealed, .flip.open { animation: none; }
  .tile, .flip .back { transition: none; }
}

/* ===================================================================================================
   Look: clean surfaces on a soft glow background; holo edges, sheen and a little 3D tilt on cards and packs
   (tilt and animation off when reduced motion is asked for).
   =================================================================================================== */
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 520px at 12% -8%, var(--glow-1), transparent 70%),
    radial-gradient(800px 480px at 95% 0%, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, .brand span, .stat .value, .pack-value .value, .big-num, .game-option span, .pack-art, .sealed, .chip {
  font-family: var(--title-font);
}
h1 { font-weight: 800; letter-spacing: -.02em; }
h2 { font-weight: 700; letter-spacing: -.01em; }
.brand span { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand span b { background: var(--frame); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }

/* Surfaces: white (or ink) cards with a hairline border and a soft shadow. */
.panel, .stat, .note, .pack-row, .rank li > a, .li-row, .odds, .center-card, dialog {
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.panel { border-radius: 18px; }
.center-card { padding: 30px 24px; border-radius: 20px; }
.note { box-shadow: none; }
.note.error { border-color: color-mix(in srgb, var(--error) 55%, var(--line)); }
.stat { position: relative; overflow: hidden; border-radius: 16px; }
.stat::before { /* a thin holo strip along the top, like a foil stamp */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--frame); opacity: .85;
}
.stat .label { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; font-weight: 600; }
.stat .value { font-weight: 700; font-size: 26px; letter-spacing: -.02em; }

/* Header: frosted glass. */
.top {
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav a { font-weight: 600; font-size: 14px; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.chip { border: 1px solid var(--line); font-weight: 600; }

/* Buttons: solid accent, rounded, a soft coloured shadow. */
button, .button { border-radius: 12px; }
button.primary, .button.primary {
  background: linear-gradient(135deg, var(--edge-1), var(--accent));
  color: #fff; border: 0; font-weight: 700;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
button.primary:hover:not(:disabled), .button.primary:hover { filter: brightness(1.08); }
button.primary:active:not(:disabled) { transform: translateY(1px); }

/* Cards: the holo edge, rounded like real cards, sheen that follows the pointer, a slight tilt. */
.tile {
  border: 1.5px solid transparent; border-radius: 14px;
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
              linear-gradient(135deg, var(--line), var(--line)) border-box;
  box-shadow: var(--shadow);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover, .tile:focus-visible {
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--frame) border-box;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}
.tile.shiny { background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--frame) border-box; }
.tile .img { margin: 6px 6px 0; border-radius: 9px; overflow: hidden; }
.tile .name { font-family: var(--title-font); font-weight: 600; font-size: 14.5px; }
.tile .img::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 45%, rgba(143, 211, 255, .4) 50%, rgba(255, 155, 210, .35) 55%, transparent 70%);
  background-size: 250% 100%; background-position: var(--sheen, 50%) 0; transition: opacity .2s ease;
}
.tile:hover .img::before { opacity: .55; }
.tile.shiny .img::after { animation: holo 4s linear infinite; background-size: 300% 100%; opacity: .6; }
@keyframes holo { from { background-position: 0% 0; } to { background-position: 300% 0; } }
.tile.serialized {
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(135deg, #111, #ffe58f, #111, #ffe58f) border-box;
  box-shadow: 0 0 22px rgba(255, 215, 110, .5), var(--shadow);
}

/* Booster packs: foil wrappers with crimped ends and a moving sheen. */
.pack-art, .sealed { position: relative; overflow: hidden; border: 0; font-weight: 800; text-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.pack-art::after, .sealed::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 20%, var(--foil-a) 35%, var(--foil-b) 50%, var(--foil-c) 62%, transparent 78%);
  background-size: 300% 100%; animation: holo 5s linear infinite;
}
.pack-art::before, .sealed::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 4px, rgba(0, 0, 0, .18) 4px 8px) top / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 4px, rgba(0, 0, 0, .18) 4px 8px) bottom / 100% 12px no-repeat;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; }
.hero h1 em { font-style: normal; background: var(--frame); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Pack opening. */
.flip .back { border-radius: 14px; box-shadow: var(--shadow); border: 0; }
.flip .back.mtg {
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--mtg) 55%, #fff) 0 16%, transparent 17%),
    repeating-linear-gradient(45deg, var(--mtg-deep) 0 10px, var(--mtg) 10px 20px);
}
.flip.hit .tile { box-shadow: 0 0 0 2px var(--edge-2), 0 0 26px color-mix(in srgb, var(--edge-1) 55%, transparent); }
.game-option span { padding: 16px 32px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); }
.game-option.mtg input:checked + span { background: linear-gradient(150deg, var(--mtg), var(--mtg-deep)); border-color: transparent; color: #fff; }
.game-option.pokemon input:checked + span { background: linear-gradient(150deg, var(--pokemon), var(--pokemon-deep)); border-color: transparent; color: #fff; }

/* Ranks: gold, silver and bronze for the top three. */
.rank li::before { font-family: var(--title-font); font-size: 17px; }
.rank li:nth-child(1)::before { color: #e0a82e; }
.rank li:nth-child(2)::before { color: #9aa5b5; }
.rank li:nth-child(3)::before { color: #c27a3e; }

.seg { border: 1px solid var(--line); border-radius: 12px; }
.seg a { font-weight: 600; font-size: 13.5px; }
.seg a.on { background: var(--accent); color: var(--accent-text); }
.table th { text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.toast { border: 0; border-radius: 14px; }

@media (prefers-reduced-motion: reduce) {
  .tile.shiny .img::after, .pack-art::after, .sealed::after { animation: none; }
  .tile { transition: none; transform: none; }
}

/* ----- Sign up / sign in ----- */
.signin { text-align: center; }
.signin h2 { margin-right: 0; font-size: 24px; }
.signin-art { display: flex; justify-content: center; gap: 10px; margin: 4px 0 14px; }
.signin-art .pack-art { width: 64px; font-size: 10px; border-width: 2px; }
/* Real packs (the same as the home page), smaller, just to look at. */
.signin-art.real { gap: 0; min-height: 150px; align-items: center; margin: 0 0 8px; }
.signin-art .booster { zoom: .56; pointer-events: none; }
.providers { display: grid; gap: 10px; margin: 18px 0 12px; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px; border-radius: 10px;
  font-family: "Inter", system-ui, sans-serif; font-weight: 600; font-size: 15.5px; text-decoration: none;
  border: 1px solid #dadce0; background: #fff; color: #1f1f1f; box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.provider svg { width: 20px; height: 20px; flex: none; }
.provider:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); border-color: #c4c7cc; }
.provider.facebook { background: #1877f2; border-color: #1877f2; color: #fff; }
.provider.microsoft { background: #2f2f2f; border-color: #2f2f2f; color: #fff; }
.provider.off { opacity: .5; cursor: not-allowed; box-shadow: none; font-weight: 500; }
.fine-print { margin: 6px 0 0; }
/* ----- Privacy policy and terms pages ----- */
.legal { max-width: 820px; }
.legal article { padding: clamp(18px, 4vw, 36px); line-height: 1.6; }
.legal h2 { margin: 28px 0 8px; font-size: 20px; }
.legal h3 { margin: 18px 0 6px; font-size: 16px; }
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }

.email-signin { margin: 4px 0 12px; }
.email-signin .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; margin: 4px 0 12px; }
.email-signin .or::before, .email-signin .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.email-form { display: grid; gap: 10px; }
.email-form p { margin: 0; }
.email-form input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 11px 12px; }
#ev-code { text-align: center; font-size: 22px; letter-spacing: 6px; }
.email-form button.primary { padding: 12px 16px; font-size: 15.5px; }
.dev-box { text-align: left; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.dev-box summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.dev-box .dev-login { border-top: 0; padding-top: 8px; }
.stack { display: grid; gap: 4px; margin: 12px 0 4px; }
.error-text { color: var(--error); margin: 6px 0 0; font-size: 14px; }


/* ----- A pack: summary panel, then the cards ----- */
.pack-summary {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 20px; margin: 6px 0 14px; position: relative; overflow: hidden;
}
.pack-summary::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--frame); }
.ps-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.ps-title { min-width: 0; flex: 1 1 260px; }
.ps-title h1, .ps-title h2 { margin: 4px 0 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.ps-title p { margin: 4px 0 0; }
.ps-tags { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.game-tag { padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.game-tag.mtg { background: linear-gradient(135deg, var(--mtg), var(--mtg-deep)); }
.game-tag.pokemon { background: linear-gradient(135deg, var(--pokemon), var(--pokemon-deep)); }
.ps-value { display: grid; justify-items: end; text-align: right; }
.ps-value .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ps-value .value { font-family: var(--title-font); font-size: clamp(34px, 5vw, 46px); font-weight: 800; line-height: 1.05; color: var(--price); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ps-value .sub { color: var(--muted); font-size: 13px; }
.ps-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.ps-facts > div { background: var(--bg); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.ps-facts dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.ps-facts dd { margin: 2px 0 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .ps-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ps-value { justify-items: start; text-align: left; } }

/* Cards deal in one after another. */
.pull-slot { position: relative; isolation: isolate; display: grid; }
.dealing .pull-slot { animation: deal .38s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes deal { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
.dealing .pull-slot[data-n="1"] { animation-delay: 70ms; }
.dealing .pull-slot[data-n="2"] { animation-delay: 140ms; }
.dealing .pull-slot[data-n="3"] { animation-delay: 210ms; }
.dealing .pull-slot[data-n="4"] { animation-delay: 280ms; }
.dealing .pull-slot[data-n="5"] { animation-delay: 350ms; }
.dealing .pull-slot[data-n="6"] { animation-delay: 420ms; }
.dealing .pull-slot[data-n="7"] { animation-delay: 490ms; }
.dealing .pull-slot[data-n="8"] { animation-delay: 560ms; }
.dealing .pull-slot[data-n="9"] { animation-delay: 630ms; }
.dealing .pull-slot[data-n="10"] { animation-delay: 700ms; }
.dealing .pull-slot[data-n="11"] { animation-delay: 770ms; }
.dealing .pull-slot[data-n="12"] { animation-delay: 840ms; }
.dealing .pull-slot[data-n="13"] { animation-delay: 910ms; }
.dealing .pull-slot[data-n="14"] { animation-delay: 980ms; }
.dealing .pull-slot[data-n="15"] { animation-delay: 1050ms; }

/* Big hits: golden rays turning slowly behind the card. */
.pull-slot.burst::before {
  content: ""; position: absolute; inset: -16% -22%; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 92, .75) 0deg 7deg, rgba(255, 214, 92, 0) 7deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 25%, transparent 100%);
  mask: radial-gradient(closest-side, #000 25%, transparent 100%);
  animation: sunburst 14s linear infinite;
}
.pull-slot.burst::after {
  content: ""; position: absolute; inset: -6%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 220, 120, .55), transparent 75%);
  animation: glow 2.4s ease-in-out infinite;
}
.pull-slot.burst .tile { box-shadow: 0 0 0 2px #ffd65c, 0 10px 30px rgba(255, 190, 40, .35); }
@keyframes sunburst { to { transform: rotate(360deg); } }
@keyframes glow { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) {
  .dealing .pull-slot, .pull-slot.burst::before, .pull-slot.burst::after { animation: none; }
}

/* ----- The two sides: Magic or Pokemon. The accent and background glow follow the chosen game. ----- */
body[data-side="mtg"] { --accent: #e0662e; --accent-soft: color-mix(in srgb, #e0662e 14%, var(--panel)); --edge-1: #ff8a4c; --glow-1: rgba(255, 110, 50, .16); }
body[data-side="pokemon"] { --accent: #e3a800; --accent-soft: color-mix(in srgb, #ffcb05 18%, var(--panel)); --edge-1: #ffcb05; --edge-3: #ff4b3e; --glow-1: rgba(255, 203, 5, .16); --glow-2: rgba(59, 76, 202, .14); }
body[data-side="pokemon"] button.primary, body[data-side="pokemon"] .button.primary { color: #1b1300; }
@media (prefers-color-scheme: dark) {
  body[data-side="mtg"] { --accent: #ff8a4c; --accent-text: #1a0b03; }
  body[data-side="pokemon"] { --accent: #ffcb05; --accent-text: #1b1300; }
}
.side-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); flex: none; }
.side-switch button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--muted); box-shadow: none; }
.side-switch button[aria-pressed="true"].mtg { background: linear-gradient(135deg, var(--mtg), var(--mtg-deep)); color: #fff; }
.side-switch button[aria-pressed="true"].pokemon { background: linear-gradient(135deg, #ffcb05, #e3a800); color: #1b1300; }
@media (max-width: 760px) { .side-switch { order: 2; } .who { order: 3; } }
.side-choose { text-align: center; }
.side-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.side-option { display: grid; gap: 2px; padding: 26px 12px; border-radius: 16px; border: 0; color: #fff; box-shadow: var(--shadow); }
.side-option.mtg { background: linear-gradient(150deg, var(--mtg), var(--mtg-deep)); }
.side-option.pokemon { background: linear-gradient(150deg, #ffcb05, #d1352b); color: #1b1300; }
.side-option:hover { transform: translateY(-2px); }
.so-name { font-family: var(--title-font); font-size: 24px; font-weight: 800; }
.so-sub { font-size: 12.5px; opacity: .85; }
.hero .game-tag, .opener .game-tag { display: inline-block; margin-bottom: 8px; }


/* ----- Smaller totals (My cards) ----- */
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-bottom: 16px; }
.tiles.compact .stat { min-height: 0; padding: 10px 14px; }
.tiles.compact .stat .label { font-size: 10.5px; }
.tiles.compact .stat .value { font-size: 19px; }
.tiles.compact .stat .sub { font-size: 12px; }

/* ----- Line charts (prices, vault value) ----- */
.line-chart .chart-head { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.line-chart .chart-head b { font-family: var(--title-font); font-size: 20px; }
.line-chart .up { color: var(--ok); font-weight: 600; }
.line-chart .down { color: var(--error); font-weight: 600; }
.line-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.line-chart circle { fill: var(--accent); stroke: var(--panel); stroke-width: 2; opacity: 0; }
.line-chart .pt:hover circle, .line-chart .pt:focus circle { opacity: 1; }
.line-chart .pt:focus { outline: none; }
.price-history { margin: 14px 0 0; }
.vault-box { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.vault-box h3 { margin: 0 0 4px; }
.vault-box input { width: 80px; margin-left: 6px; }
#gift-form .row { flex-wrap: nowrap; }
#gift-form input { flex: 1; min-width: 0; width: auto; margin-left: 0; }
#vault-chart-box .section-head { margin-bottom: 4px; }

/* ----- Keeping only some of a pack ----- */
/* Reminder settings */
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.switch-row > span { display: grid; gap: 2px; }

/* Featured set of the week */
.featured { display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 8px auto 14px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); text-align: left; font-size: 14.5px; }
.featured.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.featured .f-star { font-size: 22px; }
.featured .set-icon { width: 18px; height: 18px; vertical-align: -3px; margin: 0 4px 0 2px; }
.featured-tag { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: 12px; font-weight: 700; }

/* Public profiles */
.user-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.user-link:hover { color: var(--accent); }
.profile-head { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: start; }
.profile-head .row { grid-column: 1 / -1; }
.ph-main h1 { margin: 0 0 4px; }
.ph-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 22px; margin: 0; }
.ph-facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ph-facts dd { margin: 2px 0 0; font-size: 22px; font-weight: 800; }
.season-badges, .ach-chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.season-badges li { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: 13px; }
.ach-chips li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 13.5px; }
.set-progress { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.set-progress li { display: grid; grid-template-columns: 1fr 110px auto; gap: 10px; align-items: center; }
.set-progress progress { width: 100%; height: 7px; }
@media (max-width: 640px) { .profile-head { grid-template-columns: 1fr; } .ph-facts dd { font-size: 18px; } .set-progress li { grid-template-columns: 1fr 70px auto; } }

/* "Virtual packs, no cash value": shown wherever packs or values appear */
.virtual-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px auto 12px; padding: 8px 12px; max-width: 760px;
  border-radius: 10px; background: var(--panel); border: 1px dashed var(--line); color: var(--muted); font-size: 13.5px; text-align: left; line-height: 1.45; }
.virtual-note b { color: var(--text); }
.virtual-note a { white-space: nowrap; }
.virtual-note.small { font-size: 12.5px; padding: 6px 10px; margin: 8px 0 4px; }

/* Streaks, achievements, set completion */
.streak { display: inline-block; font-size: 14.5px; }
.streak.off { color: var(--muted); }
#streak-line { margin: 4px 0 10px; min-height: 1em; }
.ach-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; opacity: .62; }
.ach.earned { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.ach .b-icon { font-size: 26px; line-height: 1; filter: grayscale(1); }
.ach.earned .b-icon { filter: none; }
.ach .b-text { display: grid; gap: 2px; min-width: 0; }
.ach .b-text b { font-size: 14.5px; }
.ach progress { width: 100%; height: 6px; margin-top: 4px; }
.sr-complete { display: grid; gap: 2px; min-width: 96px; text-align: right; }
.sr-complete progress { width: 96px; height: 6px; }
@media (max-width: 640px) { .sr-complete { display: none; } }

/* The ad dialog's own panel (no ad set up, or none to show) */
.house-ad { display: grid; justify-items: center; gap: 4px; padding: 12px; color: var(--text); }
.house-ad img { border-radius: 14px; }
.house-ad p { margin: 0; }
.house-ad .ha-title { font-weight: 700; font-size: 16px; }
.house-ad .ha-tip { margin-top: 6px; color: var(--muted); max-width: 34ch; }
.buy-pack { margin: 6px 0 18px; text-align: left; }
.buy-pack h3 { font-size: 15.5px; margin: 0 0 8px; }

/* After opening: which cards to keep (preview, then confirm), and what to do next */
.keep-panel { margin: 18px 0 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-align: left; }
.keep-panel h3 { margin: 0 0 4px; font-size: 17px; }
.keep-panel p { margin: 0 0 10px; }
.keep-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.keep-choices button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.keep-confirm { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.keep-confirm p { margin: 0 0 10px; }
/* On the card itself: the slot may still be held by the deal-in animation. */
.pull-slot.leaving .tile { opacity: .28; filter: grayscale(.8); transform: scale(.96); transition: opacity .2s, transform .2s, filter .2s; }
.pull-slot.staying .tile { outline: 2px solid var(--accent); outline-offset: 2px; }
.next-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.next-steps.flash { animation: flash-steps 1.2s ease-out 1; border-radius: 12px; }
@keyframes flash-steps { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .next-steps.flash { animation: none; } .pull-slot.leaving .tile { transition: none; } }
.keep-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; text-align: left; }
.kb-label { font-weight: 600; font-size: 14px; }
.keep-seg { overflow: visible; }
.keep-seg button { border: 0; border-radius: 0; background: none; padding: 7px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); box-shadow: none; }
.keep-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.tile.removed { opacity: .38; filter: grayscale(.85); }
.tile.removed .meta::after { content: "Not kept"; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ----- Pack history: list on the left, stats on the right ----- */
.history-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .history-layout { grid-template-columns: 1fr; } .history-stats { order: -1; } }
.history-stats { position: sticky; top: 76px; }
.history-stats h3 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-grid.three { grid-template-columns: repeat(3, 1fr); }
.ps-grid > div { background: var(--bg); border-radius: 12px; padding: 8px 12px; display: grid; min-width: 0; }
.ps-grid .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ps-grid .big { font-family: var(--title-font); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-bar { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px; font-size: 14px; margin: 4px 0; }
.mini-bar .track { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.mini-bar .fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.mini-bar .fill.mtg { background: var(--mtg); }
.mini-bar .fill.pokemon { background: #e3a800; }
.best-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--text); }
.best-row:hover { outline: 1px solid var(--accent); }
.best-row img { width: 40px; border-radius: 4px; }
.set-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.set-list li span + span { margin-left: 6px; }
.pack-row-wrap { display: flex; align-items: center; gap: 6px; }
.pack-row-wrap .pack-row { flex: 1; min-width: 0; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--error); border-color: var(--error) !important; }

/* ----- Home: two sealed booster packs, drawn like real foil wrappers -----
   A pack is: a ribbed, heat-sealed crimp at the top and bottom, and a glossy pillowed body between them with the
   game logo, the set's art, the set name and the card count. Three wrapper eras for Magic, like the real ones:
   vintage (to 1998: colour body, cream oval), classic (1999-2014: dark body, art in a bevelled diamond),
   modern (2015 on: full-bleed art). The wrapper colour (tone) is picked per set. */
.hero-art { gap: 30px; perspective: 1000px; align-items: center; }
.booster {
  --body: #1d2a4a; --body-2: #0c1428; --crimp: #141a2c; --ink: #fff;
  position: relative; display: grid; grid-template-rows: 10% 1fr 10%; width: 186px; aspect-ratio: 10 / 17;
  text-decoration: none; color: var(--ink); transform: rotate(-5deg); transition: transform .25s ease, filter .25s ease;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .4)) drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
}
.booster + .booster { transform: rotate(5deg) translateY(14px); }
.booster:hover { transform: rotate(0) translateY(-8px) scale(1.04); z-index: 1; }
.booster.loading { background: linear-gradient(160deg, var(--line), var(--panel)); border-radius: 6px; filter: none; }

/* Wrapper colours */
.booster.tone-0 { --body: #1d3f7a; --body-2: #0b1a3a; --crimp: #0f1730; }   /* blue */
.booster.tone-1 { --body: #7a1c16; --body-2: #3a0807; --crimp: #1a0c0b; }   /* red */
.booster.tone-2 { --body: #26262a; --body-2: #0b0b0d; --crimp: #0d0d0f; }   /* black */
.booster.tone-3 { --body: #1f5a34; --body-2: #0b2614; --crimp: #0e1a12; }   /* green */
.booster.tone-4 { --body: #4b2a6e; --body-2: #1e0f33; --crimp: #150c22; }   /* purple */
.booster.tone-5 { --body: #eceae4; --body-2: #c9c5bb; --crimp: #d9d6cf; --ink: #1b1b1b; }   /* white */
.booster.pokemon { --body: #2b49c4; --body-2: #0f1f6e; --crimp: #b9bec9; }
.booster.pokemon.tone-1, .booster.pokemon.tone-4 { --body: #c4302b; --body-2: #5e0c0b; }
.booster.pokemon.tone-2, .booster.pokemon.tone-5 { --body: #1b1d24; --body-2: #050507; }

/* The crimped seals: fine vertical ribs, a ragged cut edge, a little crumple. */
.b-crimp {
  position: relative; z-index: 2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 35%, rgba(0, 0, 0, .25) 70%, rgba(255, 255, 255, .1)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 1.5px, rgba(0, 0, 0, .28) 1.5px 3px),
    linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .15) 30%, rgba(0, 0, 0, .1) 55%, rgba(255, 255, 255, .12) 80%, rgba(0, 0, 0, .35)),
    var(--crimp);
}
.b-crimp.top {
  border-radius: 2px 2px 0 0;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 5px 3px repeat-x, linear-gradient(#000 0 0) bottom / 100% calc(100% - 3px) no-repeat;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 5px 3px repeat-x, linear-gradient(#000 0 0) bottom / 100% calc(100% - 3px) no-repeat;
}
.b-crimp.bottom {
  border-radius: 0 0 2px 2px;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) bottom / 5px 3px repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 3px) no-repeat;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) bottom / 5px 3px repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 3px) no-repeat;
}
.b-crimp::after { /* the seal line where the crimp meets the body */
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: rgba(0, 0, 0, .35);
}
.b-crimp.top::after { bottom: 0; }
.b-crimp.bottom::after { top: 0; }

/* The body: wrapper colour, the art printed on it, and the text. */
.b-body { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, var(--body), var(--body-2) 85%); }
.b-art-wrap { position: absolute; inset: 0; }
.b-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-art.zoom-mtg { transform: scale(2.05); transform-origin: 50% 30%; }
.b-art.zoom-pokemon { transform: scale(1.9); transform-origin: 50% 27%; }

/* Modern (2015 on) and Pokemon: full-bleed art that fades into the wrapper colour behind the logo and set name. */
.era-modern .b-art-wrap, .booster.pokemon .b-art-wrap {
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 24%, #000 66%, transparent 92%);
  mask: linear-gradient(180deg, transparent 0, #000 24%, #000 66%, transparent 92%);
}
.era-modern .b-art { object-position: 50% 30%; }
/* Classic (1999 to 2014): the art in a bevelled diamond window. */
.era-classic .b-art-wrap {
  inset: 25% 8% 27%; clip-path: polygon(50% 0, 100% 22%, 100% 78%, 50% 100%, 0 78%, 0 22%);
  background: linear-gradient(135deg, #e9d9a8, #8a6a2a);
}
.era-classic .b-art { clip-path: polygon(50% 3%, 96% 23.5%, 96% 76.5%, 50% 97%, 4% 76.5%, 4% 23.5%); }
/* Vintage (to 1998): no art, a cream oval with the logo and the set name. */
.era-vintage .b-art-wrap { display: none; }
.era-vintage .b-oval {
  position: absolute; inset: 16% 10% 18%; border-radius: 50%; display: grid; place-content: center; gap: 6px; text-align: center;
  background: radial-gradient(ellipse at 45% 35%, #fbf3dc, #eadcb5 70%, #d9c48f); color: #3b2414;
  box-shadow: inset 0 0 0 2px rgba(120, 80, 30, .45), 0 0 0 3px rgba(0, 0, 0, .15);
}
.booster.era-vintage { --crimp: #f1efe9; }
.era-vintage .b-oval .b-brand { font-size: 23px; }
.era-vintage .b-oval .b-setname { position: static; color: #3b2414; text-shadow: none; font-size: 15px; font-style: italic; text-transform: none; letter-spacing: 0; }
.era-vintage .b-oval .b-kind { font-family: Georgia, serif; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.b-oval { display: none; }
.era-vintage .b-oval { display: grid; }
.era-vintage .b-top, .era-vintage .b-bottom .b-setname { display: none; }

/* Logo and text */
.b-top { position: absolute; top: 5%; left: 0; right: 0; display: grid; justify-items: center; z-index: 1; }
.b-brand {
  font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 27px; line-height: .95; letter-spacing: .02em;
  background: linear-gradient(180deg, #ffe0a3 0, #f39a3d 45%, #c4471a 75%, #8e2b0c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .6px rgba(40, 10, 0, .85); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .75));
}
.b-sub { font-family: Georgia, serif; font-style: italic; font-size: 10.5px; color: #fff; margin-top: 1px; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
.tone-5 .b-sub { color: #1b1b1b; text-shadow: none; }
.booster.pokemon .b-brand {
  font-family: var(--title-font); font-weight: 800; font-size: 29px; letter-spacing: -.01em;
  background: linear-gradient(180deg, #fff26b, #ffcb05 55%, #e8a400); -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1.6px #2a3fbf; filter: drop-shadow(0 2px 0 #1b2a8a) drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}
.b-age { position: absolute; top: 2.5%; right: 5%; font-size: 6.5px; font-weight: 700; letter-spacing: .06em; opacity: .85; z-index: 1; }
.b-bottom { position: absolute; left: 6%; right: 6%; bottom: 4.5%; display: grid; justify-items: center; gap: 3px; text-align: center; z-index: 1; }
.b-setname {
  font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 16px; line-height: 1.05; text-transform: uppercase; letter-spacing: .03em;
  color: #f4f1ea; text-shadow: 0 1px 0 rgba(0, 0, 0, .9), 0 2px 6px rgba(0, 0, 0, .8);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tone-5 .b-setname { color: #1b1b1b; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.booster.pokemon .b-setname { font-family: var(--title-font); text-transform: none; font-size: 17px; }
.b-kind { font-size: 7.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .95; }

/* Gloss: vertical light streaks, darker bulging edges, a few diagonal crumples, and a slow sheen. */
.b-gloss {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 12%, rgba(255, 255, 255, .16) 22%, rgba(255, 255, 255, 0) 32%,
      rgba(255, 255, 255, 0) 66%, rgba(255, 255, 255, .1) 76%, rgba(0, 0, 0, 0) 88%, rgba(0, 0, 0, .55)),
    linear-gradient(172deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .12) 41%, rgba(255, 255, 255, 0) 44%),
    linear-gradient(8deg, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .1) 71%, rgba(255, 255, 255, 0) 74%),
    linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 8%, rgba(0, 0, 0, 0) 92%, rgba(0, 0, 0, .3));
}
.b-gloss::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: overlay;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .5) 45%, transparent 60%);
  background-size: 320% 100%; animation: holo 7s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .b-gloss::after { animation: none; } .booster { transition: none; } }
.era-vintage .b-oval .b-sub { color: #3b2414; text-shadow: none; }

/* Set symbols before set names (pack panel, pack history). */
.with-icon { display: inline-flex; align-items: center; gap: .45em; min-width: 0; }
.with-icon > span { overflow: hidden; text-overflow: ellipsis; }
.set-icon { width: 1.15em; height: 1.15em; object-fit: contain; flex: none; }
.ps-title .set-icon { width: 1.05em; height: 1.05em; }
@media (prefers-color-scheme: dark) { .set-icon.mtg { filter: invert(1); } }

/* ----- My cards: favourites and top-10 rows, the vault by set ----- */
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 160px); gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.card-row > .tile { scroll-snap-align: start; }
.fav-badge { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0, 0, 0, .7); color: #ffd65c; font-size: 14px; }
.fav-btn { font-size: 13px; padding: 5px 10px; }
.fav-btn[aria-pressed="true"] { color: #b88600; border-color: #ffd65c; background: color-mix(in srgb, #ffd65c 18%, var(--panel)); }
.vault-box .section-head { margin: 0 0 4px; }
.set-rows { display: grid; gap: 8px; }
.set-row { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.set-row[open] { box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.set-row summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.set-row summary::-webkit-details-marker { display: none; }
.set-row summary::after { content: "▾"; color: var(--muted); transition: transform .15s ease; }
.set-row[open] summary::after { transform: rotate(180deg); }
.set-row summary .set-icon { width: 26px; height: 26px; }
.sr-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.sr-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-facts { display: flex; gap: 14px; align-items: baseline; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sr-facts b { color: var(--text); }
/* Phones: the set name on its own line, the facts below it, so nothing runs off the edge. */
@media (max-width: 520px) { .set-row summary { flex-wrap: wrap; row-gap: 4px; } .sr-name { flex-basis: calc(100% - 50px); } .sr-facts { gap: 10px; font-size: 13px; padding-left: 38px; } }
.set-cards { padding: 4px 14px 14px; }
@media (max-width: 560px) { .sr-facts { gap: 8px; font-size: 12.5px; } .sr-name .muted { display: none; } }

/* ----- Most opened packs (home, leaderboards) ----- */
.most-opened { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: mo; }
.most-opened li {
  counter-increment: mo; display: grid; grid-template-columns: 24px minmax(0, 1.4fr) minmax(80px, 1fr) 84px 96px; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.most-opened li::before { content: counter(mo); font-family: var(--title-font); font-weight: 700; color: var(--muted); text-align: right; }
.most-opened li:nth-child(1)::before { color: #e0a82e; }
.most-opened li:nth-child(2)::before { color: #9aa5b5; }
.most-opened li:nth-child(3)::before { color: #c27a3e; }
.mo-set { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mo-set .set-icon { width: 24px; height: 24px; }
.mo-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mo-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.most-opened .track { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.most-opened .fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .5s ease; }
.most-opened .fill.mtg { background: linear-gradient(90deg, var(--mtg), #ffb27a); }
.most-opened .fill.pokemon { background: linear-gradient(90deg, #e3a800, #ffd84a); }
.mo-count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.mo-count b { color: var(--text); }
@media (max-width: 640px) {
  .most-opened li { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .most-opened .track { grid-column: 2 / -1; grid-row: 2; }
  .most-opened .price { display: none; }
  .mo-name .muted { display: none; }
}
.most-opened .price, .mo-count { text-align: right; }

/* ----- Top collections (leaderboards) ----- */
.collections { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: cl; }
.collections li {
  counter-increment: cl; display: grid; grid-template-columns: 30px minmax(120px, 1fr) 130px minmax(0, 1.3fr) minmax(0, 1.1fr); align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.collections li::before { content: counter(cl); font-family: var(--title-font); font-weight: 800; font-size: 20px; color: var(--muted); text-align: center; }
.collections li:nth-child(1) { border-color: #e0a82e; box-shadow: 0 0 0 1px #e0a82e, var(--shadow); }
.collections li:nth-child(1)::before { color: #e0a82e; }
.collections li:nth-child(2)::before { color: #9aa5b5; }
.collections li:nth-child(3)::before { color: #c27a3e; }
.cl-who { display: grid; min-width: 0; }
.cl-who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-who .muted { font-size: 13px; }
.cl-value { display: grid; }
.cl-value .price { font-family: var(--title-font); font-size: 22px; font-weight: 800; }
.collections .label { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.cl-best { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--bg); border: 1px solid transparent;
  text-decoration: none; color: var(--text); text-align: left; min-width: 0; font-weight: 400; box-shadow: none; }
.cl-best:hover { border-color: var(--accent); }
.cl-best img { width: 38px; border-radius: 4px; flex: none; }
.cl-best .grow b { font-size: 14px; }
.cl-best .grow .price { font-size: 13px; }
.cl-icon { width: 38px; display: grid; place-items: center; flex: none; }
.cl-icon .set-icon { width: 28px; height: 28px; }
@media (max-width: 900px) {
  .collections li { grid-template-columns: 26px 1fr auto; }
  .collections .cl-best { grid-column: 2 / -1; }
}

/* ----- My cards: quick actions on each card, selecting several, clean-up ----- */
.vault-item { position: relative; display: grid; min-width: 0; }
.vault-item > .tile { height: 100%; }
/* Favourite and remove sit on the price line, right after the price. */
.tile .line .vi-actions { display: inline-flex; gap: 4px; margin-left: auto; flex: none; }
.vi-actions button { width: 28px; height: 26px; padding: 0; font-size: 14px; line-height: 1; border-radius: 8px; }
.vi-fav[aria-pressed="true"] { color: #b88600; border-color: #ffd65c; background: color-mix(in srgb, #ffd65c 18%, var(--panel)); }
.vi-del:hover { border-color: var(--error) !important; background: color-mix(in srgb, var(--error) 10%, var(--panel)); }
.vi-check { display: none; position: absolute; top: 10px; left: 10px; z-index: 3; width: 26px; height: 26px; border-radius: 8px;
  background: var(--panel); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); place-items: center; cursor: pointer; }
.vi-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.selecting .vi-check { display: grid; }
.selecting .vault-item .tile { cursor: pointer; }
.selecting .vault-item.picked .tile { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.selecting .vi-actions { visibility: hidden; }
.vault-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.sel-bar { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cleanup { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.cleanup label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.cleanup input { width: 80px; }
@media (max-width: 640px) { .cleanup { margin-left: 0; } }
.card-row > .vault-item { scroll-snap-align: start; }
/* Set symbols in the pack stats panel */
.best-icon { width: 40px; display: grid; place-items: center; flex: none; }
.best-icon .set-icon { width: 30px; height: 30px; }
.set-list { padding-left: 0; list-style: none; }
.set-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

/* ----- Pack values then and now (pack history, pack feed) ----- */
.pack-values { display: grid; justify-items: end; gap: 1px; text-align: right; flex: none; }
.pv-then { color: var(--muted); font-size: 13px; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.pv-now { font-size: 14px; }
.pv-now .muted { font-size: 11.5px; }
.chg { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chg.up { color: var(--ok); }
.chg.down { color: var(--error); }
.chg.flat { color: var(--muted); font-weight: 500; }
.opener { color: var(--text); }
.trend { display: grid; gap: 8px; }
.trend > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; background: var(--bg); border-radius: 12px; padding: 8px 12px; }
.trend .label { grid-column: 1 / -1; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.trend p { margin: 0; }

/* ----- Admin: smaller charts side by side, tighter tables ----- */
.chart-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 18px; }
.chart-pair .panel { padding: 12px 16px; }
.chart-pair h3 { margin: 0 0 6px; font-size: 14px; }

.chart .axis { font-size: 10px; }
.table.compact { font-size: 13px; }
.table.compact th, .table.compact td { padding: 4px 8px; line-height: 1.3; vertical-align: middle; }
.table.compact td .muted { font-size: 12px; }
.table.compact .badge { padding: 0 6px; font-size: 10.5px; }
/* The whole admin area is compact: a working screen, not a showcase. */
#admin-body .panel { padding: 12px 16px; margin-bottom: 12px; }
#admin-body .panel h2 { font-size: 16px; margin-bottom: 8px; }
#admin-body .tiles.compact { margin-bottom: 12px; }
#admin-body .two-col { gap: 0 14px; }
.chart-pair .chart svg { max-height: none; }
.table.compact tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
#admin-body .filters { margin-bottom: 8px; }

/* ----- Disney Lorcana (deep blue and gold) and Yu-Gi-Oh! (purple and gold) ----- */
:root { --lorcana: #2b4f9e; --lorcana-deep: #101e47; --yugioh: #6a2f9e; --yugioh-deep: #24103d; }
.dot.lorcana { background: var(--lorcana); }
.dot.yugioh { background: var(--yugioh); }
.pack-art.lorcana, .sealed.lorcana { background: linear-gradient(160deg, var(--lorcana), var(--lorcana-deep)); }
.pack-art.yugioh, .sealed.yugioh { background: linear-gradient(160deg, var(--yugioh), var(--yugioh-deep)); }
.game-tag.lorcana { background: linear-gradient(135deg, var(--lorcana), var(--lorcana-deep)); }
.game-tag.yugioh { background: linear-gradient(135deg, var(--yugioh), var(--yugioh-deep)); }
body[data-side="lorcana"] { --accent: #c9a227; --accent-soft: color-mix(in srgb, #c9a227 16%, var(--panel)); --edge-1: #d9b54a; --edge-3: #2b4f9e; --glow-1: rgba(201, 162, 39, .16); --glow-2: rgba(43, 79, 158, .16); }
body[data-side="yugioh"] { --accent: #8b45c9; --accent-soft: color-mix(in srgb, #8b45c9 15%, var(--panel)); --edge-1: #b27bf0; --edge-3: #d4a017; --glow-1: rgba(139, 69, 201, .16); --glow-2: rgba(212, 160, 23, .14); }
body[data-side="lorcana"] button.primary, body[data-side="lorcana"] .button.primary { color: #1b1300; }
.side-switch button[aria-pressed="true"].lorcana { background: linear-gradient(135deg, #d9b54a, #b08a1a); color: #1b1300; }
.side-switch button[aria-pressed="true"].yugioh { background: linear-gradient(135deg, var(--yugioh), var(--yugioh-deep)); color: #fff; }
.side-option.lorcana { background: linear-gradient(150deg, var(--lorcana), var(--lorcana-deep)); }
.side-option.yugioh { background: linear-gradient(150deg, var(--yugioh), var(--yugioh-deep)); }
.mini-bar .fill.lorcana, .most-opened .fill.lorcana { background: #c9a227; }
.mini-bar .fill.yugioh, .most-opened .fill.yugioh { background: #8b45c9; }
.booster.lorcana { --body: #1d3a7a; --body-2: #0a1533; --crimp: #c9a227; }
.booster.lorcana.tone-1, .booster.lorcana.tone-4 { --body: #6b2a8c; --body-2: #1f0a2e; }
.booster.lorcana.tone-2, .booster.lorcana.tone-5 { --body: #0f5a5a; --body-2: #03201f; }
.booster.yugioh { --body: #3a1a5e; --body-2: #10061d; --crimp: #b8bcc6; }
.booster.yugioh.tone-1, .booster.yugioh.tone-4 { --body: #7a1a1a; --body-2: #250404; }
.booster.yugioh.tone-2, .booster.yugioh.tone-5 { --body: #1a2a4a; --body-2: #050a16; }
.booster.lorcana .b-art-wrap, .booster.yugioh .b-art-wrap {
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 24%, #000 66%, transparent 92%);
  mask: linear-gradient(180deg, transparent 0, #000 24%, #000 66%, transparent 92%);
}
.booster.lorcana .b-brand { font-family: Georgia, serif; font-weight: 700; font-size: 22px; letter-spacing: .14em; color: #f3d779; text-shadow: 0 2px 4px rgba(0, 0, 0, .7); }
.booster.yugioh .b-brand { font-family: var(--title-font); font-weight: 800; font-size: 24px; color: #fff; -webkit-text-stroke: 1px #d4a017; text-shadow: 0 2px 4px rgba(0, 0, 0, .8); }
.booster.lorcana .b-setname, .booster.yugioh .b-setname { font-family: var(--title-font); text-transform: none; font-size: 16px; }
/* Four games: the switch gets a little tighter so it fits on phones. */
body.many-games .side-switch button { padding: 6px 10px; font-size: 12.5px; }
body.many-games .side-options { grid-template-columns: 1fr 1fr; }
