:root {
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #efede8; --text: #1d1c1a; --muted: #6b6760;
  --line: #dedad2; --accent: #2f5d50; --accent-text: #ffffff; --accent-soft: #e2ece8;
  --warn: #9a5b00; --warn-soft: #fbf0dc; --danger: #a33a2c; --ok: #2f6b3a; --ok-soft: #e3f0e4;
  --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --surface: #1f1f1d; --surface-2: #2a2a27; --text: #ecebe7; --muted: #a29e96;
    --line: #36352f; --accent: #7fb8a5; --accent-text: #10201b; --accent-soft: #23332e;
    --warn: #e0a54a; --warn-soft: #33291a; --danger: #e4826f; --ok: #8cc99a; --ok-soft: #1f3123;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151514; --surface: #1f1f1d; --surface-2: #2a2a27; --text: #ecebe7; --muted: #a29e96;
  --line: #36352f; --accent: #7fb8a5; --accent-text: #10201b; --accent-soft: #23332e;
  --warn: #e0a54a; --warn-soft: #33291a; --danger: #e4826f; --ok: #8cc99a; --ok-soft: #1f3123;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; 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, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.cart-btn, .btn { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--accent);
  color: var(--accent-text); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.pill { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-text) 25%, transparent); text-align: center; }

.hero { padding-top: 20px; }
.lede { font-size: 17px; margin: 0 0 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: 14px; }
.facts b { color: var(--text); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters input, .filters select, .form input, .form select, .form textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.price-range { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.price-range input { width: 72px; }
.colors { display: flex; gap: 4px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 700; font-size: 13px; }
.colors button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.count { color: var(--muted); margin: 16px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; }
.card .art { all: unset; cursor: zoom-in; display: block; aspect-ratio: 488 / 680; background: var(--surface-2); }
.card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Foil look on card pictures. The sheen sits over the image; the label names the finish. */
.card .art, .art-frame { position: relative; overflow: hidden; }
.art-frame { border-radius: 4.75% / 3.5%; }
.foil::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge;
  background-size: 300% 300%; animation: foil-shift 7s ease-in-out infinite alternate; opacity: .32; }
.foil-std::after { background-image: linear-gradient(115deg, transparent 20%, rgb(255 120 220 / .55) 32%,
  rgb(120 220 255 / .55) 42%, rgb(170 255 150 / .5) 52%, rgb(255 230 120 / .5) 62%, transparent 75%); }
.foil-surge::after { opacity: .42; background-image: repeating-linear-gradient(115deg,
  rgb(255 60 120 / .55) 0 6%, rgb(255 200 60 / .55) 6% 12%, rgb(80 255 160 / .55) 12% 18%,
  rgb(60 160 255 / .55) 18% 24%, rgb(190 90 255 / .55) 24% 30%); }
.foil-etched::after { opacity: .4; mix-blend-mode: soft-light; background-image: linear-gradient(115deg,
  transparent 25%, rgb(255 255 255 / .8) 45%, rgb(200 200 210 / .6) 55%, transparent 75%); }
.foil-special::after { opacity: .42; background-image:
  radial-gradient(circle at 20% 30%, rgb(255 255 255 / .9) 0 1px, transparent 2px),
  radial-gradient(circle at 70% 60%, rgb(255 255 255 / .8) 0 1px, transparent 2px),
  radial-gradient(circle at 40% 80%, rgb(255 255 255 / .8) 0 1px, transparent 2px),
  linear-gradient(115deg, rgb(120 60 255 / .5), rgb(0 200 255 / .45), rgb(255 80 200 / .5));
  background-size: 37px 41px, 53px 47px, 29px 31px, 300% 300%; }
.foil-textured::after { opacity: .36; background-image:
  repeating-linear-gradient(45deg, rgb(255 255 255 / .25) 0 2px, transparent 2px 6px),
  linear-gradient(115deg, rgb(255 210 120 / .5), rgb(160 230 255 / .5), rgb(255 160 220 / .5)); }
@keyframes foil-shift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .foil::after { animation: none; background-position: 50% 50%; } }
.foil-badge { position: absolute; bottom: 2.2%; left: 50%; transform: translateX(-50%); z-index: 1; white-space: nowrap; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #2b2340;
  background: linear-gradient(90deg, #ffd6f5, #d3f1ff, #dcffd9, #fff2c4); box-shadow: 0 1px 3px rgb(0 0 0 / .35); }
.art-frame .foil-badge { font-size: 13px; }
.card .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: 14px; margin: 0; line-height: 1.3; }
.card .meta { font-size: 12px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.foil { background: linear-gradient(90deg, #f6d9ff, #d6f0ff, #dfffe0); color: #3b3550; }
.buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { font-weight: 700; font-size: 16px; }
.left { font-size: 12px; color: var(--muted); }
.add { border: 0; border-radius: 8px; padding: 6px 12px; background: var(--accent-soft); color: var(--accent);
  font-weight: 600; cursor: pointer; }
.add.in { background: var(--accent); color: var(--accent-text); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); width: 30px; height: 30px; cursor: pointer; font-weight: 700; }
.stepper span { min-width: 28px; text-align: center; font-weight: 600; }
.more { text-align: center; margin: 24px 0; }
.more button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 22px; cursor: pointer; }
.foot { color: var(--muted); font-size: 13px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 24px; }

dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.x { position: absolute; top: 8px; right: 10px; border: 0; background: var(--surface-2); width: 34px; height: 34px;
  border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 2; }
.sheet { width: min(860px, calc(100vw - 24px)); border-radius: 14px; }
.detail-body { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; padding: 24px; }
.detail-body .imgs img { width: 100%; display: block; }
.detail-body h2 { margin: 0 0 4px; font-size: 22px; padding-right: 36px; }
.detail-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 14px 0; font-size: 14px; }
.detail-body dt { color: var(--muted); }
.detail-body dd { margin: 0; }
.oracle { white-space: pre-line; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.flip { margin-top: 8px; }
@media (max-width: 680px) { .detail-body { grid-template-columns: 1fr; padding: 16px; } .detail-body .imgs { max-width: 300px; margin: 0 auto; } }

.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(480px, 100vw); }
#cart-body { padding: 20px 20px 32px; }
#cart-body h2 { margin: 0 0 12px; font-size: 20px; }
.lines { list-style: none; padding: 0; margin: 0 0 12px; }
.lines li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lines img { width: 44px; border-radius: 3px; display: block; }
.lines .nm { font-size: 13px; line-height: 1.3; }
.lines .sub { font-size: 12px; color: var(--muted); }
.lines .r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin: 12px 0; }
.sum .total { font-weight: 700; font-size: 18px; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 10px 0; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--warn); }
.ship { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 16px; }
.ship label { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ship label.off { opacity: .5; cursor: not-allowed; }
.ship label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ship small { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.form { display: grid; gap: 10px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form .hp { position: absolute; left: -9999px; }
.paybox { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.paybox .big { font-size: 22px; font-weight: 700; }
.paybox code { font-size: 17px; font-weight: 700; background: var(--surface); padding: 2px 8px; border-radius: 6px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* admin + order pages */
.page { padding: 24px 16px 60px; max-width: 1100px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 20px; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.tile b { display: block; font-size: 20px; }
.tile span { color: var(--muted); font-size: 13px; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); }
table.list td.n { text-align: right; font-variant-numeric: tabular-nums; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.status.pending { background: var(--warn-soft); color: var(--warn); }
.status.paid { background: var(--accent-soft); color: var(--accent); }
.status.shipped, .status.picked_up { background: var(--ok-soft); color: var(--ok); }
.tabs { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tabs button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.scroll-x { overflow-x: auto; }
@media print { .top, .filters, .tabs, .no-print, .x { display: none !important; } body { background: #fff; } }
