:root {
  --bg: #151418;
  --bg-2: #1d1b21;
  --line: #2c2931;
  --ink: #f6efe9;
  --ink-2: #a79fa6;
  --ink-3: #6d6570;
  --pink: #f0a393;
  --pink-hot: #ff8b88;
  --pink-deep: #d9776a;
  --font: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --bar-h: 56px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--page-bg, var(--bg)); }
body {
  margin: 0;
  background: var(--page-bg, var(--bg)); /* shifts per section as you scroll (js/scroll.js) */
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: 56px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(var(--page-bg, var(--bg)) 20%, transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.logo {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 22px; letter-spacing: -0.02em; text-decoration: none;
}
.logo { color: var(--page-fg, var(--ink)); }
.logo b { font-weight: inherit; color: var(--page-accent, var(--pink)); }
/* the mark: three of her pink beanies, piled (logo.svg) */
.logo-mark { height: 1.45em; width: auto; margin: -0.2em 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--line);
  display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn .off { display: none; }
a.icon-btn { text-decoration: none; }
.topbar-social svg { width: 17px; height: 17px; }
/* phones: the top bar is full (logo, closet, mute, Connect); socials live in the footer there */
@media (max-width: 640px) { .topbar-social { display: none !important; } }
.icon-btn[aria-pressed="true"] .on { display: none; }
.icon-btn[aria-pressed="true"] .off { display: block; }
.btn-connect {
  height: 38px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--pink); color: #2a1512; font-weight: 600; font-size: 15px;
}
.btn-connect:hover { background: var(--pink-hot); }

/* hat closet button (top bar) */
.closet-btn {
  position: relative; height: 38px; padding: 0 12px 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1.5px solid var(--line); color: var(--ink-2);
  font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.closet-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.closet-btn svg { width: 20px; height: 20px; }
.closet-btn.has-new::after { /* unseen new hats */
  content: ''; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pink-hot); box-shadow: 0 0 0 2px var(--bg);
}

/* game-over share row */
.ov-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; pointer-events: auto; }
.ov-actions[hidden] { display: none; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg-2); font-weight: 600; font-size: 15px;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1), border-color 0.2s;
}
.share-btn:hover { transform: translateY(-2px); border-color: var(--pink); }
.share-btn.x { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.share-btn.x svg { width: 16px; height: 16px; fill: currentColor; }
.share-btn.ghost { background: transparent; }

/* ---------- the Hat Closet ---------- */
.closet {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 16px;
  background: rgba(10,9,12,0.7); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.25s;
}
.closet.open { opacity: 1; }
.closet-panel {
  width: min(880px, 100%); max-height: min(86vh, 900px); overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 28px; padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transform: translateY(24px) scale(0.98); transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.closet.open .closet-panel { transform: none; }
.closet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.closet-head .kicker { margin: 0 0 6px; }
.closet-head h2 { margin: 0; font-size: clamp(30px, 5vw, 44px); line-height: 1; letter-spacing: -0.02em; }
.closet-meter { display: flex; align-items: center; gap: 14px; margin: 18px 0 22px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.closet-bar {
  flex: 1; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--pink) calc(var(--f, 0) * 100%), var(--line) 0);
}
.closet-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.hat-card {
  position: relative; border-radius: 20px; padding: 12px 12px 14px; text-align: center;
  border: 1px solid var(--line); background: var(--bg);
}
.hat-card.got { background: radial-gradient(90% 70% at 50% 30%, rgba(240,163,147,0.12), transparent 70%), var(--bg); }
.hat-card.is-new { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink), 0 0 24px rgba(240,163,147,0.25); }
.hat-art { position: relative; aspect-ratio: 1.3; display: grid; place-items: center; overflow: hidden; }
.hat-art img { width: 118%; max-width: none; margin-top: -8%; filter: drop-shadow(0 8px 10px rgba(0,0,0,0.4)); }
.hat-card.locked .hat-art img { filter: brightness(0) invert(0.16); opacity: 0.9; } /* silhouette */
.hat-new {
  position: absolute; top: 4px; right: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--pink); color: #2a1512; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
}
.hat-card strong { display: block; font-size: 16px; margin-top: 4px; }
.hat-card p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.hat-card.locked strong { color: var(--ink-3); }
.closet-foot { margin: 18px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }

