/* =========================================================
   BİZİM HİKÂYEMİZ ❤  —  mobil PWA
   Renkler: bordo · koyu kırmızı · siyah · krem · hafif altın
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  overflow: hidden;
  background-color: #080406;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--cream);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Tokens ---------- */
:root {
  --ink:        #080406;
  --ink-2:      #14060a;
  --bordo:      #4d0b18;
  --bordo-2:    #6d1023;
  --red:        #c11f3c;
  --red-lt:     #ff5f7a;
  --cream:      #f4e9dd;
  --cream-dim:  #c3ab9d;
  --gold:       #d9b26a;
  --gold-soft:  rgba(217, 178, 106, .34);

  --serif: "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(.22, .68, .28, 1);
  --ease-back: cubic-bezier(.22, 1.4, .36, 1);

  --app-h: 100dvh;
  --pad-t: calc(env(safe-area-inset-top, 0px) + 10px);
  --pad-b: calc(env(safe-area-inset-bottom, 0px) + 12px);
  --pad-x: calc(env(safe-area-inset-left, 0px) + 16px);
}

/* ---------- Sahne ---------- */
#stage {
  position: fixed; inset: 0;
  width: 100%;
  height: var(--app-h);
  overflow: hidden;
  isolation: isolate;
}
.bg-layer {
  position: absolute; inset: -10%;
  background:
    radial-gradient(58% 42% at 50% 12%, rgba(193, 31, 60, .28), transparent 68%),
    radial-gradient(70% 50% at 12% 92%, rgba(109, 16, 35, .34), transparent 70%),
    radial-gradient(60% 45% at 92% 78%, rgba(77, 11, 24, .40), transparent 72%),
    linear-gradient(175deg, #14060a 0%, #0b0407 46%, #060305 100%);
  animation: bgDrift 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes bgDrift {
  0%   { transform: scale(1) translate3d(0, 0, 0); }
  100% { transform: scale(1.06) translate3d(-1.5%, 1.5%, 0); }
}
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 78% at 50% 46%, transparent 42%, rgba(0,0,0,.55) 88%, rgba(0,0,0,.8) 100%);
}
#dust {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: .85;
}
#fx {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 40;
}

/* ---------- Ekranlar ---------- */
#app { position: absolute; inset: 0; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: var(--pad-t) var(--pad-x) var(--pad-b);
  opacity: 0; pointer-events: none;
  transform: translateY(10px) scale(.994);
  transition: opacity .52s var(--ease), transform .52s var(--ease);
}
.screen.is-active { opacity: 1; pointer-events: auto; transform: none; }
.screen.is-leaving { opacity: 0; transform: translateY(-10px) scale(.994); }

.topbar { flex: 0 0 auto; display: flex; justify-content: center; padding-bottom: 4px; }
.content {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(10px, 2.4vh, 20px);
}
.bottombar { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 8px; }

/* ---------- Tipografi ---------- */
.title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
  color: var(--cream);
  text-shadow: 0 0 26px rgba(193, 31, 60, .45), 0 2px 18px rgba(0,0,0,.6);
}
.title--hero { font-size: clamp(21px, 6.5vw, 34px); white-space: nowrap; }
.level-title {
  font-family: var(--serif);
  font-size: clamp(19px, 5.4vw, 26px);
  letter-spacing: .06em;
  margin: 0; text-align: center; color: var(--cream);
  text-shadow: 0 0 22px rgba(193,31,60,.35);
}
.level-hint {
  margin: 6px 0 0; text-align: center;
  font-size: clamp(12.5px, 3.5vw, 15px);
  color: var(--cream-dim); letter-spacing: .02em; line-height: 1.45;
  max-width: 34ch;
}
.subtitle {
  margin: 0; color: var(--cream-dim);
  font-size: clamp(13px, 3.9vw, 16px); letter-spacing: .04em;
  animation: softPulse 3.4s ease-in-out infinite;
}
@keyframes softPulse { 0%,100% { opacity: .72; } 50% { opacity: 1; } }
.rule {
  width: min(48vw, 190px); height: 1px; margin: 14px 0 12px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 22%, rgba(217,178,106,.7) 50%, var(--gold-soft) 78%, transparent);
}

