:root {
  --bg: #FBF3EF;
  --bg-2: #FBE7DE;
  --peach: #F2A585;
  --rose: #E0788A;
  --rose-deep: #C95C70;
  --ink: #3A2A2E;
  --ink-soft: #6E595E;
  --card: #FFFFFF;
  --line: #F0D9CF;
  --shadow: 0 18px 50px -22px rgba(160, 90, 80, 0.45);
  --radius: 26px;
  --radius-sm: 16px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Mulish", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-2) 0%, var(--bg) 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* ---------- üst ilerleme ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 20px 10px;
  background: linear-gradient(to bottom, var(--bg) 60%, rgba(251, 243, 239, 0));
}
.progress {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
}
.dot {
  width: 12px;
  height: 12px;
  background: var(--line);
  transition: background .35s ease, transform .35s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.2-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.8-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.2-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.8-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dot.active { background: var(--rose); transform: scale(1.4); }
.dot.done { background: var(--peach); }

/* ---------- sahne / kartlar ---------- */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 36px;
  position: relative;
}

.card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 30px 24px 28px;
  text-align: center;
  position: relative;
  animation: cardIn .5s cubic-bezier(.2, .8, .2, 1) both;
}
.card.leaving { animation: cardOut .32s ease both; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardOut {
  to { opacity: 0; transform: translateY(-14px) scale(.98); }
}

.kicker {
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--peach);
  font-weight: 700;
  margin: 0 0 12px;
}
.q-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(23px, 6.4vw, 30px);
  line-height: 1.18;
  margin: 0 0 8px;
  color: var(--ink);
}
.q-sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 22px;
  line-height: 1.5;
}

/* ---------- seçenekler ---------- */
.options { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.opt {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .25s ease;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.opt:hover { border-color: var(--peach); transform: translateY(-2px); }
.opt:active { transform: scale(.98); }
.opt:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }
.opt.selected {
  background: linear-gradient(135deg, var(--peach), var(--rose));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px -12px var(--rose);
}
.opt.gone {
  opacity: 0;
  transform: scale(.4) rotate(-8deg);
  pointer-events: none;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  border: 0;
}

/* ---------- butonlar ---------- */
.btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--peach), var(--rose));
  border: none;
  border-radius: 999px;
  padding: 15px 40px;
  cursor: pointer;
  box-shadow: 0 14px 28px -14px var(--rose);
  transition: transform .16s ease, box-shadow .16s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--peach); outline-offset: 3px; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn.ghost {
  background: transparent;
  color: var(--rose-deep);
  box-shadow: none;
  border: 1.5px solid var(--line);
  padding: 12px 26px;
  font-size: 15px;
}
.btn-row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 8px; }

.reaction {
  min-height: 22px;
  margin-top: 16px;
  font-size: 15px;
  color: var(--rose-deep);
  font-weight: 600;
  font-family: var(--serif);
  font-style: italic;
}

