/* Değişken yazı tipleri: Türkçe dahil tam Latin Genişletilmiş kapsam (SIL OFL) */
@font-face { font-family: "Jost Light"; src: url("../fontlar/Jost-Var.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "CG Light"; src: url("../fontlar/CormorantGaramond-Var.ttf") format("truetype"); font-weight: 300 700; font-display: block; }

:root {
  --zemin: #02030a;
  --yazi: #eef0fb;
  --soluk: rgba(226, 230, 250, 0.62);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--zemin); color: var(--yazi);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: none; overscroll-behavior: none;
}
body { font-family: "Jost Light", system-ui, sans-serif; font-weight: 300; }

#gok, #yazi { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#gok { opacity: 0; transition: opacity 1.8s ease; }
#gok.hazir { opacity: 1; }
#yazi { pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
#yazi.gorunur { opacity: 1; }

#etiketler { position: fixed; inset: 0; pointer-events: none; }
.etiket {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-size: 12.5px; letter-spacing: 0.3em; padding-left: 0.3em; line-height: 18px;
  color: var(--yazi); opacity: 0; will-change: transform, opacity;
  text-shadow: 0 0 4px rgba(2, 3, 10, 0.95), 0 0 10px rgba(2, 3, 10, 0.8);
}
.etiket.kucuk { font-size: 11px; letter-spacing: 0.24em; padding-left: 0.24em; }

#tut {
  position: fixed; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px;
  pointer-events: none; transition: opacity 0.9s ease;
}
#tut svg { display: block; overflow: visible; }
#tut circle { fill: none; stroke-width: 1; }
#tut .iz { stroke: rgba(255, 255, 255, 0.22); }
#tut .dolgu { stroke: rgba(255, 248, 235, 0.9); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 276.46; }
#tut.nabiz .iz { animation: nabiz 2.4s ease-in-out infinite; transform-origin: 60px 60px; }
#tutYazi {
  position: absolute; left: 50%; top: calc(100% + 10px); transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.34em; padding-left: 0.34em; text-transform: uppercase;
  color: var(--soluk); white-space: nowrap; transition: opacity 0.6s ease;
}
@keyframes nabiz {
  0%, 100% { transform: scale(1); stroke: rgba(255, 255, 255, 0.18); }
  50% { transform: scale(1.07); stroke: rgba(255, 255, 255, 0.42); }
}

#ipucu {
  position: fixed; left: 0; right: 0; bottom: calc(26px + env(safe-area-inset-bottom)); margin: 0;
  text-align: center; font-size: 11px; letter-spacing: 0.32em; padding-left: 0.32em; text-transform: uppercase;
  color: var(--soluk); transition: opacity 1.2s ease; pointer-events: none;
}

#mesaj { position: fixed; left: 50%; top: 0; width: min(86vw, 540px); transform: translateX(-50%); text-align: center; pointer-events: none; }
#mesajMetin {
  margin: 0; font-family: "CG Light", Georgia, serif; font-weight: 400;
  font-size: clamp(19px, 4.9vw, 25px); line-height: 1.45; color: rgba(242, 238, 255, 0.92);
  white-space: pre-line; overflow-wrap: anywhere; opacity: 0; transition: opacity 1.8s ease;
  text-shadow: 0 0 18px rgba(2, 3, 10, 0.9);
}
#imzaMetin {
  margin: 1.5em 0 0; font-size: 12px; letter-spacing: 0.32em; padding-left: 0.32em; text-transform: uppercase;
  color: rgba(226, 230, 250, 0.7); opacity: 0; transition: opacity 1.8s ease; overflow-wrap: anywhere;
}
#gokMetin {
  margin: 1.1em 0 0; font-size: 10px; letter-spacing: 0.28em; padding-left: 0.28em; text-transform: uppercase;
  color: rgba(226, 230, 250, 0.5); opacity: 0; transition: opacity 1.8s ease 0.6s; overflow-wrap: anywhere;
}
#gokMetin:empty { display: none; }
#mesaj.metinGorunur #mesajMetin { opacity: 1; }
#mesaj.imzaGorunur #imzaMetin, #mesaj.imzaGorunur #gokMetin { opacity: 1; }

/* Gerçek gökyüzü altyazısı: oyun boyunca üstte, çarpışmada söner */
#gokUst {
  position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 58px; right: 58px; margin: 0;
  text-align: center; font-size: 10px; line-height: 1.8; letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase;
  color: rgba(226, 230, 250, 0.55); pointer-events: none; transition: opacity 1.6s ease;
  text-shadow: 0 0 6px rgba(2, 3, 10, 0.9);
}
#gokUst span { display: block; }
#gokUst span:last-child { color: rgba(226, 230, 250, 0.4); }
#gokUst:empty, #gokUst span:empty { display: none; }

.ekranOkuyucu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

button {
  position: fixed; border: 0; background: transparent; color: rgba(236, 238, 250, 0.7); cursor: pointer;
  font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.6); outline-offset: 4px; border-radius: 4px; }
#sesDugme { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); width: 44px; height: 44px; display: grid; place-items: center; z-index: 3; }
#sesDugme svg { fill: currentColor; }
#sesDugme .dalga { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
#sesDugme .sesKapali { display: none; }
#sesDugme.kapali .sesAcik { display: none; }
#sesDugme.kapali .sesKapali { display: block; }

#altDugmeler {
  position: fixed; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 6px; z-index: 3; pointer-events: none;
}
#tekrar, #kaydet {
  position: static; pointer-events: auto;
  padding: 12px 16px; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; white-space: nowrap;
  transition: opacity 1.2s ease;
}

#hata { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }
#hataMetin { max-width: 30em; font-family: "CG Light", Georgia, serif; font-size: 22px; line-height: 1.45; color: rgba(242, 238, 255, 0.9); }

.gizli { opacity: 0 !important; pointer-events: none !important; }
#hata.gizli, #tekrar.gizli { visibility: hidden; }
#kaydet.gizli { display: none; }

/* Telefonda kaydetme: resim büyük açılır, basılı tutunca galeriye kaydedilir */
#kayitPencere {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: rgba(2, 3, 10, 0.94); touch-action: auto;
}
#kayitPencere.kapali { display: none; }
#kayitResim {
  display: block; max-width: 100%; max-height: 66vh; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 18px 48px rgba(0, 0, 0, 0.6);
  -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; pointer-events: auto;
}
#kayitYonerge { margin: 0; max-width: 26em; text-align: center; font-size: 15px; line-height: 1.5; color: rgba(236, 238, 250, 0.82); }
.kayitDugmeler { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#kayitPencere button {
  position: static; padding: 12px 20px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
  font-size: 11px; letter-spacing: 0.3em; padding-left: calc(20px + 0.3em); text-transform: uppercase; color: rgba(236, 238, 250, 0.85);
}
#kayitPaylas { background: rgba(255, 246, 234, 0.92) !important; color: #14110d !important; border-color: transparent !important; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  #tut.nabiz .iz { animation: none; }
}

body.yedek #baslikMetin { margin: 0 0 0.6em; font-family: "CG Light", Georgia, serif; font-weight: 300; font-size: clamp(34px, 9vw, 60px); line-height: 1.1; color: #fff6ea; }