/* ---------- Açılış ---------- */
.screen--intro .intro-inner {
  margin: auto; display: flex; flex-direction: column; align-items: center;
  padding-bottom: 6vh;
}
.hero-heart-btn {
  position: relative;
  width: min(56vw, 240px); height: min(56vw, 240px);
  display: grid; place-items: center;
  margin-bottom: clamp(18px, 5vh, 40px);
  animation: heroFloat 4.6s ease-in-out infinite;
  transition: transform .18s var(--ease);
}
.hero-heart-btn:active { transform: scale(.95); }
.hero-heart { width: 100%; height: 100%; filter: drop-shadow(0 14px 40px rgba(193,31,60,.55)); }
.hero-halo {
  position: absolute; inset: -22%;
  background: radial-gradient(circle at 50% 50%, rgba(224,36,68,.42), rgba(224,36,68,.14) 42%, transparent 68%);
  animation: haloBreath 3.6s ease-in-out infinite;
}
@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes haloBreath { 0%,100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.12); opacity: 1; } }

.hero-heart-btn.is-bursting { animation: heroBurst 1s var(--ease) forwards; }
@keyframes heroBurst {
  0%   { transform: scale(1); filter: none; }
  28%  { transform: scale(.88); }
  55%  { transform: scale(1.5); filter: brightness(1.7); }
  100% { transform: scale(2.6); opacity: 0; filter: brightness(2.4); }
}

/* ---------- Butonlar ---------- */
.btn {
  position: relative;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: clamp(14px, 4vw, 16px);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(140,18,40,.95), rgba(77,11,24,.95));
  border: 1px solid var(--gold-soft);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 26px rgba(193,31,60,.28), inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .16s var(--ease), box-shadow .3s var(--ease);
  overflow: hidden;
}
.btn:active { transform: scale(.96); box-shadow: 0 6px 18px rgba(0,0,0,.5), 0 0 16px rgba(193,31,60,.24); }
.btn--ghost {
  background: rgba(255,255,255,.04);
  border-color: rgba(217,178,106,.28);
  box-shadow: none; font-size: 13px; padding: 12px 24px;
}

/* ---------- İlerleme kalpleri ---------- */
.progress { display: flex; gap: 10px; align-items: center; }
.progress__heart {
  width: 15px; height: 15px; color: rgba(244,233,221,.16);
  transition: color .5s var(--ease), transform .5s var(--ease-back), filter .5s var(--ease);
}
.progress__heart.is-done { color: var(--red); filter: drop-shadow(0 0 7px rgba(224,36,68,.75)); }
.progress__heart.is-current { color: var(--gold); transform: scale(1.28); filter: drop-shadow(0 0 8px rgba(217,178,106,.7)); }

/* ---------- Ortak tahta ---------- */
.head { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.board-wrap,
.photo-wrap {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
}
.board { width: var(--board-w, 100%); margin: 0 auto; display: grid; }
/* buton/div fark etmeksizin her hücre sütununu tam doldursun (Safari'de buton esnemiyor) */
.board > * { width: 100%; margin: 0; padding: 0; }
.heart { width: 100%; height: 100%; fill: currentColor; display: block; }

/* ---------- 1. Farklı kalbi bul ---------- */
.grid-odd { gap: clamp(5px, 1.9vw, 11px); }
.odd-cell {
  aspect-ratio: 1; display: grid; place-items: center;
  color: #8e1226;
  transition: transform .25s var(--ease), color .3s var(--ease), opacity .5s var(--ease), filter .4s;
  animation: cellIn .5s var(--ease-back) backwards;
}
.odd-cell .heart { transform: rotate(var(--rot, 0deg)); filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.odd-cell:active { transform: scale(.9); }
.odd-cell.is-odd { color: #d4284a; }
@keyframes cellIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

.odd-cell.is-wrong { animation: shakeX .42s ease; }
@keyframes shakeX {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-4deg); }
  45% { transform: translateX(6px) rotate(4deg); }
  70% { transform: translateX(-3px); }
}
.grid-odd.is-solved .odd-cell:not(.is-odd) { opacity: .10; transform: scale(.72); filter: blur(1px); }
.odd-cell.is-found {
  color: #ff5f7a; transform: scale(2.1); z-index: 5;
  filter: drop-shadow(0 0 26px rgba(255,95,122,.95)) drop-shadow(0 0 60px rgba(224,36,68,.7));
  transition: transform .8s var(--ease-back), color .5s, filter .6s;
}

/* ---------- 2. Kalpleri eşleştir ---------- */
.grid-match { gap: clamp(6px, 2.2vw, 12px); }
.match-cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  color: var(--c, #a1152c);
  transition: transform .28s var(--ease-back), opacity .45s var(--ease), filter .35s var(--ease);
  animation: cellIn .5s var(--ease-back) backwards;
}
.match-cell .heart { filter: drop-shadow(0 3px 10px rgba(0,0,0,.5)); }
.match-cell .glyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding-top: 6%;
  font-size: calc(var(--cell, 46px) * .38);
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  pointer-events: none;
}
.match-cell:active { transform: scale(.93); }
.match-cell.is-sel { transform: translateY(-6px) scale(1.08); filter: drop-shadow(0 0 16px rgba(217,178,106,.85)) brightness(1.15); }
.match-cell.is-bad { animation: shakeX .42s ease; }
.match-cell.is-matched {
  opacity: .42; transform: scale(.84);
  filter: drop-shadow(0 0 12px rgba(217,178,106,.5)) saturate(.6);
  pointer-events: none;
}
.match-cell.is-pop { animation: popMatch .6s var(--ease-back); }
@keyframes popMatch {
  0% { transform: scale(1.08); }
  35% { transform: scale(1.45); filter: brightness(1.6) drop-shadow(0 0 26px rgba(255,95,122,.9)); }
  100% { transform: scale(.84); }
}
.counter {
  font-family: var(--serif); font-size: 14px; letter-spacing: .16em;
  color: var(--gold); opacity: .85;
}

