:root {
  --paper: #fcfbff;
  --dot: #d9d4ea;
  --ink: #1b1b1f;
  --yellow: #ffd43b;
  --pink: #ff6fb5;
  --orange: #ff8a3d;
  --blue: #5aa9ff;
  --green: #35d49c;
  --lilac: #b8a1ff;
  --red: #ff5a5a;
  --muted: #55535e;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --b: 3px solid var(--ink);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.6px, transparent 1.7px);
  background-size: 24px 24px;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--yellow); }
:focus-visible { outline: 3px dashed var(--blue); outline-offset: 4px; }
mark {
  background: linear-gradient(100deg, transparent 2%, var(--yellow) 4%, var(--yellow) 96%, transparent 98%);
  padding: 0 0.2em; margin: 0 -0.1em; color: inherit;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hand { font-family: var(--hand); font-weight: 700; }

/* Washi tape pieces */
.tape {
  position: absolute; width: 96px; height: 28px; z-index: 3;
  background: repeating-linear-gradient(45deg, rgba(255, 111, 181, 0.75) 0 8px, rgba(255, 255, 255, 0.6) 8px 16px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 4% 96%, 0 50%);
}
.tape-tl { top: -12px; left: 18px; transform: rotate(-8deg); }
.tape-tr { top: -12px; right: 18px; transform: rotate(7deg); background: repeating-linear-gradient(-45deg, rgba(90, 169, 255, 0.75) 0 8px, rgba(255, 255, 255, 0.6) 8px 16px); }

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--gutter);
  padding-top: max(14px, env(safe-area-inset-top));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand-tile {
  display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--yellow); border: var(--b); border-radius: 7px;
  font-family: "Rubik Mono One", sans-serif; font-size: 14px; transform: rotate(-8deg);
}
.pill {
  display: inline-block; color: var(--ink); text-decoration: none;
  background: #fff; border: var(--b); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 800;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.pill:hover { background: var(--yellow); transform: translate(-2px, -2px) rotate(-2deg); box-shadow: 5px 5px 0 var(--ink); }

.progress { position: fixed; left: 0; right: 0; top: 0; height: 7px; z-index: 41; }
.progress span {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, var(--pink) 0 10px, var(--yellow) 10px 20px);
  border-bottom: 2px solid var(--ink); border-right: 2px solid var(--ink);
  transition: width 0.6s var(--ease);
}

/* Screens */
.screen { display: none; min-height: 100svh; padding: 92px var(--gutter) 48px; position: relative; }
.screen.is-active { display: flex; flex-direction: column; }

/* Buttons */
.btn {
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  border: var(--b); border-radius: 14px;
  padding: 15px 26px;
  font-weight: 800; font-size: 18px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.2s;
}
.btn span { transition: transform 0.25s var(--ease); display: inline-block; }
.btn:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 7px 7px 0 var(--ink); }
.btn:hover span { transform: translateX(4px) rotate(-10deg); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--pink); }
.btn-ghost {
  border: 0; box-shadow: none; background: transparent; padding: 15px 10px;
  font-family: var(--hand); font-size: 24px; font-weight: 700; text-decoration: underline wavy; text-underline-offset: 6px;
}
.btn-ghost:hover { box-shadow: none; transform: rotate(-3deg); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.sticker { position: absolute; width: 80px; height: 80px; z-index: 4; filter: drop-shadow(3px 4px 0 rgba(27, 27, 31, 0.22)); }

/* ---------- INTRO ---------- */
.intro { padding-bottom: 0; overflow: hidden; }
.intro-grid {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 4vw, 64px); align-items: center;
  max-width: 1320px; width: 100%; margin: 0 auto;
}
.intro-copy { position: relative; z-index: 5; }
.invite { font-size: clamp(26px, 2.6vw, 34px); margin: 0 0 10px; transform: rotate(-2deg); transform-origin: left; color: var(--muted); }

/* Ransom-note letters */
.ransom { margin: 0; display: flex; flex-wrap: nowrap; gap: 1.2cqi; line-height: 1; container-type: inline-size; width: 100%; max-width: 640px; }
.ransom-sm { max-width: 400px; margin-inline: auto; }
.ransom .tile {
  flex: 1 1 0; min-width: 0;
  display: grid; place-items: center;
  aspect-ratio: 0.82;
  font-size: 9.6cqi;
  border: var(--b); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  will-change: transform;
}
.ransom-sm .tile { font-size: 13cqi; }
.ransom .f0 { font-family: var(--display); font-weight: 800; }
.ransom .f1 { font-family: "Abril Fatface", serif; }
.ransom .f2 { font-family: "Rubik Mono One", sans-serif; font-size: 7.6cqi; }
.ransom .f3 { font-family: var(--hand); font-weight: 700; font-size: 12cqi; }
.ransom-sm .f2 { font-size: 10cqi; }
.ransom-sm .f3 { font-size: 16cqi; }

