:root {
  font: 100%/1.5 system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #86868b;
  --text-3: #6e6e73;
  --accent: #0071e3;
  --accent-press: #0077ed;
  --accent-text: #ffffff;
  --gold: #f5b400;
  --gold-deep: #9a6d00;
  --hairline: rgba(0, 0, 0, 0.07);
  --chrome: rgba(251, 251, 253, 0.78);
  --chrome-edge: rgba(255, 255, 255, 0.55);
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.05), 0 24px 60px rgba(0, 0, 0, 0.14);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --r-sm: 0.75rem;
  --r-md: 1.125rem;
  --r-lg: 1.5rem;
}

* { margin: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: linear-gradient(180deg, #fbfbfd 0%, var(--bg) 22rem);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Content layer that gets pushed back while the payment sheet is up */
#push { will-change: transform; transform-origin: 50% 0; }

/* ---- Translucent chrome: content scrolls underneath ---- */
.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
/* Scroll edge effect instead of a hard divider */
.chrome::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto 0;
  height: 14px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), transparent);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
body.scrolled .chrome::after { opacity: 1; }

.chrome-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.8125rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.wordmark .mark { display: block; border-radius: 0.4375rem; }
.wordmark .tld { color: var(--text-2); font-weight: 600; }
.wordmark:hover { text-decoration: none; }
nav { display: flex; gap: 1.375rem; margin-left: auto; }
nav a {
  color: var(--text-3);
  font-size: 0.875rem;
  /* Vibrancy over translucent chrome: heavier weight + slight tracking bump */
  font-weight: 500;
  letter-spacing: 0.01em;
}
nav a:hover { text-decoration: none; color: var(--text); }
nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

main { max-width: 42rem; margin: 0 auto; padding: 3.5rem 1.25rem 4rem; }

