:root {
  --bg: #0f0b1a; --panel: #1a1428; --line: #33294a; --text: #e6edf3; --muted: #8b949e;
  --accent: #8b5cf6; --accent-ink: #ffffff; --accent-text: #b794f6; --danger: #f85149; --ok: #3fb950;
  --radius: 14px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent-text); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(15,11,26,.92); backdrop-filter: blur(8px); z-index: 10; }
header.site .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent-text); }
nav { margin-left: auto; display: flex; gap: 6px; }
nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
nav a:hover, nav a.on { background: var(--panel); }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.hero { padding: 56px 0 32px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; margin: 0 0 12px; letter-spacing: -.03em; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0 0 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 11px 18px; border-radius: 10px; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.product .meta { display: flex; justify-content: space-between; align-items: baseline; }
.product .price { font-weight: 800; font-size: 1.1rem; }
.product p { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* The printed card look, ratio 63x88mm */
.card { aspect-ratio: 63/88; width: 100%; border-radius: 12px; padding: 7%; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--c1, #333), var(--c2, #111)); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  display: flex; flex-direction: column; color: #fff; border: 3px solid rgba(255,255,255,.15); container-type: inline-size; }
.card.foil::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .55;
  background: linear-gradient(115deg, transparent 20%, #ff6ec7 35%, #7afcff 50%, #feff9c 65%, transparent 80%); background-size: 250% 250%; animation: shine 4s linear infinite; }
.card.gold { border-color: #f0b429; box-shadow: 0 0 0 2px #7a5a00, 0 10px 30px rgba(0,0,0,.45); }
@keyframes shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.card .top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 7cqw; gap: 6px; }
.card .top .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .chip { font-size: 5cqw; background: rgba(0,0,0,.4); border-radius: 999px; padding: 1% 4%; white-space: nowrap; }
.card .art { flex: 1; margin: 5% 0; border-radius: 6px; background: rgba(0,0,0,.25) center/cover no-repeat; display: grid; place-items: center; font-size: 30cqw; border: 2px solid rgba(255,255,255,.2); min-height: 0; }
.card .flavor { font-size: 4.6cqw; font-style: italic; opacity: .9; min-height: 2.6em; }
.card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; margin-top: 4%; }
.card .stat { background: rgba(0,0,0,.4); border-radius: 6px; text-align: center; padding: 3% 0; font-size: 4.2cqw; }
.card .stat b { display: block; font-size: 8cqw; line-height: 1.1; }
.card .brand { position: absolute; bottom: 2.4%; right: 6%; font-size: 3.4cqw; opacity: .6; font-weight: 800; }

.builder { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 40px; padding: 32px 0 64px; align-items: start; }
.builder .preview { position: sticky; top: 84px; }
form .field { margin-bottom: 18px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
input[type=text], textarea, select { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
textarea { resize: vertical; min-height: 70px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.statrow { display: grid; grid-template-columns: 70px 1fr 28px; gap: 10px; align-items: center; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.opt { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: var(--panel); font-weight: 600; }
.opt input { margin-right: 6px; accent-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); }
.opt small { display: block; color: var(--muted); font-weight: 400; }
.avatars { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.avatars .opt { font-size: 1.6rem; text-align: center; padding: 8px 4px; }
.avatars .opt input { position: absolute; opacity: 0; }
.err { color: var(--danger); font-weight: 600; min-height: 1.5em; }
.okmsg { color: var(--ok); font-weight: 600; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { background: var(--panel); border: 0; color: var(--text); width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer; }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }

.cart { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 24px 0 64px; align-items: start; }
.line { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line .card { border-width: 1px; padding: 5%; box-shadow: none; }
.line h3 { margin: 0; font-size: 1rem; }
.line p { margin: 2px 0 8px; color: var(--muted); font-size: .85rem; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 84px; }
.summary .row { display: flex; justify-content: space-between; margin: 6px 0; }
.summary .total { font-size: 1.2rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 24px 0 40px; margin-top: 40px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ok); color: #04210b; font-weight: 700; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 760px) {
  .hero, .builder, .cart { grid-template-columns: 1fr; }
  .hero .fan { display: none; }
  .builder .preview { position: static; max-width: 280px; margin: 0 auto; }
  nav a { padding: 8px 8px; }
}
