/* ---------------------------------------------------------------
   Lily & Jordi — love colours
--------------------------------------------------------------- */
:root {
  --red: #e11d48;
  --red-deep: #c9184a;
  --red-soft: #ff4d6d;
  --pink: #ff8fab;
  --pink-soft: #ffb3c6;
  --pink-pale: #ffe0e6;
  --cream: #fff0f3;
  --ink: #4a1020;
  --white: #ffffff;
  --shadow: 0 24px 60px -18px rgba(201, 24, 74, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 15% -10%, #ffd0dc 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 20%, #ffb3c6 0%, transparent 50%),
    linear-gradient(160deg, #ffe3ea 0%, #ffd1dc 45%, #ffc0cf 100%);
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
}

/* floating hearts background */
.hearts-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hearts-bg span {
  position: absolute;
  bottom: -40px;
  font-size: var(--s, 20px);
  opacity: var(--o, .5);
  animation: floatUp var(--d, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg) scale(.9); opacity: 0; }
  10%  { opacity: var(--o, .5); }
  90%  { opacity: var(--o, .5); }
  100% { transform: translateY(-115dvh) rotate(220deg) scale(1.1); opacity: 0; }
}

canvas#fx { position: fixed; inset: 0; z-index: 6; pointer-events: none; }

/* stage / screens */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}
.screen {
  grid-area: 1 / 1;
  width: 100%;
  max-width: 560px;
  display: none;
  animation: none;
}
.screen.is-active { display: block; animation: pop .55s cubic-bezier(.2,.9,.25,1.1) both; }
@keyframes pop {
  0%   { opacity: 0; transform: translateY(22px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* card */
.card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 34px 30px 38px;
  text-align: center;
}

/* photo */
.photo-frame {
  position: relative;
  width: fit-content;
  margin: 0 auto 6px;
  border-radius: 26px;
  padding: 8px;
  background: linear-gradient(135deg, var(--red-soft), var(--pink));
  box-shadow: 0 18px 40px -14px rgba(201,24,74,.55);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: translateY(-4px); } }
.photo {
  display: block;
  width: 100%;
  max-width: 320px;
  max-height: 46dvh;
  object-fit: cover;
  border-radius: 20px;
}
.photo-frame.small .photo { max-height: 30dvh; max-width: 240px; }
.photo-heart {
  position: absolute;
  right: -12px;
  top: -12px;
  font-size: 34px;
  filter: drop-shadow(0 4px 8px rgba(201,24,74,.45));
  animation: beat 1.1s ease-in-out infinite;
}
@keyframes beat { 0%,100%{transform:scale(1)} 15%{transform:scale(1.25)} 30%{transform:scale(1)} 45%{transform:scale(1.18)} }

.intro-hint {
  font-family: "Dancing Script", cursive;
  font-size: 26px;
  color: var(--red-deep);
  margin: 14px 0 20px;
}

/* typography */
.script { font-family: "Dancing Script", cursive; font-weight: 700; }
.accent { color: var(--red-deep); }
h1.script { font-size: clamp(2.4rem, 8vw, 3.4rem); line-height: 1.05; margin-bottom: 12px; }
.q {
  font-family: "Playfair Display", serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 5.5vw, 2.1rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 6px 0 20px;
}
.q.big { font-size: clamp(1.7rem, 6.5vw, 2.5rem); }
.lead { font-size: 1.18rem; font-weight: 500; margin-bottom: 10px; }
.sub { color: #7a2540; font-size: 1rem; margin-bottom: 22px; line-height: 1.5; }
.qtag {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--white);
  background: var(--red-deep);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* buttons */
.btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 15px 34px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.3), box-shadow .2s, background .2s;
  user-select: none;
  touch-action: manipulation;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-soft) 0%, var(--red-deep) 100%);
  box-shadow: 0 14px 26px -10px rgba(201,24,74,.7);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 20px 34px -10px rgba(201,24,74,.8); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-start { font-size: 1.2rem; padding: 16px 54px; letter-spacing: .02em; }
