/* Arthur. A bright gallery: white walls, generous space, big Bodoni titles, stamps hung like small paintings
   with soft museum shadows. Gilt from album edging is the single accent. Dark mode is a dim slate gallery after hours,
   never black. */
:root {
  --ground: #ffffff; --ground-2: #f4f5f7; --ground-3: #eceef1; --line: rgba(17, 20, 24, .11); --line-2: rgba(17, 20, 24, .22); --ink: #0e1116; --ink-2: #2f3640; --ink-3: #5a626d; --gold: #93701f; --gold-ink: #ffffff; --glow: rgba(160, 125, 46, .07); --want: #c2414a; --owned: #2a7d52; --glim: rgba(255, 255, 255, .7); --stamp-shadow: 0 1px 1px rgba(17,20,24,.08), 0 14px 28px -10px rgba(17,20,24,.28); --scrim: rgba(255,255,255,.86); --img-filter: drop-shadow(0 1px 1px rgba(17,20,24,.10)) drop-shadow(0 16px 22px rgba(17,20,24,.22));
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar: 0px;
  color-scheme: light;
}
:root[data-theme="dark"] { --ground: #23272e; --ground-2: #2b3038; --ground-3: #353b45; --line: rgba(236, 239, 243, .1); --line-2: rgba(236, 239, 243, .19); --ink: #f2f3f5; --ink-2: #bcc1c9; --ink-3: #8c939d; --gold: #dcbf7e; --gold-ink: #23272e; --glow: rgba(220, 191, 126, .07); --want: #f0989d; --owned: #92d4ae; --glim: rgba(255, 255, 255, .22); --stamp-shadow: 0 2px 3px rgba(0,0,0,.25), 0 18px 34px -12px rgba(0,0,0,.55); --scrim: rgba(35,39,46,.88); --img-filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)) drop-shadow(0 20px 26px rgba(0,0,0,.45)); color-scheme: dark; }
:root[data-theme="light"] { --ground: #ffffff; --ground-2: #f4f5f7; --ground-3: #eceef1; --line: rgba(17, 20, 24, .11); --line-2: rgba(17, 20, 24, .22); --ink: #0e1116; --ink-2: #2f3640; --ink-3: #5a626d; --gold: #93701f; --gold-ink: #ffffff; --glow: rgba(160, 125, 46, .07); --want: #c2414a; --owned: #2a7d52; --glim: rgba(255, 255, 255, .7); --stamp-shadow: 0 1px 1px rgba(17,20,24,.08), 0 14px 28px -10px rgba(17,20,24,.28); --scrim: rgba(255,255,255,.86); --img-filter: drop-shadow(0 1px 1px rgba(17,20,24,.10)) drop-shadow(0 16px 22px rgba(17,20,24,.22)); color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.6 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-inline: 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: 26px; height: 30px; color: var(--gold); }
.brand-word { font: 600 27px/1 var(--serif); letter-spacing: -.01em; }
.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: 15px; }
.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: 8px 12px; border-radius: 10px; font-size: 15.5px; font-weight: 500; 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-2); background: none; border: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--ink); }
.tabbar .on svg { transform: scale(1.08); }
  .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: clamp(28px, 5vw, 64px); }

/* Type */
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 700 clamp(40px, 6.4vw, 80px)/1 var(--sans); letter-spacing: -.035em; }
h2 { font: 700 clamp(28px, 3.6vw, 44px)/1.06 var(--sans); letter-spacing: -.03em; }
h3 { font: 650 19px/1.25 var(--sans); letter-spacing: -.015em; }
.kicker { font: 600 15px/1.3 var(--sans); color: var(--gold); margin: 0 0 10px; }
.lede { color: var(--ink-2); max-width: 58ch; margin: 16px 0 0; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.55; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14.5px; 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: clamp(56px, 8vw, 110px); }
.section .head { margin-bottom: 16px; }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line-2); background: var(--ground); padding: 11px 18px; border-radius: 12px; text-decoration: none; font-size: 15.5px; font-weight: 600; white-space: nowrap; color: var(--ink); transition: transform .15s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.btn:hover { border-color: var(--ink-3); }
.btn.gold { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.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: 1.5px solid var(--line); background: transparent; color: var(--ink); padding: 7px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; 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: clamp(40px, 7vw, 96px) 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: 1000px; margin: 0 auto; padding-inline: 20px; }
.hero-copy h1 { font-size: clamp(44px, 7vw, 100px); letter-spacing: -.045em; }
.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: translateX(var(--tx, 0px)) 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 { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); }
.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 24px; min-height: 140px; max-width: 620px; margin: 0 auto; }
.v-caption h3 { font: 700 clamp(26px, 3.2vw, 36px)/1.1 var(--sans); letter-spacing: -.03em; }
.v-caption .meta { font-size: 15px; 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: 16px; }
.door { display: grid; gap: 8px; align-content: start; padding: 28px; background: var(--ground-2); border-radius: 22px; text-decoration: none; transition: transform .25s, background .2s; min-height: 170px; }
.door:hover { transform: translateY(-3px); }
.door:hover { background: var(--ground-2); }
.door .door-n { font: 500 12px var(--mono); color: var(--gold); }
.door h3 { font: 700 26px/1.1 var(--sans); letter-spacing: -.03em; }
.door p { margin: 0; color: var(--ink-2); font-size: 15.5px; }