/* ---- Hero: centered, balanced, tracking tightens as type grows ---- */
.hero { padding: 1.5rem 0 3rem; text-align: center; }
.eyebrow {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.display {
  font-size: clamp(2.625rem, 8.5vw, 4.375rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.grad { color: inherit; }
.subtitle {
  color: var(--text-3);
  font-size: 1.1875rem;
  line-height: 1.5;
  margin: 1.125rem auto 0;
  max-width: 30rem;
  letter-spacing: -0.008em;
  text-wrap: balance;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.625rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  border-radius: 999px;
  padding: 0.4375rem 0.9375rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.pill strong { color: var(--text); font-weight: 650; }
.live-dot {
  width: 0.5em; height: 0.5em;
  border-radius: 50%;
  background: #30d158;
  margin-right: 0.5em;
}

/* ---- Claim panel ---- */
.claim {
  background: var(--surface);
  border-radius: 1.75rem;
  padding: 1.625rem 1.625rem 1.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.07);
  margin-bottom: 2.5rem;
}
.claim-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.claim-top h2 { font-size: 1.1875rem; letter-spacing: -0.015em; font-weight: 700; }
.claim-price { color: var(--text-3); font-size: 1rem; }
.claim-price strong { color: var(--text); font-variant-numeric: tabular-nums; }
.claim-form { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.claim-form input {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 0.8125rem 1rem;
  min-width: 0;
  outline-offset: 2px;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.claim-form input:focus-visible { outline: 2px solid var(--accent); background: var(--surface); }
#site { flex: 2 1 12rem; }
.amount-field {
  flex: 1 1 7.5rem;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding-left: 1rem;
}
.amount-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--surface); }
.amount-field .currency { color: var(--text-2); font-weight: 500; }
.amount-field input {
  border: 0; background: none; padding-left: 0.25rem; flex: 1; width: 100%;
  font-variant-numeric: tabular-nums;
}
.amount-field input:focus-visible { outline: none; }
.preview[hidden] { display: none; }
.preview {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.875rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  will-change: transform, opacity;
}
.preview-icon {
  flex: 0 0 auto;
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.4375rem;
  overflow: hidden;
  background: var(--surface);
  display: grid; place-items: center;
}
.preview-icon { position: relative; }
.preview-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.preview-letter {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #fff; font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
}
.preview-main { min-width: 0; }
.preview-site { display: block; font-size: 0.875rem; font-weight: 600; letter-spacing: -0.005em; }
.preview-desc { display: block; font-size: 0.8125rem; line-height: 1.45; color: var(--text-3); }
/* Skeleton shimmer while the preview loads */
.sk {
  display: block;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.09) 50%, rgba(0,0,0,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.sk-site { width: 7rem; height: 0.8125rem; margin: 0.1875rem 0 0.25rem; }
.sk-desc { width: 16rem; max-width: 100%; height: 0.6875rem; margin-top: 0.375rem; }
.sk-short { width: 10rem; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.hint { font-size: 0.8125rem; color: var(--text-2); margin-top: 0.75rem; }
.error { color: #e30000; }

/* ---- Buttons: feedback on pointer-down, instant ---- */
.btn {
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 0.8125rem 1.625rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); background: var(--accent-press); }
.btn:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-press); }
}

/* ---- Leaderboard ---- */
.board { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.row-wrap { position: relative; list-style: none; will-change: transform; }
/* Action revealed by swiping a row left; fades/scales in with drag progress */
.row-action {
  position: absolute;
  inset: 0 0 0 auto;
  width: 6.5rem;
  border: 0;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}
.row {
  position: relative;
  will-change: transform;
  display: grid;
  grid-template-columns: 2.25rem 2.625rem 1fr auto;
  gap: 0.9375rem;
  align-items: center;
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.05);
}
.row-wrap:first-child .row {
  background: linear-gradient(180deg, #fffef9 0%, #fff8e6 100%);
  box-shadow: 0 1px 2px rgba(154, 109, 0, 0.08), 0 10px 26px rgba(154, 109, 0, 0.1);
}
.rank {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: 0.875rem;
  text-align: center;
  letter-spacing: 0.01em;
}
.row-wrap:first-child .rank { font-size: 1.125rem; }
.avatar {
  position: relative;
  width: 2.625rem; height: 2.625rem;
  border-radius: 0.8125rem;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: grid; place-items: center;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  font-size: 1.125rem;
  letter-spacing: 0;
}
.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 0.375rem;
  background: #fff;
  border-radius: inherit;
}
.row-main { min-width: 0; }
.row-site {
  font-weight: 600;
  font-size: 0.9688rem;
  letter-spacing: -0.008em;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-desc {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-3);
  margin-top: 0.0625rem;
}
.row-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 0.1875rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.row-right { text-align: right; }
.row-bid {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}
.row-claim {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0.25rem 0 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 160ms var(--ease-out);
}
.row-claim:active { transform: scale(0.95); }

.empty {
  text-align: center;
  color: var(--text-3);
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border-radius: 1.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
}
.empty-crown { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty strong { color: var(--text); }

footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  color: var(--text-2);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
}

.prose { max-width: 36rem; padding-top: 1.5rem; }
.prose h1 { margin-bottom: 1rem; }
.prose h2 { font-size: 1.25rem; letter-spacing: -0.015em; margin: 1.75rem 0 0.5rem; }
.prose p, .prose li { color: var(--text-3); font-size: 0.9688rem; line-height: 1.65; }
.prose ul { padding-left: 1.25rem; }
.prose strong { color: var(--text); }
.prose h3 { font-size: 1.0312rem; letter-spacing: -0.01em; margin: 1.25rem 0 0.25rem; }
.prose code { font-size: 0.875em; background: rgba(0, 0, 0, 0.045); padding: 0.1em 0.35em; border-radius: 0.375rem; }

/* Server-rendered board: the pre-hydration paint and the crawlable copy.
   app.js removes the list once the interactive rows exist. */
.ssr-board { margin: 0.75rem 0 0; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ssr-board li { color: var(--text-3); }
.ssr-board a { font-weight: 590; color: var(--text); }
.ssr-bid { font-weight: 640; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.ssr-note { margin-top: 1rem; font-size: 0.875rem !important; color: var(--text-2) !important; }
#ssr-board:empty { display: none; }

/* ---- Payment sheet: modal task → scrim + pushed-back content ---- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  will-change: opacity;
}
.sheet {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  width: min(100%, 24.5rem);
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  transform: translateX(-50%);
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--chrome-edge);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 1.375rem 1.5rem;
  will-change: transform, opacity;
  touch-action: none;
}
@media (min-width: 600px) {
  .sheet {
    bottom: auto;
    top: 50%;
    border-radius: var(--r-lg);
    --sheet-rest: -50%;
  }
  .sheet-grab { visibility: hidden; }
}
.sheet-grab {
  width: 2.25rem;
  height: 0.3125rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
  margin: 0.375rem auto 0.25rem;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 0.25rem;
}
.sheet-head h2 { font-size: 1.125rem; letter-spacing: -0.015em; }
.sheet-close {
  border: 0;
  background: var(--bg);
  color: var(--text-3);
  width: 1.875rem; height: 1.875rem;
  border-radius: 50%;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.sheet-close:active { transform: scale(0.92); }

.pay-amount {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 2.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.pay-unit { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-left: 0.375rem; letter-spacing: 0; }
.pay-sub { text-align: center; color: var(--text-2); font-size: 0.8125rem; margin-top: 0.25rem; }

.chains {
  display: flex;
  gap: 0.4375rem;
  overflow-x: auto;
  padding: 1rem 1.5rem 0.25rem 0;
  scrollbar-width: none;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
  /* Fade the right edge so it reads as scrollable */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}
.chains::-webkit-scrollbar { display: none; }
.chain {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.0625rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 0.875rem;
  padding: 0.4375rem 0.9375rem 0.375rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.chain:active { transform: scale(0.96); }
.chain .chain-fee {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chain[aria-checked="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
  font-weight: 600;
}
.chain[aria-checked="true"] .chain-fee { color: rgba(255, 255, 255, 0.7); font-weight: 500; }

.qr-card {
  width: fit-content;
  margin: 1rem auto 0;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 0.75rem;
  line-height: 0;
}
.addr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1rem;
  font: inherit;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 0.6875rem 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms var(--ease-out);
}
.addr:active { transform: scale(0.985); }
.addr code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.copy-label { flex: 0 0 auto; font-size: 0.75rem; font-weight: 600; color: var(--accent); }

.fee-line { text-align: center; font-size: 0.75rem; color: var(--text-2); margin-top: 0.75rem; font-variant-numeric: tabular-nums; }

.pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.spinner {
  width: 0.875rem; height: 0.875rem;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fallback {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 0.875rem;
}

.fine-print {
  text-align: center;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--text-2);
  margin-top: 0.875rem;
}
.sheet-done { text-align: center; padding: 1.5rem 0 0.5rem; }
.done-crown { font-size: 3rem; }
.sheet-done h3 { font-size: 1.5rem; letter-spacing: -0.02em; margin-top: 0.5rem; }
.sheet-done p { color: var(--text-3); margin: 0.375rem 0 1.25rem; }

/* ---- Reduced motion / transparency / contrast ---- */
@media (prefers-reduced-motion: reduce) {
  .btn, .row-claim, .chain, .addr, .sheet-close { transition: none; }
  .btn:active { transform: none; opacity: 0.8; }
  .row-claim:active, .chain:active, .addr:active, .sheet-close:active { transform: none; opacity: 0.7; }
  .chrome::after { transition: none; }
  .spinner { animation-duration: 1.8s; }
}
@media (prefers-reduced-transparency: reduce) {
  .chrome { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .scrim { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .chrome { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--text-2); }
  .row, .claim, .empty, .sheet { border-color: var(--text-2); }
}
