:root {
  --bg: #0e1014; --surface: #161920; --surface-2: #1d212a; --line: #2a2f3a; --line-strong: #3a404d;
  --text: #ebe8e3; --muted: #9298a4; --faint: #6b7180;
  --accent: #e5484d; --accent-ink: #fff; --accent-soft: rgba(229, 72, 77, .14);
  --gold: #e2b45a; --gold-soft: rgba(226, 180, 90, .14); --linen: #f3ede2;
  --display-font: "Unbounded", "Inter", system-ui, sans-serif;
  --trade: #5fd39a; --trade-soft: rgba(95, 211, 154, .14);
  --wish: #a597ff; --wish-soft: rgba(165, 151, 255, .15);
  --danger: #ff7a6b; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px; --radius-sm: 9px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Cinzel", Georgia, serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f1ea; --surface: #fffdf9; --surface-2: #f1ede4; --line: #e2dccf; --line-strong: #cfc7b6;
    --text: #1c1d21; --muted: #676b75; --faint: #8d909a;
    --accent: #c22f36; --accent-ink: #fff; --accent-soft: rgba(194, 47, 54, .09);
    --gold: #9c6a0e; --gold-soft: rgba(156, 106, 14, .1); --linen: #fffdf9;
    --trade: #1d7d4f; --trade-soft: rgba(29, 125, 79, .1);
    --wish: #5444c9; --wish-soft: rgba(84, 68, 201, .1);
    --danger: #b42318; --shadow: 0 10px 30px rgba(60, 45, 20, .12); --accent-2: #c9862a;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); min-height: 100vh;
  background-image: radial-gradient(1000px 520px at 85% -220px, var(--gold-soft), transparent 70%),
                    radial-gradient(900px 480px at 0% -160px, var(--accent-soft), transparent 70%); background-repeat: no-repeat; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; transform: rotate(45deg); border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--gold)); box-shadow: 0 0 18px var(--accent-soft); display: grid; place-items: center; }