/* ---------- 3. Şifre ---------- */
.cipher { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2.6vh, 22px); width: 100%; }
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: 330px;
}
.legend-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(217,178,106,.22);
  font-size: 13px; color: var(--cream-dim); letter-spacing: .06em;
}
.legend-chip b { color: var(--gold); font-weight: 500; font-size: 15px; }
.legend-chip .sym { color: var(--red-lt); font-size: 16px; line-height: 1; }

.slots { display: flex; gap: clamp(6px, 2.2vw, 11px); justify-content: center; }
.slot {
  width: clamp(44px, 13vw, 58px);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.slot .sym { font-size: clamp(19px, 5.6vw, 24px); color: var(--red-lt); line-height: 1; text-shadow: 0 0 12px rgba(224,36,68,.55); }
.slot .box {
  width: 100%; aspect-ratio: 1 / 1.18;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(217,178,106,.28);
  background: linear-gradient(180deg, rgba(109,16,35,.35), rgba(8,4,6,.5));
  font-family: var(--serif); font-size: clamp(20px, 6vw, 26px); color: var(--cream);
  transition: all .3s var(--ease);
}
.slot.is-filled .box { border-color: rgba(217,178,106,.6); box-shadow: 0 0 16px rgba(193,31,60,.35), inset 0 1px 0 rgba(255,255,255,.1); }
.slot.is-ok .box {
  border-color: var(--gold); color: #fff;
  box-shadow: 0 0 26px rgba(217,178,106,.75), 0 0 46px rgba(224,36,68,.5);
  animation: okPop .6s var(--ease-back);
}
@keyframes okPop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.slots.is-bad { animation: shakeX .45s ease; }

.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(6px, 1.8vw, 9px); width: min(94%, 380px); }
.key {
  aspect-ratio: 1; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: clamp(16px, 4.6vw, 20px);
  color: var(--cream);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(217,178,106,.18);
  transition: transform .14s var(--ease), background .2s;
}
.key:active { transform: scale(.9); background: rgba(193,31,60,.4); }
.key--wide {
  grid-column: 3 / span 2; aspect-ratio: auto; padding: 12px 0;
  font-size: 13px; letter-spacing: .08em; font-family: inherit; color: var(--cream-dim);
}

