:root {
  --cream: #fff6f1;
  --card: #ffffff;
  --ink: #4b2f3d;
  --muted: #8d7180;
  --line: #f6dde5;

  --rose: #f0648f;
  --rose-deep: #cf3f6e;
  --rose-soft: #ffe4ec;
  --lav: #7f7be6;
  --lav-deep: #5a55c9;
  --lav-soft: #eae9ff;
  --butter: #fff0bf;
  --amber: #e0921f;
  --amber-soft: #fff1d6;
  --plum: #8a7a86;
  --plum-soft: #efe9ed;
  --mint-soft: #dcf5ea;

  --accent: var(--rose);
  --accent-deep: var(--rose-deep);
  --accent-soft: var(--rose-soft);

  --radius: 26px;
  --shadow: 0 10px 30px -14px rgba(207, 63, 110, 0.35), 0 2px 6px rgba(75, 47, 61, 0.05);
  --display: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, sans-serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
}

body[data-user='dustin'] {
  --accent: var(--lav);
  --accent-deep: var(--lav-deep);
  --accent-soft: var(--lav-soft);
  --shadow: 0 10px 30px -14px rgba(90, 85, 201, 0.35), 0 2px 6px rgba(75, 47, 61, 0.05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
}

/* Soft blobs and a sprinkle of hearts behind everything */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42rem 30rem at 8% -6%, var(--rose-soft), transparent 62%),
    radial-gradient(38rem 28rem at 104% 12%, var(--lav-soft), transparent 60%),
    radial-gradient(36rem 26rem at 50% 112%, var(--butter), transparent 62%),
    var(--cream);
}
.sky::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%23f7c3d3'%3E%3Cpath transform='translate(20 24) scale(.7) rotate(-14)' d='M12 21s-7.5-4.9-7.5-10.4C4.5 7.9 6.5 6 8.8 6c1.3 0 2.5.6 3.2 1.7C12.7 6.6 13.9 6 15.2 6c2.3 0 4.3 1.9 4.3 4.6C19.5 16.1 12 21 12 21z'/%3E%3Cpath transform='translate(118 96) scale(.5) rotate(18)' d='M12 21s-7.5-4.9-7.5-10.4C4.5 7.9 6.5 6 8.8 6c1.3 0 2.5.6 3.2 1.7C12.7 6.6 13.9 6 15.2 6c2.3 0 4.3 1.9 4.3 4.6C19.5 16.1 12 21 12 21z'/%3E%3C/g%3E%3Ccircle cx='150' cy='30' r='3' fill='%23d5d3ff'/%3E%3Ccircle cx='60' cy='140' r='4' fill='%23ffe6a3'/%3E%3C/svg%3E");
}

#app {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 20px 16px 72px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 3px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-deep);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 5px 0 -1px color-mix(in srgb, var(--accent-deep) 70%, #000);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 -1px color-mix(in srgb, var(--accent-deep) 70%, #000); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }

.btn.soft {
  background: var(--card);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 2px var(--accent-soft), 0 4px 0 -1px var(--accent-soft);
}
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.btn.big { min-height: 56px; padding: 14px 28px; font-size: 19px; }

/* ---------- welcome ---------- */

.welcome { text-align: center; padding-top: 6vh; }

.welcome .kicker {
  font-family: var(--hand);
  font-size: 30px;
  color: var(--rose-deep);
  transform: rotate(-3deg);
  display: inline-block;
}
.welcome h1 { font-size: clamp(44px, 12vw, 72px); letter-spacing: -0.01em; }
.welcome h1 .heart { display: inline-block; width: 0.8em; vertical-align: -0.06em; animation: beat 1.6s ease-in-out infinite; }
.welcome h1 .heart svg { fill: var(--rose); display: block; }
.welcome .sub { margin-top: 8px; color: var(--muted); font-size: 19px; }

.who { margin-top: 36px; font-family: var(--display); font-size: 24px; }

.people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 12px 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.person:hover { transform: translateY(-4px) rotate(-1.5deg); }
.person:nth-child(2):hover { transform: translateY(-4px) rotate(1.5deg); }
.person:active { transform: scale(0.97); }
.person .face {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 46% 54% 52% 48% / 55% 48% 52% 45%;
  font-family: var(--display);
  font-size: 46px;
  color: #fff;
}
.person.lindsey .face { background: var(--rose); box-shadow: inset -8px -8px 0 rgba(207, 63, 110, 0.35); }
.person.dustin .face { background: var(--lav); box-shadow: inset -8px -8px 0 rgba(90, 85, 201, 0.4); }
.person .name { font-family: var(--display); font-size: 26px; }
.person .hint { color: var(--muted); font-size: 15px; }

