/* ============================================================
   BuildSpin — base: tokens, reset, scene, chrome
   ============================================================ */

:root {
  /* palette */
  --bg-0: #08060f;
  --bg-1: #0d0918;
  --bg-2: #140e24;
  --ink: #f4f1ff;
  --ink-dim: #a99fc4;
  --ink-faint: #8d84b0;

  --red: #ff3b5c;
  --red-hot: #ff5d78;
  --red-deep: #b91f3c;
  --gold: #ffc233;
  --gold-hot: #ffdd75;
  --gold-deep: #b9821a;
  --teal: #2de2c6;
  --teal-deep: #0f8f7c;
  --purple: #8b5cf6;

  --paper: #f6efdf;
  --paper-shade: #e8dfc8;
  --paper-ink: #241d16;
  --paper-faint: #6e6350;

  --metal-hi: #4a4360;
  --metal: #2a2440;
  --metal-lo: #171226;
  --metal-edge: #5d5480;

  --font-display: 'Bungee', 'Arial Black', sans-serif;
  --font-ui: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

  --glow-red: 0 0 6px rgba(255,59,92,.9), 0 0 18px rgba(255,59,92,.55), 0 0 42px rgba(255,59,92,.3);
  --glow-gold: 0 0 6px rgba(255,194,51,.9), 0 0 18px rgba(255,194,51,.5), 0 0 42px rgba(255,194,51,.28);
  --glow-teal: 0 0 6px rgba(45,226,198,.9), 0 0 18px rgba(45,226,198,.5), 0 0 40px rgba(45,226,198,.28);

  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-snap: cubic-bezier(.22,.9,.32,1.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--red); color: #fff; }

/* ---------- ambient scene ---------- */
.scene {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #171030 0%, var(--bg-0) 62%),
    var(--bg-0);
}
.scene__glow {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .16;
  animation: scene-breathe 9s ease-in-out infinite;
}
.scene__glow--red    { width: 46vw; height: 46vw; background: var(--red);    top: -12vw; left: -10vw; }
.scene__glow--teal   { width: 38vw; height: 38vw; background: var(--teal);   top: 20vh; right: -14vw; animation-delay: -3s; }
.scene__glow--purple { width: 52vw; height: 52vw; background: var(--purple); bottom: -20vw; left: 24vw; animation-delay: -6s; opacity: .12; }
@keyframes scene-breathe {
  0%, 100% { transform: scale(1); opacity: .13; }
  50%       { transform: scale(1.12); opacity: .2; }
}
.scene__grid {
  position: absolute; left: -20%; right: -20%; bottom: -6%; height: 44%;
  background-image:
    linear-gradient(rgba(139,92,246,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,.16) 1px, transparent 1px);
  background-size: 56px 44px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, rgba(0,0,0,.5), transparent 82%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.5), transparent 82%);
}
.scene__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(115% 100% at 50% 42%, transparent 55%, rgba(3,2,8,.75) 100%);
}

#fxCanvas {
  position: fixed; inset: 0; z-index: 85; /* above modals (80), below toast (90) */
  pointer-events: none; width: 100%; height: 100%;
}

