:root {
  --radius: .625rem;
  --background: oklch(14.5% .018 272);
  --foreground: oklch(97% .004 270);
  --card: oklch(18.8% .021 271);
  --primary: oklch(62% .205 277);
  --primary-foreground: oklch(99% .005 270);
  --secondary: oklch(24.5% .022 270);
  --secondary-foreground: oklch(95% .005 270);
  --muted: oklch(23.5% .02 270);
  --muted-foreground: oklch(70% .022 268);
  --destructive: oklch(65% .19 22);
  --success: oklch(70% .15 158);
  --border: oklch(100% 0 0 / .09);
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--background); color: var(--foreground); }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg.i { width: 1em; height: 1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 0 16px; font-size: 14px; color: var(--muted-foreground); }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2px solid oklch(70% .022 268 / .3); border-top-color: var(--foreground); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

.page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.card { width: 100%; max-width: 28rem; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); }
.card-header { display: flex; flex-direction: column; gap: 6px; padding: 24px; text-align: center; }
.card-content { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.lock-circle { margin: 0 auto; width: 48px; height: 48px; border-radius: 50%; background: oklch(62% .205 277 / .1); display: grid; place-items: center; color: var(--primary); font-size: 24px; }
.title { margin-top: 8px; font-size: 18px; font-weight: 600; line-height: 1; letter-spacing: -.025em; }
.handle { font-size: 12px; color: var(--muted-foreground); }
.muted { color: var(--muted-foreground); }

.media { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(to bottom right, var(--muted), var(--secondary)); }
.media > img.full, .media > video.full { width: 100%; height: 100%; object-fit: contain; background: #000; }
.media .blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); filter: blur(24px); }
.media .fill { position: absolute; inset: 0; }
.media .shade { position: absolute; inset: 0; background: rgb(0 0 0 / .3); }
.media .locked-label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; color: rgb(255 255 255 / .9); font-size: 12px; text-shadow: 0 1px 2px rgb(0 0 0 / .5); }
.media .locked-label svg { font-size: 40px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .4)); }
.media .corner { position: absolute; top: 8px; right: 8px; z-index: 2; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; border: 1px solid transparent; padding: 2px 10px; font-size: 12px; font-weight: 600; line-height: 16px; }
.badge svg { font-size: 12px; }
.badge.ok { background: #10b981; color: #fff; }
.badge.pending { background: #f59e0b; color: #fff; }
.badge.locked { background: oklch(65% .19 22 / .15); border-color: oklch(65% .19 22 / .3); color: var(--destructive); }

.message { font-size: 14px; font-style: italic; color: var(--muted-foreground); }
.row { display: flex; align-items: center; justify-content: space-between; }
.row .label { font-size: 14px; color: var(--muted-foreground); }
.row .price { font-size: 18px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 40px; padding: 0 32px; border-radius: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .15s, opacity .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.btn.primary { background: var(--primary); color: var(--primary-foreground); }
.btn.primary:hover { background: oklch(62% .205 277 / .9); }
.btn.secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn:disabled { opacity: .5; pointer-events: none; }
.note { font-size: 10px; text-align: center; color: var(--muted-foreground); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.confirming { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 500; }
.confirming + p { text-align: center; font-size: 12px; color: var(--muted-foreground); }
.success-text { text-align: center; font-size: 14px; font-weight: 500; color: #059669; }
.info { text-align: center; font-size: 14px; color: var(--muted-foreground); }

/* album viewer */
.viewer { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; color: #fff; }
.viewer.window { position: fixed; z-index: 50; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.viewer .stage { position: relative; flex: 1; min-height: 0; touch-action: pan-y; }
.viewer .stage img, .viewer .stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: rgb(0 0 0 / .5); color: #fff; display: grid; place-items: center; font-size: 20px; line-height: 1; }
.viewer .nav.prev { left: 4px; } .viewer .nav.next { right: 4px; }
.viewer .bar { height: 40px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 12px; }
.viewer .count { justify-self: start; font-size: 11px; font-variant-numeric: tabular-nums; color: rgb(255 255 255 / .8); }
.viewer .dots { display: flex; align-items: center; gap: 6px; }
.viewer .dot { height: 6px; width: 6px; border-radius: 999px; background: rgb(255 255 255 / .5); transition: all .2s; }
.viewer .dot.on { width: 16px; background: #fff; }
.viewer .fs { justify-self: end; margin-right: -6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: rgb(255 255 255 / .9); font-size: 16px; }
.viewer .fs:hover { background: rgb(255 255 255 / .15); }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(92vw, 360px); }
.toast { padding: 12px 16px; border-radius: 8px; background: oklch(21.5% .023 271); border: 1px solid var(--border); color: var(--foreground); font-size: 14px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / .3); animation: toast-in .2s ease-out; }
.toast.error { border-color: oklch(65% .19 22 / .4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