/* ---------- intro ---------- */
.intro .big-emoji { font-size: 56px; margin-bottom: 6px; animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.intro .q-title { font-size: clamp(28px, 8vw, 38px); }

/* ---------- 2: kedi ---------- */
.cat-runner {
  position: fixed;
  top: 50%;
  left: -90px;
  font-size: 54px;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
}
.cat-runner.run {
  animation: catRun 1.25s cubic-bezier(.4,0,.6,1) forwards;
}
@keyframes catRun {
  0%   { left: -90px; opacity: 1; transform: scaleX(1) rotate(0); }
  45%  { transform: scaleX(1) rotate(-6deg); }
  55%  { transform: scaleX(1) rotate(6deg); }
  100% { left: 110vw; opacity: 1; transform: scaleX(1) rotate(0); }
}
.opt.snatched { animation: snatch .5s ease forwards; }
@keyframes snatch {
  to { opacity: 0; transform: translateY(-40px) scale(.3) rotate(20deg); }
}

/* ---------- 3: balonlar ---------- */
.balloon-field {
  position: relative;
  height: 420px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.balloon {
  position: absolute;
  top: 0; left: 0;
  padding: 11px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.2;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: 0 10px 20px -12px rgba(160,90,80,.5);
  cursor: pointer;
  max-width: 162px;
  text-align: center;
  white-space: normal;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.balloon::after {
  content: "";
  position: absolute;
  bottom: -9px; left: 50%;
  width: 2px; height: 11px;
  background: var(--line);
  transform: translateX(-50%);
}
.balloon.pop { animation: pop .4s ease forwards; }
@keyframes pop {
  40% { transform: scale(1.4); }
  100% { transform: scale(0); opacity: 0; }
}

/* ---------- 5 / 11: metin ---------- */
.field {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
.field:focus { outline: none; border-color: var(--peach); }
input.field { min-height: 0; }

/* ---------- 6: kaçan hayır ---------- */
.runaway-wrap { position: relative; min-height: 150px; margin-top: 10px; }
.btn.runaway {
  position: absolute;
  transition: left .18s ease, top .18s ease;
  background: linear-gradient(135deg, #cfc2c4, #a98f95);
}

/* ---------- 7: görsel kartlar ---------- */
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.img-card {
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 52px;
  overflow: hidden;
  position: relative;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.img-card img { width: 100%; height: 100%; object-fit: cover; }
.img-card .cap { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.img-card:hover { transform: translateY(-3px); border-color: var(--peach); }
.img-card.selected { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose) inset; }

/* ---------- 8: slider ---------- */
.slider-val {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--rose-deep);
  margin: 18px 0 8px;
  min-height: 30px;
}
.slider-num { font-size: 44px; display:block; line-height:1; }
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--peach), var(--rose));
  outline: none;
  margin: 8px 0 4px;
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--rose);
  cursor: pointer;
  box-shadow: 0 4px 10px -3px var(--rose);
}
input[type="range"].slider::-moz-range-thumb {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--rose);
  cursor: pointer;
}
.shake { animation: shake .4s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0);} 20%{transform:translateX(-7px);} 40%{transform:translateX(7px);} 60%{transform:translateX(-5px);} 80%{transform:translateX(5px);}
}
.sparkle { animation: sparkle .7s ease; }
@keyframes sparkle {
  0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 14px var(--peach)) brightness(1.1); }
}

/* ---------- 9: video ---------- */
.video-box {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  margin-bottom: 18px;
  aspect-ratio: 9/16;
  max-height: 360px;
  display: flex; align-items: center; justify-content: center;
}
.video-box video,
.video-box img { width: 100%; height: 100%; object-fit: cover; }
.video-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg));
  color: var(--ink-soft);
  font-size: 14px;
}
.video-placeholder .pe { font-size: 48px; }

/* ---------- 11: kazı kazan ---------- */
.scratch-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 8px 0 18px;
  border: 1.5px solid var(--line);
}
.scratch-under {
  padding: 26px 18px;
  background: var(--card);
}
.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.scratch-hint {
  font-size: 13px; color: var(--ink-soft); margin-bottom: 12px;
}

/* ---------- 12: kalp sayacı ---------- */
.heart-btn {
  font-size: 78px;
  background: none; border: none; cursor: pointer;
  line-height: 1;
  transition: transform .1s ease;
  -webkit-tap-highlight-color: transparent;
  margin: 6px 0;
}
.heart-btn:active { transform: scale(.85); }
.heart-count {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--rose-deep);
}
.fly-heart {
  position: absolute;
  font-size: 26px;
  pointer-events: none;
  animation: flyup 1.1s ease forwards;
  z-index: 5;
}
@keyframes flyup {
  to { transform: translate(var(--dx), -160px) scale(.4); opacity: 0; }
}

/* ---------- 13: sürükle ---------- */
.drag-heart {
  font-size: 46px;
  cursor: grab;
  display: inline-block;
  touch-action: none;
  margin: 8px 0 16px;
  user-select: none;
}
.drag-heart.dragging { cursor: grabbing; }
.drop-zones { display: flex; flex-direction: column; gap: 12px; }
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: all .18s ease;
  background: var(--bg);
}
.drop-zone.over { border-color: var(--rose); background: var(--bg-2); color: var(--rose-deep); transform: scale(1.02); }
.drop-zone.filled { border-style: solid; border-color: var(--peach); background: linear-gradient(135deg, var(--peach), var(--rose)); color:#fff; }

/* ---------- 14: sahte yükleme ---------- */
.loadbar-track {
  width: 100%; height: 14px; border-radius: 999px;
  background: var(--line); overflow: hidden; margin: 18px 0 12px;
}
.loadbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--peach), var(--rose));
  border-radius: 999px;
  transition: width .4s ease;
}
.load-step { color: var(--ink-soft); font-size: 14px; min-height: 22px; }
.result-big {
  font-family: var(--serif);
  font-size: clamp(26px, 8vw, 36px);
  color: var(--rose-deep);
  font-weight: 700;
  margin: 8px 0;
}