/* 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); }
.cal-cell.has { color: var(--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: var(--img-filter); 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: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .cap span { font-size: 13.5px; 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; }
@media (max-width: 600px) { .hero .suggest { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; } .hero .suggest::-webkit-scrollbar { display: none; } }
.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 { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); 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,.16), transparent 50%); opacity: var(--go, 0); transition: opacity .3s; }
.s3d-face.back { transform: rotateY(180deg); filter: var(--img-filter); }
.gum { width: min(100%, 340px); aspect-ratio: 4 / 5; background: linear-gradient(160deg, #f7f2e4, #e7dfc8); color: #2b2416; padding: 7px; box-shadow: 0 30px 34px -12px rgba(0,0,0,.55); -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-in { height: 100%; padding: 9%; display: grid; align-content: start; gap: 8px; border: 1px solid rgba(80, 64, 30, .18); background: repeating-linear-gradient(45deg, rgba(120,100,60,.05) 0 2px, transparent 2px 6px); overflow: hidden; }
.gum h4 { margin: 0; font: 700 clamp(16px, 2.3vw, 21px)/1.15 var(--sans); letter-spacing: -.02em; min-height: 1.15em; }
.gum dl { margin: 6px 0 0; display: grid; gap: 5px; font: 400 clamp(11px, 1.35vw, 13.5px)/1.4 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: 450 clamp(19px, 2vw, 23px)/1.45 var(--sans); color: var(--ink); margin: 16px 0 0; max-width: 44ch; letter-spacing: -.01em; }
.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: 13.5px; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 17px; font-weight: 500; 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: var(--ground); 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: var(--ink); z-index: 2; }
.inspect-hud .icon-btn, .inspect-hud .hud-btn { background: var(--scrim); border-color: var(--line-2); color: var(--ink); }
.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: var(--ink-3); 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; }
}

/* ---------- Tiles as wrappers (link + heart) ---------- */
.tile-link { display: grid; gap: 10px; text-decoration: none; min-width: 0; }
.tile .mount { background: var(--ground-2); border-color: transparent; }
.tile .status { right: auto; left: 12px; top: 12px; }
.heart { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--scrim); color: var(--ink-3); box-shadow: 0 2px 8px rgba(0,0,0,.08); opacity: 0; transform: scale(.9); transition: opacity .2s, transform .2s, color .2s; }
.heart svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tile:hover .heart, .heart:focus-visible, .heart.on { opacity: 1; transform: none; }
.heart.on { color: var(--want); }
.heart.on svg, .heart-btn.on svg { fill: currentColor; }
@media (hover: none) { .heart { opacity: 1; transform: none; } }
.heart-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.heart-btn.on { color: var(--want); border-color: var(--want); }
.pop svg { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.cap-actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Glimmer: a slow band of light that crosses a stamp now and then ---------- */
.glim { overflow: hidden; }
.wall-frame, .qshot .frame, .vw-zoom .glim { position: relative; }
.glim::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 42%, var(--glim) 50%, transparent 58%); background-size: 300% 100%; background-position: 130% 0; animation: glimmer var(--gd, 11s) ease-in-out infinite; animation-delay: var(--gdelay, 0s); }
@keyframes glimmer { 0%, 78% { background-position: 130% 0; } 100% { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .glim::after { animation: none; display: none; } }

/* ---------- Header extras ---------- */
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.theme-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn:hover { color: var(--ink); border-color: var(--line-2); }
.gcount { font: 500 11px var(--mono); color: var(--want); }
@media (max-width: 960px) { .top-actions { margin-left: 0; } }
@media (max-width: 600px) { .search-pill { margin-left: auto; } }

/* ---------- Gallery wall ---------- */
.gal-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 28px; margin-bottom: clamp(28px, 5vw, 56px); }
.gal-total { display: flex; gap: clamp(18px, 4vw, 44px); flex-wrap: wrap; }
.gal-total div { display: grid; gap: 2px; }
.gal-total b { font: 700 clamp(28px, 3.6vw, 44px)/1 var(--sans); letter-spacing: -.03em; }
.gal-total span { font-size: 12px; color: var(--ink-3); }
.wall { columns: 4 230px; column-gap: clamp(18px, 3vw, 40px); }
@media (max-width: 600px) { .wall { columns: 2; column-gap: 14px; } }
.wall-item { break-inside: avoid; display: grid; gap: 12px; width: 100%; margin: 0 0 clamp(26px, 4vw, 48px); padding: 0; border: 0; background: none; text-align: left; perspective: 900px; color: inherit; }
.wall-frame { display: grid; place-items: center; padding: clamp(18px, 3vw, 34px); background: var(--ground-2); border-radius: 4px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.wall-frame img { display: block; max-height: 320px; object-fit: contain; filter: var(--img-filter); transform: rotate(var(--r, 0deg)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.wall-item:hover .wall-frame { transform: rotateX(5deg) rotateY(-7deg) translateY(-4px); }
.wall-item:hover .wall-frame img { transform: rotate(0deg) scale(1.03); }
.wall-cap { display: grid; gap: 2px; padding-inline: 2px; }
.wall-cap b { font: 650 16px/1.25 var(--sans); }
.wall-cap span { font-size: 12.5px; color: var(--ink-3); }
.wall-cap .val { font: 500 12.5px var(--mono); color: var(--gold); }
.empty-hero { text-align: center; padding: clamp(40px, 8vw, 100px) 20px; }
.empty-hero svg { width: 44px; height: 44px; color: var(--want); margin-bottom: 14px; }
.empty-hero h2 { margin-bottom: 10px; }
.empty-hero p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 22px; }

/* ---------- Full-screen viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 66; background: radial-gradient(80% 60% at 50% 45%, var(--ground), var(--ground-2) 100%); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); animation: vwIn .3s ease-out; }
@keyframes vwIn { from { opacity: 0; } }
.vw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px clamp(14px, 3vw, 28px); }
.vw-count { font-size: 13px; color: var(--ink-3); }
.vw-actions { display: flex; gap: 8px; align-items: center; }
.vw-actions .heart-btn, .vw-actions .icon-btn, .vw-actions .hud-btn { background: var(--scrim); }
.vw-actions .heart-btn { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.vw-stage { position: relative; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.vw-stage.grabbing { cursor: grabbing; }
.vw-strip { position: absolute; inset: 0; will-change: transform; }
.vw-strip.anim { transition: transform .38s cubic-bezier(.2, .8, .2, 1); }
.vw-slide { position: absolute; top: 0; bottom: 0; width: 100%; display: grid; place-items: center; padding: clamp(14px, 4vw, 48px); }
.vw-slide[data-pos="-1"] { left: -100%; } .vw-slide[data-pos="0"] { left: 0; } .vw-slide[data-pos="1"] { left: 100%; }
.vw-zoom { position: relative; width: 100%; height: 100%; display: grid; place-items: center; transform-origin: 50% 50%; will-change: transform; }
.vw-zoom.anim { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.vw-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); -webkit-user-drag: none; pointer-events: none; }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--scrim); font-size: 24px; display: grid; place-items: center; }
.vw-nav.prev { left: clamp(10px, 2vw, 28px); } .vw-nav.next { right: clamp(10px, 2vw, 28px); }
.vw-nav[disabled] { opacity: .3; cursor: default; }
@media (hover: none) { .vw-nav { display: none; } }
.vw-info { padding: 6px clamp(16px, 4vw, 40px) 4px; display: grid; gap: 6px; text-align: center; justify-items: center; }
.vw-info h2 { font-size: clamp(24px, 3.4vw, 38px); }
.vw-info .meta { font-size: 13px; color: var(--ink-3); }
.vw-info p { margin: 0; color: var(--ink-2); max-width: 60ch; font-size: 14.5px; }
.vw-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.val-field { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; height: 38px; background: var(--scrim); }
.val-field span { color: var(--ink-3); font-size: 13px; }
.val-field input { width: 90px; border: 0; outline: none; background: transparent; font: 500 15px var(--mono); }
.vw-film { display: flex; gap: 8px; overflow-x: auto; padding: 10px clamp(14px, 3vw, 28px) 16px; scrollbar-width: none; scroll-padding-inline: 40%; }
.vw-film::-webkit-scrollbar { display: none; }
.vw-film button { flex: none; width: 58px; height: 58px; border-radius: 10px; border: 2px solid transparent; background: var(--ground-2); padding: 5px; opacity: .55; transition: opacity .2s, border-color .2s; }
.vw-film button img { width: 100%; height: 100%; object-fit: contain; }
.vw-film button.on { border-color: var(--gold); opacity: 1; }
@media (min-width: 1024px) and (orientation: landscape) {
  .viewer { grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .vw-top { grid-column: 1 / -1; }
  .vw-stage { grid-column: 1; grid-row: 2; }
  .vw-info { grid-column: 2; grid-row: 2; align-content: center; text-align: left; justify-items: start; padding-right: 36px; }
  .vw-row { justify-content: flex-start; }
  .vw-film { grid-column: 1 / -1; }
  .vw-film button { width: 72px; height: 72px; }
}
@media (min-width: 700px) and (max-width: 1023px) { .vw-film button { width: 68px; height: 68px; } }

/* ---------- Stamp checker ---------- */
.check-drop { border: 1.5px dashed var(--line-2); border-radius: 24px; padding: clamp(28px, 6vw, 64px) 20px; text-align: center; display: grid; justify-items: center; gap: 14px; background: var(--ground-2); transition: border-color .2s, background .2s; }
.check-drop.over { border-color: var(--gold); background: var(--glow); }
.check-drop svg.cam { width: 46px; height: 46px; color: var(--gold); }
.check-drop .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.check-note { font-size: 13px; color: var(--ink-3); max-width: 56ch; margin: 0; }
.queue { display: grid; gap: clamp(18px, 3vw, 28px); margin-top: 32px; }
.qcard { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: var(--ground); }
@media (max-width: 720px) { .qcard { grid-template-columns: 1fr; } }
.qshot { display: grid; gap: 10px; align-content: start; }
.qshot .frame { aspect-ratio: 1; background: var(--ground-2); border-radius: 14px; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden; }
.qshot .frame img, .qshot .frame canvas { max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); }
.qshot .row { display: flex; gap: 6px; flex-wrap: wrap; }
.qstate { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qbody h3 { font: 700 clamp(24px, 3vw, 34px)/1.08 var(--sans); margin-bottom: 6px; letter-spacing: -.03em; }
.qbody .facts { margin: 14px 0; }
.qbody .estimate { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }
.qbody .estimate b { color: var(--gold); font-weight: 500; font-family: var(--mono); }
.matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.matches button { aspect-ratio: 1; border: 2px solid transparent; border-radius: 10px; background: var(--ground-2); padding: 6px; }
.matches button img { width: 100%; height: 100%; object-fit: contain; }
.matches button.on { border-color: var(--gold); }
.qactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.qdone { color: var(--owned); font-size: 14px; font-weight: 500; }
.crop { position: fixed; inset: 0; z-index: 75; background: var(--ground); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.crop-stage { position: relative; display: grid; place-items: center; padding: 20px; overflow: hidden; touch-action: none; }
.crop-wrap { position: relative; max-width: 100%; max-height: 100%; }
.crop-wrap img { display: block; max-width: min(92vw, 900px); max-height: calc(100vh - 200px); }
.crop-box { position: absolute; border: 2px solid var(--gold); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); cursor: move; }
.crop-box i { position: absolute; width: 22px; height: 22px; background: var(--gold); border-radius: 50%; border: 3px solid var(--ground); }
.crop-box i[data-h="nw"] { left: -12px; top: -12px; cursor: nwse-resize; } .crop-box i[data-h="ne"] { right: -12px; top: -12px; cursor: nesw-resize; }
.crop-box i[data-h="sw"] { left: -12px; bottom: -12px; cursor: nesw-resize; } .crop-box i[data-h="se"] { right: -12px; bottom: -12px; cursor: nwse-resize; }
.crop-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; }
.api-banner { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; font-size: 14px; color: var(--ink-2); margin-top: 18px; background: var(--ground-2); }
.badge-est { font: 500 11px var(--sans); color: var(--ink-3); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }

/* ---------- Favorites + Collection buttons and their animations ---------- */
.fav-btn, .col-btn { position: relative; }
.fav-btn svg, .col-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.fav-btn.on { color: var(--want); border-color: color-mix(in srgb, var(--want) 55%, transparent); background: color-mix(in srgb, var(--want) 7%, var(--ground)); }
.fav-btn.on svg, .heart.on svg { fill: currentColor; }
.col-btn.on { color: var(--owned); border-color: color-mix(in srgb, var(--owned) 55%, transparent); background: color-mix(in srgb, var(--owned) 7%, var(--ground)); }
.col-btn.on { --tick: 0; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--want)); animation: burst .7s cubic-bezier(.15, .8, .3, 1) forwards; }
.burst b { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--c, var(--want)); animation: ring .55s ease-out forwards; }
@keyframes burst { 0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-30px) scale(.3); opacity: 0; } }
@keyframes ring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.flyer { position: fixed; z-index: 90; pointer-events: none; border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,.25); transition: transform .75s cubic-bezier(.5, 0, .2, 1), opacity .75s; transform-origin: 0 0; object-fit: contain; background: var(--ground); }
.bump { animation: bump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.nav a svg { width: 17px; height: 17px; vertical-align: -3px; margin-right: 5px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar svg.icon-line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 3D stage extras ---------- */
.flip-btn { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.flip-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .6s cubic-bezier(.5, 0, .2, 1); }
.flip-btn.on svg { transform: rotate(180deg); }
.stage.orbit .s3d { transition: none; }
.gum dd.typing::after, .gum h4.typing::after { content: ""; display: inline-block; width: .5em; height: 1em; margin-left: 1px; vertical-align: -2px; background: currentColor; opacity: .6; animation: caret .7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.stage-hud .hud-btn { font-size: 14.5px; padding: 10px 16px; font-weight: 600; }

/* ---------- Collections of the day ---------- */
.today { display: grid; gap: clamp(20px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) { .today { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.collage { position: relative; aspect-ratio: 5 / 4; width: 100%; max-height: 620px; border-radius: 28px; background: radial-gradient(70% 70% at 50% 45%, var(--ground), var(--ground-2)); overflow: hidden; display: block; text-decoration: none; }
.collage .cs { position: absolute; width: var(--w, 24%); left: var(--x); top: var(--y); transform: translate(-50%, -50%) rotate(var(--r)); animation: csIn .8s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--d); z-index: var(--z); }
.collage .cs span { display: block; animation: csFloat var(--f, 7s) ease-in-out infinite; animation-delay: var(--fd); }
.collage .cs img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: contain; filter: var(--img-filter); }
@keyframes csIn { from { opacity: 0; transform: translate(-50%, -50%) translate(var(--ix), var(--iy)) rotate(0deg) scale(.6); } }
@keyframes csFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(.8deg); } }
.collage.out .cs { opacity: 0; transform: translate(-50%, -50%) scale(.85); transition: opacity .35s, transform .35s; }
.today-copy h2 { font-size: clamp(34px, 4.6vw, 60px); }
.today-copy .lede { margin-top: 14px; }
.today-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.today-tabs button { border: 1.5px solid var(--line); background: var(--ground); border-radius: 999px; padding: 8px 14px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); position: relative; overflow: hidden; }
.today-tabs button.on { color: var(--ground); background: var(--ink); border-color: var(--ink); }
.today-tabs button.on::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; animation: tabTimer var(--t, 9s) linear forwards; }
@keyframes tabTimer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.today-date { font: 600 14px var(--sans); color: var(--gold); }