.logo-mark::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--bg); }
.top nav { display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.active { color: var(--text); }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 18px;
  cursor: pointer; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; white-space: nowrap; transition: transform .1s, filter .15s, background .15s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.icon { padding: 0; width: 30px; height: 30px; font-size: 16px; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 7px 12px; border-radius: 8px; }
button.link:hover { color: var(--text); background: var(--surface-2); }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); padding: 10px 14px; border-radius: var(--radius-sm); }
.error.plain { background: none; border: 0; padding: 0; font-size: 13px; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.segmented span { display: block; padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 550; color: var(--muted); transition: background .15s, color .15s; }
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.segmented input[value="trade"]:checked + span { color: var(--trade); }
.segmented input[value="wish"]:checked + span { color: var(--wish); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag-trade { background: var(--trade-soft); color: var(--trade); border-color: transparent; }
.tag-wish { background: var(--wish-soft); color: var(--wish); border-color: transparent; }
.tag-foil { background: linear-gradient(110deg, #ff9ad5, #9fd0ff 35%, #c6ffb0 65%, #ffe08a); color: #222; border-color: transparent; }
.tag-price { background: var(--gold-soft); color: var(--gold); border-color: transparent; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { margin-bottom: 6px; }
.panel > p.muted { margin: 0 0 14px; font-size: 14px; }

/* mana symbols */
img.ms { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin: 0 1px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.mana { white-space: nowrap; }

/* ---------- hero / search ---------- */
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2, #f3d58e)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin: 14px 0 26px; color: var(--muted); font-size: 14px; }
.stats b { color: var(--text); font-size: 17px; margin-right: 4px; }
.search { max-width: 780px; margin: 0 auto; }
.search .segmented { margin-bottom: 12px; }
.searchbar { display: flex; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow); text-align: left; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }
.searchbar textarea, .searchbar select { border: 0; background: transparent; box-shadow: none !important; }
.searchbar select { width: auto; max-width: 160px; border-left: 1px solid var(--line); border-radius: 0; color: var(--muted); }
.suggest-wrap { position: relative; flex: 1; min-width: 0; }
#q { resize: none; overflow: hidden; min-height: 44px; font-size: 16px; }
.suggest { position: absolute; z-index: 30; top: calc(100% + 10px); left: -8px; right: -8px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: 360px; overflow: auto; }
.suggest li { padding: 8px 10px; cursor: pointer; border-radius: 8px; display: flex; justify-content: space-between; gap: 10px; }
.suggest li:hover, .suggest li.active { background: var(--surface-2); }
.hint { font-size: 13px; color: var(--faint); margin-top: 10px; }

/* ---------- search results ---------- */
.results { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.result { display: grid; grid-template-columns: 200px 1fr; gap: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.result-info { min-width: 0; }
.card-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card-title h2 { font-size: 21px; }
.type-line { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.oracle { font-size: 14px; line-height: 1.55; color: color-mix(in srgb, var(--text) 85%, var(--muted)); padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm); border-left: 3px solid var(--line-strong); margin-bottom: 14px; }
.offers { width: 100%; border-collapse: collapse; font-size: 14px; }
.offers th { text-align: left; color: var(--faint); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; }
.offers td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.offers tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none;
  background: linear-gradient(135deg, var(--accent-soft), var(--wish-soft)); color: var(--text); border: 1px solid var(--line); }
.avatar.big { width: 52px; height: 52px; font-size: 22px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- card image ---------- */
.mtg { position: relative; aspect-ratio: 488 / 680; border-radius: 4.75% / 3.5%; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.mtg img.art { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .25s; }
.mtg .placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-family: var(--display); font-size: 14px; color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px); }
.mtg.foil::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .35;
  background: linear-gradient(115deg, transparent 20%, #ff8ad8 35%, #8ad8ff 50%, #c7ff8a 65%, transparent 80%); background-size: 250% 250%;
  animation: foil 6s ease-in-out infinite; }
@keyframes foil { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { .mtg.foil::after { animation: none; } }

/* ---------- list page ---------- */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.list-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.owner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.owner a.name { color: var(--text); font-weight: 600; }
.metrics { display: flex; gap: 10px; flex-wrap: wrap; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.metric b { display: block; font-size: 20px; letter-spacing: -.01em; }
.metric span { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.toolbar input { max-width: 300px; }
.toolbar select { width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .18s, border-color .18s, box-shadow .18s; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.tile:hover .mtg img.art { transform: scale(1.02); }
.tile .qty { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(10, 10, 12, .82); color: #fff; font-weight: 700; font-size: 13px;
  padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.tile-body { padding: 0 4px 2px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-name { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-weight: 650; font-size: 15px; line-height: 1.3; }
.tile .type-line { margin: 0; font-size: 12.5px; }
.tile .oracle { font-size: 12.5px; margin: 0; padding: 8px 10px; cursor: pointer; }
.tile .oracle .clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tile .oracle.open .clamp { -webkit-line-clamp: unset; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; font-size: 12.5px; }
.match { font-weight: 600; font-size: 12.5px; }
.match.wish { color: var(--wish); }
.match.trade { color: var(--trade); }
.owner-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper b { min-width: 26px; text-align: center; }

/* add card */
.adder { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 8px; }
.adder.has-preview { grid-template-columns: 230px 1fr; }
.adder .preview-img { display: none; }
.adder.has-preview .preview-img { display: block; }
.preview-meta { display: none; }
.adder.has-preview .preview-meta { display: block; }
.adder-form { display: flex; flex-direction: column; gap: 12px; }
.adder-form .row > .field { flex: 1; min-width: 120px; }
.adder-form .row > .field.qty { flex: 0 0 90px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; padding: 10px 0; }
details.panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "＋"; color: var(--muted); font-size: 18px; }
details.panel[open] > summary::after { content: "−"; }
details.panel[open] > summary { margin-bottom: 14px; }

/* ---------- dashboard ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.creator { margin-bottom: 30px; }
.creator .tabs { margin-bottom: 16px; }
.creator [data-pane] { display: none; }
.creator [data-pane].on { display: block; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.source { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .18s, transform .18s; }
.source:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cover { height: 120px; background: var(--surface-2) center 22% / cover no-repeat; position: relative; display: block; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--surface)); }
.cover .tag { position: absolute; top: 10px; left: 10px; z-index: 1; backdrop-filter: blur(6px); }
.source-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.source-body h3 { font-size: 17px; }
.source-body h3 a { color: var(--text); }
.source-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 8px; }
.source-actions select { width: auto; padding: 5px 8px; font-size: 13px; }
.profile { max-width: 520px; margin-top: 36px; }

/* ---------- auth ---------- */
.auth { max-width: 420px; margin: 40px auto; }
.auth h1 { font-size: 28px; margin-bottom: 6px; }
.auth .panel { margin-top: 18px; }

/* ---------- seller ---------- */
.seller-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 6, 8, .82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 88vh; max-width: 92vw; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox[hidden] { display: none; }

footer.site { text-align: center; color: var(--faint); font-size: 12.5px; padding: 30px 16px 40px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .result { grid-template-columns: 110px 1fr; gap: 14px; padding: 14px; }
  .result .oracle { display: none; }
  .offers-wrap { grid-column: 1 / -1; overflow-x: auto; }
  .adder.has-preview { grid-template-columns: 1fr; }
  .adder.has-preview .preview-img { max-width: 220px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tile .oracle { display: none; }
  .searchbar { flex-wrap: wrap; }
  .searchbar select { border-left: 0; max-width: none; flex: 1; }
  .searchbar .btn { flex: 1; }
  .hero { padding-top: 28px; }
}

.result { grid-template-areas: "img info" "img offers"; grid-template-rows: auto 1fr; }
.result > .mtg { grid-area: img; align-self: start; }
.result-info { grid-area: info; }
.offers-wrap { grid-area: offers; overflow-x: auto; }
@media (max-width: 720px) {
  .result { grid-template-areas: "img info" "offers offers"; }
}

/* keep long names / mana costs and wide tables inside narrow screens */
.result { grid-template-columns: 200px minmax(0, 1fr); }
.result-info, .offers-wrap, .tile-body, .tile-name > span:first-child { min-width: 0; }
.tile-name .mana { white-space: normal; text-align: right; flex: none; max-width: 50%; }
.offers td { white-space: nowrap; }
@media (max-width: 720px) {
  .result { grid-template-columns: 110px minmax(0, 1fr); }
  .top-inner { padding: 10px 12px; }
  .top nav { gap: 0; }
  .nav-link, button.link { padding: 6px 8px; font-size: 14px; white-space: nowrap; }
  .logo { font-size: 17px; gap: 8px; }
  .logo-mark { width: 22px; height: 22px; }
  .tile { padding: 8px; }
  .tile-name { flex-direction: column; gap: 2px; }
  .tile-name .mana { max-width: none; text-align: left; }
  .toolbar input, .toolbar select { max-width: none; flex: 1 1 100%; }
  .metric { min-width: 0; flex: 1 1 40%; }
}
.source-body h3, .list-head h1 { overflow-wrap: anywhere; }

/* privacy & account */
.doc { max-width: 760px; }
.doc h2 { margin: 28px 0 10px; }
.doc p, .doc li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc .offers td { white-space: normal; }
.check.consent { align-items: flex-start; font-weight: 400; font-size: 13px; color: var(--muted); padding: 2px 0; line-height: 1.45; }
.check.consent input { margin-top: 3px; flex: none; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); margin-top: 18px; }
.danger-zone h2 { color: var(--danger); }
.notice { background: var(--trade-soft); color: var(--trade); padding: 10px 14px; border-radius: var(--radius-sm); text-align: center; }
.stack label.check { flex-direction: row; gap: 10px; }
.notice.syncing { background: var(--accent-soft); color: var(--accent); text-align: left; }

/* ---------- versions (exact printing + finish) ---------- */
.result { display: block; }
.result-head { margin-bottom: 14px; }
.result-head .type-line { margin-bottom: 8px; }
.oracle-details { margin-top: 10px; }
.oracle-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.oracle-details .oracle { margin: 8px 0 0; }
.versions { display: flex; flex-direction: column; gap: 12px; }
.version { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); }
.version-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.version-title { font-size: 15px; }
.version-tags { gap: 6px; }
.version .offers td { background: transparent; }
.tag-art { background: var(--wish-soft); color: var(--wish); border-color: transparent; }
.tag-nonfoil { background: transparent; }
.tag-foil-special { color: #1a1a1a; border-color: transparent; font-weight: 700;
  background: linear-gradient(110deg, #f6d365, #fda085 25%, #a1c4fd 50%, #c2e9fb 70%, #d4fc79); }
.mtg.example img.art { opacity: .55; filter: grayscale(.4); }
.example-note { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  background: rgba(10, 10, 12, .82); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
#pv-tags { gap: 6px; }
@media (max-width: 720px) {
  .version { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .version .offers-wrap { grid-column: 1 / -1; }
  .version-body { display: contents; }
  .version-title, .version-tags { grid-column: 2; }
}
@media (max-width: 720px) { .version > .mtg { grid-row: span 2; align-self: start; } }
.prefs .check { align-items: flex-start; font-weight: 400; color: var(--text); padding: 4px 0; line-height: 1.4; }
.prefs .check input { margin-top: 3px; flex: none; }

/* =====================================================================
   Home page: Belarusian ornament × Magic
   Ornament = rhombus motifs of vyshyvanka / rushnik embroidery, as SVG tiles.
   ===================================================================== */
:root {
  --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cg fill='%23e5484d'%3E%3Cpath d='M20 1l9 9-9 9-9-9z' fill='none' stroke='%23e5484d' stroke-width='2'/%3E%3Cpath d='M20 6l4 4-4 4-4-4z'/%3E%3Cpath d='M0 6l4 4-4 4zM40 6l-4 4 4 4z'/%3E%3Crect x='8' y='9' width='2' height='2'/%3E%3Crect x='30' y='9' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  --orn-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23e5484d' stroke-width='1.5'%3E%3Cpath d='M28 6l22 22-22 22L6 28z'/%3E%3Cpath d='M28 16l12 12-12 12-12-12z'/%3E%3C/g%3E%3Cg fill='%23e5484d'%3E%3Cpath d='M28 23l5 5-5 5-5-5z'/%3E%3Cpath d='M0 0l4 4-4 4zM56 0l-4 4 4 4zM0 48l4 4-4 4zM56 48l-4 4 4 4z'/%3E%3Crect x='27' y='1' width='2' height='3'/%3E%3Crect x='27' y='52' width='2' height='3'/%3E%3Crect x='1' y='27' width='3' height='2'/%3E%3Crect x='52' y='27' width='3' height='2'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) {
  :root {
    --orn-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cg fill='%23c22f36'%3E%3Cpath d='M20 1l9 9-9 9-9-9z' fill='none' stroke='%23c22f36' stroke-width='2'/%3E%3Cpath d='M20 6l4 4-4 4-4-4z'/%3E%3Cpath d='M0 6l4 4-4 4zM40 6l-4 4 4 4z'/%3E%3Crect x='8' y='9' width='2' height='2'/%3E%3Crect x='30' y='9' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  }
}

h1, h2, .display, .display-sm { font-family: var(--display-font); letter-spacing: -.01em; }
.top::before { content: ""; display: block; height: 8px; background: var(--orn-band) center / 20px 10px repeat-x; opacity: .9; }
.ornament-band { height: 20px; margin: 8px 0 30px; background: var(--orn-band) center / 40px 20px repeat-x; opacity: .85;
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }

/* hero */
.landing-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center;
  padding: 40px 0 24px; min-height: 520px; }
.hero-bg { position: absolute; inset: -24px -16px 0; z-index: -1; background: var(--orn-tile) center / 56px 56px; opacity: .07;
  -webkit-mask: radial-gradient(70% 80% at 75% 45%, #000 20%, transparent 75%); mask: radial-gradient(70% 80% at 75% 45%, #000 20%, transparent 75%); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.eyebrow .pips { display: inline-flex; gap: 2px; }
.eyebrow .pips img { width: 16px; height: 16px; }
.display { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.04; font-weight: 700; margin: 18px 0 16px; }
.display .red { color: var(--accent); position: relative; white-space: nowrap; }
.display .red::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: .16em;
  background: var(--orn-band) left center / .32em .16em repeat-x; }
.display-sm { font-size: clamp(19px, 2.4vw, 24px); font-weight: 700; }
.lead { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 0 24px; line-height: 1.6; }
.landing-hero .search { margin: 0; max-width: 600px; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-family: inherit; transition: border-color .15s, transform .15s; }
.chip:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.chip b { color: var(--accent); }

/* fanned cards + floating mana */
.hero-art { position: relative; height: 470px; }
.fan { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1200px; }
.fan-card { position: absolute; width: min(230px, 46%); aspect-ratio: 488 / 680; border-radius: 4.75% / 3.5%; object-fit: cover;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  transform-origin: 50% 120%; transform: translateX(calc(var(--i) * 26%)) rotate(calc(var(--i) * 9deg)) translateY(calc(var(--i) * var(--i) * 6px));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; animation: deal .8s backwards cubic-bezier(.2, .8, .2, 1);
  animation-delay: calc((var(--i) + 2) * 90ms); }
.fan-card:nth-child(3) { z-index: 3; } .fan-card:nth-child(2), .fan-card:nth-child(4) { z-index: 2; }
.hero-art:hover .fan-card { transform: translateX(calc(var(--i) * 34%)) rotate(calc(var(--i) * 12deg)) translateY(calc(var(--i) * var(--i) * 8px - 10px)); }
@keyframes deal { from { opacity: 0; transform: translateY(60px) rotate(0) scale(.9); } }
.orb { position: absolute; width: 38px; height: 38px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); animation: float 6s ease-in-out infinite; }
.orb-1 { top: 4%; left: 14%; } .orb-2 { top: 10%; right: 6%; animation-delay: -1.2s; } .orb-3 { bottom: 16%; right: 2%; animation-delay: -2.4s; }
.orb-4 { bottom: 4%; left: 8%; animation-delay: -3.6s; } .orb-5 { top: 46%; left: 0; animation-delay: -4.8s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .fan-card, .orb { animation: none; } }

/* stats */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 44px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--orn-band) center / 4px 8px repeat-y; background-color: var(--accent); }
.stat b { display: block; font-family: var(--display-font); font-size: clamp(24px, 3vw, 34px); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }

/* sections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.showcase { margin-bottom: 40px; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.shelf-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.shelf-card:hover { text-decoration: none; }
.shelf-card .mtg { transition: transform .2s; }
.shelf-card:hover .mtg { transform: translateY(-4px) rotate(-1deg); }
.shelf-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.shelf-meta b { font-weight: 600; line-height: 1.3; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
.wanted-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wanted-list a { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; color: var(--text); }
.wanted-list a:hover { background: var(--surface-2); text-decoration: none; }
.wanted-list img, .wanted-list .noimg { width: 46px; height: 34px; object-fit: cover; object-position: 50% 22%; border-radius: 6px; background: var(--surface-2); flex: none; }
.wanted-list span:nth-child(2) { flex: 1; font-weight: 500; }
.steps { list-style: none; padding: 0; margin: 14px 0 20px; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-n { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-family: var(--display-font); font-weight: 700;
  color: var(--accent-ink); background: var(--accent); transform: rotate(45deg); border-radius: 6px; margin: 4px 4px 0; }
.step-n i { font-style: normal; font-size: 14px; transform: rotate(-45deg); }
.cities { margin-bottom: 40px; }
.city-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.search-top { padding: 18px 0 8px; }
.search-top .search { max-width: 820px; margin: 0 auto; text-align: center; }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 24px; gap: 8px; }
  .hero-art { height: 300px; order: -1; }
  .fan-card { width: 150px; }
  .orb { width: 28px; height: 28px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
.hero-copy { position: relative; z-index: 2; }
.fan { left: 6%; }
.fan-card { transform: translateX(calc(var(--i) * 22%)) rotate(calc(var(--i) * 8deg)) translateY(calc(var(--i) * var(--i) * 6px)); }
.hero-art:hover .fan-card { transform: translateX(calc(var(--i) * 28%)) rotate(calc(var(--i) * 10deg)) translateY(calc(var(--i) * var(--i) * 7px - 10px)); }
@media (max-width: 900px) {
  .hero-art { order: 0; height: 250px; margin-top: 12px; }
  .fan { left: 0; }
  .fan-card { width: 130px; }
  .display { margin-top: 14px; }
}
@media (max-width: 720px) {
  .searchbar .suggest-wrap { flex: 1 1 100%; }
  .version > .mtg { grid-row: 1 / span 2; grid-column: 1; }
  .version-title { grid-row: 1; grid-column: 2; }
  .version-tags { grid-row: 2; grid-column: 2; align-self: start; }
  .version .offers-wrap { grid-row: 3; grid-column: 1 / -1; }
}
.admin-stats .stat span { font-size: 12.5px; } .admin-users td { white-space: nowrap; }