.btn-ghost {
  color: var(--red-deep);
  background: rgba(255,255,255,.7);
  border: 2px solid var(--pink-soft);
}
.btn-ghost:hover { background: #fff; }

.choices { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-choice {
  min-width: 130px;
  color: var(--red-deep);
  background: #fff;
  border: 2px solid var(--pink-soft);
  box-shadow: 0 10px 22px -14px rgba(201,24,74,.6);
}
.btn-choice:hover { transform: translateY(-3px); border-color: var(--red-soft); }
.btn-choice.shake { animation: shake .45s; border-color: var(--red); }
@keyframes shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)}
  60%{transform:translateX(-6px)} 80%{transform:translateX(5px)}
}

.feedback { margin-top: 18px; min-height: 1.4em; font-weight: 500; color: var(--red-deep); line-height: 1.45; }
.feedback.show { animation: pop .4s both; }

/* slider */
.rate { margin: 8px 0 26px; }
.rate-value {
  font-family: "Playfair Display", serif;
  font-weight: 800;
  font-size: 4.6rem;
  line-height: 1;
  color: var(--red-deep);
  transition: transform .15s;
}
.rate-value.bump { transform: scale(1.15); }
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; max-width: 340px; height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red-deep) 0%, var(--red-soft) 50%, var(--pink) 100%);
  outline: none; margin: 18px auto 8px; display: block;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 4px solid var(--red-deep);
  box-shadow: 0 6px 14px rgba(201,24,74,.5); cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 4px solid var(--red-deep);
  box-shadow: 0 6px 14px rgba(201,24,74,.5); cursor: pointer;
}
.rate-scale { display: flex; justify-content: space-between; max-width: 340px; margin: 0 auto; color: #a83b57; font-size: .85rem; font-weight: 600; }

/* magnet area (Q3) */
.magnet-area {
  position: relative;
  min-height: 150px;
  display: flex; gap: 16px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.magnet-yes { position: relative; z-index: 2; will-change: transform; transition: box-shadow .18s; }
.magnet-yes::after {
  content: ""; position: absolute; inset: -6px; border-radius: 999px;
  border: 2px solid rgba(255, 77, 109, .55); pointer-events: none;
  animation: invite 1.6s ease-out infinite;
}
@keyframes invite { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.55); opacity: 0; } }
.magnet-yes.is-near {
  box-shadow: 0 0 0 10px rgba(255, 77, 109, .22), 0 24px 46px -8px rgba(201, 24, 74, .95);
}
.magnet-no { will-change: transform; }
.cursor-heart.is-near { filter: drop-shadow(0 0 15px rgba(255, 77, 109, .95)); }

/* final area (Q4) */
.final-card { min-height: 60dvh; display: flex; flex-direction: column; justify-content: center; }
.final-area {
  position: relative;
  min-height: 220px;
  margin-top: 10px;
}
.btn-yes {
  font-size: 1.35rem; padding: 18px 56px;
  position: relative; z-index: 2;
  animation: yesPulse 1.4s ease-in-out infinite;
}
@keyframes yesPulse { 50% { transform: scale(1.06); box-shadow: 0 22px 40px -10px rgba(201,24,74,.9); } }
.btn-no {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(calc(-50% + 120px), -50%);
  z-index: 3;
  transition: transform .12s ease, opacity .3s;
}

/* custom heart cursor (magnet) */
.cursor-heart {
  position: fixed; left: 0; top: 0;
  font-size: 30px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9;
  display: none;
  filter: drop-shadow(0 4px 8px rgba(201,24,74,.5));
  transition: font-size .15s;
}
body.magnet-on .cursor-heart { display: block; }
body.magnet-on .magnet-area { cursor: none; }

/* toast */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 30px);
  background: var(--red-deep); color: #fff;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 500; font-size: .98rem;
  box-shadow: 0 14px 30px -8px rgba(201,24,74,.7);
  opacity: 0; pointer-events: none; z-index: 10;
  max-width: 90vw; text-align: center;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .35s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.yay-title { color: var(--red-deep); }
.yay-card .lead { margin-top: 6px; }

