/* Stockbook. Concept: a lit museum vitrine at night. Deep Prussian-blue ground (the ink of early engraved issues),
   gilt accents from album edging, crisp Geist UI for the instrument feel, Bodoni for the engraved, historic voice.
   The stamps are the only things that float. */
:root {
  --ground: #0b1626;
  --ground-2: #102036;
  --ground-3: #16294266;
  --line: rgba(196, 212, 236, .12);
  --line-2: rgba(196, 212, 236, .22);
  --ink: #e9eef5;
  --ink-2: #a7b3c5;
  --ink-3: #6f7f96;
  --gold: #d4b072;
  --gold-ink: #1b1405;
  --glow: rgba(212, 176, 114, .16);
  --paper: #f4f0e6;
  --want: #f39494;
  --owned: #8fd6ad;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, .65), 0 10px 22px -10px rgba(0, 0, 0, .5);
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar: 0px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #eef1f5; --ground-2: #e2e7ee; --ground-3: #d6dde766; --line: rgba(16, 34, 58, .12); --line-2: rgba(16, 34, 58, .22);
    --ink: #0f1e33; --ink-2: #3f5068; --ink-3: #6b7a90; --gold: #8f6a1c; --gold-ink: #ffffff; --glow: rgba(143, 106, 28, .12);
    --want: #b9343c; --owned: #1f7a4a; --shadow: 0 30px 50px -24px rgba(15, 30, 51, .45), 0 10px 20px -12px rgba(15, 30, 51, .3);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ground: #eef1f5; --ground-2: #e2e7ee; --ground-3: #d6dde766; --line: rgba(16, 34, 58, .12); --line-2: rgba(16, 34, 58, .22);
  --ink: #0f1e33; --ink-2: #3f5068; --ink-3: #6b7a90; --gold: #8f6a1c; --gold-ink: #ffffff; --glow: rgba(143, 106, 28, .12);
  --want: #b9343c; --owned: #1f7a4a; --shadow: 0 30px 50px -24px rgba(15, 30, 51, .45), 0 10px 20px -12px rgba(15, 30, 51, .3);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.wrap, main > .page { max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 600px) { .wrap, main > .page { padding-inline: 16px; } }

/* Header */
.top { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px); background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 22px; height: 26px; color: var(--gold); }
.brand-word { font: 600 19px/1 var(--sans); letter-spacing: -.035em; }
.brand-year { font: 500 10px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; align-self: flex-start; margin-top: 2px; margin-left: -4px; }
.search-pill { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--ground-2); color: var(--ink-3); text-align: left; transition: border-color .2s; }
.search-pill:hover { border-color: var(--line-2); color: var(--ink-2); }
.search-pill svg { width: 17px; height: 17px; flex: none; }
.search-pill span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.search-pill kbd { font: 500 11px var(--mono); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; color: var(--ink-3); }
.nav { margin-left: auto; display: flex; gap: 2px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 7px 11px; border-radius: 9px; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--ground-2); }
.count { font: 500 11px var(--mono); color: var(--gold); }
@media (max-width: 960px) {
  .nav { display: none; }
  .search-pill { max-width: none; }
}
@media (max-width: 600px) {
  .top-inner { padding: 10px 16px; gap: 12px; }
  .search-pill kbd, .search-pill span { display: none; }
  .search-pill { flex: none; margin-left: auto; padding: 8px; border-radius: 10px; }
}

/* Bottom tab bar (phones and small tablets) */
.tabbar { display: none; }
@media (max-width: 960px) {
  :root { --tabbar: 62px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding-bottom: env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 0 8px; text-decoration: none; color: var(--ink-3); background: none; border: 0; font-size: 10.5px; letter-spacing: .01em; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--gold); }
  .tab-count { position: absolute; top: 5px; left: calc(50% + 8px); font: 600 9px/14px var(--mono); font-style: normal; min-width: 15px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: var(--gold-ink); }
  .tab-count:empty { display: none; }
  body { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
}

main { outline: none; min-height: 70vh; padding-bottom: 56px; }
.page { padding-top: 28px; }