.rules { position: relative; display: inline-block; font-size: clamp(30px, 3vw, 40px); margin: 22px 0 0; transform: rotate(-1.5deg); }
.squiggle { position: absolute; left: 0; bottom: -10px; width: 100%; height: 16px; overflow: visible; }
.squiggle path { fill: none; stroke: var(--pink); stroke-width: 6; stroke-linecap: round; }
.lede { font-size: clamp(19px, 1.7vw, 23px); font-weight: 600; margin: 18px 0 0; max-width: 40ch; }
.lede mark { white-space: nowrap; }

.sticky-note {
  position: relative; margin: 30px 0 0; max-width: 420px;
  background: var(--yellow); border: var(--b); border-radius: 4px;
  padding: 22px 22px 18px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1.8deg);
  font-size: 16px;
}
.sticky-note p { margin: 0; }
.note-title { font-family: var(--hand); font-weight: 700; font-size: 28px; line-height: 1; margin-bottom: 6px !important; }
.intro-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 34px; }
.hint { font-size: 15px; font-weight: 600; color: var(--muted); }

.collage { position: relative; height: min(76svh, 700px); }
.polaroid {
  position: absolute; margin: 0;
  background: #fff; border: var(--b); border-radius: 4px;
  padding: 12px 12px 0;
  box-shadow: 8px 8px 0 var(--ink);
}
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 2px solid var(--ink); }
.polaroid figcaption { font-family: var(--hand); font-weight: 700; font-size: 24px; text-align: center; padding: 6px 0 10px; line-height: 1.3; }
.polaroid .tape { top: -14px; left: 50%; margin-left: -48px; transform: rotate(-4deg); }
.cutout { position: absolute; width: auto; max-width: none; filter: drop-shadow(6px 6px 0 var(--ink)); pointer-events: none; }
.c-hero { height: 98%; left: 34%; top: 0; transform: rotate(3deg); z-index: 3; }
.c-power { height: 80%; right: 0; top: 13%; transform: rotate(6deg); z-index: 1; }
.cut-label { position: absolute; margin: 0; font-size: 26px; line-height: 1.2; z-index: 6; white-space: nowrap; }
.l-hero { top: 2%; left: 4%; transform: rotate(-6deg); }
.l-hero::after { content: " ↘"; }
.l-power { top: 92%; right: 6%; transform: rotate(-3deg); }
.p2 { width: 34%; left: 0; top: 36%; transform: rotate(-9deg); z-index: 3; }
.p2 img { object-position: 50% 16%; }
.p2 .tape { background: repeating-linear-gradient(45deg, rgba(255, 212, 59, 0.85) 0 8px, rgba(255, 255, 255, 0.6) 8px 16px); }

