:root {
  --bg: #fff3ee; --card: #ffffff; --ink: #4a2433; --muted: #8a6272;
  --rose: #d6547a; --rose-deep: #b33a61; --blush: #ffd9e2; --leaf: #3f9a6b; --oops: #e0762e;
  --shadow: 0 10px 30px rgba(179, 58, 97, .15);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #24131b; --card: #33202a; --ink: #ffe9ef; --muted: #d3a9b8; --blush: #4b2635; --shadow: 0 10px 30px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 17px/1.5 "Nunito", system-ui, sans-serif;
  background-image: radial-gradient(circle at 15% 10%, var(--blush), transparent 45%), radial-gradient(circle at 90% 90%, var(--blush), transparent 40%);
  min-height: 100dvh; overflow-x: hidden;
}
#app { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; position: relative; z-index: 2; }
h1, h2 { font-family: "Caveat", cursive; font-weight: 700; margin: 0; line-height: 1.1; }
h1 { font-size: 3rem; } h2 { font-size: 2.1rem; }

.progress { display: flex; gap: 6px; justify-content: center; padding: 6px 0 16px; min-height: 40px; }
.progress .pip { font-size: 18px; filter: grayscale(1) opacity(.35); transition: filter .4s, transform .4s; }
.progress .pip.on { filter: none; transform: scale(1.15); }
.progress.hidden { visibility: hidden; }

.card { background: var(--card); border-radius: 28px; padding: 28px 22px; box-shadow: var(--shadow); animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.section { color: var(--rose); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; margin-bottom: 6px; }
.emoji { font-size: 3rem; display: block; margin-bottom: 4px; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.lead { color: var(--muted); margin: 10px 0 18px; }

.opts { display: grid; gap: 10px; margin: 18px 0 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
.opt, .chip, .slot {
  text-align: left; background: var(--bg); border: 2px solid var(--blush); border-radius: 16px;
  padding: 13px 16px; min-height: 48px; transition: transform .15s, border-color .15s, background .15s;
}
.opt:active, .chip:active { transform: scale(.98); }
.opt:hover:not(:disabled), .chip:hover { border-color: var(--rose); }
.opt.right { background: #dff5e8; border-color: var(--leaf); color: #1f5a3b; }
.opt.wrong { background: #ffe8d6; border-color: var(--oops); color: #7a3a10; animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.chip { display: inline-flex; gap: 8px; align-items: center; border-radius: 999px; }
.chip.on { background: var(--rose); border-color: var(--rose); color: #fff; font-weight: 700; }

.slots { display: grid; gap: 8px; margin: 12px 0; }
.slot { display: flex; gap: 10px; align-items: center; border-style: dashed; }
.slot .n { font-family: "Caveat", cursive; font-size: 1.6rem; color: var(--rose); width: 1.2em; }
.slot.filled { border-style: solid; }

textarea, input[type=text] {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 2px solid var(--blush); border-radius: 16px; padding: 12px 14px; margin-top: 12px; resize: vertical;
}
textarea:focus, input[type=text]:focus { outline: none; border-color: var(--rose); }

.feedback { min-height: 1.6em; margin: 12px 0 0; font-weight: 600; }
.feedback.good { color: var(--leaf); } .feedback.bad { color: var(--oops); }
.actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; }
.btn { background: var(--rose); color: #fff; border: 0; border-radius: 999px; padding: 14px 26px; font-weight: 700; min-height: 48px; box-shadow: 0 6px 16px rgba(214, 84, 122, .35); transition: transform .15s, background .15s; }
.btn:hover:not(:disabled) { background: var(--rose-deep); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; box-shadow: none; cursor: default; }
.btn.ghost { background: transparent; color: var(--rose-deep); box-shadow: none; border: 2px solid var(--blush); }
.center { text-align: center; }

.thinking { text-align: center; padding: 40px 0; }
.thinking .beat { font-size: 4rem; display: block; animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.25); } 60% { transform: scale(1.05); } }
.finale .photo { margin: 0 0 18px; opacity: 0; animation: rise .9s ease .1s forwards; transform-origin: center; }
.finale .photo img { display: block; width: 100%; height: auto; border-radius: 20px; border: 5px solid #fff; box-shadow: 0 8px 24px rgba(179, 58, 97, .3); }
.finale p { margin: 0 0 14px; opacity: 0; animation: rise .8s ease forwards; }
.finale .signoff { font-family: "Caveat", cursive; font-size: 2rem; color: var(--rose-deep); text-align: right; margin-top: 18px; }

.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.hearts span { position: absolute; bottom: -40px; opacity: .0; animation: float linear infinite; }
@keyframes float { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .5; } 100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 3; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } .finale .photo { margin: 0 0 18px; opacity: 0; animation: rise .9s ease .1s forwards; transform-origin: center; }
.finale .photo img { display: block; width: 100%; height: auto; border-radius: 20px; border: 5px solid #fff; box-shadow: 0 8px 24px rgba(179, 58, 97, .3); }
.finale p, .finale .photo { opacity: 1; } }