/* ---------- Set page: one stamp per panel, presentation style ---------- */
.set-hero { text-align: center; padding-block: clamp(20px, 5vw, 60px) 20px; }
.set-hero h1 { font-size: clamp(44px, 8vw, 110px); letter-spacing: -.05em; }
.set-hero .lede { margin-inline: auto; font-size: clamp(18px, 1.8vw, 22px); }
.slides { display: grid; gap: clamp(40px, 8vw, 120px); margin-top: clamp(30px, 6vw, 80px); }
.slidecard { display: grid; gap: clamp(20px, 4vw, 60px); align-items: center; }
@media (min-width: 860px) { .slidecard { grid-template-columns: 1.1fr 1fr; } .slidecard:nth-child(even) .sc-img { order: 2; } }
.sc-img { display: grid; place-items: center; aspect-ratio: 1; max-height: 70vh; background: var(--ground-2); border-radius: 28px; padding: clamp(24px, 6vw, 70px); position: relative; text-decoration: none; }
.sc-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); animation: csFloat 8s ease-in-out infinite; }
.sc-copy .num { font: 600 15px var(--sans); color: var(--gold); }
.sc-copy h2 { margin: 8px 0 10px; font-size: clamp(28px, 3.6vw, 46px); }
.sc-copy .meta { font-size: 16px; color: var(--ink-3); margin-bottom: 12px; }
.sc-copy p { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; color: var(--ink-2); margin: 0 0 20px; max-width: 46ch; }
.sc-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Notification banner ---------- */
.notice { position: fixed; z-index: 85; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 74px); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 12px 12px 14px; border-radius: 20px; background: var(--scrim); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line); box-shadow: 0 20px 50px -18px rgba(0,0,0,.35); animation: noticeIn .6s cubic-bezier(.2, 1.2, .3, 1); text-decoration: none; color: var(--ink); }
.notice img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: var(--ground-2); padding: 4px; }
.notice b { display: block; font-size: 15.5px; }
.notice span { font-size: 14px; color: var(--ink-2); }
.notice small { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; font-weight: 600; }
.notice .x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); font-size: 20px; }
.notice.out { animation: noticeOut .35s ease-in forwards; }
@keyframes noticeIn { from { opacity: 0; transform: translate(-50%, -30px) scale(.96); } }
@keyframes noticeOut { to { opacity: 0; transform: translate(-50%, -20px); } }
.dot-new { position: absolute; top: 6px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--want); box-shadow: 0 0 0 2px var(--ground); }
@media (prefers-reduced-motion: reduce) { .collage .cs, .collage .cs span, .sc-img img, .notice { animation: none; } }