/* ---------- topbar ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 44px) 0;
  max-width: 1280px; margin: 0 auto;
}
.topbar__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: .22em; font-size: 11px; color: var(--ink-dim);
}
.topbar__brand em { font-style: normal; color: var(--ink-faint); letter-spacing: .18em; font-weight: 500; }
.topbar__claw { width: 20px; height: 20px; color: var(--red); filter: drop-shadow(0 0 6px rgba(255,59,92,.7)); }

.topbar__controls { display: flex; align-items: center; gap: 12px; }

.quarters {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,194,51,.08);
  border: 1px solid rgba(255,194,51,.28);
  padding: 6px 14px 6px 8px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--gold-hot);
  cursor: default; user-select: none;
}
.quarters__coin {
  width: 22px; height: 22px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff3c8 0%, var(--gold) 42%, var(--gold-deep) 100%);
  box-shadow: inset 0 0 0 2.5px rgba(185,130,26,.65), 0 0 10px rgba(255,194,51,.5);
  position: relative;
}
.quarters__coin::after {
  content: "25"; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 8.5px; font-weight: 800; color: #7c5510; font-family: var(--font-mono);
}
.quarters.is-bump .quarters__coin { animation: coin-bump .5s var(--ease-spring); }
@keyframes coin-bump {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.35) rotate(18deg); }
  100% { transform: scale(1) rotate(0); }
}

.iconbtn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(244,241,255,.05);
  border: 1px solid rgba(244,241,255,.12);
  color: var(--ink-dim);
  transition: color .2s, border-color .2s, background .2s;
}
.iconbtn:hover { color: var(--ink); border-color: rgba(244,241,255,.3); background: rgba(244,241,255,.09); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn[aria-pressed="false"] { color: var(--ink-faint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  padding: 13px 22px; border-radius: 14px;
  text-decoration: none; white-space: nowrap;
  transition: transform .16s var(--ease-snap), box-shadow .2s, background .2s, border-color .2s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px) scale(.98); }

.btn--primary {
  background: linear-gradient(180deg, var(--red-hot) 0%, var(--red) 46%, var(--red-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 0 #7e1128, 0 10px 26px rgba(255,59,92,.36), inset 0 1px 0 rgba(255,255,255,.42);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #7e1128, 0 16px 34px rgba(255,59,92,.46), inset 0 1px 0 rgba(255,255,255,.42); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #7e1128, 0 6px 16px rgba(255,59,92,.3), inset 0 1px 0 rgba(255,255,255,.42); }

.btn--gold {
  background: linear-gradient(180deg, var(--gold-hot) 0%, var(--gold) 46%, var(--gold-deep) 100%);
  color: #3c2905;
  box-shadow: 0 4px 0 #7c5510, 0 10px 26px rgba(255,194,51,.32), inset 0 1px 0 rgba(255,255,255,.55);
}
.btn--gold:hover { transform: translateY(-2px); }

.btn--ghost {
  background: rgba(244,241,255,.05);
  border: 1px solid rgba(244,241,255,.16);
  color: var(--ink);
}
.btn--ghost:hover { background: rgba(244,241,255,.1); border-color: rgba(244,241,255,.34); transform: translateY(-1px); }

.btn--big { font-size: 17px; padding: 16px 30px; border-radius: 16px; }

/* ---------- steps strip ---------- */
.steps {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  max-width: 900px; margin: 44px auto 0; padding: 0 20px;
  color: var(--ink-dim); font-size: 14.5px;
}
.steps__item { display: flex; align-items: baseline; gap: 10px; }
.steps__item b {
  font-family: var(--font-display); font-size: 15px; color: var(--red);
  text-shadow: 0 0 12px rgba(255,59,92,.6);
}
.steps__sep { width: 44px; height: 1px; background: linear-gradient(90deg, transparent, rgba(244,241,255,.25), transparent); flex: none; }

/* ---------- slogans ---------- */
.slogans {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  max-width: 1080px; margin: 72px auto 0; padding: 0 20px;
}
.slogan {
  position: relative; border-radius: 18px; padding: 30px 26px;
  background: linear-gradient(165deg, rgba(244,241,255,.05), rgba(244,241,255,.015));
  border: 1px solid rgba(244,241,255,.1);
  overflow: hidden;
  transition: transform .25s var(--ease-snap), border-color .25s;
}
.slogan:hover { transform: translateY(-4px); }
.slogan::before {
  content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 2px; border-radius: 2px;
}
.slogan p {
  font-family: var(--font-display); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.35;
  text-transform: uppercase;
}
.slogan--red::before  { background: var(--red);  box-shadow: var(--glow-red); }
.slogan--gold::before { background: var(--gold); box-shadow: var(--glow-gold); }
.slogan--teal::before { background: var(--teal); box-shadow: var(--glow-teal); }
.slogan--red:hover  { border-color: rgba(255,59,92,.4); }
.slogan--gold:hover { border-color: rgba(255,194,51,.4); }
.slogan--teal:hover { border-color: rgba(45,226,198,.4); }
.slogan--red p  { color: #ffb9c6; text-shadow: 0 0 18px rgba(255,59,92,.45); }
.slogan--gold p { color: #ffe3a1; text-shadow: 0 0 18px rgba(255,194,51,.4); }
.slogan--teal p { color: #b8f7ec; text-shadow: 0 0 18px rgba(45,226,198,.4); }

/* ---------- footer ---------- */
.footer {
  max-width: 860px; margin: 64px auto 0; padding: 0 20px 60px;
  text-align: center; color: var(--ink-faint); font-size: 13.5px; line-height: 1.7;
}
.footer b { color: var(--ink-dim); letter-spacing: .1em; }
.footer__fine { margin-top: 8px; font-size: 12.5px; opacity: .8; }
.footer a { color: var(--ink-dim); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(8px);
  z-index: 90;
  background: linear-gradient(180deg, #211a38, #171128);
  border: 1px solid rgba(45,226,198,.45);
  color: var(--ink); font-weight: 600; font-size: 14.5px;
  padding: 13px 22px; border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 22px rgba(45,226,198,.18);
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s var(--ease-snap);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 404 ---------- */
.notfound { display: grid; place-items: center; min-height: 72vh; padding: 40px 20px; }
.notfound__sign { text-align: center; max-width: 560px; }
.notfound__lobster { width: 190px; margin: 0 auto 8px; }
.notfound h1 {
  font-family: var(--font-display); font-size: clamp(22px, 4vw, 34px);
  color: var(--red-hot); text-shadow: var(--glow-red); margin-bottom: 14px;
}
.notfound p { color: var(--ink-dim); font-size: 17px; margin-bottom: 28px; }

/* ---------- utility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.shake { animation: shake .5s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-7px) rotate(-.4deg); }
  35% { transform: translateX(6px) rotate(.4deg); }
  55% { transform: translateX(-4px); }
  75% { transform: translateX(3px); }
}