/* Type */
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 500 clamp(34px, 6vw, 64px)/1.02 var(--serif); letter-spacing: -.015em; }
h2 { font: 500 clamp(24px, 3.2vw, 34px)/1.08 var(--serif); letter-spacing: -.01em; }
h3 { font: 600 17px/1.25 var(--sans); letter-spacing: -.01em; }
.kicker { font: 500 13px/1.3 var(--sans); color: var(--gold); margin: 0 0 8px; }
.lede { color: var(--ink-2); max-width: 60ch; margin: 12px 0 0; font-size: 16px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.head > div { min-width: 0; }
.section { margin-top: 56px; }
.section .head { margin-bottom: 16px; }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--ground-2); padding: 9px 16px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.ghost { background: transparent; }
.btn.on-owned { border-color: var(--owned); color: var(--owned); }
.btn.on-want { border-color: var(--want); color: var(--want); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ground-2); font-size: 20px; line-height: 1; }
.icon-btn svg { width: 20px; height: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px; }
.chips.scroll::-webkit-scrollbar { display: none; }
@media (max-width: 600px) { .chips.scroll { margin-inline: -16px; padding-inline: 16px; } }
.chip { border: 1px solid var(--line); background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip .n { font: 400 11px var(--mono); color: var(--ink-3); margin-left: 5px; }
.chip.on .n { color: inherit; opacity: .6; }
.field { width: 100%; max-width: 420px; background: var(--ground-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; }
.field:focus { border-color: var(--gold); }

/* Hero */
.hero { position: relative; padding: 44px 0 0; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 720px; background: radial-gradient(60% 50% at 50% 55%, var(--glow), transparent 70%); pointer-events: none; }
.hero-copy { position: relative; text-align: center; max-width: 860px; margin: 0 auto; padding-inline: 20px; }
.hero-copy h1 { font-size: clamp(38px, 7vw, 76px); }
.hero-copy .lede { margin-inline: auto; }
.live-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; border-radius: 16px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--ground-2) 85%, transparent); box-shadow: 0 16px 40px -24px rgba(0,0,0,.6); transition: border-color .2s, box-shadow .2s; }
.live-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--glow), 0 16px 40px -24px rgba(0,0,0,.6); }
.live-input svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.live-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; }
.live-input input::-webkit-search-cancel-button { filter: grayscale(1); }
.hero-search { max-width: 640px; margin: 28px auto 0; position: relative; z-index: 3; }
.hero-results { max-width: 1240px; margin: 0 auto; padding-inline: 20px; position: relative; z-index: 3; }
.hero-results:empty { display: none; }