.lang-btn { font: 600 15px var(--sans); }
:lang(zh-Hant) h1, :lang(zh-Hant) h2 { letter-spacing: 0; }
:lang(zh-Hant) body { line-height: 1.7; }

/* ---------- More air everywhere ---------- */
.section { margin-top: clamp(84px, 11vw, 168px); }
.head-xl { margin-bottom: clamp(26px, 4vw, 48px); }
.head-xl .lede { margin-top: 12px; }
.grid { gap: clamp(22px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
.v-caption { margin-bottom: 12px; }

/* ---------- Album cards: one big stamp per way in ---------- */
.albums { display: flex; gap: clamp(16px, 2.4vw, 32px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -20px; padding: 24px 20px 40px; scroll-padding-inline: 20px; }
.albums::-webkit-scrollbar { display: none; }
@media (max-width: 600px) { .albums { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; } }
.album { --k: 0; flex: none; width: clamp(270px, 30vw, 380px); aspect-ratio: 4 / 5.2; scroll-snap-align: center; position: relative; text-decoration: none; color: #fff; filter: drop-shadow(0 22px 30px rgba(17, 20, 24, .2)); transform: scale(calc(1 - var(--k) * .07)); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
@media (max-width: 700px) { .album { width: 78vw; } }
.album-art { position: absolute; inset: 0; display: block; padding: 9px; background: var(--ground); -webkit-mask: radial-gradient(circle 6px at center, #0000 96%, #000) -9px -9px / 18px 18px, linear-gradient(#000 0 0) content-box; mask: radial-gradient(circle 6px at center, #0000 96%, #000) -9px -9px / 18px 18px, linear-gradient(#000 0 0) content-box; transition: filter .4s; }
.album-img { position: absolute; inset: 9px; display: block; background: var(--ground-3) center / cover no-repeat; transform: scale(1.06); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1), opacity .6s; opacity: 0; }
.album-img.in { opacity: 1; }
.album-art::after { content: ""; position: absolute; inset: 9px; background: linear-gradient(180deg, rgba(10, 12, 16, 0) 35%, rgba(10, 12, 16, .78) 100%); }
.album:hover .album-img, .album:focus-visible .album-img { transform: scale(1.14); }
.album:hover { transform: scale(1.02) translateY(-4px); }
.album-copy { position: absolute; left: 30px; right: 30px; bottom: 30px; display: grid; gap: 8px; z-index: 2; }
.album-copy b { font: 800 clamp(34px, 3.6vw, 48px)/1 var(--sans); letter-spacing: -.04em; text-shadow: 0 2px 20px rgba(0,0,0,.35); }
.album-copy span:last-child { font-size: 16.5px; line-height: 1.45; color: rgba(255, 255, 255, .9); max-width: 30ch; font-weight: 500; }
.album-n { font: 650 13.5px var(--sans); letter-spacing: .02em; color: rgba(255, 255, 255, .8); }

/* ---------- World map ---------- */
.worldmap { position: relative; border-radius: 32px; overflow: hidden; background: var(--ground-2); aspect-ratio: 2.15 / 1; isolation: isolate; }
.wm-pattern { position: absolute; inset: -60px; z-index: 0; opacity: .5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='84' viewBox='0 0 72 84'%3E%3Cg fill='none' stroke='%2393701f' stroke-opacity='.22' stroke-width='1'%3E%3Crect x='14' y='14' width='44' height='56' rx='1'/%3E%3Crect x='20' y='20' width='32' height='44'/%3E%3C/g%3E%3Cg fill='%2393701f' fill-opacity='.16'%3E%3Ccircle cx='14' cy='22' r='2'/%3E%3Ccircle cx='14' cy='34' r='2'/%3E%3Ccircle cx='14' cy='46' r='2'/%3E%3Ccircle cx='14' cy='58' r='2'/%3E%3Ccircle cx='58' cy='22' r='2'/%3E%3Ccircle cx='58' cy='34' r='2'/%3E%3Ccircle cx='58' cy='46' r='2'/%3E%3Ccircle cx='58' cy='58' r='2'/%3E%3C/g%3E%3C/svg%3E"); background-size: 72px 84px; animation: drift 40s linear infinite; mask: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 85%); -webkit-mask: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 85%); }
@keyframes drift { to { transform: translate(72px, 84px); } }
.wm-zoom { position: absolute; inset: 4% 3%; z-index: 1; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.worldmap.zoomed .wm-zoom { transform: scale(1.45); }
.wm-svg { width: 100%; height: 100%; display: block; }
.wm-svg path { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.45; stroke-linecap: round; transition: stroke-opacity .5s; }
.worldmap.zoomed .wm-svg path { stroke-opacity: .32; }
.wm-pin { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; text-decoration: none; color: var(--ink); z-index: 2; transition: transform .4s cubic-bezier(.2, 1.4, .3, 1); }
.wm-pin i { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 22%, transparent); animation: pulse2 2.6s ease-in-out infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--gold) 0%, transparent); } }
.wm-pin b { font: 700 15px var(--sans); background: var(--ground); padding: 7px 12px; border-radius: 999px; box-shadow: 0 6px 18px rgba(17, 20, 24, .12); white-space: nowrap; letter-spacing: -.01em; }
.wm-pin span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; opacity: 0; transition: opacity .3s; }
.wm-pin.on { transform: translate(-50%, -50%) scale(.72); z-index: 3; }
.wm-pin.on b { background: var(--ink); color: var(--ground); }
.wm-pin.on span { opacity: 1; }
.region-tiles { display: none; }
@media (max-width: 1023px) {
  .worldmap { aspect-ratio: 1.9 / 1; border-radius: 24px; }
  .wm-pin b, .wm-pin span { display: none; }
  .wm-pin i { width: 10px; height: 10px; }
  .region-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
}
@media (max-width: 480px) { .region-tiles { grid-template-columns: 1fr 1fr; } }
.rtile { display: grid; gap: 6px; padding: 16px; border-radius: 20px; background: var(--ground-2); text-decoration: none; transition: transform .25s; }
.rtile:active { transform: scale(.97); }
.rtile svg { width: 100%; aspect-ratio: 1.6; }
.rtile svg path { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; }
.rtile b { font: 700 16.5px/1.2 var(--sans); }
.rtile span { font-size: 13.5px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .wm-pattern, .wm-pin i { animation: none; } }

@media (max-width: 1320px) and (min-width: 961px) { .search-pill { flex: none; } .search-pill span, .search-pill kbd { display: none; } .nav a { padding: 8px 9px; font-size: 15px; } }

/* =====================================================================
   v7: one heart, Gallery in 3D, Collection grid/list, topics, toggles
   ===================================================================== */

/* ---------- The heart: transparent glass on every stamp, red when it is yours ---------- */
.heart { opacity: 1; transform: none; width: 38px; height: 38px; top: 10px; right: 10px; background: rgba(255, 255, 255, .28); border: 1px solid rgba(255, 255, 255, .7); backdrop-filter: blur(8px) saturate(1.3); -webkit-backdrop-filter: blur(8px) saturate(1.3); color: #3a4049; box-shadow: 0 2px 10px rgba(17, 20, 24, .10); transition: background .2s, transform .2s, color .2s; cursor: pointer; }
.heart:hover { background: rgba(255, 255, 255, .6); transform: scale(1.06); }
.heart.on { color: #e2264d; background: rgba(255, 255, 255, .55); }
:root[data-theme="dark"] .heart { background: rgba(35, 39, 46, .35); border-color: rgba(255, 255, 255, .22); color: #e6e8eb; }
:root[data-theme="dark"] .heart.on { color: #ff5a79; }
.hx { position: relative; display: grid; place-items: center; width: 20px; height: 20px; }
.hx svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; overflow: visible; }
.heart.on .hx svg, .heart-btn.on .hx svg { fill: currentColor; }
.heart-btn { display: inline-flex; align-items: center; gap: 9px; }
.heart-btn.on { color: #e2264d; border-color: color-mix(in srgb, #e2264d 50%, transparent); background: color-mix(in srgb, #e2264d 6%, var(--ground)); }
/* the like animation: heart shrinks, a ring blooms, seven pairs of sparks fly out, the heart springs back */
.popping .hx svg { animation: heartSpring .62s cubic-bezier(.17, .89, .32, 1.49) both; }
@keyframes heartSpring { 0% { transform: scale(.2); } 40% { transform: scale(.2); } 75% { transform: scale(1.22); } 100% { transform: scale(1); } }
.pop-fx { position: absolute; inset: 0; pointer-events: none; }
.pop-fx .ring { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px; border-radius: 50%; border: 18px solid #e2264d; opacity: 0; animation: heartRing .5s ease-out forwards; }
@keyframes heartRing { 0% { transform: scale(.1); opacity: 1; border-color: #e2264d; border-width: 18px; } 60% { opacity: 1; border-color: #cd8aed; border-width: 2px; transform: scale(1.1); } 100% { transform: scale(1.3); opacity: 0; border-width: 0; } }
.pop-fx .spark { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)); }
.pop-fx .spark b { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--c); opacity: 0; animation: spark .62s .26s cubic-bezier(.2, .7, .3, 1) forwards; }
.pop-fx .spark b:first-child { left: -5px; }
.pop-fx .spark b:last-child { left: 2px; width: 4px; height: 4px; animation-delay: .3s; }
@keyframes spark { 0% { transform: translateY(-10px) scale(1); opacity: 1; } 100% { transform: translateY(-30px) scale(0); opacity: 0; } }
.flyer { transition: transform .75s cubic-bezier(.5, 0, .2, 1), opacity .75s; }
.stage-heart { top: 14px; right: 14px; width: 46px; height: 46px; z-index: 5; }
.stage-heart .hx svg { width: 22px; height: 22px; }
.vw-heart { position: static; width: 42px; height: 42px; }
.ledger-hint { margin: 14px 0 0; font-size: 15px; }
.ledger-cta { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--ink-2); }
.ledger-cta svg { width: 20px; height: 20px; flex: none; fill: none; stroke: #e2264d; stroke-width: 1.9; }
.heart-add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; margin-right: 6px; vertical-align: -3px; }
.tile .status { display: none; }

/* ---------- Stage: centred turn-over icon, loupe with an ON state ---------- */
.stage-hud { align-items: center; }
.stage-hud .flip-btn, .flip-btn { width: 46px; height: 46px; padding: 0; display: inline-grid; place-items: center; line-height: 0; flex: none; }
.flip-btn svg { display: block; margin: 0; width: 22px; height: 22px; transform-origin: 50% 50%; }
.stage-hud .hud-btn { height: 46px; display: inline-flex; align-items: center; justify-content: center; }
.loupe-btn { gap: 8px; position: relative; transition: background .25s, color .25s, border-color .25s, box-shadow .25s; }
.loupe-btn svg { width: 19px; height: 19px; display: block; }
.loupe-btn .on-tag { font: 700 10.5px/1 var(--sans); letter-spacing: .06em; font-style: normal; padding: 4px 6px; border-radius: 6px; background: var(--ground); color: var(--gold); display: none; }
.loupe-btn.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent), 0 8px 22px -6px color-mix(in srgb, var(--gold) 60%, transparent); }
.loupe-btn.on:hover { color: var(--gold-ink); }
.loupe-btn.on .on-tag { display: inline-block; }
.loupe { width: clamp(190px, 26vw, 280px); height: clamp(190px, 26vw, 280px); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--gold), 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 24px rgba(0, 0, 0, .18); image-rendering: auto; }
.loupe::after { content: attr(data-z); position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font: 600 11px var(--mono); color: #fff; background: rgba(0, 0, 0, .45); padding: 3px 7px; border-radius: 99px; }
.stage.looking { cursor: none; touch-action: none; }
.stage.looking .s3d { transform: none !important; }
@media (hover: none) { .loupe { width: 200px; height: 200px; } }
.stage-tip { transition: opacity .4s; }
.stage-tip.gone { opacity: 0; }
.stage { cursor: pointer; }
.stage.dragging { cursor: grabbing; }

/* ---------- Header toggles: language with flags, light and dark ---------- */
.top-actions { gap: 8px; }
.lang-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; height: 38px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--ground-2); cursor: pointer; isolation: isolate; }
.ls-knob { position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--ground); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 4px 12px -4px rgba(0,0,0,.2); transition: transform .38s cubic-bezier(.65, 0, .25, 1.3); }
.lang-switch.zh .ls-knob { transform: translateX(100%); }
.ls-opt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; height: 100%; font: 650 13px/1 var(--sans); color: var(--ink-3); transition: color .3s; white-space: nowrap; }
.lang-switch:not(.zh) .ls-en, .lang-switch.zh .ls-zh { color: var(--ink); }
.flag { width: 19px; height: 13px; border-radius: 2.5px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; transition: transform .38s cubic-bezier(.3, 1.6, .5, 1), filter .3s; filter: saturate(.35) opacity(.7); }
.lang-switch:not(.zh) .ls-en .flag, .lang-switch.zh .ls-zh .flag { filter: none; transform: scale(1.08); }
.lang-switch.going { pointer-events: none; }
.theme-switch { position: relative; width: 64px; height: 38px; border-radius: 999px; border: 1px solid var(--line-2); background: linear-gradient(180deg, #dbeafe, #fdf3d6); cursor: pointer; padding: 0; transition: background .5s; overflow: hidden; }
.theme-switch.dark { background: linear-gradient(180deg, #1e2533, #343c4c); }
.ts-knob { position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); display: grid; place-items: center; transition: transform .5s cubic-bezier(.65, 0, .25, 1.25), background .5s; }
.theme-switch.dark .ts-knob { transform: translateX(26px) rotate(360deg); background: #f2f3f5; }
.ts-knob svg { grid-area: 1 / 1; width: 17px; height: 17px; transition: opacity .35s, transform .5s cubic-bezier(.65, 0, .25, 1.25); }
.ts-sun { color: #c98a0b; }
.ts-moon { color: #3d4a63; opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-switch.dark .ts-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.theme-switch.dark .ts-moon { opacity: 1; transform: none; }
.theme-fade, .theme-fade * { transition: background-color .45s, color .45s, border-color .45s !important; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@media (max-width: 1200px) and (min-width: 961px) { .ls-opt { padding: 0 7px; font-size: 12px; } }
@media (max-width: 600px) { .ls-opt { padding: 0 7px; gap: 4px; font-size: 12px; } .ls-opt .flag { width: 16px; height: 11px; } .theme-switch { width: 56px; } .theme-switch.dark .ts-knob { transform: translateX(18px) rotate(360deg); } .search-pill span { display: none; } }

/* ---------- Collection: bold grid or a tidy list ---------- */
.col-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; margin-bottom: clamp(24px, 4vw, 44px); }
.col-head .lede { max-width: 52ch; }
.col-tools { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 63px); z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; margin-bottom: 20px; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.col-tools .field { flex: 1 1 200px; max-width: 340px; }
.col-tools .btn.gold { margin-left: auto; }
.col-sort { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--ground-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 9px; font: 600 14px var(--sans); color: var(--ink-3); cursor: pointer; transition: background .25s, color .25s; }
.seg button.on { background: var(--ground); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: clamp(22px, 3vw, 40px) clamp(16px, 2.4vw, 32px); }
@media (max-width: 600px) { .cgrid { grid-template-columns: 1fr 1fr; gap: 26px 14px; } }
.ctile { position: relative; display: grid; gap: 14px; min-width: 0; }
.ct-img { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 12%; border-radius: 18px; background: var(--ground-2); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.ct-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.ctile:hover .ct-img img { transform: translateY(-4px) scale(1.03); }
.ct-cap { display: grid; gap: 3px; text-decoration: none; color: var(--ink); padding-inline: 2px; }
.ct-cap b { font: 750 clamp(17px, 1.6vw, 20px)/1.2 var(--sans); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ct-cap span { font-size: 14px; color: var(--ink-3); }
.ct-cap .val, .cr-val input { font: 600 15px var(--mono); color: var(--gold); }
.clist { display: grid; border-top: 1px solid var(--line); }
.crow { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; align-items: center; gap: clamp(12px, 2vw, 24px); padding: 16px 0; border-bottom: 1px solid var(--line); }
.cr-img { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 14px; background: var(--ground-2); padding: 10px; }
.cr-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: var(--img-filter); }
.cr-text { display: grid; gap: 3px; text-decoration: none; color: var(--ink); min-width: 0; }
.cr-text b { font: 750 clamp(17px, 1.8vw, 21px)/1.2 var(--sans); letter-spacing: -.02em; }
.cr-text span { font-size: 14px; color: var(--ink-3); }
.cr-text .cr-cond { font-size: 13px; }
.cr-val { width: 130px; }
.crow .heart { position: static; }
@media (max-width: 600px) { .crow { grid-template-columns: 72px minmax(0, 1fr) auto; } .cr-img { width: 72px; height: 72px; } .cr-val { grid-column: 2; width: 100%; max-width: 160px; } .crow .heart { grid-row: 1; grid-column: 3; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.leaving { opacity: 0 !important; transform: scale(.94) !important; transition: opacity .35s, transform .35s !important; }
.col-foot { margin-top: 56px; display: grid; gap: 24px; }
.empty-hero svg { fill: none; stroke: #e2264d; stroke-width: 1.6; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Explore, topics, eras ---------- */
.doors4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.door4 { display: grid; gap: 8px; align-content: start; padding: clamp(22px, 3vw, 32px); border-radius: 22px; background: var(--ground-2); text-decoration: none; color: var(--ink); transition: transform .3s cubic-bezier(.2, .7, .2, 1), background .3s; }
.door4:hover { transform: translateY(-3px); background: var(--ground-3); }
.door4 svg { width: 32px; height: 32px; color: var(--gold); margin-bottom: 8px; }
.door4 b { font: 750 clamp(24px, 2.6vw, 30px)/1.1 var(--sans); letter-spacing: -.025em; }
.door4 span { color: var(--ink-2); font-size: 16px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: clamp(14px, 2vw, 24px); }
@media (max-width: 600px) { .tgrid { grid-template-columns: 1fr 1fr; } }
.tcard { display: grid; gap: 10px; text-decoration: none; color: var(--ink); }
.tc-img, .th-img, .dc-img { display: block; aspect-ratio: 1; border-radius: 18px; background: var(--ground-2) center / 62% no-repeat; transition: transform .4s cubic-bezier(.2, .7, .2, 1); position: relative; overflow: hidden; }
.tc-img.in, .th-img.in, .dc-img.in { animation: coverIn .6s ease both; }
@keyframes coverIn { from { background-size: 50%; opacity: .2; } }
.tcard:hover .tc-img { transform: translateY(-3px); }
.tcard b { font: 700 17px/1.2 var(--sans); letter-spacing: -.015em; }
.tgroup { margin-top: clamp(36px, 5vw, 60px); }
.tgroup .head { margin-bottom: 16px; }
.topic-hero { display: grid; grid-template-columns: clamp(110px, 16vw, 180px) minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; margin-bottom: 28px; }
.topic-hero h1 { margin: 0; }
.decades { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 2vw, 24px); }
.decade { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border-radius: 22px; background: var(--ground-2); text-decoration: none; color: var(--ink); transition: transform .3s cubic-bezier(.2, .7, .2, 1), background .3s; }
.decade:hover { transform: translateY(-3px); background: var(--ground-3); }
.dc-img { background-color: var(--ground); border-radius: 14px; }
.dc-copy { display: grid; gap: 4px; }
.dc-copy b { font: 800 clamp(28px, 3vw, 36px)/1 var(--sans); letter-spacing: -.035em; }
.dc-copy span { font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.year-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.year-strip .chip { flex: none; font-variant-numeric: tabular-nums; }
.era-countries summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.stage-heart { border-color: rgba(17, 20, 24, .14); background: rgba(255, 255, 255, .55); }

/* ---------- Country flags ---------- */
.country { display: flex; align-items: center; gap: 12px; }
.cflag { flex: none; display: inline-grid; place-items: center; width: 30px; height: 20px; border-radius: 4px; overflow: hidden; background: var(--ground-3); box-shadow: 0 0 0 1px var(--line); }
.cflag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cflag.none { background: repeating-linear-gradient(135deg, var(--ground-3) 0 4px, var(--ground-2) 4px 8px); }
.country .tag { margin-left: auto; }
.c-title { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.c-title .cflag { width: clamp(44px, 6vw, 66px); height: clamp(30px, 4vw, 44px); border-radius: 6px; }
.country { justify-content: flex-start; align-items: center; }
.country > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Gallery: an empty, softly lit gallery room; stamps in a row or a grid ---------- */
:root { --room-wall: #f6f5f2; --room-wall-2: #eeece7; --room-floor: #e6e3dc; --room-light: rgba(255, 248, 230, .9); --room-mat: #ffffff; --room-frame: #1b1d21; }
:root[data-theme="dark"] { --room-wall: #2a2e35; --room-wall-2: #24282e; --room-floor: #1d2025; --room-light: rgba(255, 236, 200, .10); --room-mat: #f4f2ec; --room-frame: #0e1013; }
body.gallery-mode { background: var(--room-wall); }
body.gallery-mode .foot { display: none; }
body.gallery-mode main { padding-bottom: 0; }
.groom { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .92; }
.groom i { position: absolute; display: block; }
.gr-wall { inset: 0; background: linear-gradient(180deg, var(--room-wall) 0%, var(--room-wall-2) 70%); }
.gr-floor { left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(180deg, color-mix(in srgb, var(--room-floor) 70%, transparent), var(--room-floor)); border-top: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); }
.gr-floor::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.gr-light { top: -12%; width: 46vw; height: 86%; background: radial-gradient(50% 60% at 50% 0%, var(--room-light), transparent 72%); filter: blur(6px); }
.gr-light.l1 { left: -10vw; } .gr-light.l2 { left: 27vw; } .gr-light.l3 { right: -10vw; }
.gal { position: relative; z-index: 1; min-height: calc(100svh - 64px - var(--tabbar)); display: flex; flex-direction: column; }
.gal-bar { max-width: 1240px; width: 100%; margin: 0 auto; padding: clamp(24px, 4vw, 48px) 20px 8px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.gal-bar h1 { margin: 0; }
.gal-bar p { margin: 6px 0 0; color: var(--ink-3); }
.gal-tools { display: flex; gap: 10px; }
.gal-views { display: inline-flex; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ground) 70%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gal-views button { width: 40px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: 9px; color: var(--ink-3); cursor: pointer; transition: background .25s, color .25s; }
.gal-views button svg { width: 20px; height: 20px; display: block; }
.gal-views button.on { background: var(--ground); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.gal-views button:hover:not(:disabled) { color: var(--ink); }
.gal-views button:disabled { opacity: .3; cursor: default; }
.gal-wrap { position: relative; flex: 1; display: flex; }
/* the frame: thin dark moulding, white mat, the stamp floating in the middle */
.g-frame { display: grid; place-items: center; background: var(--room-mat); padding: clamp(14px, 7%, 34px); border: 5px solid var(--room-frame); box-shadow: 0 2px 3px rgba(0,0,0,.12), 0 22px 40px -14px rgba(0,0,0,.35); transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s; }
.g-frame img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); pointer-events: none; -webkit-user-drag: none; }
.gs-item { text-decoration: none; color: var(--ink); display: grid; justify-items: center; align-content: center; gap: 16px; }
.gs-item:hover .g-frame { transform: translateY(-4px); box-shadow: 0 2px 3px rgba(0,0,0,.12), 0 32px 50px -16px rgba(0,0,0,.38); }
.gs-cap { display: grid; gap: 2px; text-align: center; max-width: 30ch; }
.gs-cap b { font: 700 16px/1.25 var(--sans); letter-spacing: -.01em; }
.gs-cap span { font-size: 13px; color: var(--ink-3); }
/* row: one line, scrolling left to right */
.gal.row .gal-strip { flex: 1; display: flex; align-items: center; gap: clamp(36px, 6vw, 96px); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: auto; padding: 24px max(20px, calc(50vw - var(--gh) * .4 - 10px)) calc(var(--tabbar) + 40px); scrollbar-width: none; overscroll-behavior-x: contain; }
.gal.row .gal-strip::-webkit-scrollbar { display: none; }
.gal.row .gal-strip.dragging { scroll-snap-type: none; cursor: grabbing; }
.gal.row .gs-item { flex: none; scroll-snap-align: center; }
.gal.row .g-frame { height: var(--gh); width: auto; aspect-ratio: 4 / 5; transition: height .45s cubic-bezier(.2, .7, .2, 1), transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s; }
.gal.row .g-frame img { width: 100%; height: 100%; }
.g-arrow { position: absolute; top: calc(50% - 30px); z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--ground) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); cursor: pointer; transition: opacity .3s, transform .25s, background .25s; }
.g-arrow svg { width: 22px; height: 22px; display: block; }
.g-arrow.prev { left: clamp(10px, 3vw, 40px); } .g-arrow.prev svg { transform: rotate(180deg); }
.g-arrow.next { right: clamp(10px, 3vw, 40px); }
.g-arrow:hover:not(:disabled) { background: var(--ground); transform: scale(1.06); }
.g-arrow:disabled { opacity: 0; pointer-events: none; }
.gal.grid .g-arrow { display: none; }
@media (hover: none) { .g-arrow { width: 44px; height: 44px; } }
/* grid: the whole collection at a glance */
.gal.grid .gal-strip { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 20px calc(var(--tabbar) + 60px); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--gw), 38vw), 1fr)); gap: clamp(28px, 4vw, 52px) clamp(18px, 3vw, 40px); align-items: end; }
.gal.grid .gs-item { align-content: end; }
.gal.grid .g-frame { width: 100%; aspect-ratio: 4 / 5; border-width: 4px; }
.gal.grid .g-frame img { width: 100%; height: 100%; }
.gal.grid .gs-cap b { font-size: 14.5px; }
.g-empty { margin: auto; padding: 40px 20px calc(var(--tabbar) + 60px); width: min(520px, 100%); text-align: center; }
.g-empty svg { width: 46px; height: 46px; fill: none; stroke: #e2264d; stroke-width: 1.6; }
.g-empty h2 { margin: 14px 0 10px; }
.g-empty p { color: var(--ink-2); font-size: 17px; }
