/* Hanoto Card Vault: dark-first premium theme, light mode via prefers-color-scheme. */
:root {
  --bg: #0a0b0f;
  --bg-2: #11131a;
  --surface: #151821;
  --surface-2: #1b1f2a;
  --line: #262a36;
  --line-2: #323745;
  --fg: #f2f2f5;
  --fg-2: #c9ccd6;
  --muted: #8e94a3;
  --gold: #f0c75e;
  --gold-2: #ffdd8a;
  --gold-ink: #1a1405;
  --accent: var(--gold);
  --up: #3ddc84;
  --down: #ff6b6b;
  --psa: #e03a3a;
  --holo: linear-gradient(115deg, #ffd56b 0%, #ff8fab 25%, #a78bfa 50%, #5eead4 75%, #ffd56b 100%);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.75), 0 0 0 1px rgba(240,199,94,.25);
  --radius: 16px;
  --spot: radial-gradient(120% 80% at 50% 0%, #2a2f3d 0%, #161922 55%, #11131a 100%);
  /* matches the 240,239,235 canvas baked into standardised photos */
  --studio: #f0efeb;
  --holo-text: var(--holo);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f4ef; --bg-2: #efece4; --surface: #ffffff; --surface-2: #f8f6f1;
    --line: #e4e0d6; --line-2: #d6d1c4; --fg: #15161b; --fg-2: #33353d; --muted: #6b6f7a;
    --gold: #a8780c; --gold-2: #c8930f; --gold-ink: #fff; --up: #138a4b; --down: #c62828;
    --shadow: 0 1px 2px rgba(20,20,30,.06), 0 8px 24px -14px rgba(20,20,30,.25);
    --shadow-lg: 0 22px 50px -22px rgba(20,20,30,.35), 0 0 0 1px rgba(168,120,12,.35);
    --spot: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, #f1eee6 60%, #e9e5da 100%);
    --holo-text: linear-gradient(115deg, #b7791f 0%, #c2416b 30%, #6d28d9 60%, #0f766e 85%, #b7791f 100%);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--fg);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(240,199,94,.10), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(167,139,250,.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.num, .price, .ask, .stats strong { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1240px) / 2));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--holo); background-size: 200% 200%; color: #111; font-size: 15px; font-weight: 900;
  box-shadow: 0 6px 18px -6px rgba(240,199,94,.7); animation: holo 8s linear infinite;
}
.brand small { display: block; font-weight: 500; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a, .top nav button.link {
  text-decoration: none; color: var(--fg-2); font: 500 14px/1 inherit; font-family: inherit;
  padding: 9px 12px; border-radius: 999px; margin: 0; border: 0; background: none; cursor: pointer;
}
.top nav a:hover, .top nav button.link:hover { background: var(--surface-2); color: var(--fg); }
.inline { display: inline; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; }
footer { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- controls ---------- */
button, .btn {
  font: 600 14px/1 inherit; font-family: inherit; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
button:hover, .btn:hover { border-color: var(--gold); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: transparent; box-shadow: 0 8px 22px -10px rgba(240,199,94,.8); }
button.danger { color: var(--down); margin-top: 24px; }
button.link { background: none; border: 0; padding: 0; text-decoration: underline; }
input, select, textarea {
  font: 15px/1.3 inherit; font-family: inherit; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
}
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
label { display: block; font-size: 13px; color: var(--muted); }
label input, label select, label textarea { margin-top: 4px; color: var(--fg); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--down); }
.flash { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 12px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 28px 26px 22px; margin-bottom: 18px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%;
  background: var(--holo); filter: blur(70px); opacity: .18; pointer-events: none;
}
.hero h1 { margin: 0; font-size: clamp(26px, 4.2vw, 42px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
.hero h1 .hl { background: var(--holo-text); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: holo 8s linear infinite; }
.hero p.lede { margin: 8px 0 18px; color: var(--fg-2); max-width: 60ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; position: relative; }
.hero-stats div { padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line); min-width: 120px; }
.hero-stats strong { display: block; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12px; color: var(--muted); }
.trust { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.trust .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px color-mix(in srgb, var(--up) 20%, transparent); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; position: relative; }
.search { flex: 1 1 280px; position: relative; }
.search input { padding-left: 42px; height: 48px; font-size: 16px; border-radius: 14px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters select { width: auto; height: 48px; border-radius: 14px; }
.filters button { height: 48px; border-radius: 14px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.pill {
  text-decoration: none; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--fg-2); background: var(--surface);
}
.pill:hover { border-color: var(--gold); color: var(--fg); }
.pill.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.resultbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* ---------- grid + tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.tile {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .25s ease;
}
.tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.ph { position: relative; aspect-ratio: 3 / 4.4; background: var(--studio); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.tile:hover .ph img { transform: scale(1.04); }
.ph::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,214,107,.35) 42%, rgba(167,139,250,.35) 50%, rgba(94,234,212,.3) 58%, transparent 70%);
  background-size: 250% 100%; background-position: 120% 0; transition: opacity .3s ease;
}
.tile:hover .ph::after { opacity: 1; animation: sheen 1.1s ease forwards; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--fg); border: 1px solid var(--line-2); white-space: nowrap;
}
.chip.g-psa { background: var(--psa); border-color: var(--psa); color: #fff; }
.chip.g-bgs { background: #1d2a44; border-color: #3a5288; color: #dfe7ff; }
.chip.g-cgc { background: #12323a; border-color: #2a6b78; color: #d7f6fb; }
.chip.g-raw { background: color-mix(in srgb, var(--up) 18%, var(--surface)); border-color: color-mix(in srgb, var(--up) 45%, transparent); color: var(--fg); }
.chip.g-10 { box-shadow: 0 0 0 1px var(--gold), 0 0 14px -2px rgba(240,199,94,.6); }
.ph .chip { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(6px); }
.ribbon {
  position: absolute; top: 14px; right: -36px; transform: rotate(45deg); width: 140px; text-align: center;
  background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 5px 0;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.6);
}
.meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.meta strong { font-size: 15px; letter-spacing: -.01em; line-height: 1.25; }
.meta .set { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.prices { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.ask { font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--gold); line-height: 1; }
.ask.poa { font-size: 15px; color: var(--fg-2); }
.mkt { font-size: 11.5px; color: var(--muted); text-align: right; line-height: 1.3; }
.trend { font-size: 11.5px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.trend.up { color: var(--up); } .trend.down { color: var(--down); }
.spark { vertical-align: middle; }

/* ---------- item page ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.crumb:hover { color: var(--fg); }
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery { display: grid; gap: 12px; }
.stage {
  position: relative; border-radius: 22px; background: var(--studio); color: #333; font: inherit; border: 1px solid var(--line); overflow: hidden;
  box-shadow: var(--shadow); cursor: zoom-in; padding: 22px; display: grid; place-items: center;
}
.stage img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.stage:hover { border-color: var(--gold); }
.stage .hint { position: absolute; right: 12px; bottom: 12px; font-size: 12px; color: #fff; background: rgba(10,11,15,.7); padding: 5px 10px; border-radius: 999px; }
.thumbs { display: flex; gap: 10px; }
.thumbs button { padding: 6px; border-radius: 12px; background: var(--studio); width: 84px; height: 112px; }
.thumbs button img { width: 100%; height: 100%; object-fit: contain; }
.thumbs button[aria-pressed="true"] { border-color: var(--gold); }
.info h1 { margin: 6px 0 4px; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.03em; line-height: 1.1; }
.info .sub { color: var(--muted); margin: 0 0 14px; }
.pricebox {
  background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 20px; margin: 16px 0; box-shadow: var(--shadow);
}
.pricebox .ask { font-size: 40px; }
.pricebox .row2 { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ask-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); font-size: 14px; color: var(--fg-2); }
.ask-note strong { color: var(--fg); }
dl.specs { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
dl.specs dt, dl.specs dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); }
dl.specs dt { color: var(--muted); font-size: 13px; }
dl.specs dd { font-weight: 600; text-align: right; }
dl.specs dt:last-of-type, dl.specs dd:last-of-type { border-bottom: 0; }
dl.specs a { color: var(--gold); }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-top: 26px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -.01em; }
.chart { width: 100%; height: auto; color: var(--gold); display: block; }
.chart circle { fill: var(--gold); }
.chart .axis { font-size: 11px; fill: var(--muted); }

/* lightbox */
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(5,6,10,.88); backdrop-filter: blur(6px); }
dialog.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 12px; cursor: zoom-out; }
dialog.lightbox form { position: fixed; top: 14px; right: 14px; }
dialog.lightbox button { border-radius: 999px; width: 44px; height: 44px; justify-content: center; font-size: 20px; padding: 0; }

/* ---------- tables + admin (shared) ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.num { text-align: right; white-space: nowrap; }
.scroll { overflow-x: auto; border-radius: 14px; }
.thumb { width: 44px; height: 64px; object-fit: contain; border-radius: 6px; background: #f0efeb; }
.thumb.big { width: 120px; height: 180px; margin-top: 8px; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.bar h1 { margin: 0 auto 0 0; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stats strong { font-size: 24px; letter-spacing: -.02em; }
fieldset { border: 1px solid var(--line); border-radius: 16px; margin: 0 0 14px; padding: 14px 16px; background: var(--surface); }
legend { font-weight: 700; padding: 0 6px; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row input { width: auto; flex: 1 1 200px; }
.narrow { max-width: 400px; margin: 48px auto; }
.card-form label { margin-bottom: 12px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 0 0 18px; letter-spacing: -.02em; }
.login-card button { width: 100%; justify-content: center; margin-top: 6px; }
.lres { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; text-align: center; }
.pick img { width: 100%; max-width: 120px; }
p.badge { display: inline-block; background: var(--gold); color: var(--gold-ink); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------- motion ---------- */
@keyframes holo { to { background-position: 200% 0; } }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -40% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:hover { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .stage img { max-height: 60vh; }
}
@media (max-width: 600px) {
  main { padding: 16px 16px 32px; }
  .top { padding: 10px 16px; }
  .brand small { display: none; }
  .top nav a, .top nav button.link { padding: 8px 9px; font-size: 13px; }
  .hero { padding: 20px 16px 16px; border-radius: 18px; }
  .hero-stats { gap: 8px; margin-bottom: 14px; }
  .hero-stats div { min-width: 0; flex: 1 1 0; padding: 8px 10px; }
  .hero-stats div:nth-child(3) { display: none; }
  .hero-stats strong { font-size: 17px; }
  .hero p.lede { display: none; }
  .hero h1 { margin-bottom: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .meta { padding: 10px 10px 12px; }
  .meta strong { font-size: 13.5px; }
  .ask { font-size: 18px; }
  .prices { flex-direction: column; align-items: flex-start; gap: 2px; }
  .mkt { text-align: left; }
  .ph .chip { top: 8px; left: 8px; font-size: 11px; padding: 4px 8px; }
  .filters select { flex: 1 1 0; min-width: 0; }
  .filters button { flex: 0 0 auto; }
  .pricebox .ask { font-size: 34px; }
}