/* ---------- 4. Hafıza ---------- */
.grid-memory { gap: clamp(7px, 2.4vw, 12px); }
.card { aspect-ratio: 1 / 1.24; perspective: 900px; animation: cellIn .5s var(--ease-back) backwards; }
.card__inner {
  display: block;                 /* span olduğu için şart: yoksa yükseklik 0 olur */
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-back);
}
.card.is-open .card__inner, .card.is-matched .card__inner { transform: rotateY(180deg); }
.card__face {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: 12px;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.card__face--back {
  background:
    radial-gradient(circle at 50% 38%, rgba(224,36,68,.30), transparent 62%),
    linear-gradient(160deg, #6d1023, #35080f 70%);
  border: 1px solid rgba(217,178,106,.22);
  color: rgba(255,255,255,.30);
}
.card__face--back .heart { width: 42%; height: auto; }
.card__face--front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, rgba(244,233,221,.10), rgba(109,16,35,.5));
  border: 1px solid rgba(217,178,106,.35);
  color: var(--cream);
  font-size: calc(var(--cell, 70px) * .46);
}
.card.is-matched .card__face--front {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(217,178,106,.55), inset 0 0 20px rgba(224,36,68,.28);
  color: var(--gold);
}
.card.is-matched { animation: matchedPulse .7s var(--ease-back); }
@keyframes matchedPulse { 0% { transform: scale(1); } 45% { transform: scale(1.1); } 100% { transform: scale(1); } }
.card.is-wrong .card__inner { animation: shakeX .45s ease; }

/* ---------- 5. Kalbi tamamla ---------- */
.grid-puzzle { gap: 4px; transition: gap .8s var(--ease), transform .9s var(--ease-back), filter .9s var(--ease); }
.piece {
  aspect-ratio: 1; border-radius: 8px;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  border: 1px solid rgba(217,178,106,.14);
  transition: transform .28s var(--ease-back), border-color .3s, box-shadow .3s, border-radius .8s var(--ease);
  animation: cellIn .5s var(--ease-back) backwards;
}
.piece:active { transform: scale(.94); }
.piece.is-sel {
  transform: scale(1.06); z-index: 3;
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(217,178,106,.7), 0 10px 26px rgba(0,0,0,.5);
}
.piece.is-swap { animation: swapPop .45s var(--ease-back); }
@keyframes swapPop { 0% { transform: scale(1); } 50% { transform: scale(1.14); filter: brightness(1.3); } 100% { transform: scale(1); } }
.grid-puzzle.is-solved { gap: 0; transform: scale(1.06); filter: drop-shadow(0 0 40px rgba(224,36,68,.75)); }
.grid-puzzle.is-solved .piece { border-color: transparent; border-radius: 0; }

/* ---------- Mesaj perdesi ---------- */
.msg-overlay {
  position: absolute; inset: 0; z-index: 45;
  display: grid; place-items: center;
  padding: 0 28px;
  background: radial-gradient(60% 40% at 50% 50%, rgba(8,4,6,.55), rgba(8,4,6,.86));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .5s var(--ease);
}
.msg-overlay.is-out { animation: fadeOut .5s var(--ease) forwards; }
.msg-text {
  font-family: var(--serif);
  font-size: clamp(26px, 8vw, 38px);
  line-height: 1.35; text-align: center; margin: 0;
  color: var(--cream);
  text-shadow: 0 0 30px rgba(224,36,68,.7), 0 0 70px rgba(193,31,60,.45);
  animation: msgIn 1s var(--ease-back);
}
@keyframes msgIn {
  from { opacity: 0; transform: scale(.9) translateY(14px); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- Fotoğraf ---------- */
.photo-caption {
  font-family: var(--serif);
  font-size: clamp(18px, 5.4vw, 24px);
  text-align: center; margin: 0; color: var(--cream);
  text-shadow: 0 0 22px rgba(224,36,68,.5);
  animation: capIn .9s var(--ease) .25s backwards;
}
@keyframes capIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.frame {
  position: relative; display: inline-block;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(217,178,106,.35);
  background: #0d0508;
  box-shadow: 0 26px 60px rgba(0,0,0,.65), 0 0 44px rgba(193,31,60,.30);
  animation: photoIn 1.25s var(--ease) both;
  max-width: 100%;
}
.frame img { width: auto; height: auto; max-width: min(88vw, 460px); max-height: 58vh; }
@keyframes photoIn {
  0%   { opacity: 0; transform: scale(1.07) translateY(12px); filter: blur(16px) saturate(.6); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; filter: none; }
}
.frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 34%, rgba(255,255,255,.20) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: sweep 1.5s var(--ease) .7s;
  pointer-events: none;
}
@keyframes sweep { to { transform: translateX(120%); } }

.photo-fallback {
  width: min(72vw, 320px); aspect-ratio: 3/4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--cream-dim); text-align: center; padding: 20px;
  background: linear-gradient(160deg, rgba(109,16,35,.4), rgba(8,4,6,.6));
  font-size: 13px; line-height: 1.6; letter-spacing: .04em;
}
.photo-fallback .heart { width: 54px; height: 54px; color: var(--red); opacity: .8; }
.photo-fallback code { color: var(--gold); font-size: 13px; }

