/* ============================================================================
   styles.css — "18" doğum günü uygulaması
   Mobil öncelikli. Tema: gece göğü / uzay + pembe-altın romantik vurgular.
   ========================================================================== */

:root {
  --bg-0: #0c0620;
  --bg-1: #160a2e;
  --bg-2: #241147;
  --ink: #f6f0ff;
  --ink-soft: #c8bce6;
  --ink-dim: #8f83b3;
  --pink: #ff5d9e;
  --pink-soft: #ff9ec7;
  --gold: #ffd479;
  --gold-deep: #f4b23e;
  --accent-grad: linear-gradient(135deg, #ff5d9e 0%, #ff8fb1 45%, #ffd479 100%);
  --card: rgba(255, 255, 255, 0.06);
  --card-brd: rgba(255, 255, 255, 0.12);
  --ok: #57e0a0;
  --no: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --r: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 50% -10%, #3a1a63 0%, transparent 60%),
    radial-gradient(900px 700px at 100% 110%, #4a1e52 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Yıldız arka planı ----------------------------------------------------- */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --- Sahne ----------------------------------------------------------------- */
.stage {
  position: relative;
  z-index: 2;
  height: 100dvh;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.section {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: calc(48px + env(safe-area-inset-top, 0px)) 22px calc(40px + var(--safe-b));
  text-align: center;
  gap: 18px;
  animation: sectionIn 0.7s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* --- Tipografi ------------------------------------------------------------- */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.9;
}

h1.title {
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 93, 158, 0.35));
}

.subtitle { color: var(--ink-soft); font-size: 1rem; max-width: 30ch; }
.dim { color: var(--ink-dim); font-size: 0.9rem; }

/* --- Butonlar -------------------------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #2a0c1c;
  background: var(--accent-grad);
  padding: 15px 34px;
  border-radius: 999px;
  font-size: 1.05rem;
  box-shadow: 0 12px 30px rgba(255, 93, 158, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--card-brd);
  box-shadow: none;
}

.next-wrap { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* --- Kart ------------------------------------------------------------------ */
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-brd);
  border-radius: var(--r);
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* --- Bölüm 0: Kapı --------------------------------------------------------- */
.lock-emoji { font-size: 3.4rem; filter: drop-shadow(0 6px 20px rgba(255,212,121,.4)); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.input {
  width: 100%;
  text-align: center;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: rgba(0,0,0,0.25);
  border: 1.5px solid var(--card-brd);
  border-radius: 16px;
  padding: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,93,158,0.18); }
.input.shake { animation: shake 0.4s; border-color: var(--no); }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-9px)} 40%,80%{transform:translateX(9px)} }

.hint { color: var(--ink-dim); font-size: 0.85rem; }
.feedback { min-height: 1.2em; font-weight: 600; font-size: 0.95rem; }
.feedback.no { color: var(--no); }
.feedback.ok { color: var(--ok); }

/* --- Bölüm 1: Sohbet balonları --------------------------------------------- */
.chat { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 1rem;
  line-height: 1.35;
  position: relative;
  animation: bubbleIn 0.45s ease both;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  word-wrap: break-word;
}
.bubble .when { display: block; font-size: 0.66rem; opacity: 0.6; margin-bottom: 3px; font-weight: 600; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, #ff5d9e, #ff86ae); color: #2a0c1c; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: rgba(255,255,255,0.1); color: var(--ink); border-bottom-left-radius: 5px; }
@keyframes bubbleIn { from{opacity:0; transform:translateY(10px) scale(0.96)} to{opacity:1; transform:none} }

.typing { align-self: flex-start; background: rgba(255,255,255,0.1); padding: 14px 16px; border-radius: 18px; display: inline-flex; gap: 5px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: blink 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: 0.2s } .typing span:nth-child(3){ animation-delay: 0.4s }
@keyframes blink { 0%,60%,100%{opacity:0.25; transform:translateY(0)} 30%{opacity:1; transform:translateY(-4px)} }

/* --- Bölüm 2: Zaman tüneli ------------------------------------------------- */
.timeline { width: 100%; position: relative; padding-left: 26px; text-align: left; }
.timeline::before { content:""; position:absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--pink), var(--gold)); opacity: 0.5; }
.tl-item { position: relative; margin-bottom: 26px; animation: sectionIn 0.6s both; }
.tl-item::before { content:""; position:absolute; left:-26px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(255,212,121,0.2); }
.tl-date { color: var(--gold); font-weight: 700; font-size: 0.85rem; }
.tl-event { font-weight: 700; font-size: 1.1rem; margin: 2px 0; }
.tl-note { color: var(--ink-soft); font-size: 0.95rem; }
.tl-photo { width: 100%; border-radius: 14px; margin-top: 10px; display: block; box-shadow: var(--shadow); }
.photo-ph {
  width: 100%; aspect-ratio: 4/3; border-radius: 14px; margin-top: 10px;
  border: 2px dashed var(--card-brd); display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim); font-size: 0.85rem; background: rgba(0,0,0,0.2); text-align: center; padding: 12px;
}