/* Vitrine: floating 3D stamps */
.vitrine-wrap { position: relative; margin-top: 18px; }
.vitrine { display: flex; gap: clamp(8px, 2vw, 22px); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 60px calc(50% - var(--cw) / 2) 70px; --cw: clamp(190px, 46vw, 270px); perspective: 1400px; -webkit-overflow-scrolling: touch; }
.vitrine::-webkit-scrollbar { display: none; }
.v-item { flex: none; width: var(--cw); scroll-snap-align: center; transform-style: preserve-3d; }
.v-card { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; transform-style: preserve-3d; transform: rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0px)) scale(var(--sc, 1)); transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .5s; opacity: var(--op, 1); text-decoration: none; background: none; border: 0; padding: 0; }
.v-float { position: absolute; inset: 0; transform-style: preserve-3d; animation: float 6s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.v-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.6, .05, .25, 1); }
.v-flip.flipped { transform: rotateY(180deg); }
.v-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.v-face.back { transform: rotateY(180deg); }
.v-face img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 26px 30px rgba(0,0,0,.55)) drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.v-face .v-shimmer { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.18) 48%, transparent 58%); background-size: 260% 100%; background-position: var(--sx, 120%) 0; mix-blend-mode: soft-light; pointer-events: none; transition: background-position .6s; }
.v-ph { width: 78%; aspect-ratio: 4 / 5; border-radius: 3px; background: linear-gradient(135deg, var(--ground-2), color-mix(in srgb, var(--ground-2) 70%, var(--gold))); opacity: .5; animation: pulse 1.6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotateZ(-.6deg); } 50% { transform: translateY(-12px) rotateZ(.6deg); } }
@keyframes pulse { 50% { opacity: .25; } }
.v-floor { position: absolute; left: 0; right: 0; bottom: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); pointer-events: none; }
.v-caption { text-align: center; padding: 0 20px; min-height: 118px; max-width: 620px; margin: 0 auto; }
.v-caption h3 { font: 500 clamp(24px, 3vw, 30px)/1.1 var(--serif); letter-spacing: -.01em; }
.v-caption .meta { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.v-caption .meta b { color: var(--gold); font-weight: 500; }
.v-caption p { color: var(--ink-2); margin: 8px auto 0; max-width: 52ch; }
.v-arrows { position: absolute; inset: 0 0 auto; height: calc(100% - 0px); pointer-events: none; display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
.v-arrows .icon-btn { pointer-events: auto; backdrop-filter: blur(8px); background: color-mix(in srgb, var(--ground-2) 75%, transparent); }
@media (max-width: 700px) { .v-arrows { display: none; } }

/* Doors */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.door { display: grid; gap: 6px; align-content: start; padding: 22px; background: var(--ground); text-decoration: none; transition: background .2s; min-height: 150px; }
.door:hover { background: var(--ground-2); }
.door .door-n { font: 500 12px var(--mono); color: var(--gold); }
.door h3 { font: 500 24px/1.1 var(--serif); }
.door p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* Region strip on home */
.region-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.region-row a { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; }
.region-row a:hover { border-color: var(--gold); }
.region-row span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* Countries */
.sticky-tools { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 61px); z-index: 10; padding: 12px 0; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; gap: 10px; }
@media (max-width: 600px) { .sticky-tools { top: calc(env(safe-area-inset-top, 0px) + 57px); } }
.regions { display: grid; gap: 40px; margin-top: 16px; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); column-gap: 24px; }
@media (max-width: 480px) { .country-grid { grid-template-columns: 1fr 1fr; column-gap: 14px; } }
.country { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0; }
.country span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country:hover { color: var(--gold); }
.tag { font: 500 10px var(--mono); color: var(--ink-3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; flex: none; }

/* Issue calendar */
.calendar { display: grid; gap: 4px; }
.cal-row { display: grid; grid-template-columns: 52px repeat(10, minmax(0, 1fr)); gap: 4px; align-items: center; }
.cal-row .dec { font: 500 12px var(--mono); color: var(--ink-3); }
.cal-cell { height: 32px; border-radius: 6px; background: var(--ground-3); font: 400 11px var(--mono); color: var(--ink-3); display: grid; place-items: center; text-decoration: none; min-width: 0; opacity: .55; }
.cal-cell.has { opacity: 1; color: var(--ink); background: color-mix(in srgb, var(--gold) calc(var(--t, .2) * 85%), var(--ground-2)); }
.cal-cell.has:hover { outline: 2px solid var(--gold); outline-offset: 1px; }
.cal-cell.hot { color: var(--gold-ink); }
@media (max-width: 480px) { .cal-row { grid-template-columns: 40px repeat(10, minmax(0, 1fr)); gap: 3px; } .cal-cell { height: 28px; font-size: 10px; border-radius: 4px; } }

/* Stamp grid */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar select { background: var(--ground-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px 14px; }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr 1fr; gap: 14px 10px; } }
.tile { position: relative; display: grid; gap: 10px; text-decoration: none; min-width: 0; perspective: 800px; }
.tile .mount { position: relative; aspect-ratio: 1; border-radius: 14px; background: radial-gradient(120% 90% at 50% 20%, var(--ground-2), var(--ground) 80%); border: 1px solid var(--line); overflow: hidden; transform-style: preserve-3d; }
.tile .mount img { position: absolute; inset: 0; margin: auto; max-width: 78%; max-height: 78%; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(0,0,0,.45)); transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.tile:hover .mount img { transform: translateY(-4px) rotateX(8deg) rotateY(-10deg) scale(1.04); }
.tile .cap { display: grid; gap: 2px; min-width: 0; padding-inline: 2px; }
.tile .cap b { font-weight: 500; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .cap span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .status { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--ground); }
.dot.owned { background: var(--owned); }
.dot.want { background: var(--want); }
.sk .mount { animation: pulse 1.4s ease-in-out infinite; }
.ph-name { position: absolute; inset: 14%; display: grid; place-items: center; text-align: center; font: 500 15px/1.2 var(--serif); color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: 4px; padding: 8px; }
.more { display: flex; justify-content: center; margin-top: 28px; }
.status-line { font-size: 13px; color: var(--ink-3); text-align: center; padding: 24px 0; }
.empty { padding: 36px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: 16px; color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; }
.err { color: var(--want); }

/* Live search results */
.live-results { display: grid; gap: 22px; padding-top: 18px; }
.live-group h4 { margin: 0 0 10px; font: 500 13px var(--sans); color: var(--ink-3); display: flex; justify-content: space-between; align-items: baseline; }
.live-group h4 a { color: var(--gold); text-decoration: none; font-size: 13px; }
.live-results .grid { transition: opacity .2s; }
.live-results .grid.stale { opacity: .45; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.overlay .suggest { justify-content: flex-start; }
.overlay { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--ground) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow-y: auto; overscroll-behavior: contain; }
.overlay-inner { max-width: 1100px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px calc(env(safe-area-inset-bottom, 0px) + 40px); }
.overlay-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 6px 0 10px; background: linear-gradient(var(--ground) 70%, transparent); }
.overlay-bar .live-input { flex: 1; }
@media (max-width: 600px) { .overlay-inner { padding-inline: 14px; } .live-input { height: 50px; } }

