:root {
  --night: #0a1330;
  --night-2: #0f1d45;
  --ink: #eef3ff;
  --ink-dim: #a9b6d6;
  --ink-faint: #6f7ea6;
  --gold: #f6c65b;
  --gold-deep: #d99a2b;
  --berry: #e0425a;
  --pine: #2e8b5f;
  --ice: #9fd0ff;
  --card: rgba(255, 255, 255, 0.045);
  --card-line: rgba(255, 255, 255, 0.09);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Fraunces", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px clamp(14px, 3vw, 32px);
  background: linear-gradient(to bottom, rgba(7, 12, 32, 0.92), rgba(7, 12, 32, 0.7));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-line);
}
.brand { font: 700 20px/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: 0.01em; white-space: nowrap; }
.brand-star { color: var(--gold); text-shadow: 0 0 12px rgba(246, 198, 91, 0.8); }
.sym { font: 600 12px/1 var(--ui); color: var(--ink-dim); margin-left: 6px; }
.countdown { display: flex; align-items: baseline; gap: 10px; justify-self: center; }
.cd-label { color: var(--ink-dim); font-size: 13px; }
.cd-units { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.cd-units i { font: 500 12px var(--ui); color: var(--ink-faint); margin: 0 8px 0 2px; font-style: normal; }
.wallet-wrap { justify-self: end; position: relative; }
.wallet-btn {
  font: 600 14px var(--ui); color: #1b1404;
  background: linear-gradient(180deg, #ffd978, var(--gold-deep));
  border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(246, 198, 91, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.wallet-btn:hover { transform: translateY(-1px); }
.wallet-btn:active { transform: scale(0.97); }
.wallet-btn.connected { background: rgba(255, 255, 255, 0.08); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }

/* ---------- Scene ---------- */

.scene-wrap { position: relative; }
.scene {
  position: relative;
  height: min(88vh, 880px); min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 50% 105%, rgba(159, 208, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at 80% -10%, rgba(120, 90, 255, 0.18), transparent 60%),
    linear-gradient(180deg, #060b1f 0%, #0b1638 45%, #142554 100%);
}
#tree-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.presents3d { position: absolute; z-index: 2; display: block; }
.float-3d {
  position: absolute; z-index: 8; pointer-events: none; transform: translate(-50%, -100%);
  font: 700 24px var(--display); color: #ffe7a3; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(5, 10, 30, 0.8), 0 0 18px rgba(246, 198, 91, 0.6);
  animation: float-up 2.6s var(--ease-out) forwards;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -80%) scale(0.85); }
  15% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -260%); }
}
.hint { margin-top: 10px; font-size: 12.5px; color: var(--ink-faint); }
.hint::before { content: "✋ "; }
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.sky {
  position: absolute; z-index: 4; pointer-events: none;
  top: clamp(20px, 5vh, 56px); left: clamp(16px, 4vw, 64px); right: clamp(16px, 4vw, 64px);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
}
.sky-left { max-width: 360px; }
.sky-right { display: grid; gap: 10px; justify-items: end; text-align: right; }
.kicker { color: var(--ink-dim); font-size: 14px; letter-spacing: 0.02em; }
.big-num {
  font: 900 clamp(48px, 7vw, 92px)/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: #fff6dc;
  text-shadow: 0 0 40px rgba(246, 198, 91, 0.45), 0 2px 0 rgba(0, 0, 0, 0.2);
  margin: 4px 0 6px;
  transition: color 300ms;
}
.big-num.bump { animation: bump 900ms var(--ease-out); }
@keyframes bump {
  0% { transform: scale(1); }
  25% { transform: scale(1.06); color: #fff; text-shadow: 0 0 60px rgba(246, 198, 91, 0.9); }
  100% { transform: scale(1); }
}
.big-num { transform-origin: left bottom; }
.sub { color: var(--ink-dim); font-size: 14px; max-width: 280px; }
.stat { display: grid; justify-items: end; }
.stat b { font: 700 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-dim); font-size: 12px; }
.stocking { width: 220px; margin-top: 6px; pointer-events: auto; }
.stocking-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-dim); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stocking-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.stocking-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, #ff5a72 0 8px, #fff 8px 16px);
  border-radius: inherit;
  transition: width 1200ms var(--ease-out);
}

