/* TCG Apex. Palette: card stock, binder ink, cobalt, holo foil. */
:root {
  --paper: #FAF7F2;
  --white: #FFFFFF;
  --ink: #1A1A1F;
  --ink-2: #5B5963;
  --line: #E6E0D8;
  --cobalt: #D62828;        /* primary: Fire red (buttons, links) */
  --cobalt-dark: #B01E1E;
  --orange: #EC6602;        /* accent: big numbers, highlights (not for small text) */
  --gold: #FFC23D;
  --wa: #128C4A;
  --red: #B42E2E;
  --foil: linear-gradient(115deg, #FFC23D 0%, #EC6602 38%, #D62828 70%, #FFC23D 100%);
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 var(--body); }
img { max-width: 100%; display: block; }
a { color: var(--cobalt); text-underline-offset: 2px; }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-stretch: 112%; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; }
.page { padding-top: 40px; padding-bottom: 72px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header / footer ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.wordmark { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 1.3rem; letter-spacing: .02em; color: var(--ink); text-decoration: none; margin: 0; }
.wordmark { display: inline-flex; align-items: center; gap: 6px; }
.wordmark img { height: 34px; width: auto; }
.admin .wordmark img { height: 27px; }
.footer-logo { height: 29px; width: auto; margin-bottom: 12px; }
.wordmark small { font-stretch: 100%; font-weight: 600; font-size: .8rem; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.wordmark-sm { font-size: 1.05rem; margin-bottom: 8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--white); color: var(--ink); }
.cart-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 2px; border-radius: 11px; background: var(--cobalt); color: #fff; font-size: .78rem; font-weight: 700; }
.site-footer { background: var(--ink); color: #D8D4CE; padding: 40px 0; font-size: .9rem; }
.site-footer .wordmark { color: #fff; }
.site-footer a { color: var(--gold); }
.footer-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.legal { max-width: 52ch; color: #A6A2AB; font-size: .8rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem/1 var(--body); padding: 14px 22px; border-radius: 10px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); text-decoration: none; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.btn:hover { background: var(--ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); color: #fff; }
.btn-ghost { background: transparent; }
.btn-small { padding: 9px 14px; font-size: .9rem; border-width: 1.5px; }
.btn-block { width: 100%; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #0D7038; border-color: #0D7038; color: #fff; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .875rem; font-weight: 600; color: var(--cobalt); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.is-done { color: var(--wa); text-decoration: none; }

/* ---------- hero with holo card fan ---------- */
.hero { padding: 56px 0 72px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 5.2rem); font-stretch: 125%; font-weight: 900; line-height: .94; letter-spacing: -0.02em; max-width: 11ch; margin-bottom: 24px; }
.lede { font-size: 1.15rem; max-width: 46ch; color: var(--ink-2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.fan { position: relative; height: 380px; }
.holo-card {
  --mx: 50%; --my: 30%;
  position: absolute; left: 50%; top: 50%; width: 200px; aspect-ratio: 5 / 7;
  margin: -140px 0 0 -100px; border-radius: 14px; border: 8px solid transparent;
  background: linear-gradient(var(--ink), var(--ink)) padding-box, var(--foil) border-box;
  box-shadow: 0 18px 40px -18px rgba(26, 26, 31, .55);
  display: grid; place-items: center; overflow: hidden; isolation: isolate;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.holo-card::before { /* diamond lattice back pattern */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 1px, transparent 1px 16px);
}
.holo-card::after { /* foil sheen that follows the pointer */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.4), transparent 45%),
    var(--foil);
  background-size: 100% 100%, 300% 300%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: color-dodge; opacity: .24;
}
.holo-card span {
  font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 3rem; color: var(--gold);
  width: 120px; height: 160px; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid rgba(255, 214, 110, .55); letter-spacing: .02em;
}
.holo-card.c1 { transform: translateX(-46%) rotate(-13deg); }
.holo-card.c2 { transform: translateY(-14px); z-index: 2; }
.holo-card.c3 { transform: translateX(46%) rotate(13deg); }
.fan.is-stacked .holo-card { transform: none; }
.fan-products .shot { position: absolute; width: 58%; left: 21%; top: 2%; transition: transform .8s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 20px 26px rgba(26,26,31,.25)); }
.fan-products .s1 { transform: translate(-38%, 14%) rotate(-9deg) scale(.82); }
.fan-products .s3 { transform: translate(38%, 14%) rotate(9deg) scale(.82); }
.fan-products .s2 { z-index: 2; }
.fan.is-stacked .shot { transform: none; }
.new-in { display: inline-flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 6px 6px; margin-bottom: 22px; font-weight: 600; font-size: .92rem; text-decoration: none; color: var(--ink); }
.new-in b { background: var(--foil); color: var(--ink); border-radius: 6px; padding: 3px 8px; font-size: .8rem; }
.tag-pre { background: var(--cobalt); color: #fff; }

/* ---------- how it works ---------- */
.how { padding: 64px 0; background: var(--white); border-block: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 18px; }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 2.4rem; line-height: 1; color: var(--orange); margin-bottom: 12px; }
.steps p { color: var(--ink-2); margin: 0; }

/* ---------- shop ---------- */
.shop { padding: 64px 0 88px; scroll-margin-top: 64px; }
.shop-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.shop-head h2 { margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.shop-head .chips { margin: 0; }
.chip { padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { opacity: .6; font-weight: 500; margin-left: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.product { background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.product-media { position: relative; display: block; aspect-ratio: 5 / 6; background: #F5F7FB; }
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px 14px; }
.product.is-sold .product-media img, .product.is-sold .ph { filter: grayscale(1); opacity: .55; }
.ph { position: absolute; inset: 14px; border-radius: 12px; background: var(--ink); overflow: hidden; display: flex; align-items: flex-end; padding: 16px; }
.ph::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 1px, transparent 1px 14px), repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 1px, transparent 1px 14px); }
.ph::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--foil); }
.ph span { position: relative; font-family: var(--display); font-stretch: 125%; font-weight: 800; color: #fff; font-size: 1.15rem; line-height: 1.05; }
.ph-lg { position: relative; inset: auto; aspect-ratio: 5 / 7; }
.ph-lg span { font-size: 2rem; }
.tag { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.tag-low { background: var(--gold); color: var(--ink); }
.tag-sold { background: var(--ink); color: #fff; }
.product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-type { font-size: .82rem; color: var(--ink-2); margin: 0 0 4px; }
.product-name { font-family: var(--body); font-stretch: 100%; font-size: 1.02rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; margin: 0 0 14px; }
.product-name a { color: var(--ink); text-decoration: none; }
.product-name a:hover { text-decoration: underline; }
.product-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.price { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.price-lg { font-size: 2rem; margin-bottom: 4px; }
.empty { background: var(--white); border: 1.5px dashed var(--line); border-radius: 16px; padding: 32px; text-align: center; color: var(--ink-2); }

/* ---------- product page ---------- */
.product-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.product-page-media { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.product-page-media img { margin: 0 auto; max-height: 560px; object-fit: contain; }
.back { display: inline-block; font-weight: 600; font-size: .9rem; margin-bottom: 18px; }
.back::before { content: "‹ "; }
.stock { font-weight: 600; color: var(--wa); }
.stock-out { color: var(--red); }
.buy-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 20px 0 28px; }
.qty { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.qty input { width: 90px; }
.qty-sm input { width: 72px; padding: 8px 10px; }
.desc { border-top: 1px solid var(--line); padding-top: 20px; color: var(--ink-2); }

/* ---------- forms ---------- */
.form fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.form legend { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.2rem; margin-bottom: 14px; padding: 0; }
.field { margin-bottom: 16px; }
.field label, .field > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1.5px solid #C3C9DA; border-radius: 10px; padding: 12px 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--cobalt); outline: 3px solid rgba(214, 40, 40, .2); outline-offset: 0; }
input[type="radio"], input[type="checkbox"] { width: auto; accent-color: var(--cobalt); }
input[type="file"] { padding: 10px; }
.has-error input, .has-error textarea { border-color: var(--red); }
.err { color: var(--red); font-size: .875rem; font-weight: 600; margin: 6px 0 0; }
.hint { color: var(--ink-2); font-size: .85rem; margin: 6px 0 0; }
.options { display: grid; gap: 8px; margin-bottom: 16px; }
.option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--white); border: 1.5px solid #C3C9DA; border-radius: 12px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.option-label { flex: 1; font-weight: 600; }
.option-fee { font-weight: 600; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 8px 0 16px; cursor: pointer; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- cart / summary ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.cart-lines { display: grid; gap: 12px; justify-items: start; }
.line { width: 100%; display: grid; grid-template-columns: 64px 1fr auto auto auto; gap: 16px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 12px 12px; }
.line-thumb { position: relative; width: 64px; aspect-ratio: 5 / 6; background: #F5F7FB; border-radius: 8px; overflow: hidden; }
.line-thumb img { width: 100%; height: 100%; object-fit: contain; }
.line-thumb .ph { inset: 0; border-radius: 8px; padding: 6px; }
.line-thumb .ph span { font-size: .55rem; }
.line-info { display: grid; gap: 2px; min-width: 0; }
.line-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.line-total { font-weight: 700; white-space: nowrap; }
.summary { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px; position: sticky; top: 84px; }
.summary-title { font-size: 1.2rem; }
.sum-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.sum-total { font-size: 1.15rem; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; }
.sum-total strong { font-family: var(--display); font-stretch: 112%; font-weight: 800; }
hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.summary .btn-block { margin-top: 12px; }

/* ---------- flash & status ---------- */
.flash { margin: 20px 0 0; padding: 12px 16px; border-radius: 10px; font-weight: 500; border-left: 4px solid; }
.flash-ok { background: #DFF4E8; border-color: var(--wa); color: #0D4F2B; }
.flash-warn { background: #FFF2CC; border-color: #D79A00; color: #5C4200; }
.status { display: inline-block; padding: 4px 10px; border-radius: 6px; font-family: var(--body); font-stretch: 100%; font-size: .82rem; font-weight: 700; letter-spacing: 0; vertical-align: middle; white-space: nowrap; }
.status-pending { background: #FFF1C7; color: #6B4E00; }
.status-paid { background: #DDF5E6; color: #12613A; }
.status-shipped { background: #E0E6FF; color: #2238A8; }
.status-completed { background: #E6E8F0; color: #3A3F5C; }
.status-cancelled { background: #FBE1E1; color: #9B2424; }

/* ---------- order / payment page ---------- */
.order-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 10px; }
.order-no { font-stretch: 125%; }
.pay { display: grid; grid-template-columns: 360px 1fr; gap: 40px; margin: 28px 0 40px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.pay-qr { text-align: center; }
.pay-qr img { width: 100%; max-width: 340px; height: auto; margin: 0 auto; border-radius: 16px; box-shadow: 0 10px 30px -12px rgba(26,26,31,.35); }
.pay-to { margin: 14px 0 6px; }
.amount-label { font-weight: 600; color: var(--ink-2); margin: 0; }
.amount { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; margin: 0 0 8px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.amount .link-btn { font-family: var(--body); font-stretch: 100%; font-size: .9rem; }
.deadline { font-size: .92rem; color: #6B4E00; background: #FFF6DA; padding: 8px 12px; border-radius: 8px; display: inline-block; }
.pay-list { padding-left: 22px; margin: 18px 0 24px; display: grid; gap: 12px; }
.pay-list li::marker { font-family: var(--display); font-weight: 800; color: var(--cobalt); }
.order-detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.order-detail h2, .panel h2 { font-size: 1.15rem; }
.sub { font-size: 1.1rem; margin-top: 32px; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 6px 0; }

/* ---------- admin ---------- */
.admin .site-header { background: var(--ink); border: 0; }
.admin .wordmark, .admin .nav a { color: #fff; }
.admin .wordmark { display: inline-flex; align-items: center; gap: 6px; }
.wordmark img { height: 34px; width: auto; }
.admin .wordmark img { height: 27px; }
.footer-logo { height: 29px; width: auto; margin-bottom: 12px; }
.wordmark small { color: var(--gold); }
.admin .nav a:hover { background: rgba(255,255,255,.1); }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; }
.search input { padding: 9px 12px; min-width: 240px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .82rem; color: var(--ink-2); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-off { opacity: .55; }
.thumb-cell { width: 56px; }
.thumb-cell img { width: 44px; height: 52px; object-fit: contain; }
.admin-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 24px; }
.narrow-form { max-width: 720px; }
.edit-thumb { width: 120px; margin-bottom: 8px; border-radius: 8px; border: 1px solid var(--line); }
.log { white-space: pre-wrap; font: .82rem/1.5 var(--body); color: var(--ink-2); background: var(--paper); padding: 12px; border-radius: 8px; margin: 0; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 32px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .product-page, .cart-layout, .pay, .order-detail, .admin-cols { grid-template-columns: 1fr; }
  .fan { height: 250px; order: -1; }
  .fan-products { height: 290px; }
  .fan-products .shot { width: 46%; left: 27%; }
  .holo-card { width: 130px; margin: -91px 0 0 -65px; border-width: 6px; }
  .holo-card span { width: 76px; height: 104px; font-size: 1.8rem; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .summary { position: static; }
  .pay { padding: 22px; }
  .pay-qr { max-width: 270px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .hero { padding-top: 24px; }
  .nav { flex-wrap: nowrap; gap: 0; }
  .nav a { padding: 8px 7px; font-size: .9rem; white-space: nowrap; }
  .wordmark img { height: 21px; }
  .header-row { gap: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-body { padding: 12px; }
  .product-foot { flex-direction: column; align-items: stretch; }
  .product-foot .btn { width: 100%; }
  .line { grid-template-columns: 56px 1fr auto; }
  .line-thumb { width: 56px; }
  .line .qty { grid-column: 2; }
  .line-total { grid-column: 3; grid-row: 1; }
  .line .link-btn { grid-column: 3; justify-self: end; }
  .search input { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .holo-card { transition: none; }
  .holo-card::after { background-position: 0 0, 50% 50%; }
}