/* ---------- Final ---------- */
.screen--final { padding: 0; }
/* arka plan: aynı fotoğrafın bulanık, tam ekranı dolduran hâli */
.final-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(30px) saturate(.85) brightness(.5);
  transform: scale(1.2);
  animation: kenBurns 22s ease-out both;
}
@keyframes kenBurns {
  from { transform: scale(1.34); opacity: 0; }
  18%  { opacity: 1; }
  to   { transform: scale(1.2); opacity: 1; }
}
/* fotoğrafın kendisi: hiçbir yeri kırpılmadan, çerçeveli */
.final-photo {
  position: absolute;
  left: 50%; top: calc(env(safe-area-inset-top, 0px) + 3.5vh);
  transform: translateX(-50%);
  width: auto; height: auto;
  max-width: 86vw; max-height: 52vh;
  border-radius: 16px;
  border: 1px solid rgba(217,178,106,.38);
  box-shadow: 0 30px 70px rgba(0,0,0,.7), 0 0 60px rgba(193,31,60,.4);
  animation: finalPhotoIn 1.6s var(--ease) both;
}
@keyframes finalPhotoIn {
  0%   { opacity: 0; transform: translateX(-50%) scale(1.08); filter: blur(18px) saturate(.6); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translateX(-50%) scale(1); filter: none; }
}
.final-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.final-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 46% at 50% 26%, rgba(8,4,6,0) 40%, rgba(8,4,6,.35) 100%),
    linear-gradient(180deg, rgba(8,4,6,.55) 0%, rgba(8,4,6,.12) 22%, rgba(8,4,6,.55) 56%, rgba(8,4,6,.94) 84%, rgba(8,4,6,.99) 100%);
}
.final-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 12px; text-align: center;
  padding: var(--pad-t) calc(var(--pad-x) + 6px) calc(var(--pad-b) + 10px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.final-content > * { animation: finalUp 1s var(--ease) backwards; }
.final-content > *:nth-child(1) { animation-delay: 1.1s; }
.final-content > *:nth-child(2) { animation-delay: 1.35s; }
.final-content > *:nth-child(3) { animation-delay: 1.6s; }
.final-content > *:nth-child(4) { animation-delay: 2.0s; }
.final-content > *:nth-child(5) { animation-delay: 2.4s; }
@keyframes finalUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.final-title { font-family: var(--serif); font-size: clamp(22px, 6.6vw, 30px); letter-spacing: .16em; margin: 0; }
.final-line { margin: 0; font-size: clamp(13px, 3.8vw, 15px); color: var(--cream-dim); line-height: 1.65; max-width: 30ch; font-style: italic; }
.forever {
  font-family: var(--serif); font-size: clamp(20px, 6vw, 26px); letter-spacing: .22em;
  margin: 6px 0 2px; color: var(--gold);
  text-shadow: 0 0 24px rgba(217,178,106,.6), 0 0 60px rgba(224,36,68,.45);
  animation: foreverGlow 3.4s ease-in-out infinite alternate, finalUp 1s var(--ease) backwards;
}
@keyframes foreverGlow {
  from { text-shadow: 0 0 18px rgba(217,178,106,.4), 0 0 40px rgba(224,36,68,.3); }
  to   { text-shadow: 0 0 34px rgba(217,178,106,.85), 0 0 80px rgba(224,36,68,.6); }
}

/* ---------- Efektler (uçan kalpler / parçacıklar) ---------- */
.fx-heart {
  position: absolute; width: var(--s, 16px); height: var(--s, 16px);
  color: var(--col, #e02444);
  will-change: transform, opacity;
  animation: fxFly var(--dur, 1.3s) var(--ease) forwards;
}
.fx-heart svg { width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(0 0 6px rgba(224,36,68,.8)); }
@keyframes fxFly {
  0%   { transform: translate(-50%, -50%) scale(.2) rotate(0deg); opacity: 0; }
  14%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--sc, 1)) rotate(var(--rot, 90deg)); opacity: 0; }
}
.fx-spark {
  position: absolute; width: var(--s, 4px); height: var(--s, 4px); border-radius: 50%;
  background: var(--col, #ffd8a8);
  box-shadow: 0 0 10px 2px rgba(255,200,150,.7);
  animation: fxFly var(--dur, 1s) var(--ease) forwards;
}
.fx-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid rgba(255,120,150,.75);
  transform: translate(-50%, -50%);
  animation: ringOut .9s var(--ease) forwards;
}
@keyframes ringOut {
  0% { width: 0; height: 0; opacity: .9; border-width: 3px; }
  100% { width: 78vw; height: 78vw; opacity: 0; border-width: 1px; }
}
.fx-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), rgba(255,190,205,.85), rgba(224,36,68,.35) 30%, transparent 62%);
  animation: flashOut .9s var(--ease) forwards;
}
@keyframes flashOut { from { opacity: .9; } to { opacity: 0; } }