.welcome .peek { margin-top: 28px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 22px; height: 22px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 8px;
  z-index: 5;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.topbar .line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 24px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.progress .track { flex: 1; height: 12px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.progress .fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 0.4s ease; }
.progress .status { min-width: 9ch; text-align: right; }
.progress .status.error { color: #b3261e; }

/* ---------- cards ---------- */

.part {
  margin: 34px 4px 12px;
}
.part .tag {
  font-family: var(--hand);
  font-size: 24px;
  color: var(--accent-deep);
}
.part h2 { font-size: 30px; }
.part p { margin-top: 4px; color: var(--muted); }

.card {
  margin-top: 14px;
  padding: 18px 18px 10px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card > h3 { font-size: 21px; display: flex; align-items: center; gap: 8px; }
.card > .lead { margin-top: 2px; font-family: var(--hand); font-size: 22px; color: var(--accent-deep); }
.card.note { padding-bottom: 18px; background: var(--butter); box-shadow: none; }
.card.note .legend { justify-content: flex-start; color: var(--ink); margin-top: 10px; }

.rows { margin-top: 8px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 2px dashed var(--line);
}
.row:first-child { border-top: 0; }
.row-label { flex: 1; min-width: 0; }

.marks { display: flex; gap: 6px; flex-shrink: 0; }

.mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #d9c3cc;
  transition: transform 0.15s cubic-bezier(0.3, 1.8, 0.6, 1), background 0.15s, border-color 0.15s, color 0.15s;
}
.mark svg, .badge svg, .legend svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mark svg { width: 26px; height: 26px; }
.mark:hover { transform: scale(1.08); }
.mark-heart:hover { color: var(--rose); border-color: var(--rose); }
.mark-squiggle:hover { color: var(--amber); border-color: var(--amber); }
.mark-x:hover { color: var(--plum); border-color: var(--plum); }

.mark[aria-pressed='true'] { transform: scale(1.1); animation: pop 0.3s ease; }
.mark-heart[aria-pressed='true'] { color: var(--rose-deep); border-color: var(--rose); background: var(--rose-soft); }
.mark-heart[aria-pressed='true'] svg { fill: var(--rose); stroke: var(--rose-deep); }
.mark-squiggle[aria-pressed='true'] { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.mark-x[aria-pressed='true'] { color: var(--ink); border-color: var(--plum); background: var(--plum-soft); }

.c-heart { color: var(--rose-deep); }
.c-heart svg { fill: var(--rose); }
.c-squiggle { color: var(--amber); }
.c-x { color: var(--plum); }

/* ---------- text answers ---------- */

.field { display: block; padding: 10px 0 12px; border-top: 2px dashed var(--line); }
.field:first-child { border-top: 0; }
.field .q { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffafc;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 24px;
  line-height: 1.25;
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); background: #fff; }
.field ::placeholder { color: #d6bfc8; }

.finish { margin-top: 34px; text-align: center; }
.finish .cheer { font-family: var(--hand); font-size: 28px; color: var(--accent-deep); margin-bottom: 12px; }

/* ---------- results ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 18px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.tab {
  flex: 1;
  min-height: 42px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.tab[aria-selected='true'] { background: var(--rose-deep); color: #fff; }
.tab.dustin[aria-selected='true'] { background: var(--lav-deep); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
}
.chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip[aria-pressed='true'] { border-color: var(--accent-deep); background: var(--accent-soft); }
.chip .n { color: var(--muted); font-weight: 800; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
}
.badge svg { width: 24px; height: 24px; }
.badge.none { color: #d9c3cc; }

.pair { display: grid; grid-template-columns: 52px 52px; flex-shrink: 0; justify-items: center; }
.pair-head {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 14px;
}
.pair-head .pair span:first-child { color: var(--rose-deep); }
.pair-head .pair span:last-child { color: var(--lav-deep); }

.row.sweet {
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-top-color: transparent;
  border-radius: 16px;
  background: var(--rose-soft);
}
.row.sweet + .row { border-top-color: transparent; }
.row.sweet .row-label::after {
  content: 'sweet spot';
  display: inline-block;
  margin-left: 8px;
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1;
  color: var(--rose-deep);
}

.callout {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--mint-soft);
  font-weight: 700;
}

.said { padding: 12px 0; border-top: 2px dashed var(--line); }
.said:first-child { border-top: 0; }
.said .q { font-weight: 800; }
.said dl { margin: 8px 0 0; display: grid; gap: 8px; }
.said dt { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.said dd { margin: 0; font-family: var(--hand); font-size: 25px; line-height: 1.2; overflow-wrap: anywhere; }
.said dd.blank { font-family: var(--body); font-size: 15px; color: #c9b3bc; }
.said .by-lindsey { color: var(--rose-deep); }
.said .by-dustin { color: var(--lav-deep); }

.empty { padding: 26px 8px 34px; text-align: center; color: var(--muted); }
.empty .big { font-family: var(--hand); font-size: 28px; color: var(--ink); }

.loading { padding: 80px 0; text-align: center; font-family: var(--hand); font-size: 30px; color: var(--muted); }
.oops { margin-top: 20vh; text-align: center; }
.oops p { margin: 8px 0 18px; color: var(--muted); }

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.16); }
  24% { transform: scale(1); }
  36% { transform: scale(1.1); }
}
@keyframes pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1.1); }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .card { padding: 16px 14px 8px; }
  .mark { width: 42px; height: 42px; }
  .marks { gap: 4px; }
  .person .face { width: 80px; height: 80px; font-size: 38px; }
  .row.sweet .row-label::after { display: block; margin: 2px 0 0; }
}

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