/* Absolutely Clowned: Clown Mode.
   Red nose = Abstract cost you. Gold nose = it paid you. Primaries everywhere else, white underneath. */
@font-face { font-family: 'Titan One'; src: url('/fonts/titan-one-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --red: #ff3b30;
  --red-ink: #d92a20;   /* red text on white (AA) */
  --yellow: #ffd23f;
  --blue: #2f5bff;
  --green: #1fc46b;
  --green-ink: #0b7a3e; /* green text on white (AA) */
  --ink: #16130f;
  --grey: #6b6259;
  --white: #ffffff;
  --pink-soft: #ffe0dc;
  --yellow-soft: #fff3c4;
  --blue-soft: #dfe7ff;
  --green-soft: #d8f6e6;
  --track: #f1ebe4;

  --nose-red: radial-gradient(circle at 34% 30%, #ff9d93 0 9%, #ff5b50 22%, var(--red) 52%, #c4170e 100%);
  --nose-gold: radial-gradient(circle at 34% 30%, #fff4c2 0 9%, var(--yellow) 30%, #f2b705 62%, #b88400 100%);

  --display: 'Titan One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Fredoka', ui-rounded, system-ui, sans-serif;

  --boing: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-mid: 300ms;
  --t-slow: 700ms;
  --pop-shadow: 4px 4px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { position: relative; margin: 0; min-height: 100vh; background: var(--white); color: var(--ink); font: 500 16px/1.45 var(--body); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stripe { height: 16px; background: repeating-linear-gradient(90deg, var(--red) 0 60px, var(--yellow) 60px 120px, var(--blue) 120px 180px, var(--green) 180px 240px); }
.dots { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.masthead, main { z-index: 1; }
.dots i { position: absolute; border-radius: 50%; }
.dots i:nth-child(1) { width: 76px; height: 76px; left: -34px; top: 120px; background: var(--yellow); }
.dots i:nth-child(2) { width: 120px; height: 120px; right: -50px; top: 170px; background: var(--blue); }
.dots i:nth-child(3) { width: 90px; height: 90px; right: -44px; top: 660px; background: var(--red); }
.dots i:nth-child(4) { width: 100px; height: 100px; left: -40px; top: 760px; background: var(--green); }
.dots i:nth-child(5) { width: 70px; height: 70px; right: -30px; top: 1320px; background: var(--yellow); }

/* ---- masthead: big on the homepage, compact once a report is showing */
.masthead { position: relative; width: min(100% - 32px, 1120px); margin: 0 auto; padding: 56px 0 8px; text-align: center; }
.logo { display: inline-block; text-decoration: none; font: 400 clamp(2.3rem, 8.4vw, 5.6rem)/0.95 var(--display); letter-spacing: 0.01em; }
.logo-nose {
  display: inline-block; width: 0.72em; height: 0.72em; margin: 0 0.02em; vertical-align: -0.04em; border-radius: 50%;
  background: var(--nose-red); box-shadow: inset -0.05em -0.06em 0 rgba(0, 0, 0, 0.08);
}
.hero-copy { margin-top: 18px; }
.lede { margin: 0; font: 400 clamp(1.25rem, 3.6vw, 1.9rem)/1.15 var(--display); }
.order { display: flex; gap: 10px; max-width: 620px; margin: 28px auto 0; }
.order input {
  flex: 1; min-width: 0; padding: 15px 22px; border: 3px solid var(--ink); border-radius: 999px; background: var(--white);
  font-size: 17px; font-weight: 500;
}
.order input::placeholder { color: #9a8f83; }
.order input:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.order input[aria-invalid='true'] { border-color: var(--red); }
.btn, .order button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-height: 54px; padding: 0 26px; border: 3px solid var(--ink); border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--red); color: var(--white); font: 400 20px/1 var(--display); letter-spacing: 0.01em; box-shadow: var(--pop-shadow);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background var(--t-fast);
}
.btn:hover, .order button:hover { transform: translate(-1px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active, .order button:active { transform: translate(3px, 3px) scale(0.98, 0.94); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible, .order button:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.white { background: var(--white); color: var(--ink); }
.order button[disabled] { opacity: 0.65; cursor: progress; }
.error-line { max-width: 620px; margin: 18px auto 0; text-align: center; color: var(--red-ink); font-weight: 600; }

body.has-report .masthead { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 24px; padding-top: 34px; text-align: left; }
body.has-report .logo { font-size: clamp(1.7rem, 4vw, 2.5rem); }
body.has-report .hero-copy { display: none; }
body.has-report .order { margin: 0 0 0 auto; width: min(100%, 460px); }
body.has-report .order input { padding: 11px 18px; font-size: 15px; }
body.has-report .order button { min-height: 48px; font-size: 18px; }

main { position: relative; width: min(100% - 32px, 1120px); margin: 0 auto; padding-bottom: 64px; }
.out { margin-top: 30px; }

/* ---- the report */
.report { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 48px; align-items: start; }
.who { font-weight: 600; font-size: 19px; }
.label { margin-top: 6px; font: 400 clamp(1.7rem, 3.4vw, 2.3rem)/1 var(--display); }
.nose-wrap { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 22px 0 0 clamp(0px, 3vw, 36px); }
.nose {
  position: absolute; inset: 0; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
  display: grid; place-items: center; text-align: center; color: var(--white);
  background: var(--nose-red); box-shadow: 0 30px 0 -10px rgba(22, 19, 15, 0.12), inset -18px -24px 0 rgba(0, 0, 0, 0.08);
  animation: boing var(--t-slow) var(--boing) both;
}
.nose.gold { background: var(--nose-gold); color: var(--ink); }
.nose:focus-visible { outline: 4px solid var(--blue); outline-offset: 6px; }
.nose.squish { animation: squish 320ms var(--boing); }
.nose b { display: block; font: 400 clamp(54px, 10vw, 100px)/1 var(--display); text-shadow: 0 5px 0 rgba(0, 0, 0, 0.16); font-variant-numeric: tabular-nums; }
.nose.gold b { text-shadow: 0 4px 0 rgba(255, 255, 255, 0.35); }
.nose small { display: block; margin-top: 6px; font-size: clamp(16px, 2.4vw, 22px); font-weight: 600; opacity: 0.92; }
.tag {
  position: absolute; right: -6%; top: 8%; transform: rotate(12deg); padding: 10px 18px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--yellow); font: 400 clamp(18px, 2.6vw, 26px)/1 var(--display); box-shadow: 5px 5px 0 var(--ink);
  animation: drop 520ms var(--boing) 420ms both;
}
.tag.on-gold { background: var(--blue); color: var(--white); }
.honk {
  position: absolute; left: -5%; bottom: 8%; width: 28%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: var(--white); font: 400 clamp(17px, 2.6vw, 26px)/1 var(--display); transform: rotate(-14deg);
  box-shadow: var(--pop-shadow); animation: pop 420ms var(--boing) 620ms both;
}
.rank { margin-top: 18px; font-weight: 600; font-size: 19px; }
.traits { margin-top: 4px; color: var(--grey); font-size: 15px; }

.right h2 { margin: 0 0 14px; font: 400 clamp(1.4rem, 2.6vw, 1.9rem)/1.1 var(--display); }
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 96px; align-items: center; gap: 14px; font-weight: 600; font-size: 17px; }
.bar { height: 26px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 900ms var(--ease-out); }
.in .bar i { width: var(--w); }
.row .v { text-align: right; font-variant-numeric: tabular-nums; }
.row .sub-v { grid-column: 2 / 4; margin-top: -8px; font-size: 13px; font-weight: 500; color: var(--grey); }
.loss { color: var(--red-ink); }
.win { color: var(--green-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding: 0; list-style: none; }
.chips li {
  padding: 9px 16px; border: 2.5px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: 16px;
  animation: pop 380ms var(--boing) calc(700ms + var(--i, 0) * 60ms) both;
}
.chips li:nth-child(4n+1) { background: var(--pink-soft); }
.chips li:nth-child(4n+2) { background: var(--yellow-soft); }
.chips li:nth-child(4n+3) { background: var(--blue-soft); }
.chips li:nth-child(4n) { background: var(--green-soft); }
.bubble {
  position: relative; margin: 26px 0 0; padding: 16px 20px; border: 3px solid var(--ink); border-radius: 22px; background: var(--white);
  font-size: 19px; font-weight: 500; box-shadow: 5px 5px 0 var(--ink);
}
.bubble::after {
  content: ''; position: absolute; left: 40px; bottom: -15px; width: 24px; height: 24px; background: var(--white);
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* ---- the full act */
.act { margin-top: 64px; }
.act > h2, .compare h2, .car h2 { margin: 0 0 16px; font: 400 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--display); }
.math { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tok { padding: 14px 20px; border: 3px solid var(--ink); border-radius: 22px; background: var(--white); box-shadow: 5px 5px 0 var(--ink); }
.tok b { display: block; font: 400 clamp(26px, 3.6vw, 36px)/1 var(--display); font-variant-numeric: tabular-nums; }
.tok span { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--grey); }
.tok.total { background: var(--red); color: var(--white); }
.tok.total span { color: var(--pink-soft); }
.tok.total.gold { background: var(--yellow); color: var(--ink); }
.tok.total.gold span { color: var(--ink); }
.op { display: grid; place-items: center; width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font: 400 26px/1 var(--display); }
.math-fine { margin: 16px 0 0; font-size: 15px; color: var(--grey); }

/* the peak and the fumble */
.spark { position: relative; height: 190px; margin-top: 22px; border: 3px solid var(--ink); border-radius: 22px; background: var(--white); box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.spark svg { position: absolute; left: 14px; right: 14px; top: 14px; bottom: 28px; width: calc(100% - 28px); height: calc(100% - 42px); overflow: visible; }
.spark .area { fill: var(--pink-soft); }
.spark .line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-dot { position: absolute; width: 20px; height: 20px; border: 3px solid var(--ink); border-radius: 50%; background: var(--nose-red); transform: translate(-50%, -50%); }
.spark-label {
  position: absolute; padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--yellow);
  font: 400 15px/1.2 var(--display); white-space: nowrap; transform: translate(-50%, 16px); /* the peak is always the top, so the label sits under it */
}
.spark-label.left { transform: translate(-12px, 16px); }
.spark-label.right { transform: translate(calc(-100% + 12px), 16px); }
.spark-axis { position: absolute; left: 14px; right: 14px; bottom: 6px; display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--grey); }
.bubbles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.bub { position: relative; margin: 0; padding: 16px 18px; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); font-size: 17px; }
.bub::after { content: ''; position: absolute; left: 34px; bottom: -15px; width: 22px; height: 22px; background: inherit; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); }
.bub:nth-child(1) { background: var(--pink-soft); }
.bub:nth-child(2) { background: var(--yellow-soft); }
.bub:nth-child(3) { background: var(--blue-soft); }
.bubbles + .note { margin-top: 30px; }
.note { margin-top: 14px; font-size: 13.5px; color: var(--grey); }

.compare { margin-top: 56px; max-width: 640px; }
.compare p { margin: -6px 0 14px; color: var(--grey); }
.compare form { display: flex; gap: 10px; }
.compare input { flex: 1; min-width: 0; padding: 13px 20px; border: 3px solid var(--ink); border-radius: 999px; }
.compare input[aria-invalid='true'] { border-color: var(--red); }

/* ---- the dare: what a visitor from a shared link sees first */
body.visitor .masthead .order { display: none; }
.dare {
  margin: 0 0 34px; padding: 18px 22px; border: 3px solid var(--ink); border-radius: 24px; background: var(--yellow-soft);
  box-shadow: 5px 5px 0 var(--ink);
}
.dare p { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.dare p b { font: 400 22px/1 var(--display); }
.dare form { display: flex; gap: 10px; }
.dare input { flex: 1; min-width: 0; padding: 13px 20px; border: 3px solid var(--ink); border-radius: 999px; background: var(--white); font-size: 16px; }
.dare input:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.dare input[aria-invalid='true'] { border-color: var(--red); }
.vs-banner + .dare { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---- referral counter: first-time wallets that came in through your links */
.brought { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-weight: 600; font-size: 16px; }
.brought b {
  display: grid; place-items: center; flex: none; min-width: 56px; height: 56px; padding: 0 10px; border-radius: 999px;
  background: var(--nose-red); color: var(--white); font: 400 24px/1 var(--display); box-shadow: 3px 3px 0 var(--ink);
  font-variant-numeric: tabular-nums;
}
.vs-brought { display: flex; justify-content: center; }
.vs-brought .brought { max-width: 520px; }

/* ---- versus */
.vs-banner { text-align: center; margin-bottom: 28px; }
.vs-banner b { display: block; font: 400 clamp(1.8rem, 5vw, 3rem)/1.05 var(--display); }
.vs-banner span { color: var(--grey); font-weight: 600; }
.vs-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; align-items: start; }
.vs-mid { align-self: center; font: 400 44px/1 var(--display); color: var(--blue); }
.vs-card { text-align: center; }
.vs-card .nose-wrap { width: min(100%, 300px); margin: 12px auto 0; }
.vs-card .nose b { font-size: clamp(40px, 6vw, 64px); }
.vs-card .rows { margin-top: 22px; text-align: left; }
.vs-card .crown { display: inline-block; margin-top: 10px; padding: 6px 14px; border: 3px solid var(--ink); border-radius: 999px; background: var(--yellow); font: 400 16px/1 var(--display); }

/* ---- waiting */
.waiting { text-align: center; padding: 30px 0 10px; }
.waiting .nose-mini { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; background: var(--nose-red); animation: honking 900ms var(--boing) infinite; }
.waiting p { margin: 22px 0 0; font: 400 22px/1.2 var(--display); }
.waiting .slow { font: 500 15px/1.4 var(--body); color: var(--grey); margin-top: 8px; }

/* ---- clown car */
.car { margin-top: 70px; }
.car-window { overflow: hidden; border: 3px solid var(--ink); border-radius: 24px; padding: 16px 0; background: var(--blue-soft); box-shadow: 5px 5px 0 var(--ink); }
.car-track { display: flex; gap: 22px; width: max-content; padding-left: 22px; animation: drive 80s linear infinite; }
.car-window:hover .car-track { animation-play-state: paused; }
.clown { width: 128px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.25; }
.clown i { display: grid; place-items: center; width: 78px; height: 78px; margin: 0 auto 8px; border-radius: 50%; background: var(--nose-red); color: var(--white); font: 400 14px/1 var(--display); font-style: normal; box-shadow: 3px 3px 0 var(--ink); }
.clown.gold i { background: var(--nose-gold); color: var(--ink); }
.clown.empty { opacity: 0.45; }
.clown span { display: block; color: var(--grey); font-weight: 500; }


/* ---- the maker: where people who liked the tool find the person who built it */
.maker {
  display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; margin-top: 56px; padding: 24px 28px;
  border: 3px solid var(--ink); border-radius: 24px; background: var(--ink); color: var(--white); box-shadow: 6px 6px 0 var(--red);
}
.maker h2 { margin: 0; font: 400 clamp(1.4rem, 2.6vw, 1.8rem)/1.1 var(--display); }
.maker p { margin: 6px 0 0; font-size: 17px; color: #e9e2da; }
.maker .btn { border-color: var(--white); box-shadow: 4px 4px 0 var(--white); }
.maker .btn:hover { box-shadow: 6px 6px 0 var(--white); }
.maker .btn:active { box-shadow: 1px 1px 0 var(--white); }

/* ---- music toggle */
.sound-toggles { position: fixed; left: 18px; bottom: 18px; z-index: 5; display: flex; gap: 10px; }
.music-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px 0 14px; border: 3px solid var(--ink); border-radius: 999px; cursor: pointer;
  background: var(--white); color: var(--ink); font: 400 16px/1 var(--display); box-shadow: var(--pop-shadow);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background var(--t-fast);
}
.music-toggle:hover { transform: translate(-1px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.music-toggle:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.music-toggle:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.music-note { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--track); font-size: 17px; }
.music-toggle[aria-pressed='true'] { background: var(--yellow); }
.music-toggle[aria-pressed='true'] .music-note { background: var(--red); color: var(--white); }
#music[aria-pressed='true'] .music-note { animation: bop 0.91s var(--boing) infinite; } /* one bop per bar of the polka */
@keyframes bop { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-4px) rotate(8deg); } }

/* ---- motion */
@keyframes boing { 0% { transform: scale(0.2); } 55% { transform: scale(1.08); } 75% { transform: scale(0.96); } 100% { transform: scale(1); } }
@keyframes squish { 0% { transform: scale(1); } 35% { transform: scale(1.12, 0.86); } 70% { transform: scale(0.95, 1.05); } 100% { transform: scale(1); } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-40px) rotate(-8deg); } 100% { opacity: 1; transform: translateY(0) rotate(12deg); } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.4) rotate(var(--rot, -14deg)); } 100% { opacity: 1; transform: scale(1) rotate(var(--rot, -14deg)); } }
.chips li { --rot: 0deg; }
@keyframes honking { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18, 0.84); } 70% { transform: scale(0.94, 1.06); } }
@keyframes drive { to { transform: translateX(-50%); } }