/* ---------- "Ana ekrana ekle" ---------- */
.install-chip {
  margin-top: clamp(18px, 4vh, 34px);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 12.5px; letter-spacing: .06em; color: var(--cream-dim);
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(217,178,106,.26);
  transition: transform .16s var(--ease), border-color .3s, color .3s;
  animation: softFade 1s var(--ease) 1.2s backwards;
}
.install-chip[hidden] { display: none !important; }
.install-chip:active { transform: scale(.95); color: var(--cream); border-color: rgba(217,178,106,.55); }
.install-chip svg { width: 15px; height: 15px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@keyframes softFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.sheet {
  position: absolute; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(4,2,3,.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .3s var(--ease);
}
.sheet[hidden] { display: none !important; }
.sheet__card {
  width: 100%; max-width: 420px;
  padding: 22px 20px 18px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(46,10,20,.98), rgba(12,5,8,.99));
  border: 1px solid rgba(217,178,106,.28);
  box-shadow: 0 -12px 50px rgba(0,0,0,.75), 0 0 60px rgba(193,31,60,.2);
  animation: sheetUp .5s var(--ease-back);
}
@keyframes sheetUp { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__icon { display: block; margin: 0 auto 12px; border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.sheet__card h3 { font-family: var(--serif); font-size: 20px; letter-spacing: .06em; margin: 0 0 4px; color: var(--cream); }
.sheet__sub { margin: 0 0 18px; font-size: 12.5px; color: var(--cream-dim); }
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; line-height: 1.45; color: var(--cream); }
.steps b { color: var(--gold); font-weight: 500; }
.step-n {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(193,31,60,.35); border: 1px solid rgba(217,178,106,.3);
  font-size: 12px; color: var(--gold);
}
.ios-share { width: 15px; height: 15px; vertical-align: -3px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sheet__note { font-size: 11.5px; line-height: 1.55; color: var(--cream-dim); margin: 0 0 14px; }
.sheet .btn { width: 100%; }

/* ---------- Safari / kurulum çubuğu ---------- */
.browser-bar {
  /* ÜSTTE durur: alttaki "Devam" düğmesinin üstünü kapatmasın */
  position: absolute; z-index: 60;
  left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 16px;
  border-radius: 999px;
  background: rgba(20, 6, 10, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(217,178,106,.22);
  box-shadow: 0 12px 30px rgba(0,0,0,.55);
  max-width: calc(100vw - 24px);
  animation: barIn .6s var(--ease) 1.4s backwards;
}
@keyframes barIn { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translateX(-50%); } }
.browser-bar__text {
  font-size: 12px; color: var(--cream-dim); letter-spacing: .01em;
  line-height: 1.3; max-width: 52vw;
}
.browser-bar__btn {
  font-size: 12px; letter-spacing: .06em; text-decoration: none; white-space: nowrap;
  color: var(--cream); padding: 8px 14px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(140,18,40,.95), rgba(77,11,24,.95));
  border: 1px solid rgba(217,178,106,.3);
}
.browser-bar__close { font-size: 20px; line-height: 1; color: var(--cream-dim); padding: 0 6px; }
/* hidden özniteliği display:flex'i ezebilsin (yoksa çubuk hiç kapanmaz) */
.browser-bar[hidden] { display: none !important; }

/* ---------- Erişilebilirlik / hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
  }
  .bg-layer { animation: none; }
}

/* ---------- Çok kısa ekranlar ---------- */
@media (max-height: 640px) {
  .hero-heart-btn { width: min(44vw, 180px); height: min(44vw, 180px); }
  .frame img { max-height: 48vh; }
  .legend-chip { padding: 5px 9px; font-size: 12px; }
}
