:root {
  --gece: #07080c;
  --lacivert: #16223d;
  --amber: #ffb547;
  --turuncu: #ff7a2f;
  --krem: #f6ead2;
  --kraft: #c8a27a;
  --deniz: #2f6f73;
  --yazi: #efe6d6;
  --soluk: #a99d8b;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--gece);
  color: var(--yazi);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 30%, #fff6e3 0%, #f6e3c0 45%, #e2b97f 100%);
  opacity: 0;
  transition: opacity 1.8s ease;
  pointer-events: none;
}
body.aydinlik::before { opacity: 1; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--amber); }

/* ---------- Oluşturma ---------- */
#olustur {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 16px 40px;
}
#olustur::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 140px;
  width: 520px;
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 160, 70, 0.18), rgba(255, 160, 70, 0) 65%);
  pointer-events: none;
}
.bas { text-align: center; position: relative; }
.kucuk { margin: 0 0 6px; font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--kraft); }
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 10vw, 3.3rem);
  line-height: 1.02;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
h1 em { font-style: italic; color: var(--amber); }
.giris { margin: 0 auto; max-width: 30em; color: #cfc3b0; }

.onizleme { height: 250px; margin: 6px -16px 0; position: relative; }
.onizleme canvas { width: 100%; height: 100%; display: block; }

.kart {
  position: relative;
  background: rgba(22, 34, 61, 0.42);
  border: 1px solid rgba(246, 234, 210, 0.1);
  border-radius: 22px;
  padding: 20px 18px 22px;
  backdrop-filter: blur(6px);
}
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend, .alan > span { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; color: var(--krem); }
.alan { display: block; margin-bottom: 16px; }
.alan small, legend small { font-weight: 400; color: var(--soluk); margin-left: 6px; }
input:not([type=radio]):not([type=range]), textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(246, 234, 210, 0.16);
  background: rgba(7, 8, 12, 0.55);
  font-size: 17px;
  outline: none;
}
textarea { resize: vertical; min-height: 104px; line-height: 1.45; }
input:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.18); }
::placeholder { color: #6f675c; }

.secenekler { display: flex; flex-wrap: wrap; gap: 8px; }
.secenek { position: relative; }
.secenek input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.secenek span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(246, 234, 210, 0.18);
  background: rgba(7, 8, 12, 0.35);
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.secenek input:checked + span { background: var(--amber); color: #1d1206; border-color: var(--amber); font-weight: 600; }
.secenek input:focus-visible + span { outline: 2px solid var(--krem); outline-offset: 2px; }
.renk { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.3); }

.sayac-satir { display: grid; grid-template-columns: 44px 52px 44px 1fr; align-items: center; gap: 10px; }
.yuvarlak {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(246, 234, 210, 0.2);
  background: rgba(7, 8, 12, 0.45);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
output { text-align: center; font-family: var(--serif); font-size: 1.8rem; color: var(--amber); }
input[type=range] { width: 100%; accent-color: var(--amber); }

.uyari { color: var(--turuncu); margin: 0 0 12px; font-weight: 600; }

.dugme {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 0;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.dugme:active { transform: scale(0.98); }
.dugme.ana { background: linear-gradient(180deg, #ffc469, var(--amber)); color: #1d1206; box-shadow: 0 8px 30px rgba(255, 160, 60, 0.28); }
.dugme.whatsapp { background: #25d366; color: #052e16; margin-bottom: 10px; }
.dugme.ikinci { background: transparent; color: var(--krem); border: 1px solid rgba(246, 234, 210, 0.25); font-weight: 600; font-size: 0.98rem; }
.dugme.hayalet { background: rgba(246, 234, 210, 0.1); color: var(--krem); border: 1px solid rgba(246, 234, 210, 0.2); width: auto; min-width: 160px; }
.ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.baglanti {
  background: none; border: 0; color: #b9ad99; text-decoration: underline; text-underline-offset: 4px;
  padding: 12px; cursor: pointer; font-size: 0.95rem;
}
.baglanti.koyu { color: #5a4a35; }

.sonuc { margin-top: 18px; border-color: rgba(255, 181, 71, 0.35); }
.sonuc h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; margin: 0 0 6px; color: var(--amber); }
.sonuc p { margin: 0 0 16px; color: #d6cab6; font-size: 0.95rem; }
.link-kutusu { margin-top: 12px; font-size: 0.8rem !important; color: var(--soluk); }

.alt { text-align: center; color: #7f7667; font-size: 0.85rem; margin-top: 28px; }
.alt p { margin: 0 0 6px; }
.alt a { color: #9d927f; }

/* ---------- Davet ---------- */
.karanlik {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 22px max(30px, env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
}
.karanlik h1 { font-size: clamp(2rem, 8.5vw, 2.7rem); }
.gonderen { color: var(--kraft); margin: -4px 0 18px; font-style: italic; font-family: var(--serif); }
.davet-yazi { color: #cfc3b0; margin: 0 0 18px; }
.gizlilik {
  font-size: 0.88rem; color: #9b917f; margin: 0 0 26px;
  padding: 10px 14px; border-radius: 12px; background: rgba(246, 234, 210, 0.05);
}
.karanlik .dugme { max-width: 340px; }
.kibrit { width: 60px; height: 90px; position: relative; margin-bottom: 18px; }
.kibrit::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 170, 80, 0.22), rgba(255, 170, 80, 0) 60%);
}
.kibrit span {
  position: absolute; left: 50%; bottom: 10px; width: 22px; height: 46px; margin-left: -11px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 72%, #fffbe8 0 18%, #ffd27a 38%, #ff8a2a 70%, rgba(255, 90, 20, 0) 100%);
  transform-origin: 50% 90%;
  animation: titre 2.4s ease-in-out infinite;
}
@keyframes titre {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  30% { transform: scale(0.95, 1.06) rotate(2deg); }
  60% { transform: scale(1.04, 0.95) rotate(-2deg); }
}

/* ---------- Oda ---------- */
#oda {
  position: fixed; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#sahne { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.oda-yazi {
  position: absolute; left: 0; right: 0; top: max(10vh, env(safe-area-inset-top));
  margin: 0 auto; max-width: 22em; padding: 0 22px;
  text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.4;
  color: #ffe6bd;
  text-shadow: 0 0 18px rgba(255, 170, 80, 0.55);
  opacity: 0; transition: opacity 1.4s ease;
  pointer-events: none;
}
.oda-yazi.gorunur { opacity: 1; }
body.aydinlik .oda-yazi { opacity: 0; }
.oda-alt {
  position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.oda-alt .baglanti { color: #7d7466; font-size: 0.9rem; }

.mesaj {
  position: relative;
  margin: 50dvh 16px 40px;
  max-width: 460px;
  background: #fffaf0;
  color: var(--lacivert);
  border-radius: 24px;
  padding: 26px 22px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(110, 60, 10, 0.25);
  animation: belir 1s ease both;
}
@media (min-width: 500px) { .mesaj { margin-left: auto; margin-right: auto; } }
@keyframes belir { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.mesaj-ust { margin: 0 0 6px; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: #b26a1c; }
.mesaj h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 1.1; margin: 0 0 8px; }
.mesaj-yas { margin: 0 0 12px; color: #7a5a35; }
.mesaj-metin { font-family: var(--serif); font-style: italic; font-size: 1.22rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; }
.mesaj-imza { margin: 0 0 18px; font-weight: 600; color: #7a5a35; }
.mesaj .dugme { margin-top: 8px; }

#konfeti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
#olcum {
  position: fixed; left: 8px; top: 8px; z-index: 60; margin: 0;
  font: 12px/1.4 ui-monospace, Menlo, monospace; color: #9f9; background: rgba(0, 0, 0, 0.6); padding: 6px 8px; border-radius: 6px;
}
.noscript { padding: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .kibrit span { animation: none; }
  .mesaj { animation: none; }
}