/* three-language "I love you" finale */
.love-langs { display: flex; flex-direction: column; gap: 0; margin: 16px 0 10px; }
.love-langs span {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  font-size: clamp(1.9rem, 6.5vw, 2.7rem);
  line-height: 1.18;
  opacity: 0;
  transform: translateY(14px) scale(.9);
  animation: loveIn .7s cubic-bezier(.2, .9, .25, 1.25) forwards;
  animation-delay: calc(var(--i) * .6s + .35s);
}
.love-langs span:nth-child(1) { color: var(--red-deep); }
.love-langs span:nth-child(2) { color: var(--red-soft); }
.love-langs span:nth-child(3) { color: #d81e5b; }
@keyframes loveIn { to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- LOCK screen: hangman ---------- */
.lock-card .sub { margin-bottom: 12px; }
.gallows { width: 138px; height: 138px; display: block; margin: 2px auto 8px; }
.gallows .gal line { stroke: #b83a57; stroke-width: 5; stroke-linecap: round; }
.gallows .part {
  stroke: var(--red-deep); fill: none; stroke-width: 5; stroke-linecap: round;
  opacity: 0; transition: opacity .3s;
}
.gallows .part.on { opacity: 1; }
.word { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 16px; }
.word .slot {
  width: 34px; height: 46px; border-bottom: 4px solid var(--pink-soft);
  font-family: "Playfair Display", serif; font-weight: 800; font-size: 2rem;
  color: var(--red-deep); display: grid; place-items: center;
}
.word .slot.filled { animation: pop .3s both; border-bottom-color: var(--red-deep); }
.keyboard {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px;
  max-width: 340px; margin: 0 auto;
}
.key {
  font-family: inherit; font-weight: 700; font-size: 1rem;
  border: none; border-radius: 10px; padding: 12px 0; cursor: pointer;
  background: #fff; color: var(--red-deep);
  box-shadow: 0 6px 14px -8px rgba(201, 24, 74, .5);
  transition: transform .1s, background .2s, opacity .2s;
  touch-action: manipulation;
}
.key:hover:not(:disabled) { transform: translateY(-2px); background: var(--pink-pale); }
.key:disabled { cursor: default; opacity: .5; box-shadow: none; }
.key.correct { background: #2fae66; color: #fff; opacity: 1; }
.key.wrong { background: #eab6c3; color: #8a2a44; opacity: 1; }
.hint { margin-top: 18px; animation: pop .45s both; }
.hint img { max-width: 220px; width: 68%; border-radius: 16px; box-shadow: var(--shadow); }
.hint p { margin-top: 10px; color: var(--red-deep); font-weight: 500; }

/* ---------- WhatsApp box (finale) ---------- */
.wa-box {
  margin: 22px auto 10px; max-width: 380px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--pink-soft);
  border-radius: 18px; padding: 16px 18px;
}
.wa-title { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.wa-sub { font-size: .9rem; color: #7a2540; margin-bottom: 10px; }
.wa-msg {
  background: #dcf8c6; color: #1f2a1f; border-radius: 12px 12px 12px 3px;
  padding: 11px 15px; font-size: 1.02rem; display: inline-block; margin-bottom: 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .08);
}
.wa-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-wa { color: #fff; background: #25D366; box-shadow: 0 12px 22px -10px rgba(37, 211, 102, .8); }
.btn-wa:hover { transform: translateY(-3px) scale(1.03); background: #1eb457; }

/* ---------- music toggle ---------- */
.music-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 11;
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1.3rem; background: rgba(255, 255, 255, .88); color: var(--red-deep);
  box-shadow: 0 10px 24px -8px rgba(201, 24, 74, .6);
}

@media (max-width: 480px) {
  .stage { padding: 16px 12px; }
  .card { padding: 24px 18px 26px; border-radius: 24px; }
  .btn { padding: 14px 26px; }
  .q { font-size: clamp(1.35rem, 6.2vw, 1.9rem); }
  .q.big { font-size: clamp(1.55rem, 7.5vw, 2.2rem); }
  .word .slot { width: 30px; height: 42px; font-size: 1.7rem; }
  .keyboard { gap: 6px; max-width: 330px; }
  .key { padding: 11px 0; font-size: .95rem; }
  .gallows { width: 116px; height: 116px; margin-bottom: 4px; }
  .photo { max-height: 40dvh; }
  .photo-frame.small .photo { max-height: 26dvh; }
  .love-langs span { font-size: clamp(1.55rem, 8.5vw, 2.2rem); }
  .final-card { min-height: 68dvh; }
  .wa-box { margin-top: 16px; }
  .music-btn { width: 42px; height: 42px; font-size: 1.15rem; right: 12px; bottom: 12px; }
}