@media (max-width: 900px) {
  .report { grid-template-columns: 1fr; gap: 30px; }
  .nose-wrap { margin: 18px auto 0; width: min(86vw, 380px); }
  .bubbles { grid-template-columns: 1fr; gap: 26px; }
  body.has-report .masthead { grid-template-columns: 1fr; text-align: center; }
  body.has-report .order { margin: 0 auto; grid-column: auto; }
  .vs-grid { grid-template-columns: 1fr; }
  .vs-mid { justify-self: center; }
}
@media (max-width: 560px) {
  .math { display: grid; grid-template-columns: 46px 1fr; gap: 12px; } /* column math: operator left of its number */
  .math > .tok:first-child { grid-column: 2; }
  .peak .math { grid-template-columns: 1fr; } /* the peak has no operators, so no operator column */
  .peak .math > .tok:first-child { grid-column: auto; }
  .tok { padding: 10px 16px; }
  .sound-toggles { left: 12px; bottom: 12px; gap: 8px; }
  .music-toggle { min-height: 44px; font-size: 14px; padding: 0 14px 0 10px; }
  .order { flex-direction: column; }
  .order button { width: 100%; }
  .row { grid-template-columns: 96px 1fr 76px; gap: 10px; font-size: 15px; }
  .actions .btn { flex: 1 1 100%; }
  .compare form, .dare form { flex-direction: column; }
  .maker { flex-direction: column; align-items: stretch; padding: 20px; }
  main { padding-bottom: 88px; } /* room for the fixed sound toggles below the last block */
  .maker .btn { width: 100%; }
  .dots i:nth-child(n+2) { display: none; } /* on a phone the dots land behind text */
  .dots i:nth-child(1) { width: 56px; height: 56px; left: -14px; top: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bar i { width: var(--w); }
  .car-window { overflow-x: auto; }
}
