:root {
  --cream: #fff6f0;
  --pink: #e0245e;
  --pink-d: #a3133f;
  --rasp: #ff5c8a;
  --blue: #4b3fb5;
  --blue-d: #2e2580;
  --leaf: #3fa34d;
  --ink: #2a1530;
  --muted: #6e5670;
  --card: #ffffff;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.6 var(--body); overflow-x: hidden;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,92,138,.18) 0 70px, transparent 71px),
    radial-gradient(circle at 88% 8%, rgba(75,63,181,.14) 0 90px, transparent 91px),
    radial-gradient(circle at 92% 62%, rgba(255,92,138,.12) 0 60px, transparent 61px),
    radial-gradient(circle at 6% 78%, rgba(75,63,181,.10) 0 80px, transparent 81px),
    radial-gradient(rgba(224,36,94,.09) 2px, transparent 2.5px);
  background-size: auto, auto, auto, auto, 26px 26px;
  background-attachment: scroll;
}
.wrap { width: min(980px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

.bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 700 22px var(--display); }
.sound { display: inline-flex; align-items: center; gap: 6px; font: 700 14px var(--body); color: var(--blue); background: #fff; border: 2px solid var(--blue); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.sound[aria-pressed="false"] { color: var(--muted); border-color: #d9c6d6; }
.sound[aria-pressed="false"] .waves { display: none; }

/* Hero */
.hero { text-align: center; padding: 20px 0 30px; }
.title { margin: 0; font: 700 clamp(52px, 15vw, 128px)/.9 var(--display); letter-spacing: -.01em; }
.title span { display: block; }
.w1 { color: var(--pink); text-shadow: 0 6px 0 var(--pink-d); transform: rotate(-3deg); }
.w2 { color: var(--blue); text-shadow: 0 6px 0 var(--blue-d); transform: rotate(2deg); margin-top: 6px; }
.tagline { font-size: clamp(18px, 2.6vw, 22px); color: var(--muted); margin: 26px auto 0; max-width: 560px; font-weight: 600; }
.tagline q { color: var(--ink); }

.button-zone { margin-top: 34px; display: grid; justify-items: center; }
.big {
  --size: min(300px, 74vw);
  width: var(--size); height: var(--size); border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--pink-d);
  box-shadow: 0 16px 0 -2px #6d0b29, 0 26px 40px rgba(163,19,63,.35);
  position: relative; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .06s;
}
.big-top {
  position: absolute; inset: 0 0 14px 0; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.55) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 40%, #ff6f98, var(--pink) 60%, #c41b4f);
  display: grid; place-items: center;
  transition: transform .06s, inset .06s;
  box-shadow: inset 0 -10px 20px rgba(0,0,0,.18);
}
/* raspberry bumps */
.big-top::before {
  content: ""; position: absolute; inset: 8%; border-radius: 50%;
  background: radial-gradient(rgba(255,255,255,.18) 18%, transparent 20%) 0 0 / 34px 34px;
}
.big-leaf { position: absolute; top: -30px; left: 50%; width: 92px; transform: translateX(-50%); z-index: 2; pointer-events: none; }
.big:active .big-leaf, .big.pressed .big-leaf { top: -18px; }
.big-text { position: relative; font: 700 clamp(30px, 8.5vw, 46px)/1 var(--display); color: #fff; text-shadow: 0 3px 0 rgba(109,11,41,.6); letter-spacing: .02em; }
.big:hover .big-top { filter: brightness(1.05); }
.big:active .big-top, .big.pressed .big-top { inset: 12px 0 2px 0; }
.big:active, .big.pressed { box-shadow: 0 4px 0 -2px #6d0b29, 0 10px 20px rgba(163,19,63,.35); transform: translateY(10px); }
.big:focus-visible { outline: 4px dashed var(--blue); outline-offset: 10px; }
.big.wobble { animation: wobble .45s ease; }
@keyframes wobble { 0% { scale: 1; } 30% { scale: 1.08 .92; } 55% { scale: .95 1.05; } 80% { scale: 1.02 .98; } 100% { scale: 1; } }

.count-line { margin: 34px 0 0; display: grid; justify-items: center; }
.count { font: 700 clamp(48px, 10vw, 72px)/1 var(--display); color: var(--blue); }
.count.bump { animation: bump .3s ease; }
@keyframes bump { 40% { transform: scale(1.25); color: var(--pink); } }
.count-label { color: var(--muted); font-weight: 600; }
.rank { margin: 8px 0 0; font-weight: 600; }
.rank b { color: var(--pink); }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
kbd { font: 700 13px var(--body); background: #fff; border: 1px solid #d9c6d6; border-bottom-width: 3px; border-radius: 6px; padding: 1px 7px; }

/* Definition */
.def-wrap { padding: 40px 0 10px; }
.def { background: var(--card); border-radius: 24px; padding: 28px 30px; box-shadow: 0 10px 0 #f3d6e0, 0 20px 40px rgba(42,21,48,.08); border: 2px solid #f3d6e0; max-width: 720px; margin: 0 auto; }
.def-word { font: 700 30px/1.2 var(--display); margin: 0; color: var(--ink); }
.ipa { font: 400 17px var(--body); color: var(--muted); white-space: nowrap; }
.def-pos { font-style: italic; color: var(--pink); margin: 2px 0 10px; font-weight: 600; }
.def ol { margin: 0 0 14px; padding-left: 22px; }
.def li { margin: 6px 0; }
.def-ex { background: #fff0f5; border-left: 4px solid var(--pink); padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; }
.def-see { margin: 0; color: var(--muted); font-size: 15px; }

/* Sections */
.section { padding: 56px 0 10px; }
h2 { font: 700 clamp(30px, 5vw, 42px)/1.1 var(--display); margin: 0; color: var(--blue); }
.sub { color: var(--muted); margin: 10px 0 24px; max-width: 640px; }

.btn { font: 700 16px var(--display); border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer; color: #fff; transition: transform .08s; touch-action: manipulation; }
.btn:active { transform: translateY(3px); }
.btn-pink { background: var(--pink); box-shadow: 0 5px 0 var(--pink-d); }
.btn-blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.btn:active.btn-pink, .btn:active.btn-blue { box-shadow: 0 2px 0 var(--pink-d); }

.gen { display: grid; gap: 18px; }
.gen-card {
  background: var(--blue); color: #fff; border-radius: 24px; padding: 30px 28px; position: relative; overflow: hidden;
  box-shadow: 0 10px 0 var(--blue-d);
}
.gen-card::after { content: "\201C"; position: absolute; right: 16px; top: -30px; font: 700 180px/1 var(--display); color: rgba(255,255,255,.08); }
.gen-quote { font: 600 clamp(22px, 4vw, 32px)/1.25 var(--display); margin: 0; position: relative; }
.gen-ctx { margin: 12px 0 0; color: #d8d3ff; font-weight: 600; position: relative; }
.gen-card.swap { animation: swap .35s ease; }
@keyframes swap { 0% { transform: translateY(8px) rotate(-1deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.gen-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.det { background: #fff; border: 2px solid #f3d6e0; border-radius: 24px; padding: 22px; box-shadow: 0 10px 0 #f3d6e0; }
.det input { width: 100%; font: 600 18px var(--body); padding: 14px 16px; border: 2px solid #ead3e1; border-radius: 14px; color: var(--ink); background: var(--cream); }
.det input:focus { outline: none; border-color: var(--pink); }
.meter { margin: 16px 0 10px; height: 22px; border-radius: 999px; background: #f6e7ee; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--leaf), #f2c230 50%, var(--pink)); transition: width .35s cubic-bezier(.3,1.4,.6,1); }
.det-out { margin: 0; font: 600 18px var(--display); color: var(--ink); min-height: 1.6em; }

.rules { counter-reset: r; list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.rules li { counter-increment: r; background: #fff; border-radius: 20px; padding: 18px 18px 18px 64px; position: relative; border: 2px solid #f3d6e0; }
.rules li::before {
  content: counter(r); position: absolute; left: 14px; top: 16px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font: 700 18px var(--display); color: #fff; background: var(--pink);
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.15);
}
.rules li:nth-child(even)::before { background: var(--blue); }
.rules b { display: block; font-family: var(--display); font-size: 18px; color: var(--ink); }

.foot { padding: 60px 0 40px; text-align: center; color: var(--muted); font-size: 14px; }
.foot p { margin: 6px 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--pink); text-decoration: underline; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .big.wobble, .count.bump, .gen-card.swap { animation: none; } html { scroll-behavior: auto; } }

/* 404 */
.nf { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 24px 16px; }
.nf h1 { font: 700 clamp(40px, 10vw, 80px)/1 var(--display); color: var(--pink); margin: 10px 0; }
.nf p { color: var(--muted); font-weight: 600; }
.nf a { display: inline-block; margin-top: 10px; text-decoration: none; }
