/* Holodex - collector's vault. Card stock, ink, slab red, holo foil. */
:root {
  --paper: var(--g-paper-l, #F3EFE6);
  --paper-2: var(--g-paper2-l, #E9E3D6);
  --card: #FFFDF8;
  --ink: #17151D;
  --ink-2: #5A5563;
  --ink-3: #8C8696;
  --line: #DCD4C4;
  --red: var(--g-red-l, #E2361C);
  --red-ink: var(--g-ink-l, #B4240D);
  --red-soft: var(--g-soft-l, #FBE3DC);
  --on-red: var(--g-on-l, #fff);
  --g-bg: var(--g-bg-l, none);
  --gold: #B8861F;
  --up: #12805C;
  --down: #C42B1C;
  --slab: rgba(255, 255, 255, .55);
  --slab-edge: rgba(23, 21, 29, .14);
  --shadow: 0 1px 2px rgba(23, 21, 29, .06), 0 8px 24px rgba(23, 21, 29, .08);
  --holo: linear-gradient(115deg, #ff9fd6 0%, #ffe48a 22%, #8df2c6 44%, #8cc9ff 66%, #c7a3ff 84%, #ff9fd6 100%);
  --radius: 18px;
  --tabbar-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--g-paper-d, #121016); --paper-2: var(--g-paper2-d, #1A1720); --card: #1E1B24; --ink: #F2EDE3; --ink-2: #B5AFBE; --ink-3: #7F7989;
    --line: #2E2A36; --red: var(--g-red-d, #FF5436); --red-ink: var(--g-ink-d, #FF7A61); --red-soft: var(--g-soft-d, #3A1B16); --gold: #E2B04A;
    --on-red: var(--g-on-d, #fff); --g-bg: var(--g-bg-d, none);
    --up: #3CC48F; --down: #FF6B5A; --slab: rgba(255, 255, 255, .06); --slab-edge: rgba(255, 255, 255, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: var(--g-paper-d, #121016); --paper-2: var(--g-paper2-d, #1A1720); --card: #1E1B24; --ink: #F2EDE3; --ink-2: #B5AFBE; --ink-3: #7F7989;
  --line: #2E2A36; --red: var(--g-red-d, #FF5436); --red-ink: var(--g-ink-d, #FF7A61); --red-soft: var(--g-soft-d, #3A1B16); --gold: #E2B04A;
  --on-red: var(--g-on-d, #fff); --g-bg: var(--g-bg-d, none);
  --up: #3CC48F; --down: #FF6B5A; --slab: rgba(255, 255, 255, .06); --slab-edge: rgba(255, 255, 255, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
  background-image: radial-gradient(rgba(120, 100, 70, .07) 1px, transparent 1px);
  background-size: 4px 4px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
svg { width: 24px; height: 24px; flex: none; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 8px; }

#view { overflow-x: clip; padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); max-width: 760px; margin: 0 auto; outline: none; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 8px var(--safe-b);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 12px; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { color: var(--red); }
.tabbar a.scan-btn { position: relative; padding: 0 0 4px; height: 100%; justify-content: flex-end; }
.scan-ring {
  display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 0; border-radius: 50%;
  border: 4px solid transparent; color: #fff; box-shadow: 0 6px 18px rgba(226, 54, 28, .45);
  background: linear-gradient(var(--red), var(--red)) padding-box, var(--holo) border-box;
  background-size: 100% 100%, 200% 200%;
  position: relative; transform: translateY(-20px); animation: ringfoil 6s linear infinite;
}
@keyframes ringfoil { to { background-position: 0 0, 200% 0; } }
.scan-ring svg { width: 30px; height: 30px; }
@keyframes foil { to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- headers ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.wordmark .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
h1 { font-size: 30px; font-weight: 800; line-height: 1.05; }
h2 { font-size: 20px; font-weight: 700; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.section-h a { font-size: 14px; font-weight: 600; color: var(--red-ink); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; color: var(--ink-2); background: none; border: 0; padding: 0; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---------- value hero ---------- */
.hero {
  position: relative; margin-top: 8px; padding: 22px 20px 16px; border-radius: 24px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--holo); background-size: 200% 100%; animation: foil 8s linear infinite; }
.hero .big { font-family: var(--mono); font-weight: 500; font-size: clamp(38px, 11vw, 54px); letter-spacing: -.04em; line-height: 1; margin: 8px 0 12px; }
.hero .big .cents { font-size: .5em; color: var(--ink-3); letter-spacing: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--paper-2); color: var(--ink-2); }
.chip svg { width: 14px; height: 14px; }
.chip.up { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.chip.down { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--mono); font-weight: 500; font-size: 19px; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---------- chart ---------- */
.chart { position: relative; margin: 14px -4px 0; height: 150px; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .tip {
  position: absolute; top: -6px; transform: translateX(-50%); pointer-events: none; padding: 5px 9px; border-radius: 9px;
  background: var(--ink); color: var(--paper); font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.chart .tip b { font-family: var(--mono); font-weight: 500; }
.chart.hover .tip { opacity: 1; }
.chart-empty { display: grid; place-items: center; height: 120px; margin-top: 12px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--ink-3); font-size: 14px; text-align: center; padding: 0 20px; }

/* ---------- card thumbs ---------- */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 0 -16px; padding: 4px 16px 12px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.tile { position: relative; display: block; }
.tile .art { position: relative; aspect-ratio: 600 / 825; border-radius: 6.5% / 4.8%; overflow: hidden; background: var(--paper-2); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .1); }
.tile .art img { width: 100%; height: 100%; object-fit: cover; }
.tile .art.ghost img { filter: grayscale(1) contrast(.8); opacity: .28; }
.tile .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, transparent 40%, rgba(255, 255, 255, .28) 50%, transparent 60%); background-size: 250% 250%; background-position: 100% 100%; transition: background-position .6s; pointer-events: none; }
.tile:hover .art::after, .tile:active .art::after { background-position: 0 0; }
.tile .name { margin-top: 6px; font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .price { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.badge { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--paper); box-shadow: 0 0 0 2px var(--card); }
.badge.red { background: var(--red); color: var(--on-red); }
.rail .tile { width: 132px; }
.missing-num { position: absolute; inset: auto 0 8px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* ---------- slab (signature) ---------- */
.slab {
  position: relative; margin: 6px auto 0; max-width: 340px; padding: 12px 12px 16px; border-radius: 20px;
  background: linear-gradient(160deg, var(--slab), transparent 60%), var(--paper-2);
  border: 1.5px solid var(--slab-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), var(--shadow);
}
.slab-label {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px; margin-bottom: 12px;
  border-radius: 10px; background: var(--card); border: 2px solid var(--red); position: relative;
}
.slab-label .ln { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; line-height: 1.1; }
.slab-label .ls { font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.slab-label .lv { grid-row: span 2; text-align: right; }
.slab-label .lv b { display: block; font-family: var(--mono); font-weight: 500; font-size: 20px; letter-spacing: -.03em; }
.slab-label .lv span { font-size: 10.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.slab .window { position: relative; border-radius: 12px; padding: 8px; background: rgba(0, 0, 0, .04); box-shadow: inset 0 0 0 1px var(--slab-edge); }
.slab .window img { width: 100%; aspect-ratio: 600 / 825; border-radius: 4.4% / 3.2%; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); background: var(--paper-2); }
.slab .foil { position: absolute; inset: 8px; border-radius: 4.4% / 3.2%; pointer-events: none; mix-blend-mode: color-dodge; opacity: .0; background: var(--holo); background-size: 300% 300%; transition: opacity .3s; }
.slab.tilting .foil { opacity: .35; }

/* ---------- lists / panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rows > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; }
.row .thumb { width: 44px; aspect-ratio: 600 / 825; border-radius: 4px; overflow: hidden; flex: none; background: var(--paper-2); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .v { text-align: right; font-family: var(--mono); font-weight: 500; }
.row .v small { display: block; font-family: var(--body); font-size: 12px; font-weight: 600; }
.up { color: var(--up); } .down { color: var(--down); }

.price-trio { display: grid; grid-template-columns: 1fr 1.3fr 1fr; text-align: center; padding: 14px 6px 6px; }
.price-trio > div { min-width: 0; padding: 0 4px; }
.price-trio span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-trio b { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(13px, 3.8vw, 16px); margin-top: 4px; overflow-wrap: anywhere; }
.price-trio .mk b { font-size: clamp(20px, 6vw, 26px); color: var(--ink); letter-spacing: -.03em; margin-top: 0; }
.price-trio .mk { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px 6px; }
.price-table th:not(:first-child), .price-table td:not(:first-child) { text-align: right; }
.price-table td { padding: 11px 14px; border-top: 1px solid var(--line); font-family: var(--mono); }
.price-table td:first-child { font-family: var(--body); font-weight: 600; }
.price-table td.mk { font-weight: 500; color: var(--ink); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 700; font-size: 16px; background: var(--ink); color: var(--paper); }
.btn.red { background: var(--red); color: var(--on-red); box-shadow: 0 6px 16px color-mix(in srgb, var(--red) 30%, transparent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .5; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper-2); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; text-align: left; line-height: 1.15; }
.pick button small { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--ink-3); }
.pick button.on { border-color: var(--red); background: var(--red-soft); color: var(--ink); }
.pick button.on small { color: var(--red-ink); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; }
.stepper button svg { width: 18px; height: 18px; }
.stepper output { min-width: 32px; text-align: center; font-family: var(--mono); font-size: 17px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; }
.input:focus { outline: none; border-color: var(--ink); }
.searchbar { position: sticky; top: 0; z-index: 5; padding: 12px 0 10px; background: var(--paper); }
.searchbar .wrap { position: relative; }
.searchbar .wrap > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 20px; height: 20px; }
.searchbar .input { padding-left: 44px; min-height: 52px; border-radius: 16px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 8px 2px 0; }
.empty { text-align: center; padding: 34px 20px; }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--ink-2); margin: 0 auto 18px; max-width: 34ch; }
.progress { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--red); }
.progress.done i { background: var(--holo); background-size: 200% 100%; animation: foil 4s linear infinite; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; }
.attack { padding: 12px 14px; }
.attack .ah { display: flex; justify-content: space-between; font-weight: 700; }
.attack p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.energy { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: -3px; }
.energy i { width: 15px; height: 15px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .18); }

/* ---------- set list ---------- */
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px; }
.set-row .logo { width: 84px; height: 36px; flex: none; display: grid; place-items: center; }
.set-row .logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-row .logo .fallback { font-family: var(--display); font-weight: 800; font-size: 12px; line-height: 1.15; text-align: center; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.set-row .grow { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.set-row .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.set-row .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row .t span:last-child { font-family: var(--mono); font-size: 13px; color: var(--ink-3); flex: none; }
.series-h { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.series-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .shade { position: absolute; inset: 0; pointer-events: none; }
.scanner .guide { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); height: min(58vh, 112vw); aspect-ratio: 600 / 825; border-radius: 4.5% / 3.3%; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .52); pointer-events: none; }
.scanner .guide i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.scanner .guide i:nth-child(1) { left: -3px; top: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.scanner .guide i:nth-child(2) { right: -3px; top: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.scanner .guide i:nth-child(3) { right: -3px; bottom: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.scanner .guide i:nth-child(4) { left: -3px; bottom: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.scanner .guide.busy::after { content: ""; position: absolute; left: 6%; right: 6%; height: 3px; top: 0; border-radius: 3px; background: var(--holo); box-shadow: 0 0 18px 4px rgba(255, 255, 255, .5); animation: sweep 1.1s ease-in-out infinite alternate; }
@keyframes sweep { to { top: calc(100% - 3px); } }
.scanner .bar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 0; }
.scanner .bar .icon-btn { background: rgba(0, 0, 0, .45); border-color: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(10px); }
.scanner .bar .icon-btn.on { background: #fff; color: #000; }
.scanner .msg { position: absolute; z-index: 2; left: 0; right: 0; top: calc(45% + min(29vh, 56vw) + 14px); text-align: center; font-weight: 600; font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); padding: 0 24px; }
.scanner .controls { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 0 28px calc(var(--safe-b) + 26px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 0; padding: 0; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .35); display: grid; place-items: center; }
.shutter::after { content: ""; width: 62px; height: 62px; border-radius: 50%; border: 2.5px solid #000; }
.shutter:active { transform: scale(.94); }
.tally { justify-self: end; text-align: right; font-size: 13px; line-height: 1.25; }
.tally b { display: block; font-family: var(--mono); font-size: 18px; font-weight: 500; }
.rapid-pill { position: absolute; z-index: 2; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 18px); transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.scanner .nocam { position: relative; z-index: 2; margin: auto; max-width: 340px; text-align: center; padding: 24px; }
.scanner .nocam p { color: #ccc; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(10, 8, 14, .45); animation: fade .18s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 26px 26px 0 0; padding: 8px 16px calc(var(--safe-b) + 20px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); animation: rise .26s cubic-bezier(.2, .9, .3, 1);
  max-width: 760px; margin: 0 auto;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.match-head { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
.match-head .pair { position: relative; }
.match-head .pair img { width: 100%; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.match-head .pair .yours { position: absolute; width: 44%; right: -10px; bottom: -10px; border: 2px solid var(--paper); border-radius: 5px; }
.conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.conf.hi { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.conf.mid { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.conf.lo { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.alts { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.alts button { flex: none; width: 84px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; text-align: left; }
.alts button.on { border-color: var(--red); }
.alts img { width: 100%; border-radius: 6px; aspect-ratio: 600 / 825; background: var(--paper-2); }
.alts span { display: block; font-size: 11px; font-weight: 600; padding: 3px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; gap: 16px; margin-top: 18px; }
.form-row { display: flex; gap: 12px; align-items: end; }
.form-row > * { flex: 1; }

/* ---------- toast ---------- */
#toast { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: all .22s; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: var(--paper); color: var(--ink); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.scanning #toast { bottom: calc(var(--safe-b) + 130px); }

.skeleton { background: linear-gradient(90deg, var(--paper-2), var(--card), var(--paper-2)); background-size: 200% 100%; animation: foil 1.4s linear infinite; border-radius: 12px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--red); animation: rot .8s linear infinite; margin: 40px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.wishhit { border: 2px solid var(--up); }
.note { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; margin-top: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; }
  .card-layout { display: grid; grid-template-columns: 330px 1fr; gap: 24px; align-items: start; }
}

.rapid-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .45); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .08em; backdrop-filter: blur(10px); }
.rapid-btn svg { width: 18px; height: 18px; }
.rapid-btn.on { background: var(--red); border-color: var(--red); }

.auto-tag { font-style: normal; display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); vertical-align: 1px; }
.auto-tag.check { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.auto-tag.pend { background: var(--paper-2); color: var(--ink-2); letter-spacing: .02em; text-transform: none; font-weight: 700; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
.auto-why { margin-top: 2px; }

.check-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 4px 0 14px; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.check-banner .grow { flex: 1; line-height: 1.3; }
.check-banner svg { color: var(--red); }
.scanner .target { position: absolute; z-index: 2; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 66px); display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); line-height: 1.25; }
.scanner .target .thumb { width: 36px; flex: none; }
.scanner .target .thumb img { width: 100%; border-radius: 3px; }
.scanner .target .grow { flex: 1; min-width: 0; }

.share { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin: 5px 0 4px; max-width: 220px; }
.share i { display: block; height: 100%; border-radius: 999px; background: var(--red); }
.meta-head { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin-top: 6px; }
.meta-cover img { width: 100%; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.mini-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 14px; font-size: 14px; }
.mini-row b { width: 18px; text-align: right; }
.mini-row .grow { flex: 1; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.deck-status { padding: 12px 14px; margin-top: 14px; font-size: 14px; font-weight: 600; display: grid; gap: 4px; }
.deck-status.ok { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.deck-status.ok svg { width: 16px; height: 16px; vertical-align: -3px; }
.deck-status.bad { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, var(--line)); }
.deck-status.warn { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.add-tile { width: 108px; padding: 0; border: 0; background: none; text-align: left; }
.add-tile .badge svg { width: 14px; height: 14px; }

.mana { display: inline-flex; gap: 2px; vertical-align: -2px; margin-left: 4px; }
.mana i { width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 800; color: #222; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 0 rgba(0, 0, 0, .25); }
.legal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.legal-grid div { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.legal-grid b { font-weight: 700; font-size: 13px; }
.set-sym { width: 30px; height: 30px; object-fit: contain; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .set-sym { filter: invert(1); } }
:root[data-theme="dark"] .set-sym { filter: invert(1); }
.curve { padding: 12px 14px; margin-top: 12px; }
.curve .bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; height: 96px; align-items: end; margin-top: 8px; }
.curve .bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.curve .bar i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--red); }
.curve .bar span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.plain-btn { border: 0; background: none; padding: 0; text-align: left; min-width: 0; }
.game-seg { max-width: 480px; }

.builder-card { display: block; margin-bottom: 10px; }
.builder-card .progress { max-width: 260px; }

.filter-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .btn { min-height: 38px; padding: 0 14px; font-size: 14px; flex: none; }
.filter-row .chips { flex-wrap: nowrap; }
.chip.filt { border: 0; cursor: pointer; background: var(--red-soft); color: var(--red-ink); white-space: nowrap; }
.icon-btn.on { background: var(--red-soft); color: var(--red-ink); border-color: var(--red); }

.binder-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.binder-tabs button small { font-family: var(--mono); font-size: 11px; color: var(--ink-3); background: var(--paper); border-radius: 999px; padding: 1px 7px; }
.binder-tabs button.on small { background: var(--red-soft); color: var(--red-ink); }
.binder-tabs button.empty-tab { opacity: .55; }

.fair-card { padding: 14px 16px; margin-top: 12px; }
.fair-totals { display: flex; justify-content: space-between; }
.fair-totals b { display: block; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.fair-bar { position: relative; height: 12px; border-radius: 999px; margin: 14px 0 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--down) 30%, transparent), var(--paper-2) 45%, var(--paper-2) 55%, color-mix(in srgb, var(--up) 30%, transparent)); }
.fair-bar .zone { position: absolute; left: 47.5%; width: 5%; top: 0; bottom: 0; background: color-mix(in srgb, var(--up) 35%, transparent); border-radius: 4px; }
.fair-bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--ink-3); }
.fair-bar .needle { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); z-index: 1; }
.fair-bar .needle.ok, .fair-bar .needle.up { background: var(--up); }
.fair-bar .needle.down { background: var(--down); }
.fair-verdict { font-weight: 700; text-align: center; }

.icon-btn.bell { position: relative; }
.icon-btn.bell .badge { top: -6px; right: -6px; min-width: 20px; height: 20px; font-size: 11px; }
.row.unread { background: color-mix(in srgb, var(--red-soft) 55%, transparent); }
.alert-ic { width: 15px; height: 15px; vertical-align: -2px; color: var(--red); }
.row.toggle { cursor: pointer; }
.row.toggle input { width: 22px; height: 22px; accent-color: var(--red); }

.grade-badge { font-style: normal; display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; background: var(--ink); color: var(--paper); border: 1.5px solid var(--red); }
.grade-badge.on-art { position: absolute; left: 6px; bottom: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.grade-grid div { background: var(--card); padding: 10px 12px; display: grid; gap: 2px; }
.grade-grid span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.grade-grid b { font-weight: 500; font-size: 16px; }
.grade-grid .ten b { color: var(--red-ink); }

/* sell helper */
.sell-row { cursor: pointer; user-select: none; }
.sell-row .tick { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; color: var(--on-red); }
.sell-row .tick svg { width: 16px; height: 16px; }
.sell-row.on { background: color-mix(in srgb, var(--red) 7%, transparent); }
.sell-row.on .tick { background: var(--red); border-color: var(--red); }
.sell-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .14); min-height: 58px; }
.sell-bar:not(.has) { justify-content: center; }
.chan { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.chan.on { background: color-mix(in srgb, var(--red) 7%, transparent); box-shadow: inset 3px 0 0 var(--red); }
.chan .s { white-space: normal; }
.chan-bar { height: 6px; border-radius: 3px; background: var(--paper-2); margin: 6px 0 5px; overflow: hidden; }
.chan-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ink-3); }
.chan.on .chan-bar i { background: var(--red); }
.sell-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); overflow: hidden; }
.sell-sum > div { background: var(--card); padding: 12px 14px; display: grid; gap: 3px; }
.sell-sum span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sell-sum b { font-weight: 500; font-size: 18px; }
.sell-sum .keep b { color: var(--red-ink); font-weight: 700; }
.ask { display: flex; align-items: center; gap: 3px; font-family: var(--mono); color: var(--ink-3); flex: none; }
.ask input { width: 84px; min-height: 40px; padding: 6px 8px; text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.listing .two-btn { display: flex; gap: 6px; flex: none; }
.listing .two-btn .btn { min-height: 36px; padding: 0 12px; }
textarea.bulk { width: 100%; padding: 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; resize: vertical; }
.sell-bar .btn { white-space: nowrap; flex: none; } .sell-bar > div { min-width: 0; }
.sell-line .s { white-space: normal; }

/* insights */
.share-bar { height: 8px; border-radius: 4px; background: var(--paper-2); margin: 6px 0 5px; overflow: hidden; }
.share-bar i { display: block; height: 100%; border-radius: 4px; background: var(--red); }
.share-bar.other i { background: var(--ink-3); }
.share-row .s { white-space: normal; }
.insight-callout { padding: 14px 16px; font-size: 14.5px; color: var(--ink-2); }
.insight-callout b { color: var(--ink); }
.insight-link { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; color: inherit; text-decoration: none; }
.insight-link .grow { display: grid; gap: 2px; }
.insight-link span { font-size: 13px; color: var(--ink-3); }
.insight-link svg { width: 22px; height: 22px; color: var(--red); flex: none; }

/* per-game themes: the page takes on the game you're looking at */
:root[data-gtheme="pokemon"] {
  --g-paper-l: #F6F0DF;
  --g-paper2-l: #ECE3CC;
  --g-red-l: #E2361C;
  --g-ink-l: #B4240D;
  --g-soft-l: #FBE3DC;
  --g-on-l: #fff;
  --g-bg-l: radial-gradient(120% 55% at 100% 0%, rgba(255, 203, 5, .32), transparent 62%), radial-gradient(90% 50% at 0% 100%, rgba(226, 54, 28, .10), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='none' stroke='rgba%2823%2C21%2C29%2C.07%29' stroke-width='1.6'%3E%3Ccircle cx='36' cy='36' r='12'/%3E%3Cpath d='M24 36h8M40 36h8'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3Ccircle cx='112' cy='108' r='8'/%3E%3Cpath d='M104 108h5M115 108h5'/%3E%3Ccircle cx='112' cy='108' r='2.6'/%3E%3Cpath d='M108 22l-7 12h6l-5 11 11-14h-6l5-9z' stroke-linejoin='round'/%3E%3Cpath d='M30 112l4 4M34 112l-4 4' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
  --g-paper-d: #14110F;
  --g-paper2-d: #1D1915;
  --g-red-d: #FF5436;
  --g-ink-d: #FF7A61;
  --g-soft-d: #3A1B16;
  --g-on-d: #fff;
  --g-bg-d: radial-gradient(120% 55% at 100% 0%, rgba(255, 203, 5, .12), transparent 62%), radial-gradient(90% 50% at 0% 100%, rgba(255, 84, 54, .09), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='none' stroke='rgba%28255%2C236%2C170%2C.06%29' stroke-width='1.6'%3E%3Ccircle cx='36' cy='36' r='12'/%3E%3Cpath d='M24 36h8M40 36h8'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3Ccircle cx='112' cy='108' r='8'/%3E%3Cpath d='M104 108h5M115 108h5'/%3E%3Ccircle cx='112' cy='108' r='2.6'/%3E%3Cpath d='M108 22l-7 12h6l-5 11 11-14h-6l5-9z' stroke-linejoin='round'/%3E%3Cpath d='M30 112l4 4M34 112l-4 4' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-gtheme="ja"] {
  --g-paper-l: #F7F2EC;
  --g-paper2-l: #EDE5DA;
  --g-red-l: #C8102E;
  --g-ink-l: #9E0B23;
  --g-soft-l: #F9DDE2;
  --g-on-l: #fff;
  --g-bg-l: radial-gradient(circle at 88% 7%, rgba(200, 16, 46, .14) 0 96px, transparent 97px), linear-gradient(180deg, transparent 55%, rgba(200, 16, 46, .05)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cg fill='none' stroke='rgba%28200%2C16%2C46%2C.075%29' stroke-width='1.1'%3E%3Ccircle cx='0' cy='24' r='22'/%3E%3Ccircle cx='0' cy='24' r='16'/%3E%3Ccircle cx='0' cy='24' r='10'/%3E%3Ccircle cx='48' cy='24' r='22'/%3E%3Ccircle cx='48' cy='24' r='16'/%3E%3Ccircle cx='48' cy='24' r='10'/%3E%3Ccircle cx='24' cy='12' r='22'/%3E%3Ccircle cx='24' cy='12' r='16'/%3E%3Ccircle cx='24' cy='12' r='10'/%3E%3Ccircle cx='24' cy='36' r='22'/%3E%3Ccircle cx='24' cy='36' r='16'/%3E%3Ccircle cx='24' cy='36' r='10'/%3E%3Ccircle cx='0' cy='0' r='22'/%3E%3Ccircle cx='0' cy='0' r='16'/%3E%3Ccircle cx='0' cy='0' r='10'/%3E%3Ccircle cx='48' cy='0' r='22'/%3E%3Ccircle cx='48' cy='0' r='16'/%3E%3Ccircle cx='48' cy='0' r='10'/%3E%3Ccircle cx='0' cy='48' r='22'/%3E%3Ccircle cx='0' cy='48' r='16'/%3E%3Ccircle cx='0' cy='48' r='10'/%3E%3Ccircle cx='48' cy='48' r='22'/%3E%3Ccircle cx='48' cy='48' r='16'/%3E%3Ccircle cx='48' cy='48' r='10'/%3E%3C/g%3E%3C/svg%3E");
  --g-paper-d: #130F12;
  --g-paper2-d: #1D171B;
  --g-red-d: #FF5470;
  --g-ink-d: #FF8296;
  --g-soft-d: #3B1820;
  --g-on-d: #fff;
  --g-bg-d: radial-gradient(circle at 88% 7%, rgba(255, 84, 112, .14) 0 96px, transparent 97px), linear-gradient(180deg, transparent 55%, rgba(255, 84, 112, .05)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cg fill='none' stroke='rgba%28255%2C130%2C150%2C.09%29' stroke-width='1.1'%3E%3Ccircle cx='0' cy='24' r='22'/%3E%3Ccircle cx='0' cy='24' r='16'/%3E%3Ccircle cx='0' cy='24' r='10'/%3E%3Ccircle cx='48' cy='24' r='22'/%3E%3Ccircle cx='48' cy='24' r='16'/%3E%3Ccircle cx='48' cy='24' r='10'/%3E%3Ccircle cx='24' cy='12' r='22'/%3E%3Ccircle cx='24' cy='12' r='16'/%3E%3Ccircle cx='24' cy='12' r='10'/%3E%3Ccircle cx='24' cy='36' r='22'/%3E%3Ccircle cx='24' cy='36' r='16'/%3E%3Ccircle cx='24' cy='36' r='10'/%3E%3Ccircle cx='0' cy='0' r='22'/%3E%3Ccircle cx='0' cy='0' r='16'/%3E%3Ccircle cx='0' cy='0' r='10'/%3E%3Ccircle cx='48' cy='0' r='22'/%3E%3Ccircle cx='48' cy='0' r='16'/%3E%3Ccircle cx='48' cy='0' r='10'/%3E%3Ccircle cx='0' cy='48' r='22'/%3E%3Ccircle cx='0' cy='48' r='16'/%3E%3Ccircle cx='0' cy='48' r='10'/%3E%3Ccircle cx='48' cy='48' r='22'/%3E%3Ccircle cx='48' cy='48' r='16'/%3E%3Ccircle cx='48' cy='48' r='10'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-gtheme="mtg"] {
  --g-paper-l: #F1EADC;
  --g-paper2-l: #E6DCC8;
  --g-red-l: #A85A12;
  --g-ink-l: #7E420A;
  --g-soft-l: #F5E6CF;
  --g-on-l: #fff;
  --g-bg-l: radial-gradient(40% 30% at 8% 0%, rgba(240, 220, 160, .55), transparent 70%), radial-gradient(40% 30% at 29% 0%, rgba(80, 150, 215, .20), transparent 70%), radial-gradient(40% 30% at 50% 0%, rgba(70, 60, 70, .14), transparent 70%), radial-gradient(40% 30% at 71% 0%, rgba(225, 95, 55, .18), transparent 70%), radial-gradient(40% 30% at 92% 0%, rgba(60, 150, 85, .18), transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='rgba%28150%2C105%2C30%2C.10%29' stroke-width='1.1'%3E%3Cpath d='M32 0L64 32L32 64L0 32Z'/%3E%3Cpath d='M32 26l2 6-2 6-2-6z' fill='rgba%28150%2C105%2C30%2C.10%29' stroke='none'/%3E%3Ccircle cx='0' cy='0' r='3'/%3E%3Ccircle cx='64' cy='0' r='3'/%3E%3Ccircle cx='0' cy='64' r='3'/%3E%3Ccircle cx='64' cy='64' r='3'/%3E%3C/g%3E%3C/svg%3E");
  --g-paper-d: #13110D;
  --g-paper2-d: #1C1913;
  --g-red-d: #E9A24E;
  --g-ink-d: #F2BA73;
  --g-soft-d: #33240F;
  --g-on-d: #1A1208;
  --g-bg-d: radial-gradient(40% 30% at 8% 0%, rgba(240, 220, 160, .18), transparent 70%), radial-gradient(40% 30% at 29% 0%, rgba(80, 150, 215, .19), transparent 70%), radial-gradient(40% 30% at 50% 0%, rgba(150, 120, 160, .16), transparent 70%), radial-gradient(40% 30% at 71% 0%, rgba(225, 95, 55, .19), transparent 70%), radial-gradient(40% 30% at 92% 0%, rgba(60, 170, 95, .18), transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='rgba%28233%2C162%2C78%2C.11%29' stroke-width='1.1'%3E%3Cpath d='M32 0L64 32L32 64L0 32Z'/%3E%3Cpath d='M32 26l2 6-2 6-2-6z' fill='rgba%28233%2C162%2C78%2C.07%29' stroke='none'/%3E%3Ccircle cx='0' cy='0' r='3'/%3E%3Ccircle cx='64' cy='0' r='3'/%3E%3Ccircle cx='0' cy='64' r='3'/%3E%3Ccircle cx='64' cy='64' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-gtheme="ygo"] {
  --g-paper-l: #F0ECF4;
  --g-paper2-l: #E4DEEC;
  --g-red-l: #6E3FB0;
  --g-ink-l: #54298F;
  --g-soft-l: #EBE1F7;
  --g-on-l: #fff;
  --g-bg-l: radial-gradient(90% 50% at 0% 0%, rgba(110, 63, 176, .16), transparent 60%), radial-gradient(90% 50% at 100% 100%, rgba(200, 150, 40, .16), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='70'%3E%3Cg fill='none' stroke='rgba%28150%2C110%2C20%2C.10%29' stroke-width='1.2' stroke-linejoin='round'%3E%3Cpath d='M0 70L40 0L80 70Z'/%3E%3Cpath d='M20 70L40 35L60 70'/%3E%3Cpath d='M40 0V12'/%3E%3Cpath d='M-40 70L0 0L40 70' opacity='.5'/%3E%3Cpath d='M40 70L80 0L120 70' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
  --g-paper-d: #110E18;
  --g-paper2-d: #1A1524;
  --g-red-d: #B28CFF;
  --g-ink-d: #C9AEFF;
  --g-soft-d: #261B3A;
  --g-on-d: #14081F;
  --g-bg-d: radial-gradient(90% 50% at 0% 0%, rgba(150, 100, 255, .16), transparent 60%), radial-gradient(90% 50% at 100% 100%, rgba(226, 176, 74, .10), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='70'%3E%3Cg fill='none' stroke='rgba%28226%2C176%2C74%2C.075%29' stroke-width='1.2' stroke-linejoin='round'%3E%3Cpath d='M0 70L40 0L80 70Z'/%3E%3Cpath d='M20 70L40 35L60 70'/%3E%3Cpath d='M40 0V12'/%3E%3Cpath d='M-40 70L0 0L40 70' opacity='.5'/%3E%3Cpath d='M40 70L80 0L120 70' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-gtheme] body { background-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--g-bg); opacity: 0; transition: opacity .35s ease; }
html[data-gtheme] body::before { opacity: 1; }
html { transition: background-color .35s ease; }
@media (prefers-reduced-motion: reduce) { body::before, html { transition: none; } }
