:root {
  --pink: #f0468e;
  --purple: #8e3fa8;
  --plum: #4a2160;
  --soft: #f3e6fb;
  --gold: #f4c542;
  --paper: #fff9fd;
  --ink: #3b1d4c;
  --muted: #7d6390;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(110, 40, 140, .14);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: linear-gradient(165deg, #fde7f3 0%, #f6e3fb 45%, #e9ddfb 100%) fixed;
  background-color: #f6e3fb;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--purple); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; color: var(--purple); }

.btn {
  appearance: none; border: 0; cursor: pointer;
  font: 600 1.1rem/1 var(--display);
  padding: 16px 26px; border-radius: 999px;
  background: var(--pink); color: #fff;
  box-shadow: 0 6px 0 #c22d6f, var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c22d6f; }
.btn.secondary { background: #fff; color: var(--purple); box-shadow: 0 6px 0 #dcc3ea, var(--shadow); }
.btn.secondary:active { box-shadow: 0 2px 0 #dcc3ea; }
.btn.small { font-size: .95rem; padding: 11px 18px; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.card {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid #fff;
}

/* ---------- Home ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.hero { text-align: center; padding: 48px 0 24px; }
.hero .logo { width: min(420px, 80vw); margin: 0 auto 14px; }
.hero p.tag { font: 600 clamp(1.1rem, 3vw, 1.45rem) var(--display); color: var(--plum); margin: 0 0 8px; }
.hero p.sub { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }

.section-title { text-align: center; margin: 40px 0 18px; font-size: 1.6rem; }
.kits { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; padding-bottom: 20px; }
.kit { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.kit .art { aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 16px; background: var(--soft); overflow: hidden; }
.kit .art img { max-height: 92%; object-fit: contain; }
.kit .art .emoji { font-size: 64px; filter: saturate(.9); }
.kit h3 { font-size: 1.25rem; }
.kit p { margin: 0; color: var(--muted); line-height: 1.45; flex: 1; }
.kit .meta { font-size: .85rem; font-weight: 700; color: var(--pink); text-transform: uppercase; letter-spacing: .06em; }
.kit .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kit.soon { opacity: .8; }
.pill { display: inline-block; font: 600 .8rem var(--display); background: var(--soft); color: var(--purple); padding: 6px 12px; border-radius: 999px; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.how .step { padding: 20px; }
.how .num { font: 700 1.8rem var(--display); color: var(--pink); }
.how p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }

footer { text-align: center; padding: 40px 16px; color: var(--muted); font-size: .9rem; }

/* ---------- Play ---------- */
body.play { overflow-x: hidden; }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: 14px 16px 28px; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.topbar .logo-sm { height: 34px; width: auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.85); box-shadow: var(--shadow); font-size: 20px;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
}
.icon-btn[aria-pressed="false"] { opacity: .55; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 10px; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.title-art { width: min(420px, 92%); margin: 0 auto; }
.panel { padding: 20px; }
.panel h2 { font-size: 1.35rem; margin-bottom: 10px; }
label.field { display: block; font: 600 .95rem var(--display); color: var(--plum); margin-bottom: 6px; }
input.text, textarea.text {
  width: 100%; font: 600 1.15rem var(--body); padding: 14px 16px; border-radius: 14px;
  border: 2px solid #e6d2f1; background: #fff; color: var(--ink);
}
input.text:focus, textarea.text:focus { outline: none; border-color: var(--pink); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.checklist input { width: 22px; height: 22px; accent-color: var(--pink); flex: none; margin-top: 1px; }
.note { font-size: .9rem; color: var(--muted); line-height: 1.5; margin: 10px 0 0; }

.speaker { display: flex; align-items: flex-end; gap: 6px; }
.speaker img.char { width: 120px; flex: none; filter: drop-shadow(0 6px 10px rgba(80,20,100,.2)); animation: bob 2.6s ease-in-out infinite; }
.speaker.right { flex-direction: row-reverse; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.bubble {
  position: relative; flex: 1; padding: 16px 18px; border-radius: 20px; background: #fff;
  box-shadow: var(--shadow); font-size: 1.12rem; line-height: 1.5; margin-bottom: 26px;
}
.bubble .who { display: block; font: 700 .8rem var(--display); color: var(--pink); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.bubble::after {
  content: ""; position: absolute; bottom: 16px; left: -10px; border: 10px solid transparent; border-right-color: #fff; border-left: 0;
}
.speaker.right .bubble::after { left: auto; right: -10px; border-right-color: transparent; border-left: 10px solid #fff; border-right: 0; }

.clue {
  position: relative; padding: 24px 20px 22px; text-align: center;
  background: linear-gradient(160deg, #fff 0%, #f7ecfd 100%);
  border: 3px solid #fff; border-radius: 26px; box-shadow: var(--shadow);
}
.clue .tagline { display: inline-block; font: 700 1.05rem var(--display); color: #fff; background: var(--purple); padding: 6px 16px; border-radius: 999px; margin-bottom: 14px; }
.clue .riddle { font: 600 clamp(1.25rem, 5vw, 1.5rem)/1.45 var(--display); color: var(--plum); margin: 0; }
.hint { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff5d6; color: #6b4c00; font-weight: 600; display: none; }
.hint.show { display: block; animation: pop .3s ease; }

.progress { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.progress span { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.75); display: grid; place-items: center; font: 700 .7rem var(--display); color: var(--muted); }
.progress span.done { background: var(--gold); color: #6b4c00; }
.progress span.now { background: var(--pink); color: #fff; transform: scale(1.15); }

.actions { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.toast {
  position: fixed; left: 50%; top: 22%; transform: translate(-50%, 0) scale(.6); opacity: 0;
  font: 700 clamp(1.6rem, 7vw, 2.4rem) var(--display); color: #fff; text-align: center;
  background: var(--pink); padding: 18px 28px; border-radius: 26px; box-shadow: var(--shadow);
  pointer-events: none; z-index: 20; transition: all .35s cubic-bezier(.2,1.6,.4,1); max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.finale-art { width: min(420px, 100%); margin: 0 auto; animation: bob 3s ease-in-out infinite; }
.badge-out { text-align: center; font: 700 1.3rem var(--display); color: var(--purple); }
.badge-out small { display: block; font: 600 .9rem var(--body); color: var(--muted); }

canvas#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

/* ---------- Print QR ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.qr-cell { background: #fff; border: 2px dashed #e0c9ee; border-radius: 14px; padding: 12px; text-align: center; }
.qr-cell .q { display: grid; place-items: center; }
.qr-cell b { display: block; font-family: var(--display); color: var(--purple); margin-top: 6px; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .qr-cell { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* custom clues */
textarea.text { resize: vertical; font: 600 1rem/1.4 var(--body); min-height: 74px; }
details.custom summary { cursor: pointer; font: 600 1rem var(--display); color: var(--pink); padding: 6px 0; }
.custom-field { margin-top: 12px; }
.custom-field .spot { font: 600 .8rem var(--body); color: var(--muted); }