.drag { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.drag:active { cursor: grabbing; }
.drag.dragging { filter: drop-shadow(8px 12px 0 rgba(27, 27, 31, 0.25)); z-index: 10; }
.d1 { top: 14%; left: 14%; width: 84px; height: 84px; }
.d2 { bottom: 20%; right: 0; width: 76px; height: 76px; }
.d3 { bottom: 4%; left: 30%; width: 116px; height: 116px; }
.d4 { top: 0; right: 0; width: 130px; height: 94px; }
.d5 { top: 30%; left: 4%; width: 96px; height: 72px; }
.d6 { bottom: 3%; right: 34%; width: 84px; height: 50px; }
.d7 { bottom: 12%; right: 30%; width: 50px; height: 76px; }
.d8 { top: 0; left: 62%; width: 52px; height: 52px; }
.drag-hint { position: absolute; bottom: -34px; left: 2%; margin: 0; font-size: 24px; color: var(--muted); transform: rotate(-4deg); z-index: 6; }

.washi {
  margin: 28px calc(var(--gutter) * -1) 0;
  overflow: hidden; white-space: nowrap;
  background: repeating-linear-gradient(90deg, rgba(255, 212, 59, 0.9) 0 40px, rgba(255, 228, 120, 0.9) 40px 80px);
  border-top: var(--b); border-bottom: var(--b);
  font-family: var(--hand); font-weight: 700; font-size: clamp(24px, 2.4vw, 32px);
  padding: 6px 0 8px;
  transform: rotate(-1.5deg) scale(1.03);
}
.washi-track { display: inline-flex; animation: marquee 30s linear infinite; }
.washi-track span { padding-right: 0.5em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- QUESTION SCREENS ---------- */
.q-screen { justify-content: center; padding-bottom: 80px; }
.q-wrap { width: 100%; max-width: 760px; margin: 0 auto; position: relative; }
.q-count { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.label-tape {
  display: inline-block; background: var(--ink); color: #fff;
  font-family: "Rubik Mono One", sans-serif; font-size: 12px; letter-spacing: 0.08em;
  padding: 7px 12px 6px; border-radius: 3px; transform: rotate(-2deg);
}
.label-tape.alt { background: #fff; color: var(--ink); border: 2px solid var(--ink); transform: rotate(1.5deg); }

.scrap {
  position: relative;
  background: var(--scrap, var(--yellow));
  border: var(--b); border-radius: 6px;
  padding: clamp(26px, 4vw, 40px) clamp(20px, 3.4vw, 36px);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(var(--tilt, -1deg));
}
.q-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.9rem, 4.8vw, 3.3rem);
  line-height: 1.22; letter-spacing: -0.02em;
  margin: 0; text-wrap: balance;
  padding-right: clamp(70px, 14vw, 120px);
}
.q-title em {
  font-style: normal;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 8px;
  padding: 0 0.16em; box-shadow: 3px 3px 0 var(--ink);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.mini-pol {
  position: absolute; top: -34px; right: -14px; z-index: 3;
  width: clamp(88px, 13vw, 124px);
  background: #fff; border: var(--b); border-radius: 3px; padding: 6px 6px 18px;
  box-shadow: 4px 4px 0 var(--ink); transform: rotate(7deg);
}
.mini-pol img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 14%; border: 2px solid var(--ink); }
.mini-pol .slap { position: absolute; width: 64px; height: 64px; left: -26px; bottom: -14px; }
.q-sub { font-weight: 600; margin: 18px 0 0; }

.answer { margin-top: 28px; }
.paper {
  background-color: #fff;
  background-image: repeating-linear-gradient(transparent 0 43px, #c9dcff 43px 45px);
  border: var(--b); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 6px 18px 4px;
  transform: rotate(0.6deg);
  position: relative;
}
.paper::before { content: ""; position: absolute; top: 0; bottom: 0; left: 44px; border-left: 2px solid rgba(255, 90, 90, 0.5); }
.input-line, .input-area {
  width: 100%; background: transparent; border: 0; outline: none; color: var(--ink);
  font-family: var(--hand); font-weight: 600; font-size: 32px; line-height: 45px;
  padding: 0 0 0 36px; display: block;
}
.input-area { resize: none; min-height: 135px; overflow: hidden; }
.input-line::placeholder, .input-area::placeholder { color: var(--muted); opacity: 0.85; }
.input-line:disabled { opacity: 0.35; }

.toggle { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; font-size: 17px; font-weight: 700; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { width: 52px; height: 30px; border-radius: 999px; background: #fff; border: var(--b); position: relative; transition: background 0.25s; box-shadow: 2px 2px 0 var(--ink); }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform 0.3s var(--ease); }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track::after { transform: translateX(22px); }
.toggle input:focus-visible + .track { outline: 3px dashed var(--blue); outline-offset: 3px; }

/* Relationship stickers */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; margin-top: 30px; }
.rel-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  background: var(--c, #fff); border: var(--b); border-radius: 14px;
  padding: 16px; font-weight: 800; font-size: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.rel-card .emo { font-size: 32px; line-height: 1; }
.rel-card:hover { transform: rotate(0deg) translate(-2px, -3px) scale(1.03); box-shadow: 6px 7px 0 var(--ink); }
.rel-card[aria-pressed="true"] { background: var(--ink); color: #fff; transform: rotate(0) scale(1.06); box-shadow: 6px 6px 0 var(--pink); }

/* Rating bubbles */
.rating { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; margin-top: 30px; }
.rate-btn {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: #fff; border: var(--b);
  font-weight: 800; font-size: clamp(18px, 2.2vw, 24px);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s;
}
.rate-btn:hover { transform: translateY(-4px) rotate(-6deg); }
.rate-btn.is-lit { background: var(--c); }
.rate-btn[aria-checked="true"] { transform: scale(1.22) rotate(-8deg); box-shadow: 4px 4px 0 var(--ink); z-index: 2; }
.rate-scale { display: flex; justify-content: space-between; font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--muted); margin-top: 10px; }
.reaction { margin-top: 20px; min-height: 70px; display: flex; align-items: center; gap: 14px; font-family: var(--hand); font-weight: 700; font-size: clamp(28px, 3vw, 36px); }
.reaction .big {
  display: inline-grid; place-items: center; min-width: 70px; height: 70px; padding: 0 10px;
  background: var(--ink); color: #fff; border-radius: 12px;
  font-family: "Rubik Mono One", sans-serif; font-size: 30px; transform: rotate(-6deg);
}

.q-actions { display: flex; align-items: center; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.q-actions .key-hint { margin-left: auto; font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--muted); }
.q-back { position: absolute; left: var(--gutter); bottom: 22px; background: none; border: 0; font-family: var(--hand); font-weight: 700; font-size: 24px; color: var(--muted); padding: 6px 0; }
.q-back:hover { color: var(--ink); transform: rotate(-3deg); }

.review-list { list-style: none; padding: 0; margin: 24px 0 0; max-height: 44svh; overflow: auto; background: #fff; border: var(--b); border-radius: 8px; box-shadow: 5px 5px 0 var(--ink); }
.review-list li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px 16px; border-bottom: 2px dashed var(--dot); font-size: 15px; }
.review-list li:last-child { border-bottom: 0; }
.review-list .rq { color: var(--muted); font-weight: 500; }
.review-list .ra { font-family: var(--hand); font-weight: 700; font-size: 22px; line-height: 1.1; text-align: right; max-width: 20ch; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-list button { background: none; border: 0; padding: 0; text-align: left; }
.review-list button:hover .rq { color: var(--ink); text-decoration: underline wavy var(--pink); }
.form-error { display: inline-block; background: #c62828; color: #fff; font-weight: 700; font-size: 15px; margin: 16px 0 0; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 8px; transform: rotate(-1deg); }
.form-error[hidden] { display: none; }

/* ---------- THANKS ---------- */
.thanks { align-items: center; text-align: center; justify-content: center; overflow: hidden; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.thanks .ransom { justify-content: center; margin-top: 26px; }
.thanks-note { font-size: clamp(26px, 3vw, 34px); margin: 14px auto 0; max-width: 24ch; line-height: 1.3; transform: rotate(-1deg); }

.envelope { position: relative; width: 230px; height: 156px; margin-top: 10px; perspective: 800px; }
.env-back, .env-front, .env-flap, .env-letter { position: absolute; left: 0; width: 100%; }
.env-back { inset: 0; height: 100%; background: var(--blue); border: var(--b); border-radius: 10px; }
.env-letter {
  left: 9%; width: 82%; height: 124px; bottom: 10px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 4px;
  display: grid; place-items: start center; padding-top: 14px;
  font-family: var(--hand); font-weight: 700; font-size: 24px;
}
.env-front {
  bottom: 0; height: 100%;
  background: var(--yellow);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--ink);
}
.env-flap { top: 0; height: 60%; background: var(--pink); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; }
.env-seal { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; z-index: 4; }
.env-seal svg { width: 100%; height: 100%; }

.cta-card {
  position: relative; margin-top: 52px; max-width: 580px; width: 100%; text-align: left;
  background: var(--green); border: var(--b); border-radius: 8px;
  padding: 32px 30px 30px; box-shadow: 10px 10px 0 var(--ink); transform: rotate(-1deg);
}
.cta-kicker { font-size: 30px; margin: 0; line-height: 1; transform: rotate(-3deg); transform-origin: left; }
.cta-card h3 { font-weight: 800; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.18; margin: 8px 0 12px; letter-spacing: -0.02em; }
.cta-card p { margin: 0 0 24px; font-weight: 500; }
.cta-card .btn-primary { background: #fff; }
.cta-star { top: -36px; right: 14px; width: 72px; height: 72px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .screen { padding-top: 76px; }
  .intro-grid { grid-template-columns: 1fr; gap: 14px; }
  .collage { order: -1; height: 92vw; max-height: 480px; margin: 8px 0 6px; }
  .polaroid { padding: 7px 7px 0; box-shadow: 5px 5px 0 var(--ink); }
  .polaroid figcaption { font-size: 17px; padding: 3px 0 6px; }
  .polaroid .tape { width: 70px; height: 22px; margin-left: -35px; }
  .p2 { width: 32%; top: 30%; }
  .cut-label { font-size: 18px; }
  .sticker.drag { scale: 0.68; }
  .drag-hint { font-size: 19px; bottom: -14px; }
  .ransom { gap: 4px; }
  .ransom .tile { box-shadow: 3px 3px 0 var(--ink); border-width: 2.5px; }
  .d5 { top: 12%; left: 2%; }
  .d3 { top: auto; bottom: -9%; left: 36%; }
  .d6, .d7 { display: none; }
  .intro-cta { margin-bottom: 8px; }
  .rating { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .mini-pol { top: -58px; right: -4px; width: 78px; padding: 5px 5px 14px; }
  .q-title { padding-right: 76px; }
  .q-actions .key-hint { display: none; }
  .q-back { bottom: 12px; }
}
@media (max-width: 420px) {
  .rel-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .rel-card { padding: 12px; font-size: 14.5px; }
  .pill { padding: 7px 12px; font-size: 13px; }
  .brand { font-size: 15px; }
  .input-line, .input-area { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
