:root {
  --wine: #54172b;
  --wine-deep: #2b0b17;
  --berry: #8d2949;
  --rose: #e9a9b9;
  --blush: #f8e8e8;
  --cream: #fff9f1;
  --ink: #27171b;
  --muted: #765f66;
  --line: rgba(84, 23, 43, 0.13);
  --white: #ffffff;
  --shadow: 0 28px 80px rgba(70, 20, 36, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--cream); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(233,169,185,.42), transparent 28%),
    radial-gradient(circle at 90% 85%, rgba(141,41,73,.18), transparent 31%),
    linear-gradient(145deg, #fffdf8 0%, #fff5f0 55%, #fbe9ec 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
  z-index: 0;
}
.ambient-one { width: 150px; height: 150px; top: -60px; right: -40px; background: rgba(141,41,73,.15); }
.ambient-two { width: 180px; height: 180px; bottom: -80px; left: -70px; background: rgba(233,169,185,.24); }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.icon-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--wine);
  background: rgba(255,255,255,.72);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.icon-button:active { transform: scale(.94); }

.progress-wrap { flex: 1; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.heart-progress { display: flex; gap: 5px; }
.progress-heart { color: rgba(84,23,43,.15); font-size: 15px; line-height: 1; transition: color .25s ease, transform .25s ease; }
.progress-heart.filled { color: var(--berry); transform: scale(1.08); }

.screen {
  display: none;
  opacity: 0;
  transform: translateY(12px);
}
.screen.active { display: block; animation: screenIn .46s cubic-bezier(.22,.9,.3,1) forwards; }
@keyframes screenIn { to { opacity: 1; transform: translateY(0); } }

#welcome-screen { padding-top: clamp(34px, 9vh, 90px); text-align: center; }

.mini-pill {
  display: inline-flex;
  padding: 8px 13px;
  border: 1px solid rgba(84,23,43,.16);
  border-radius: 999px;
  color: var(--wine);
  background: rgba(255,255,255,.65);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}
.hero-heart {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 28px auto 22px;
  border-radius: 32px;
  color: #fff;
  background: linear-gradient(145deg, var(--berry), var(--wine));
  box-shadow: 0 20px 35px rgba(84,23,43,.26);
  font-size: 43px;
  transform: rotate(-4deg);
  animation: heartbeat 2.2s infinite;
}
@keyframes heartbeat { 0%, 100% { transform: rotate(-4deg) scale(1); } 12% { transform: rotate(-4deg) scale(1.07); } 22% { transform: rotate(-4deg) scale(1); } }

.eyebrow { margin: 0 0 10px; color: var(--berry); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.eyebrow.light { color: #f5cbd5; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -.035em; }
h1 { font-size: clamp(39px, 10vw, 58px); line-height: .98; }
h2 { font-size: clamp(32px, 8vw, 46px); line-height: 1.02; }
.lead { margin: 20px auto 0; max-width: 420px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.lead.compact { font-size: 16px; }

.notice-card {
  display: flex;
  gap: 13px;
  margin: 28px 0 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  text-align: left;
  background: rgba(255,255,255,.68);
  box-shadow: 0 14px 35px rgba(84,23,43,.07);
  backdrop-filter: blur(10px);
}
.notice-icon { font-size: 25px; }
.notice-card strong { color: var(--wine); font-size: 13px; }
.notice-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.primary-button, .secondary-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--berry), var(--wine));
  box-shadow: 0 17px 30px rgba(84,23,43,.24);
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 21px 36px rgba(84,23,43,.28); }
.primary-button:active { transform: translateY(1px) scale(.99); }
.primary-button:disabled { cursor: wait; opacity: .7; }
.secondary-button { margin-top: 22px; border: 1px solid var(--line); color: var(--wine); background: rgba(255,255,255,.78); }
.tiny-copy, .final-note { color: var(--muted); font-size: 12px; text-align: center; }

.question-card {
  min-height: min(630px, calc(100vh - 120px));
  padding: 30px 22px 24px;
  border: 1px solid rgba(84,23,43,.1);
  border-radius: 32px;
  background: rgba(255,252,248,.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.question-number { margin-bottom: 18px; color: var(--berry); font-size: 11px; font-weight: 900; letter-spacing: .15em; }
.question-subtitle { margin: 13px 0 23px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.answers { display: grid; gap: 11px; margin-top: 26px; }
.answer-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  text-align: left;
  background: rgba(255,255,255,.86);
  cursor: pointer;
  transition: border .2s ease, transform .2s ease, background .2s ease, color .2s ease;
}
.answer-button:hover { transform: translateY(-1px); border-color: rgba(84,23,43,.3); }
.answer-button.selected { border-color: var(--berry); color: var(--wine); background: #f8e4e9; }
.answer-letter {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--berry);
  background: var(--blush);
  font-size: 11px;
  font-weight: 900;
}

.text-answer { margin-top: 25px; }
.text-answer textarea {
  width: 100%;
  min-height: 138px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  line-height: 1.5;
  transition: border .2s ease, box-shadow .2s ease;
}
.text-answer textarea:focus { border-color: var(--berry); box-shadow: 0 0 0 4px rgba(141,41,73,.09); }
.text-counter { margin: 7px 3px 14px; color: var(--muted); font-size: 11px; text-align: right; }

.reaction {
  margin-top: 17px;
  padding: 14px 15px;
  border-radius: 15px;
  color: var(--wine);
  background: var(--blush);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  animation: pop .28s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.trap-wrap { margin-top: 27px; }
.trap-zone {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  border: 1px dashed rgba(84,23,43,.22);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.76), rgba(248,232,232,.75));
}
.trap-button {
  position: absolute;
  width: calc(50% - 17px);
  min-height: 58px;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  font-weight: 900;
  transition: left .22s cubic-bezier(.2,.8,.2,1), top .22s cubic-bezier(.2,.8,.2,1), transform .18s ease;
}
.trap-button:active { transform: scale(.96); }
.trap-me { left: 10px; top: 73px; color: #fff; background: linear-gradient(135deg, var(--berry), var(--wine)); }
.trap-mother { right: 10px; top: 73px; color: var(--wine); background: #fff; border: 1px solid var(--line); }
.trap-count { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; color: var(--muted); font-size: 11px; text-align: center; }

#result-screen { padding-top: clamp(24px, 8vh, 70px); text-align: center; }
.result-seal {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 26px;
  border: 2px solid var(--berry);
  border-radius: 50%;
  color: var(--wine);
  transform: rotate(-7deg);
  box-shadow: inset 0 0 0 6px var(--cream), inset 0 0 0 8px rgba(141,41,73,.22);
}
.result-seal span { margin-top: 14px; font-family: Georgia, serif; font-size: 34px; font-weight: 800; }
.result-seal small { margin-top: -18px; font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.result-list { display: grid; gap: 10px; margin: 28px 0; text-align: left; }
.result-list div { padding: 14px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.7); font-size: 14px; font-weight: 700; }
.result-list span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; color: white; background: var(--berry); }
.consent-copy { margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.submit-status { min-height: 18px; color: var(--muted); font-size: 12px; }

#final-screen { padding-top: 10px; }
.gift-card {
  position: relative;
  overflow: hidden;
  padding: 30px 22px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(145deg, #7d2441 0%, #421020 72%);
  box-shadow: 0 28px 55px rgba(67,16,33,.29);
}
.gift-card::after { content: "♥"; position: absolute; right: -22px; top: -32px; color: rgba(255,255,255,.08); font-size: 150px; }
.gift-items { display: grid; gap: 10px; margin-top: 24px; }
.gift-items > div { display: flex; align-items: center; gap: 13px; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; background: rgba(255,255,255,.07); }
.gift-items span { font-size: 25px; }
.gift-items p { margin: 0; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.4; }
.gift-items strong { color: white; font-size: 14px; }
.gift-footnote { margin: 20px 0 0; color: rgba(255,255,255,.63); font-size: 11px; text-align: center; }

.love-letter { overflow: hidden; margin-top: 24px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.photo-wrap { position: relative; aspect-ratio: 4 / 4.3; overflow: hidden; background: #ecd9da; }
.photo-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: 54% 50%; display: block; }
.photo-wrap::after { content: ""; position: absolute; inset: auto 0 0; height: 35%; background: linear-gradient(transparent, rgba(29,6,14,.62)); }
.photo-caption { position: absolute; z-index: 1; left: 18px; bottom: 16px; color: #fff; font-family: Georgia, serif; font-size: 22px; font-style: italic; }
.letter-content { padding: 27px 22px 30px; }
.letter-content h2 { margin-bottom: 19px; }
.letter-content p { color: #604c53; font-size: 15px; line-height: 1.7; }
.letter-content .signature { margin-top: 25px; color: var(--wine); font-family: Georgia, serif; font-size: 18px; }

#heart-rain { position: fixed; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }
.falling-heart { position: absolute; top: -40px; animation: fall var(--duration) linear forwards; font-size: var(--size); opacity: .88; }
@keyframes fall { to { transform: translate3d(var(--drift), 115vh, 0) rotate(520deg); opacity: .2; } }

.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (min-width: 700px) {
  .app-shell { padding-top: 42px; padding-bottom: 60px; }
  .question-card { padding: 38px 34px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Réactions lisibles : elles restent à l'écran jusqu'au clic sur Continuer. */
.reaction-text {
  margin: 0;
}
.reaction-continue {
  width: 100%;
  min-height: 46px;
  margin-top: 13px;
  padding: 11px 15px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--berry), var(--wine));
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(84, 23, 43, .15);
}
.reaction-continue:active { transform: scale(.985); }
.reaction-continue:disabled { opacity: .58; cursor: wait; }