/* share-card preview */
.card-modal .closet-panel { width: min(760px, 100%); }
.card-preview {
  position: relative; margin: 20px 0 18px; aspect-ratio: 1200 / 675; border-radius: 18px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line);
}
.card-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-preview img:not([src]) { visibility: hidden; }
.card-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.card-actions [hidden] { display: none; }
@media (max-width: 520px) {
  .closet-panel { padding: 22px 16px; border-radius: 22px; }
  .closet-grid { grid-template-columns: repeat(2, 1fr); }
  .closet-btn { padding: 0 10px 0 8px; font-size: 13px; }
}
.btn-connect:disabled { opacity: 0.7; cursor: wait; }
.btn-connect.is-connected {
  background: var(--bg-2); color: var(--ink); border: 1.5px solid var(--line);
  font-variant-numeric: tabular-nums; padding-left: 28px; position: relative;
}
.btn-connect.is-connected::before {
  content: ''; position: absolute; left: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: #2fbf71; box-shadow: 0 0 8px #2fbf71;
}
.btn-connect.is-connected:hover { border-color: var(--pink); background: var(--bg-2); }
.wallet { position: relative; }
.wallet-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.wm-addr {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-2);
  word-break: break-all; padding: 8px 10px;
}
.wm-status {
  margin: 0 4px 6px; padding: 10px; border-radius: 12px; background: rgba(47,191,113,0.1);
  color: #7fe0a8; font-weight: 600; font-size: 14px;
}
.wm-status.pending { background: rgba(240,163,147,0.1); color: var(--pink); }
#wm-verify { color: var(--pink); }
.wm-status span { display: block; color: var(--ink-2); font-weight: 500; font-size: 12px; margin-top: 2px; }
.wallet-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px; border-radius: 10px; font-weight: 600;
}
.wallet-menu button:hover { background: var(--line); }
#wm-disconnect { color: var(--pink-hot); }

.toast {
  position: fixed; left: 50%; top: 68px; z-index: 40;
  transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; max-width: calc(100% - 32px); text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- hero / game ---------- */
.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(240,163,147,0.10), transparent 70%),
    var(--bg);
}
#game {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: manipulation; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none;
}