/* --- Bölüm 3: Wrapped ------------------------------------------------------ */
.wrap-card {
  width: 100%; min-height: 62dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  border-radius: 26px; padding: 30px 22px;
  background: linear-gradient(160deg, rgba(255,93,158,0.16), rgba(255,212,121,0.1));
  border: 1px solid var(--card-brd); box-shadow: var(--shadow);
}
.wrap-emoji { font-size: 3rem; }
.wrap-ust { color: var(--ink-soft); font-size: 1.05rem; font-weight: 600; }
.wrap-sayi { font-size: clamp(3rem, 20vw, 5.5rem); font-weight: 800; line-height: 1; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap-alt { font-size: 1.15rem; font-weight: 700; }
.wrap-not { color: var(--ink-soft); font-size: 0.92rem; max-width: 26ch; }
.wrap-dots { display: flex; gap: 7px; margin-top: 4px; }
.wrap-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.25); transition: all 0.3s; }
.wrap-dots i.on { background: var(--gold); width: 20px; border-radius: 4px; }

/* --- Bölüm 4: Quiz --------------------------------------------------------- */
.quiz-q { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.quiz-count { color: var(--gold); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.1em; }
.quiz-progress { width: 100%; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.quiz-progress i { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width 0.4s ease; }
.options { width: 100%; display: flex; flex-direction: column; gap: 11px; }
.option {
  width: 100%; text-align: left; font: inherit; font-size: 1.05rem; font-weight: 600;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--card-brd);
  border-radius: 15px; padding: 15px 18px; cursor: pointer;
  transition: transform 0.12s, border-color 0.2s, background 0.2s;
  touch-action: manipulation;
}
.option:active { transform: scale(0.98); }
.option.correct { border-color: var(--ok); background: rgba(87,224,160,0.15); }
.option.wrong { border-color: var(--no); background: rgba(255,107,107,0.14); }
.option:disabled { cursor: default; }

/* --- Bölüm 5: Karne -------------------------------------------------------- */
.report {
  width: 100%; background: #fbf6ea; color: #3a2a12; border-radius: 16px;
  padding: 24px 20px; box-shadow: var(--shadow); text-align: left;
  border: 6px double #cbb892; position: relative;
}
.report h3 { text-align: center; font-size: 1.3rem; color: #7a1533; letter-spacing: 0.02em; }
.report .okul { text-align: center; font-size: 0.8rem; color: #8a7550; margin-bottom: 14px; }
.report .ogr { text-align: center; font-weight: 700; margin-bottom: 12px; }
.report-row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed #d8c9a8; gap: 10px; }
.report-row:last-of-type { border-bottom: none; }
.report-ders { font-weight: 600; }
.report-ders small { color: #9a8560; font-weight: 500; }
.report-not { font-weight: 800; color: #7a1533; font-size: 1.15rem; }
.report .imza { text-align: right; margin-top: 14px; font-style: italic; color: #6a5330; font-size: 0.85rem; }
.report-photo {
  display: block; width: 128px; height: 128px; object-fit: cover; border-radius: 10px;
  margin: 0 auto 12px; border: 3px solid #cbb892; box-shadow: 0 6px 16px rgba(58,42,18,0.25);
  transform: rotate(-2deg);
}
.report .muhur { position: absolute; right: 14px; bottom: 42px; width: 78px; height: 78px; border: 3px solid rgba(122,21,51,0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(122,21,51,0.55); font-weight: 800; font-size: 0.62rem; text-align: center; transform: rotate(-14deg); line-height: 1.1; }

.burc { width: 100%; margin-top: 6px; }
.burc .baslik { color: var(--gold); font-weight: 700; }
.burc .metin { color: var(--ink-soft); font-style: italic; font-size: 0.95rem; }

/* --- Bölüm 6: Kazı kazan --------------------------------------------------- */
.coupons { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.coupon { position: relative; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.coupon-face {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center;
  background: linear-gradient(160deg, rgba(255,93,158,0.22), rgba(255,212,121,0.16));
  border: 1px solid var(--card-brd);
}
.coupon-face .c-emoji { font-size: 2.2rem; }
.coupon-face .c-title { font-weight: 800; font-size: 0.98rem; }
.coupon-face .c-desc { font-size: 0.78rem; color: var(--ink-soft); }
.coupon canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.coupon.done canvas { display: none; }
.coupon .used-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3; font-size: 0.62rem; font-weight: 800;
  background: var(--ok); color: #062b1a; padding: 3px 8px; border-radius: 999px; display: none;
}
.coupon.used .used-badge { display: block; }
.coupon.used .coupon-face { opacity: 0.5; }
.coupon-use-btn {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 3;
  font: inherit; font-size: 0.7rem; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  border: none; background: rgba(0,0,0,0.35); color: var(--ink); cursor: pointer; display: none;
}
.coupon.done .coupon-use-btn { display: block; }
.coupon.used .coupon-use-btn { display: none; }
.scratch-hint { color: var(--ink-dim); font-size: 0.82rem; }

/* --- Bölüm 7: Final -------------------------------------------------------- */
.final-space { font-size: 1.05rem; color: var(--ink-soft); font-style: italic; max-width: 28ch; line-height: 1.5; }
.final-big { font-size: clamp(2.2rem, 11vw, 3.6rem); font-weight: 800; line-height: 1.08; white-space: pre-line; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 20px rgba(255,93,158,0.4)); }
.letter {
  width: 100%; background: var(--card); border: 1px solid var(--card-brd); border-radius: var(--r);
  padding: 24px; text-align: left; white-space: pre-line; line-height: 1.7; color: var(--ink-soft);
  font-size: 1.02rem; box-shadow: var(--shadow);
}
.final-kiss { font-size: 1.15rem; font-weight: 700; color: var(--gold); }
.final-photo {
  width: min(62%, 240px); border-radius: 18px; box-shadow: var(--shadow);
  border: 3px solid rgba(255,255,255,0.15); transform: rotate(2deg); margin: 4px 0;
}

/* --- Placeholder / TODO uyarısı -------------------------------------------- */
.todo-box {
  border: 2px dashed var(--gold-deep); background: rgba(255,212,121,0.1);
  color: var(--gold); border-radius: 12px; padding: 10px 14px; font-size: 0.82rem; font-weight: 600;
  width: 100%;
}

/* --- İlerleme noktaları ---------------------------------------------------- */
.progress-dots {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: rgba(0,0,0,0.3); backdrop-filter: blur(8px);
}
.progress-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.28); transition: all 0.3s; }
.progress-dots i.on { background: var(--gold); }
.progress-dots i.done { background: var(--pink); }

/* --- Müzik düğmesi --------------------------------------------------------- */
.music-toggle {
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 20;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--card-brd);
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px); font-size: 1.1rem; cursor: pointer; color: var(--ink);
}

/* --- Konfeti --------------------------------------------------------------- */
.confetti-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }

/* --- Yardımcılar ----------------------------------------------------------- */
.hidden { display: none !important; }
.fade-up { animation: sectionIn 0.6s both; }

@media (min-width: 521px) {
  body::after { content:""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
    box-shadow: inset 0 0 200px rgba(0,0,0,0.5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; scroll-behavior: auto; }
}