/* ---------- 15: final / tarih ---------- */
.date-row { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 20px; }
input[type="datetime-local"].field { text-align: center; font-family: var(--sans); }

/* ---------- final ekran ---------- */
.final-screen .big-emoji { font-size: 64px; margin-bottom: 8px; }
.summary {
  text-align: left;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.summary h3 { font-family: var(--serif); font-size: 16px; margin: 0 0 12px; color: var(--ink-soft); }
.summary-item { margin-bottom: 12px; }
.summary-item .sq { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.summary-item .sa { font-size: 15px; color: var(--ink); }

/* ---------- konfeti ---------- */
.confetti {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 80;
}

/* ---------- ambians: süzülen kalpler ---------- */
.fx-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.fx-heart {
  position: absolute;
  bottom: -30px;
  font-size: 16px;
  opacity: 0;
  will-change: transform, opacity;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(0) translateX(0) rotate(0); }
  12%  { opacity: var(--op, .5); }
  88%  { opacity: var(--op, .5); }
  100% { opacity: 0; transform: translateY(-105vh) translateX(var(--drift, 20px)) rotate(var(--rot, 25deg)); }
}

/* ---------- ses düğmesi ---------- */
.snd-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  right: 14px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(6px);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -10px rgba(160, 90, 80, .6);
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease;
}
.snd-toggle[hidden] { display: none; }
.snd-toggle:hover { transform: scale(1.08); }
.snd-toggle:active { transform: scale(.94); }
.snd-toggle:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }

/* ---------- intro: açılan zarf ---------- */
.envelope { position: relative; display: inline-block; }
.envelope .big-emoji { display: inline-block; }
.envelope.open .big-emoji { animation: envPop 1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes envPop {
  0%   { transform: scale(.6) rotate(-8deg); opacity: 0; }
  55%  { transform: scale(1.18) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.env-spark {
  position: absolute;
  top: 6px; left: 50%;
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
}
.envelope.open .env-spark { animation: envSpark 1.1s ease forwards; }
@keyframes envSpark {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.4); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1.1); }
}

/* ---------- daktilo imleci ---------- */
.tw-caret {
  display: inline-block;
  width: 2px;
  margin-left: 1px;
  background: var(--rose);
  animation: caretBlink .7s steps(1) infinite;
  vertical-align: -2px;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* ---------- final: polaroid + sayaç + not ---------- */
.polaroid {
  background: #fff;
  padding: 12px 12px 16px;
  border-radius: 8px;
  box-shadow: 0 16px 36px -18px rgba(160, 90, 80, .55);
  width: 78%;
  max-width: 280px;
  margin: 6px auto 18px;
  transform: rotate(-2.2deg);
  border: 1px solid #f3ece8;
}
.polaroid .pframe {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-2), var(--peach));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}
.polaroid .pframe img { width: 100%; height: 100%; object-fit: cover; }
.polaroid .pcap {
  font-family: "Caveat", cursive;
  font-size: 23px;
  color: var(--ink);
  margin-top: 8px;
  line-height: 1.1;
}

.countdown {
  margin: 4px 0 18px;
}
.countdown .cd-num {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--rose-deep);
  line-height: 1;
}
.countdown .cd-lab {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.note-btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--rose-deep);
  background: var(--bg);
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.note-reveal {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease, margin .5s ease, opacity .5s ease;
  opacity: 0;
  margin-top: 0;
}
.note-reveal.show { max-height: 240px; opacity: 1; margin-top: 14px; }
.note-reveal p {
  font-family: "Caveat", cursive;
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}

.summary-toggle {
  font-size: 13px;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 18px;
  font-family: var(--sans);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .intro .big-emoji { animation: none; }
}