.hud {
  position: absolute; top: 64px; left: 0; right: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.45); /* stays readable on the brighter skies */
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; text-align: center;
}
.world-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-3);
}
.world-num {
  font-size: clamp(28px, 6vw, 44px); font-weight: 700; line-height: 1.05;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.online {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 13px; font-weight: 600; color: #7fe0a8;
}
.online[hidden] { display: none; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #2fbf71;
  box-shadow: 0 0 0 0 rgba(47,191,113,0.6); animation: livepulse 1.6s infinite;
}
@keyframes livepulse { 70% { box-shadow: 0 0 0 8px rgba(47,191,113,0); } 100% { box-shadow: 0 0 0 0 rgba(47,191,113,0); } }
/* contract address pill: only on the title + game-over screens (never mid-game), only once live */
.hero-ca {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; pointer-events: auto;
  height: 32px; padding: 0 12px 0 5px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(29,27,33,0.85); border: 1px solid var(--line); color: var(--ink-2);
  font-variant-numeric: tabular-nums; transition: border-color 0.2s, color 0.2s;
}
.hero-ca:hover { border-color: var(--pink); color: var(--ink); }
.hero-ca-label { background: var(--pink); color: #2a1512; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.hero-ca svg { width: 15px; height: 15px; }
.hero[data-state="playing"] .hero-ca, .hero[data-state="collapsing"] .hero-ca { display: none; }
.me { margin-top: 10px; }
.me-score {
  font-size: clamp(64px, 16vw, 120px); font-weight: 700; line-height: 0.9;
  font-variant-numeric: tabular-nums;
  transition: transform 0.12s ease-out;
}
.me-score.bump { transform: scale(1.14); }
.me-sub { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.me-sub #bank { color: var(--pink); font-weight: 600; }
.hero[data-state="title"] .me { visibility: hidden; }

.overlay {
  position: absolute; left: 0; right: 0; top: 38%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  pointer-events: none; padding: 0 16px;
  animation: pop 0.35s cubic-bezier(.2,1.4,.4,1) both;
}
.ov-kicker { font-size: 15px; color: var(--ink-2); letter-spacing: 0.04em; }
.ov-big {
  font-size: clamp(38px, 9vw, 72px); font-weight: 700; line-height: 1;
  color: var(--pink); letter-spacing: -0.01em; margin-top: 4px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
#ov-title .ov-big { animation: breathe 1.6s ease-in-out infinite; }
.ov-score { font-size: 22px; font-weight: 600; margin-top: 12px; }
.ov-hint { font-size: 14px; color: var(--ink-3); margin-top: 10px; }
.ov-best { font-size: 16px; color: var(--ink-2); margin-top: 6px; min-height: 1.2em; }
.ov-best.is-new { color: #ffd35c; font-weight: 700; font-size: 22px; animation: breathe 0.8s ease-in-out infinite; }
.me-sub #bank { display: inline-block; }
.me-sub #bank.cha-ching { animation: chaching 0.6s cubic-bezier(.2,1.6,.4,1); color: #ffd35c; }
@keyframes chaching { 0% { transform: scale(1); } 30% { transform: scale(1.8) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { transform: scale(1.05); } }

.ov-rank { font-size: 15px; color: var(--pink); font-weight: 600; margin-top: 4px; min-height: 1.2em; }

/* ---------- live feed ticker ---------- */
.feed {
  position: absolute; left: 50%; bottom: calc(var(--bar-h) + 14px); transform: translateX(-50%);
  width: min(520px, calc(100% - 110px)); display: flex; justify-content: center;
  pointer-events: none; z-index: 9;
}
.feed-line {
  display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: center;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
  background: rgba(21,20,24,0.72); backdrop-filter: blur(6px); border: 1px solid var(--line);
  opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.35s;
}
.feed-line.in { opacity: 1; transform: none; }
.feed-line strong { color: var(--ink); }
.feed-line .flag { width: 18px; height: 13.5px; }
.feed-zone { color: var(--pink); font-weight: 600; }
.tier-gold { color: #f0cf6a !important; }
.tier-diamond { color: #8fd3ff !important; }

/* ---------- leaderboard drawer (popcat-style) ---------- */
.drawer {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%); z-index: 10;
}
.drawer-bar {
  width: 100%; height: var(--bar-h); padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(29,27,33,0.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
}
.drawer-me { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.flag { border-radius: 3px; object-fit: cover; }
.rank { color: var(--pink); }
.drawer-title { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 15px; }
.drawer-title svg { width: 18px; height: 18px; transition: transform 0.25s; }
.drawer.open .drawer-title svg { transform: rotate(180deg); }
.drawer-panel {
  max-height: 0; overflow: hidden;
  background: rgba(29,27,33,0.97);
  border-inline: 1px solid var(--line);
  transition: max-height 0.3s ease;
}
.drawer.open .drawer-panel { max-height: min(60svh, 440px); overflow-y: auto; }
.tabs { display: flex; gap: 6px; padding: 4px 16px 10px; }
.tabs button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 999px;
  color: var(--ink-3); font-weight: 600;
}
.tabs button[aria-selected="true"] { background: var(--line); color: var(--ink); }
.board { list-style: none; margin: 0; padding: 0 8px; }
.board li {
  display: grid; grid-template-columns: 34px 28px 1fr auto; align-items: center; gap: 8px;
  padding: 9px 8px; border-radius: 10px; font-variant-numeric: tabular-nums;
}
.board li.mine { background: rgba(240,163,147,0.12); }
.board li.empty { display: block; color: var(--ink-3); text-align: center; padding: 18px 8px; }
.board .pos { color: var(--ink-3); font-weight: 600; text-align: right; }
.board .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .val { font-weight: 600; }
.tier { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.tier.bronze { background: #3a2a22; color: #d7a07a; }
.tier.gold { background: #3a3220; color: #f0cf6a; }
.tier.diamond { background: #1f3140; color: #8fd3ff; }
.board-note { font-size: 12px; color: var(--ink-3); text-align: center; padding: 10px 16px 16px; margin: 0; }

.scroll-cue {
  position: absolute; right: 16px; bottom: calc(var(--bar-h) + 12px);
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-3);
  border: 1.5px solid var(--line);
}
.scroll-cue svg { width: 20px; height: 20px; }

/* ================= below the fold: the story ================= */
/* motion helpers — only active when JS added .motion (and the visitor allows motion) */
.kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--pink); margin: 0 0 20px;
}
.motion [data-reveal] {
  opacity: 0; transform: translate3d(0, 44px, 0);
  transition: opacity 0.9s cubic-bezier(.2,.8,.2,1) var(--d, 0s), transform 0.9s cubic-bezier(.2,.8,.2,1) var(--d, 0s);
}
.motion [data-reveal].in { opacity: 1; transform: none; }

/* film grain over everything, very faint — makes flat colours feel expensive */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the tilted marquee and floating hats poke past the screen edges on purpose — clip them so
   phones never get a sideways-scrolling (wider-than-screen) page */
main { overflow-x: clip; }

/* while the page colour is light (the pink tagline moment), flip anything that would vanish on it */
.btn-connect, .icon-btn, .closet-btn, .stat, .stat-num, .stat-label { transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.on-light .btn-connect { background: #1f1216; color: var(--pink); }
.on-light .icon-btn, .on-light .closet-btn { color: #1f1216; border-color: rgba(31,18,22,0.25); }
.on-light .stat { background: rgba(31,18,22,0.07); border-color: rgba(31,18,22,0.15); }
.on-light .stat-num, .on-light .stat:first-child .stat-num { color: #1f1216; }
.on-light .stat-label { color: rgba(31,18,22,0.7); }

/* ---- the lore ---- */
.manifesto { position: relative; max-width: 1100px; margin: 0 auto; padding: 24vh 24px 20vh; }
.manifesto > p { position: relative; z-index: 1; }
.scrub {
  font-size: clamp(30px, 5.4vw, 72px); font-weight: 700; line-height: 1.08;
  letter-spacing: -0.02em; margin: 0; max-width: 20ch;
}
.motion .scrub .w { opacity: 0.16; }
.float-hat {
  position: absolute; pointer-events: none; z-index: 0; will-change: transform;
  filter: drop-shadow(0 24px 30px rgba(0,0,0,0.55));
}
.fh1 { width: clamp(110px, 14vw, 200px); top: 12%; right: 4%; }
.fh2 { width: clamp(70px, 9vw, 130px); bottom: 8%; left: 1%; opacity: 0.55; filter: blur(1.5px); }
.fh3 { width: clamp(60px, 7vw, 100px); top: 52%; right: 18%; opacity: 0.35; filter: blur(3px); }

/* ---- marquee ---- */
.marquee { transform: rotate(-2.2deg); margin: 0 -40px; }
.marquee-row {
  overflow: hidden; white-space: nowrap; padding: 16px 0;
  font-weight: 700; font-size: clamp(24px, 3.6vw, 44px); letter-spacing: 0.01em;
  background: var(--pink); color: #2a1512;
}
.marquee-row.alt {
  background: transparent; color: transparent; -webkit-text-stroke: 1.5px var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.marquee-track { display: inline-flex; will-change: transform; }
.marquee-track span { flex: none; }

/* ---- the rules of the pile (pinned) ---- */
/* Everything in here is scrubbed by scroll position in js/scroll.js (no timed transitions), so every
   bit of scrolling visibly moves something — it never feels "stuck". */
.ccc { position: relative; height: 280vh; margin-top: 12vh; }
.ccc-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  max-width: 1180px; margin: 0 auto; padding: 80px 24px 32px;
  display: flex; flex-direction: column;
}
.ccc-head { display: flex; justify-content: space-between; align-items: center; }
.ccc-head .kicker { margin: 0; }
.ccc-dots { display: flex; gap: 8px; }
.ccc-dots i {
  width: 44px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pink) calc(var(--f, 0) * 100%), var(--line) 0);
}
.ccc-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.ccc-text { position: relative; }
.ccc-letter {
  position: absolute; left: -0.06em; top: 50%; transform: translateY(-52%);
  font-size: clamp(220px, 32vw, 460px); font-weight: 700; line-height: 0.8;
  color: transparent; -webkit-text-stroke: 2px rgba(240,163,147,0.2); user-select: none;
}
.ccc-words { list-style: none; margin: 0; padding: 0 0 0 clamp(48px, 9vw, 130px); display: grid; position: relative; }
.ccc-words li { grid-area: 1 / 1; opacity: 0; will-change: transform, opacity; }
.ccc-words li:first-child { opacity: 1; } /* before JS runs */
.ccc-words h3 { font-size: clamp(40px, 5.4vw, 84px); line-height: 0.98; margin: 0 0 18px; letter-spacing: -0.03em; max-width: 12ch; }
.ccc-words h3::first-letter { color: var(--pink); }
.ccc-words p { font-size: clamp(17px, 1.6vw, 22px); color: var(--ink-2); max-width: 24ch; line-height: 1.45; margin: 0; }
.ccc-words strong { color: var(--pink); }

.ccc-visual { position: relative; height: min(64vh, 540px); }
.v { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; will-change: transform, opacity; }
.v-cap { opacity: 1; } /* before JS runs */

.ccc-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3);
  pointer-events: none;
}
.ccc-hint svg { width: 20px; height: 20px; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }
.v-glow {
  position: absolute; width: 75%; aspect-ratio: 1; border-radius: 50%; filter: blur(24px);
  background: radial-gradient(circle, rgba(240,163,147,0.38), transparent 65%);
}
.v-glow.gold { background: radial-gradient(circle, rgba(255,211,92,0.32), transparent 65%); }
.v-cap img {
  position: relative; width: min(92%, 460px); animation: bob 5s ease-in-out infinite;
  /* the photo is cropped at the chest: fade it out instead of a hard edge */
  -webkit-mask-image: linear-gradient(#000 62%, transparent 92%); mask-image: linear-gradient(#000 62%, transparent 92%);
}
@keyframes bob { 50% { transform: translateY(-14px) rotate(1.5deg); } }

.v-coin { perspective: 1000px; }
.coin { position: relative; width: min(66%, 330px); aspect-ratio: 1; transform-style: preserve-3d; } /* spun by scroll */
.coin-face {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; backface-visibility: hidden;
  display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, #fff1bf, #f2bd45 42%, #b57d19 100%);
  box-shadow: inset 0 0 0 10px rgba(255,255,255,0.2), inset 0 0 0 17px rgba(150,95,15,0.45), 0 30px 60px rgba(0,0,0,0.45);
}
.coin-face.front img {
  width: 104%; transform: translateY(-2%); filter: sepia(0.35) saturate(1.1);
  -webkit-mask-image: linear-gradient(#000 70%, transparent 92%); mask-image: linear-gradient(#000 70%, transparent 92%);
}
.coin-face.back { transform: rotateY(180deg); }
.coin-face.back span { font-size: clamp(110px, 14vw, 190px); font-weight: 700; color: #8a5a10; text-shadow: 0 3px 0 #ffe08a; }

.tower { position: relative; width: min(52%, 250px); height: 88%; transform-origin: 50% 100%; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.tower img { position: absolute; left: 50%; width: 100%; translate: -50% 0; filter: drop-shadow(0 10px 14px rgba(0,0,0,0.4)); }
.tower img:nth-child(1) { bottom: 0%;  rotate: -2deg; --i: 0; }
.tower img:nth-child(2) { bottom: 13%; rotate: 3deg;  --i: 1; margin-left: 6%; }
.tower img:nth-child(3) { bottom: 26%; rotate: -4deg; --i: 2; margin-left: -4%; }
.tower img:nth-child(4) { bottom: 39%; rotate: 2deg;  --i: 3; margin-left: 5%; }
.tower img:nth-child(5) { bottom: 52%; rotate: -3deg; --i: 4; margin-left: -6%; }
.tower img:nth-child(6) { bottom: 65%; rotate: 5deg;  --i: 5; margin-left: 3%; }
/* hats drop onto the tower as you scroll (js/scroll.js sets translate/opacity per hat) */

/* ---- tagline ---- */
.tagline-band { max-width: 1300px; margin: 0 auto; padding: 18vh 24px 10vh; text-align: center; }
.big-words {
  font-size: clamp(46px, 9.4vw, 156px); line-height: 0.94; letter-spacing: -0.04em;
  text-transform: uppercase; margin: 0; color: var(--page-fg, var(--ink));
}
.big-words .w { display: inline-block; will-change: transform, opacity; }
.motion .big-words .w { opacity: 0; }
.big-words em { font-style: normal; color: var(--page-accent, var(--pink)); }

/* ---- live stats ---- */
.stats { max-width: 1100px; margin: 0 auto; padding: 6vh 24px 16vh; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat {
  padding: 34px 28px; border-radius: 26px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01));
  display: flex; flex-direction: column; gap: 8px;
}
.stat-num { font-size: clamp(42px, 5.2vw, 68px); font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat:first-child .stat-num { color: var(--pink); }
.stat-label { color: var(--ink-2); font-size: 15px; }

/* ---- the coin ---- */
.token {
  max-width: 1100px; margin: 0 auto; padding: 4vh 24px 18vh;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start;
}
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.token-card {
  position: sticky; top: 96px; isolation: isolate; overflow: hidden;
  padding: 44px 40px; border-radius: 32px; border: 1px solid var(--line);
  background: radial-gradient(120% 120% at 0% 0%, rgba(240,163,147,0.16), transparent 55%), var(--bg-2);
}
.token-card::before { /* a light that travels around the card's border */
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: conic-gradient(from var(--spin), transparent 0 65%, var(--pink) 82%, #ffd35c 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: borderspin 6s linear infinite;
}
@keyframes borderspin { to { --spin: 360deg; } }
.token-card { container-type: inline-size; } /* lets the ticker size itself to the card, not the screen */
.token-name {
  /* "$PILEDOG" is long: scale with the card's width so it can never spill out of it */
  font-size: clamp(40px, 6vw, 88px); font-size: min(110px, 16.5cqw);
  line-height: 0.9; margin: 0; letter-spacing: -0.045em; white-space: nowrap;
  background: linear-gradient(100deg, #ffe0d6, var(--pink) 35%, var(--pink-hot) 60%, #ffd35c 80%, #ffe0d6);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s ease-in-out infinite;
}
@keyframes shine { 50% { background-position: 100% 0; } }
.token-sub { color: var(--ink-2); margin: 12px 0 30px; font-size: 18px; }
.ca {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px;
}
.ca-label { color: var(--ink-3); font-weight: 600; }
.ca code { font-family: ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.ca-copy { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--line); font-weight: 600; }
.ca-copy:disabled { opacity: 0.5; cursor: default; }

.steps { position: relative; padding-left: 38px; }
.steps-line { position: absolute; left: 11px; top: 30px; bottom: 30px; width: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.steps-line i { position: absolute; inset: 0; transform-origin: top; transform: scaleY(0); background: linear-gradient(var(--pink), var(--pink-hot)); }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li {
  position: relative; display: flex; gap: 20px; padding: 24px 26px;
  border-radius: 22px; border: 1px solid var(--line); background: var(--bg-2);
}
.steps li.in { transition: opacity 0.9s cubic-bezier(.2,.8,.2,1) var(--d, 0s), transform 0.5s cubic-bezier(.2,.8,.2,1), border-color 0.3s; }
.steps li.in:hover { transform: translateX(6px); border-color: rgba(240,163,147,0.45); }
.steps li::before {
  content: ''; position: absolute; left: -33px; top: 30px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--pink);
}
.step-n { font-size: 14px; font-weight: 700; color: var(--pink); letter-spacing: 0.1em; padding-top: 5px; }
.steps strong { font-size: 20px; }
.steps p { margin: 4px 0 0; color: var(--ink-2); line-height: 1.45; }

/* ---- footer ---- */
.foot {
  position: relative; overflow: hidden; text-align: center; padding: 20vh 24px 0;
  border-top: 1px solid var(--line);
  background: radial-gradient(60% 55% at 50% 100%, rgba(240,163,147,0.16), transparent 70%);
}
.foot-big { font-size: clamp(48px, 15vw, 260px); font-weight: 700; line-height: 0.84; letter-spacing: -0.045em; margin: 0; white-space: nowrap; }
.foot-big .l { display: inline-block; }
.motion .foot-big .l {
  opacity: 0; transform: translate3d(0, 55%, 0) rotate(10deg);
  transition: opacity 0.5s ease calc(var(--i) * 45ms), transform 0.9s cubic-bezier(.3,1.5,.5,1) calc(var(--i) * 45ms);
}
.motion .foot-big.in .l { opacity: 1; transform: none; }
.foot-sub { color: var(--pink); font-weight: 700; letter-spacing: 0.22em; margin: 22px 0 0; }
.socials { display: flex; justify-content: center; gap: 12px; margin: 40px 0 28px; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px;
  text-decoration: none; font-weight: 600; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line);
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), border-color 0.3s, background 0.3s;
}
.socials a:hover { transform: translateY(-3px); border-color: var(--pink); background: #25222a; }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.foot-small { font-size: 12px; color: var(--ink-3); max-width: 520px; margin: 0 auto; line-height: 1.5; }
/* the dog peeks up from the bottom, and her hats stack on as you scroll (js/scroll.js) */
.foot-stack {
  --w: min(420px, 78vw);
  position: relative; left: 50%; width: var(--w); aspect-ratio: 1;
  /* room above for the stack (--above is measured from the actual hats), chest tucked below the edge */
  margin: calc(var(--w) * var(--above, 1.15) + 28px) 0 calc(var(--w) * -0.1);
  transform: translate3d(-50%, 70%, 0); pointer-events: none; will-change: transform;
  z-index: 1;
}
/* footer text stays in front of hats falling past it */
.foot-big, .foot-sub, .socials, .foot-small, .stack-again { position: relative; z-index: 2; }

.stack-again {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 32px;
  padding: 16px 30px; border-radius: 999px; text-decoration: none;
  background: var(--pink); color: #2a1512; font-weight: 700; font-size: 20px;
  box-shadow: 0 10px 30px rgba(240,163,147,0.3);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s, background 0.25s;
}
.stack-again:hover, .motion .stack-again.in:hover { transform: translateY(-3px) scale(1.03); background: var(--pink-hot); box-shadow: 0 14px 40px rgba(240,163,147,0.45); }

/* floating "back to the game" pill — shows once the game has scrolled away */
.back-to-game {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 18px 0 14px;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px;
  background: var(--pink); color: #2a1512; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0; transform: translateY(20px) scale(0.9); pointer-events: none;
  transition: opacity 0.3s, transform 0.35s cubic-bezier(.2,.8,.2,1), background 0.3s, color 0.3s;
}
.back-to-game.show { opacity: 1; transform: none; pointer-events: auto; }
.back-to-game:hover { background: var(--pink-hot); }
.back-to-game svg { width: 20px; height: 20px; }
.on-light .back-to-game { background: #1f1216; color: var(--pink); } /* stays visible on the pink tagline */
@media (max-width: 520px) { .back-to-game span { display: none; } .back-to-game { width: 50px; height: 50px; padding: 0; justify-content: center; } }
.foot-dog { position: relative; display: block; width: 100%; filter: drop-shadow(0 -10px 40px rgba(0,0,0,0.5)); }
.foot-hats { position: absolute; inset: 0; z-index: 1; transform-origin: 54% 38%; } /* pivots on her head */
.foot-hats.done { animation: footsway 3.4s ease-in-out infinite; }
@keyframes footsway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.foot-hats img {
  position: absolute; display: block; max-width: none; opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35));
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .ccc { height: 260vh; }
  .ccc-hint { bottom: 14px; }
  .ccc-sticky { padding-top: 72px; }
  .ccc-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 12px; align-content: center; }
  .ccc-visual { order: -1; height: 36svh; }
  .ccc-letter { font-size: 170px; }
  .ccc-words { padding-left: 64px; }
  .ccc-words h3 { font-size: 38px; margin-bottom: 10px; }
  .token { grid-template-columns: 1fr; gap: 28px; }
  .token-card { position: relative; top: 0; padding: 34px 24px; }
  .stats { grid-template-columns: 1fr; }
  .fh3 { display: none; }
}
@media (max-width: 720px) {
  .logo { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .ccc *, .token *, .foot *, .token-card::before { animation: none !important; }
}
