:root {
  --rose: #e0315b;
  --rose-dark: #b81f45;
  --rose-soft: #ff8fab;
  --blush: #fff1f4;
  --blush-2: #fde0e8;
  --ink: #3b2a30;
  --muted: #8d6f78;
  --line: #f4cdd8;
  --card: rgba(255, 255, 255, 0.86);
  --shadow: 0 18px 50px -18px rgba(184, 31, 69, 0.35);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #fff6f8 0%, var(--blush-2) 55%, #fbd3de 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ---------- arka plandaki süzülen kalpler ---------- */
.bg-hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-hearts span {
  position: absolute; bottom: -40px; color: var(--rose-soft); opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: var(--o, .25); }
  90% { opacity: var(--o, .25); }
  100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}

.preview-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  background: var(--ink); color: #fff; text-align: center; font-size: 13px; padding: 6px;
}

/* ---------- yerleşim ---------- */
.stage {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
}

.card {
  width: 100%; max-width: 440px;
  background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 34px 24px 26px;
  text-align: center;
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
.card.leaving { opacity: 0; transform: translateY(-14px) scale(.98); }
.card.entering { opacity: 0; transform: translateY(16px) scale(.98); transition: none; }

/* ---------- ilerleme ---------- */
.progress { width: 100%; max-width: 440px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-track { flex: 1; height: 6px; border-radius: 99px; background: rgba(224, 49, 91, .14); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--rose-soft), var(--rose)); transition: width .5s var(--ease); }
.progress-text { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 38px; text-align: right; }

/* ---------- metinler ---------- */
h1, h2 {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 600;
  color: var(--rose-dark); margin: 0 0 12px; line-height: 1.25;
}
h1 { font-size: 30px; }
h2 { font-size: 24px; }
.lead { font-size: 16.5px; line-height: 1.6; color: var(--ink); margin: 0 0 24px; white-space: pre-line; }
.muted { color: var(--muted); font-size: 14px; }
.signature { font-family: 'Playfair Display', Georgia, serif; font-style: italic; color: var(--rose); font-size: 19px; margin: 6px 0 22px; }
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 16px; }

.photo {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover; display: block;
  margin: -4px auto 20px; border: 5px solid #fff;
  box-shadow: 0 0 0 2px var(--rose-soft), 0 12px 30px -10px rgba(184, 31, 69, .5);
}
.photo.small { width: 96px; height: 96px; }
.envelope { font-size: 54px; margin-bottom: 8px; display: inline-block; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* ---------- butonlar ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  font-size: 17px; border-radius: 99px; padding: 15px 30px; min-height: 52px;
  transition: transform .18s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, #f0587c, var(--rose));
  box-shadow: 0 10px 24px -10px rgba(224, 49, 91, .8);
}
.btn-primary:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); padding: 15px 18px; }
.btn-ghost:hover { color: var(--rose); }
.btn-block { width: 100%; }

.nav { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
.nav .btn-primary { flex: 1; }

/* ---------- evet / hayır ---------- */
.yesno { display: flex; justify-content: center; align-items: center; gap: 14px; min-height: 70px; margin-top: 8px; }
.btn-yes { font-size: 19px; padding: 16px 38px; transition: transform .3s var(--ease), box-shadow .2s; }
.btn-no {
  background: #fff; color: var(--muted); border: 1.5px solid var(--line);
  transition: left .35s var(--ease), top .35s var(--ease), transform .2s, font-size .2s;
  z-index: 20; white-space: nowrap;
}
.btn-no.escaped { position: fixed; margin: 0; }
.no-taunt { min-height: 20px; margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- seçenekler ---------- */
.question { font-size: 22px; margin-bottom: 6px; }
.options { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 4px; text-align: left; }
.option {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 16px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line);
  font-size: 16px; font-weight: 600; line-height: 1.35;
  transition: border-color .2s, background .2s, transform .15s var(--ease), box-shadow .2s;
  user-select: none;
}
.option:active { transform: scale(.985); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .mark {
  flex: none; width: 22px; height: 22px; border: 2px solid var(--line); background: #fff;
  display: grid; place-items: center; transition: all .2s var(--ease);
}
.option.single .mark { border-radius: 50%; }
.option.multi .mark { border-radius: 7px; }
.option .mark::after {
  content: ''; width: 10px; height: 10px; border-radius: inherit; background: #fff; transform: scale(0); transition: transform .2s var(--ease);
}
.option.multi .mark::after { content: '✓'; width: auto; height: auto; background: none; color: #fff; font-size: 14px; font-weight: 800; line-height: 1; }
.option.checked { border-color: var(--rose); background: #fff5f7; box-shadow: 0 6px 16px -10px rgba(224, 49, 91, .6); }
.option.checked .mark { border-color: var(--rose); background: var(--rose); }
.option.checked .mark::after { transform: scale(1); }
.option:has(input:focus-visible) { outline: 2px solid var(--rose-soft); outline-offset: 2px; }

.other-input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 2px;
  background: #fff; resize: vertical; min-height: 52px; display: none;
}
.other-input.show { display: block; animation: fadeIn .25s var(--ease); }
.other-input:focus { outline: none; border-color: var(--rose); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- kalp patlaması ---------- */
.burst { position: fixed; pointer-events: none; z-index: 40; font-size: 20px; color: var(--rose); animation: burst 1.3s var(--ease) forwards; }
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--r)); opacity: 0; }
}

/* ---------- müzik butonu ---------- */
.music-btn {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid #fff; cursor: pointer;
  background: rgba(255, 255, 255, .85); color: var(--rose); font-size: 20px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.music-btn.playing { animation: pulse 1.6s ease-in-out infinite; }
.music-btn.off { color: var(--muted); text-decoration: line-through; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- yükleniyor ---------- */
.loader { padding: 40px 0; font-size: 34px; color: var(--rose); }
.loader span { display: inline-block; animation: beat 1s ease-in-out infinite; }
@keyframes beat { 30% { transform: scale(1.25); } 60% { transform: scale(1); } }

.error { color: var(--rose-dark); font-size: 14px; margin-top: 12px; }

@media (min-width: 600px) {
  .card { padding: 44px 40px 34px; }
  h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bg-hearts { display: none; }
}