/* Stamp page: 3D stage */
.detail { display: grid; gap: 34px; padding-top: 8px; }
@media (min-width: 960px) { .detail { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } .stage-col { position: sticky; top: 90px; } }
.stage { position: relative; aspect-ratio: 1 / 1.02; max-height: 74vh; width: 100%; perspective: 1300px; display: grid; place-items: center; border-radius: 22px; background: radial-gradient(70% 60% at 50% 42%, var(--glow), transparent 72%), radial-gradient(120% 100% at 50% 0%, var(--ground-2), var(--ground) 75%); border: 1px solid var(--line); overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 9%; height: 26px; background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.45), transparent 70%); filter: blur(6px); pointer-events: none; }
.s3d { position: relative; width: 70%; height: 74%; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; }
.stage.dragging .s3d { transition: none; }
.s3d-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.6, .05, .25, 1); }
.s3d-flip.flipped { transform: rotateY(180deg); }
.s3d-face { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.s3d-face.front img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 30px 34px rgba(0,0,0,.55)) drop-shadow(0 8px 12px rgba(0,0,0,.35)); pointer-events: none; }
.s3d-glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,.28), transparent 45%); mix-blend-mode: overlay; opacity: var(--go, .0); transition: opacity .3s; }
.s3d-face.back { transform: rotateY(180deg); }
.gum { width: min(100%, 360px); aspect-ratio: 4 / 5; background: linear-gradient(160deg, #f7f2e4, #e9e1cb); color: #2b2416; border-radius: 3px; padding: 9% 9%; display: grid; align-content: start; gap: 8px; box-shadow: 0 30px 34px -12px rgba(0,0,0,.55); position: relative; overflow: hidden; -webkit-mask: radial-gradient(circle 4px at center, #0000 96%, #000) -6px -6px / 12px 12px, linear-gradient(#000 0 0) content-box; mask: radial-gradient(circle 4px at center, #0000 96%, #000) -6px -6px / 12px 12px, linear-gradient(#000 0 0) content-box; }
.gum::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(120,100,60,.05) 0 2px, transparent 2px 6px); pointer-events: none; }
.gum h4 { margin: 0; font: 500 clamp(16px, 2.4vw, 22px)/1.15 var(--serif); }
.gum dl { margin: 6px 0 0; display: grid; gap: 4px; font: 400 clamp(10px, 1.3vw, 12.5px)/1.35 var(--mono); }
.gum dl div { display: grid; grid-template-columns: 42% 1fr; gap: 6px; }
.gum dt { opacity: .6; }
.gum dd { margin: 0; overflow-wrap: anywhere; }
.stage-hud { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.hud-btn { border: 1px solid var(--line-2); background: color-mix(in srgb, var(--ground) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.hud-btn:hover { border-color: var(--gold); color: var(--gold); }
.stage-tip { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.loupe { position: absolute; width: 170px; height: 170px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 18px 40px rgba(0,0,0,.5); pointer-events: none; background-repeat: no-repeat; background-color: var(--ground); z-index: 4; transform: translate(-50%, -50%); }

.info h1 { font-size: clamp(32px, 4.6vw, 52px); }
.note { font: 400 italic clamp(18px, 2vw, 21px)/1.45 var(--serif); color: var(--ink); margin: 16px 0 0; max-width: 46ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 24px 0; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts div { background: var(--ground); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.facts dd a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.facts dd a:hover { color: var(--gold); }
.facts .wide { grid-column: 1 / -1; }
.wiki { border-left: 2px solid var(--gold); padding: 2px 0 2px 16px; color: var(--ink-2); max-width: 62ch; }
.wiki a { color: var(--gold); }
.ledger { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; background: var(--ground-2); margin-top: 22px; }
.ledger .row { display: flex; flex-wrap: wrap; gap: 8px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { background: var(--ground); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; width: 100%; min-width: 0; color: var(--ink); }
.form textarea { min-height: 72px; resize: vertical; }
.filed { margin-top: 22px; }
.filed h4 { margin: 0 0 8px; font: 500 13px var(--sans); color: var(--ink-3); }

/* Inspect (fullscreen zoom) */
.inspect { position: fixed; inset: 0; z-index: 70; background: #05080e; touch-action: none; }
.inspect-canvas { position: absolute; inset: 0; overflow: hidden; cursor: grab; }
.inspect-canvas.dragging { cursor: grabbing; }
.inspect-canvas img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.inspect-hud { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; display: flex; gap: 8px; align-items: center; color: #e9eef5; }
.inspect-hud .icon-btn, .inspect-hud .hud-btn { background: rgba(16, 32, 54, .8); border-color: rgba(196, 212, 236, .25); color: #e9eef5; }
.inspect-hud span { padding: 0 6px; font-size: 13px; }
.inspect-hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); text-align: center; color: rgba(233, 238, 245, .6); font-size: 13px; margin: 0; pointer-events: none; }

/* Collection */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.stats div { background: var(--ground); padding: 16px; display: grid; gap: 2px; }
.stats b { font: 500 24px var(--mono); }
.stats span { font-size: 12px; color: var(--ink-3); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.35); white-space: nowrap; }
.foot { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.foot p { max-width: 80ch; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .v-float, .v-ph, .sk .mount { animation: none; }
  .v-flip, .s3d-flip, .v-card, .s3d { transition: none; }
}