.dry-badge {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6;
  font-size: 12px; color: #1b1404; background: var(--gold); padding: 4px 10px; border-radius: 999px; opacity: 0.85;
}

/* "Santa is checking the list" */
.checking {
  position: absolute; z-index: 7; left: 50%; top: 18%; transform: translateX(-50%);
  min-width: 300px; padding: 16px 22px; text-align: center;
  background: linear-gradient(180deg, #fbf3df, #efe0bb);
  color: #3b2a12; border-radius: 10px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(120, 80, 20, 0.25);
  animation: unroll 420ms var(--ease-out);
}
@keyframes unroll { from { opacity: 0; transform: translateX(-50%) translateY(-10px) scaleY(0.6); } }
.checking-title { font: 700 18px var(--display); margin-bottom: 8px; }
.reel { font: 600 22px var(--display); height: 32px; overflow: hidden; font-variant-numeric: tabular-nums; }
.reel .hit { color: #1d6b47; }
.reel .hit::before { content: "✓ "; color: #1d6b47; }

/* Tooltip over presents */
.tooltip {
  position: absolute; z-index: 8; pointer-events: none;
  min-width: 200px; max-width: 260px; padding: 10px 12px;
  background: rgba(8, 14, 36, 0.94); border: 1px solid var(--card-line); border-radius: 10px;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.8);
  font-size: 13px; transform: translate(-50%, calc(-100% - 14px));
}
.tooltip .who { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.tooltip .muted { color: var(--ink-dim); }
.tooltip b { font-variant-numeric: tabular-nums; }

/* Toasts */
.toast-layer { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); z-index: 9; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  padding: 9px 14px; border-radius: 999px; font-size: 14px; white-space: nowrap;
  background: rgba(8, 14, 36, 0.9); border: 1px solid var(--card-line);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  animation: toast-in 380ms var(--ease-out), toast-out 400ms ease-in 5.2s forwards;
}
.toast b { color: var(--gold); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- SVG scene pieces ---------- */

.twinkle { animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.bulb { animation: bulb var(--d, 2.4s) ease-in-out var(--delay, 0s) infinite; }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.star-glow { animation: star-glow 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes star-glow { 0%, 100% { opacity: 0.55; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.08); } }

.present { cursor: pointer; }
.present .inner { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 200ms var(--ease-out), filter 200ms; }
.present:hover .inner { transform: translateY(-4px) scale(1.06); filter: brightness(1.12); }
.present.opened { cursor: default; }
.present.opened .inner { filter: saturate(0.35) brightness(0.75); opacity: 0.8; }
.present.opened:hover .inner { transform: none; filter: saturate(0.5) brightness(0.85); }
.present.mine .inner { filter: drop-shadow(0 0 6px rgba(246, 198, 91, 0.95)) drop-shadow(0 0 14px rgba(246, 198, 91, 0.5)); }
.present.drop .inner { animation: drop 1100ms cubic-bezier(0.3, 0, 0.6, 1) both; }
@keyframes drop {
  0% { transform: translateY(-900px) rotate(-8deg); opacity: 0; }
  8% { opacity: 1; }
  62% { transform: translateY(0) rotate(0); }
  74% { transform: translateY(-26px) scaleY(1.04); }
  86% { transform: translateY(0) scaleY(0.94) scaleX(1.05); }
  100% { transform: translateY(0); }
}
.present.grow .inner { animation: grow 700ms var(--ease-out) var(--delay, 0s) both; }
@keyframes grow { 0% { transform: scale(1); } 40% { transform: scale(1.14) translateY(-3px); filter: brightness(1.35); } 100% { transform: scale(1); } }
.present.shake .inner { animation: shake 520ms ease-in-out both; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); }
}
.float-text { font: 700 26px var(--display); paint-order: stroke; stroke: rgba(5, 10, 30, 0.8); stroke-width: 5px; }

/* ---------- Panels ---------- */

.panels {
  display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 18px;
  padding: 26px clamp(14px, 3vw, 32px) 10px;
  max-width: 1320px; margin: 0 auto;
}
.panel {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 16px;
  padding: 18px 18px 14px; min-height: 360px;
  display: flex; flex-direction: column;
}
.panel header h2 { font: 700 22px var(--display); margin: 0 0 4px; }
.panel header p { margin: 0 0 14px; color: var(--ink-dim); font-size: 13.5px; }

/* Nice list: parchment */
.nice-list {
  background: linear-gradient(180deg, #fbf3df 0%, #f1e3c0 100%);
  color: #3b2a12; border: 0;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(120, 80, 20, 0.18), inset 0 0 60px rgba(160, 110, 40, 0.18);
}
.nice-list header p { color: #7a5f37; }
.nice-list h2 { color: #8e1d2c; }
.list { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow: auto; scrollbar-width: thin; }
.list li {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center;
  padding: 7px 4px; border-bottom: 1px dashed rgba(120, 80, 20, 0.25);
  font-size: 14px;
}
.list li.new { animation: write-in 900ms var(--ease-out); }
@keyframes write-in { from { background: rgba(246, 198, 91, 0.55); } }
.list .num { font: 700 13px var(--display); color: #a07c45; text-align: right; font-variant-numeric: tabular-nums; }
.list .name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.list .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list .when { color: #8b6d42; font-size: 12px; text-align: right; white-space: nowrap; }
.list li.opened .name span { text-decoration: line-through; text-decoration-color: rgba(142, 29, 44, 0.7); text-decoration-thickness: 2px; color: #8b6d42; }
.list li.mine { background: rgba(246, 198, 91, 0.35); }
.avatar { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; object-fit: cover; background: #ddd; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.tag.early { background: rgba(142, 29, 44, 0.12); color: #8e1d2c; }
.tag.xmas { background: rgba(29, 107, 71, 0.14); color: #1d6b47; }
.empty { color: var(--ink-faint); font-size: 14px; padding: 18px 4px; }
.nice-list .empty { color: #8b6d42; }

/* Early quote */
.quote { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.quote-col { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--card-line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.quote-col span { font-size: 12px; color: var(--ink-dim); }
.quote-col b { font: 700 26px var(--display); font-variant-numeric: tabular-nums; }
.quote-col em { font-style: normal; font-size: 12px; color: var(--ink-faint); }
.quote-col.wait { border-color: rgba(246, 198, 91, 0.35); background: rgba(246, 198, 91, 0.06); }
.quote-col.wait b { color: var(--gold); }
.quote-or { align-self: center; color: var(--ink-faint); font-size: 12px; }
.curve { width: 100%; height: auto; }
.curve text { font: 500 10px var(--ui); fill: var(--ink-faint); }
.mine { margin-top: 12px; border-top: 1px solid var(--card-line); padding-top: 12px; }
.mine h3 { margin: 0 0 8px; font: 700 16px var(--display); }
.mine ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mine li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.open-btn {
  font: 600 13px var(--ui); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(224, 66, 90, 0.5); background: rgba(224, 66, 90, 0.12); color: #ffd3da;
}
.open-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow: auto; scrollbar-width: thin; }
.activity li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--card-line); font-size: 13.5px; }
.activity li .ico { text-align: center; }
.activity li time { display: block; color: var(--ink-faint); font-size: 12px; }
.activity li a { font-size: 12px; }

/* How it works */
.how { max-width: 1320px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 32px) 10px; }
.how h2 { font: 700 26px var(--display); margin: 10px 0 12px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px 16px; color: var(--ink-dim); font-size: 14px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--berry); color: #fff; font: 700 13px var(--ui); margin-bottom: 8px; }
.steps li b { display: block; color: var(--ink); margin-bottom: 2px; }
.verify { color: var(--ink-dim); font-size: 13.5px; max-width: 820px; }
.foot { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 28px 16px 40px; }

/* ---------- Small screens ---------- */

@media (max-width: 980px) {
  .panels { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .bar { grid-template-columns: 1fr auto; padding: 10px 14px; gap: 6px 10px; }
  .brand { font-size: 18px; }
  .countdown { grid-column: 1 / -1; grid-row: 2; justify-self: start; gap: 8px; }
  .cd-units { font-size: 18px; }
  .wallet-btn { padding: 8px 13px; font-size: 13px; }
  .wallet-menu { position: fixed; left: 12px; right: 12px; top: 104px; }
  /* The stage fills the phone screen below the bar. */
  .scene { height: calc(100svh - 96px); min-height: 560px; }
  .sky { top: 14px; left: 14px; right: 14px; flex-direction: column; gap: 10px; }
  .sky-left { max-width: none; }
  .kicker { font-size: 13px; }
  .big-num { font-size: clamp(44px, 14vw, 60px); margin: 2px 0; }
  .sub { display: none; }
  .hint { margin-top: 4px; }
  /* Stats become one compact row under the big number. */
  .sky-right { width: 100%; grid-template-columns: repeat(3, auto) 1fr; align-items: end; justify-items: start; text-align: left; gap: 4px 14px; }
  .stat { justify-items: start; }
  .stat b { font-size: 17px; }
  .stat span { font-size: 11px; }
  .stocking { grid-column: 1 / -1; width: 100%; margin-top: 2px; }
  .mine-card { width: 100%; min-width: 0; margin-top: 10px; }
  .mc-total { font-size: 26px; }
  .dry-badge { bottom: 10px; font-size: 11px; white-space: nowrap; }
  .toast-layer { bottom: 40px; width: calc(100% - 24px); }
  .toast { white-space: normal; text-align: center; font-size: 13px; }
  .tooltip { max-width: 220px; }
  .panels { padding: 18px 12px 6px; gap: 14px; }
  .panel { min-height: 0; }
  .list, .activity { max-height: 340px; }
  .steps { grid-template-columns: 1fr; }
  .how { padding: 16px 12px; }
  .checking { min-width: 0; width: calc(100% - 40px); top: 40%; }
  .reel { font-size: 18px; }
  .open-dialog form { padding: 18px 16px 14px; }
  .od-actions { flex-direction: column-reverse; }
  .od-actions button { width: 100%; padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* "Your presents" card in the sky */
.mine-card {
  pointer-events: auto; display: inline-grid; gap: 2px; margin-top: 14px;
  padding: 10px 12px 10px 14px; border-radius: 14px; min-width: 250px;
  background: rgba(246, 198, 91, 0.12); border: 1px solid rgba(246, 198, 91, 0.45);
  box-shadow: 0 0 30px -8px rgba(246, 198, 91, 0.55);
  animation: toast-in 380ms var(--ease-out);
}
.mc-label { font-size: 12px; color: #ffe7a3; letter-spacing: 0.02em; }
.mc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mc-total { font: 800 30px/1.1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(246, 198, 91, 0.45); }
.mc-sub { font-size: 13px; color: #f3dfb0; font-variant-numeric: tabular-nums; }
.mine-card button {
  font: 700 12.5px var(--ui); color: #2a1a04; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, #ffd978, var(--gold-deep)); border: 0; border-radius: 999px; padding: 7px 12px;
  transition: transform 140ms var(--ease-out);
}
.mine-card button:active { transform: scale(0.95); }
.mine-card.none { background: rgba(255, 255, 255, 0.06); border-color: var(--card-line); box-shadow: none; }
.mine-card.none .mc-total { color: var(--ink-dim); text-shadow: none; font-size: 22px; }
.mine-card.none button { display: none; }
@media (max-width: 720px) { .mine-card { min-width: 0; } .mc-total { font-size: 24px; } }

/* Opening a present */
.open-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px;
  background: linear-gradient(180deg, #15224f, #0d1736); color: var(--ink);
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.open-dialog[open] { animation: dialog-in 320ms var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.open-dialog::backdrop { background: rgba(3, 7, 22, 0.6); backdrop-filter: blur(3px); }
.open-dialog form { padding: 22px 22px 18px; }
.od-model {
  height: 170px; margin: -6px -6px 4px; border-radius: 14px;
  background: radial-gradient(260px 140px at 50% 70%, rgba(246, 198, 91, 0.18), transparent 70%);
}
.od-model canvas { display: block; width: 100%; height: 100%; }
.open-dialog h3 { font: 700 24px var(--display); margin: 8px 0 6px; }
.open-dialog p { color: var(--ink-dim); font-size: 14px; margin: 0 0 14px; }
.od-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.od-compare div { border: 1px solid var(--card-line); background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 10px 12px; display: grid; }
.od-compare span { font-size: 12px; color: var(--ink-dim); }
.od-compare b { font: 700 24px var(--display); font-variant-numeric: tabular-nums; }
.od-compare .wait { border-color: rgba(246, 198, 91, 0.4); background: rgba(246, 198, 91, 0.07); }
.od-compare .wait b { color: var(--gold); }
.od-status { min-height: 20px; color: var(--ink) !important; }
.od-status.err { color: #ffb3c0 !important; }
.od-actions { display: flex; gap: 10px; justify-content: flex-end; }
.od-actions button { font: 600 14px var(--ui); border-radius: 999px; padding: 10px 16px; cursor: pointer; border: 0; transition: transform 140ms var(--ease-out), opacity 140ms; }
.od-actions button:active { transform: scale(0.97); }
.od-actions button[disabled] { opacity: 0.5; cursor: progress; }
.od-wait { background: linear-gradient(180deg, #ffd978, var(--gold-deep)); color: #2a1a04; }
.od-open { background: rgba(224, 66, 90, 0.16); color: #ffd3da; box-shadow: inset 0 0 0 1px rgba(224, 66, 90, 0.5) !important; }
.od-open.christmas { background: linear-gradient(180deg, #ffd978, var(--gold-deep)); color: #2a1a04; box-shadow: none !important; }

/* Wallet picker */
.wallet-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 230px;
  padding: 8px; border-radius: 14px; background: #0f1a40; border: 1px solid var(--card-line);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.8); display: grid; gap: 4px;
  animation: toast-in 220ms var(--ease-out);
}
.wm-title { font-size: 12px; color: var(--ink-dim); padding: 4px 8px 6px; }
.wallet-menu button, .wallet-menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font: 600 14px var(--ui); color: var(--ink); background: transparent; border: 0; text-align: left; cursor: pointer; text-decoration: none;
}
.wallet-menu button:hover, .wallet-menu a:hover { background: rgba(255, 255, 255, 0.07); }
.wallet-menu img { border-radius: 6px; }
.wallet-menu p { margin: 0 8px 4px; font-size: 13px; color: var(--ink-dim); }

/* Proof of funds */
.proof { margin: 22px 0 10px; padding: 16px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-line); }
.proof h3 { margin: 0 0 10px; font: 700 18px var(--display); }
.proof ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.proof li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14px; color: var(--ink-dim); }
.proof li b { color: var(--ink); }
.proof .ok { color: #7ee2a8; }
.proof .warn { color: var(--gold); }
.proof code { font-size: 12.5px; color: var(--ink); background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 5px; }

/* Buy on pump.fun */
.buy { display: flex; align-items: stretch; border-radius: 999px; box-shadow: 0 8px 24px -8px rgba(83, 222, 140, 0.55); }
.buy-btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 5px 10px 5px 8px; border-radius: 999px 0 0 999px;
  background: linear-gradient(180deg, #7cf5a8, #2fca6f); color: #062814;
  font: 800 15px var(--ui); letter-spacing: 0.01em;
  transition: transform 160ms var(--ease-out), filter 160ms;
}
.buy-btn:hover { filter: brightness(1.06); }
.buy-btn:active { transform: scale(0.97); }
.pill { width: 26px; height: 26px; flex: 0 0 26px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
.buy-ca { font: 700 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(6, 40, 20, 0.14); padding: 3px 8px; border-radius: 999px; }
.copy-ca {
  border: 0; cursor: pointer; padding: 0 12px; border-radius: 0 999px 999px 0;
  background: #24b261; color: #062814; font: 700 15px var(--ui);
  border-left: 1px solid rgba(6, 40, 20, 0.25);
}
.copy-ca:hover { filter: brightness(1.08); }
.copy-ca.copied { background: #f6c65b; }
@media (max-width: 720px) {
  .bar { grid-template-columns: 1fr auto; }
  .countdown { grid-column: 1; grid-row: 2; }
  .buy { grid-column: 2; grid-row: 2; justify-self: end; }
  .pill { width: 22px; height: 22px; flex-basis: 22px; }
  .buy-ca { font-size: 11px; padding: 2px 6px; }
  .bar { grid-template-columns: minmax(0, 1fr) auto; }
  .cd-label { display: none; }
  .countdown::before { content: "🎄"; font-size: 15px; margin-right: -2px; }
  .cd-units { font-size: 17px; white-space: nowrap; }
  .cd-units i { margin: 0 5px 0 1px; }
}
.buy-ca { white-space: nowrap; }

/* Scrollbars: thin, rounded, no track, coloured to match each panel */
.list, .activity {
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  padding-right: 6px;
}
.list { scrollbar-color: rgba(142, 29, 44, 0.35) transparent; }
.activity { scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
.list::-webkit-scrollbar, .activity::-webkit-scrollbar { width: 6px; }
.list::-webkit-scrollbar-track, .activity::-webkit-scrollbar-track { background: transparent; }
.list::-webkit-scrollbar-thumb { background: rgba(142, 29, 44, 0.35); border-radius: 999px; }
.list::-webkit-scrollbar-thumb:hover { background: rgba(142, 29, 44, 0.55); }
.activity::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
.activity::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
html { scrollbar-color: rgba(255, 255, 255, 0.18) #070d20; }

/* ---------- /program ---------- */
.doc-page { background: radial-gradient(1200px 600px at 50% -10%, rgba(120, 90, 255, 0.16), transparent 60%), var(--night); }
.doc-bar { grid-template-columns: auto 1fr auto auto; }
.doc-back { justify-self: end; color: var(--ink-dim); text-decoration: none; font-size: 14px; }
.doc-back:hover { color: var(--ink); }
.doc { max-width: 940px; margin: 0 auto; padding: 32px clamp(14px, 3vw, 28px) 10px; display: grid; gap: 18px; }
.doc-hero { padding: 18px 4px 8px; }
.doc-kicker { color: var(--gold); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px; }
.doc h1 { font: 800 clamp(30px, 5vw, 46px)/1.08 var(--display); margin: 0 0 12px; }
.doc-lede { color: var(--ink-dim); font-size: 16.5px; max-width: 720px; margin: 0 0 16px; }
.doc-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--card-line); color: var(--ink-dim); }
.badge.green { color: #8ff0b6; border-color: rgba(143, 240, 182, 0.35); background: rgba(83, 222, 140, 0.1); }
.badge.amber { color: #ffe08a; border-color: rgba(246, 198, 91, 0.4); background: rgba(246, 198, 91, 0.08); }
.doc-card { background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; padding: 20px 22px; }
.doc-card h2 { font: 700 22px var(--display); margin: 0 0 10px; }
.doc-card h3 { font: 700 15.5px var(--ui); margin: 16px 0 6px; }
.doc-card p, .doc-card li { color: var(--ink-dim); font-size: 14.5px; }
.doc-card b { color: var(--ink); }
.doc-note { color: var(--ink-faint) !important; font-size: 13.5px !important; }
.doc code { font: 500 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 5px; }
.addr-table { display: grid; gap: 2px; }
.addr-row { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--card-line); }
.addr-label { display: grid; gap: 2px; font-size: 14px; }
.addr-label span { color: var(--ink-faint); font-size: 12.5px; }
.addr-val { display: flex; align-items: center; gap: 8px; min-width: 0; }
.addr-val a { min-width: 0; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.addr-val code { color: var(--gold) !important; white-space: nowrap; }
.copy { flex: 0 0 auto; border: 1px solid var(--card-line); background: rgba(255, 255, 255, 0.05); color: var(--ink-dim); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.copy:hover { color: var(--ink); }
.live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.live-grid div { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--card-line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.live-grid b { font: 700 22px var(--display); font-variant-numeric: tabular-nums; }
.live-grid span { color: var(--ink-faint); font-size: 12.5px; }
.live-grid div:only-child { grid-column: 1 / -1; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #7ee2a8; font-weight: 700; }
.checks.warn li::before { content: "!"; color: var(--gold); left: 4px; }
.cando { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cando > div { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--card-line); border-radius: 12px; padding: 4px 16px 10px; }
.cando ul { padding-left: 18px; margin: 6px 0 0; display: grid; gap: 6px; }
.formula, .cmd {
  font: 500 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: #e9f0ff;
  background: #070d20; border: 1px solid var(--card-line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 6px 0 10px;
  white-space: pre-wrap; word-break: break-all;
}
.formula { white-space: pre; word-break: normal; }
.example { overflow-x: auto; }
.example table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.example th, .example td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--card-line); color: var(--ink-dim); white-space: nowrap; }
.example th { color: var(--ink-faint); font-weight: 600; font-size: 12px; }
.example td:last-child { color: var(--gold); }
.ix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ix article, .accounts article { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--card-line); border-radius: 12px; padding: 2px 16px 12px; }
.accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seed { font-size: 13px !important; }
.fields { width: 100%; border-collapse: collapse; font-size: 13px; }
.fields td { padding: 6px 4px; border-bottom: 1px solid var(--card-line); color: var(--ink-dim); vertical-align: top; }
.fields td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); font-size: 12.5px; width: 46%; }
.plain { padding-left: 18px; display: grid; gap: 6px; }
.limits { border-color: rgba(246, 198, 91, 0.25); }
.proof-more { margin: -4px 0 12px; font-size: 13.5px; }
@media (max-width: 720px) {
  .doc-bar { grid-template-columns: 1fr auto; }
  .doc-bar > span { display: none; }
  .addr-row { grid-template-columns: 1fr; gap: 6px; }
  .live-grid { grid-template-columns: 1fr 1fr; }
  .cando, .ix, .accounts { grid-template-columns: 1fr; }
  .doc-card { padding: 16px; }
}

/* Share-image mode (?shot): just the scene and a title card, for og.png */
.shot-card { display: none; }
.shot .bar, .shot .panels, .shot .how, .shot .foot, .shot .sky, .shot .dry-badge, .shot .toast-layer, .shot .checking, .shot .tooltip { display: none !important; }
.shot .scene { height: 100vh; min-height: 0; }
.shot .shot-card {
  display: grid; gap: 6px; position: absolute; z-index: 6; left: 56px; top: 64px; max-width: 470px;
}
.shot-tick { font: 700 22px var(--ui); color: #8ff0b6; letter-spacing: 0.02em; }
.shot-title { font: 900 128px/0.95 var(--display); color: #fff6dc; text-shadow: 0 0 50px rgba(246, 198, 91, 0.55), 0 3px 0 rgba(0, 0, 0, 0.25); }
.shot-line { font: 500 25px/1.35 var(--ui); color: #dfe6ff; margin-top: 10px; }
.shot-url { font: 700 22px var(--ui); color: var(--gold); margin-top: 12px; }
