:root {
  --metin: #f7f3ec;
  --soluk: rgba(247, 243, 236, 0.74);
  --cok-soluk: rgba(247, 243, 236, 0.5);
  --altin: #f4d68c;
  --ar: "Noto Naskh Arabic", "Amiri", "Geeza Pro", "Al Nile", "Scheherazade New",
    "Traditional Arabic", "Noto Sans Arabic", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ust-bosluk: clamp(14px, 4.2vh, 40px);
  --kart-ust: 62%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #05060a;
  color: var(--metin);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body { display: flex; justify-content: center; }

#uygulama {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #12070e;
  user-select: none;
  -webkit-user-select: none;
}

/* Masaüstünde ortada telefon oranında sütun */
@media (min-width: 560px) {
  #uygulama {
    width: min(480px, 54vh);
    width: min(480px, 54dvh);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 90px rgba(0, 0, 0, 0.7);
  }
}

#sahne {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 0.6s ease;
}

.ust-golge, .alt-golge {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
.ust-golge {
  top: 0;
  height: 42%;
  background: linear-gradient(to bottom, rgba(4, 5, 12, 0.5), rgba(4, 5, 12, 0.18) 60%, rgba(4, 5, 12, 0));
}
.alt-golge {
  bottom: 0;
  height: 34%;
  background: linear-gradient(to top, rgba(4, 6, 10, 0.55), rgba(4, 6, 10, 0));
  opacity: 0;
  transition: opacity 1.2s ease;
}
.ekran-giris .alt-golge, .ekran-kapanis .alt-golge { opacity: 1; }

/* ---------------------------------------------------------------- metin */
p, h1, h2, blockquote { margin: 0; }

.ust {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(env(safe-area-inset-top) + var(--ust-bosluk)) calc(env(safe-area-inset-right) + 18px) 0
    calc(env(safe-area-inset-left) + 18px);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 18px rgba(0, 0, 0, 0.35);
}

.etiket {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--soluk);
  padding-left: 0.3em; /* harf aralığını ortala */
}
.etiket.altin { color: var(--altin); }

.arapca {
  font-family: var(--ar);
  direction: rtl;
  unicode-bidi: isolate;
  letter-spacing: 0;
  word-spacing: 0.06em;
  line-height: 1.85;
  font-weight: 400;
  overflow: visible;
}
.arapca.buyuk {
  font-size: clamp(27px, 8.2vw, 38px);
  margin-top: 0.05em;
  margin-bottom: -0.15em;
}

.okunus {
  font-size: clamp(12px, 3.4vw, 14px);
  color: var(--soluk);
  line-height: 1.4;
}
.egik { font-style: italic; color: var(--metin); font-size: 1.08em; }
/* Dar ekranda okunuş ve anlam iki satır; ayraç gizlenir */
.okunus .ayrac { display: none; }
.okunus .anlam { display: block; }
@media (min-width: 470px) {
  .okunus .ayrac { display: inline; }
  .okunus .anlam { display: inline; }
}

.sayac {
  margin-top: 0.3em;
  font-size: clamp(44px, 13.5vw, 60px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
#sayi { display: inline-block; transition: transform 0.35s cubic-bezier(.2, 1.6, .4, 1); }
#sayi.vurus { transform: scale(1.08); }
.bolu {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--cok-soluk);
  margin-left: 0.35em;
}

.tespih {
  width: min(94%, 370px);
  margin: 10px auto 0;
}
#tespih { display: block; width: 100%; height: auto; overflow: visible; }
#tespih .ip { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; }
#tespih .ip-dolu { fill: none; stroke: rgba(255, 255, 255, 0.92); stroke-width: 1.4; stroke-linecap: round;
  transition: stroke-dasharray 0.9s ease; }
#tespih .boncuk { fill: rgba(255, 255, 255, 0.35); transition: fill 0.6s ease; }
#tespih .boncuk.dolu { fill: #fff; }
#tespih .durak { fill: rgba(20, 22, 30, 0.6); stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; transition: fill 0.6s, stroke 0.6s; }
#tespih .durak.gecildi { fill: var(--altin); stroke: var(--altin); }
#tespih .uc { fill: #fff; transition: transform 0.9s ease; }
#tespih .uc-isik { fill: #fff; opacity: 0.35; transition: transform 0.9s ease; }
#tespih text {
  font-family: var(--sans);
  font-size: 8.2px;
  font-weight: 700;
  letter-spacing: 0.8px;
  fill: rgba(255, 255, 255, 0.62);
  transition: fill 0.6s;
}
#tespih text.gecildi { fill: var(--altin); }

h1 {
  margin-top: 0.35em;
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.alt-metin {
  margin: 0.8em auto 0;
  max-width: 22em;
  font-size: clamp(14px, 3.9vw, 16px);
  font-style: italic;
  color: var(--soluk);
  line-height: 1.45;
}

.meal {
  font-size: clamp(14px, 4vw, 16px);
  font-style: italic;
  line-height: 1.45;
  margin: 0.15em auto 0;
  max-width: 22em;
}
.kaynak {
  margin-top: 0.7em;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
  padding-left: 0.26em;
  color: var(--altin);
}

h2 {
  font-size: clamp(32px, 10vw, 44px);
  font-weight: 800;
  letter-spacing: -0.01em;
}
blockquote {
  margin: 0.6em auto 0;
  max-width: 19em;
  font-size: clamp(17px, 5vw, 20px);
  font-weight: 500;
  line-height: 1.4;
}
.soyleyen {
  margin-top: 0.55em;
  font-size: 14px;
  color: var(--soluk);
}

/* ---------------------------------------------------------------- katmanlar ve ekranlar */
#zikirUst, #magfiretUst, #giris, #kapanis {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 0s linear 1s;
}
#giris, #kapanis { position: absolute; inset: 0; }
.ekran-giris #giris,
.ekran-zikir #zikirUst,
.ekran-magfiret #magfiretUst,
.ekran-kapanis #kapanis {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.2s ease 0.2s, visibility 0s;
}

.alt-blok {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 calc(env(safe-area-inset-right) + 24px) calc(env(safe-area-inset-bottom) + clamp(22px, 6vh, 56px))
    calc(env(safe-area-inset-left) + 24px);
  text-align: center;
}
#kapanis .alt-blok .ozet { margin: 0 0 16px; }

.dugme {
  min-height: 54px;
  min-width: 210px;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  font: 700 18px/1 var(--sans);
  letter-spacing: 0.02em;
  color: #23170a;
  background: linear-gradient(180deg, #ffeab8, #f0c564);
  box-shadow: 0 10px 34px rgba(255, 186, 84, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  touch-action: manipulation;
}
.dugme:active { transform: scale(0.97); }
.dugme:focus-visible, .kose-dugme:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ekran-giris #basla { animation: nefes 3.2s ease-in-out infinite; }
@keyframes nefes {
  0%, 100% { box-shadow: 0 10px 34px rgba(255, 186, 84, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
  50% { box-shadow: 0 10px 44px rgba(255, 186, 84, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
}

.ozet {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--soluk);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.ozet.not { font-style: italic; color: var(--cok-soluk); }

/* Ana ekrana ekleme notu: yalnız girişte, küçük ve sakin */
.kurulum {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: 340px;
  margin: 8px auto -10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--cok-soluk);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.kurulum[hidden], .kurulum [hidden] { display: none; }
/* sol alttaki ses düğmesinin altına girmesin */
@media (max-width: 400px) { .kurulum { padding: 0 36px; } }
.kurulum-metin { margin: 0; text-wrap: balance; }
.paylas { font-size: 1.05em; }
.kurulum-ekle {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(247, 243, 236, 0.28);
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.35);
  color: var(--soluk);
  font: 600 12.5px/1 var(--sans);
  cursor: pointer;
  touch-action: manipulation;
}
.kurulum-kapat {
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0 -10px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cok-soluk);
  font: 400 18px/1 var(--sans);
  cursor: pointer;
  touch-action: manipulation;
}
.kurulum-ekle:focus-visible, .kurulum-kapat:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------------------------------------------------------------- ayet kartı */
.ayet-kart {
  position: absolute;
  left: 50%;
  top: var(--kart-ust);
  width: min(calc(100% - 40px), 360px);
  padding: 12px 18px 13px;
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -42%);
  transition: opacity 0.9s ease, transform 0.9s ease, visibility 0s linear 0.9s;
  pointer-events: none;
}
.ayet-kart.goster {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
.ayet-kart .arapca { font-size: clamp(22px, 6.4vw, 27px); line-height: 1.9; }
.ayet-kart .meal { font-size: 15px; margin-top: 0; }
.ayet-kart .kaynak { margin-top: 0.6em; font-size: 10px; }
.ayet-kart .kelime { opacity: 0; transition: opacity 0.7s ease; }
.ayet-kart.goster .kelime { opacity: 1; transition-delay: calc(0.25s + var(--i) * 0.22s); }

/* ---------------------------------------------------------------- ses aç / kapat (sol alt) */
.ses-dugme {
  position: absolute;
  left: calc(env(safe-area-inset-left) + 14px);
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 12, 18, 0.42);
  color: var(--metin);
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.ekran-giris .ses-dugme, .ekran-zikir .ses-dugme, .ekran-magfiret .ses-dugme {
  opacity: 0.85;
  visibility: visible;
  transition: opacity 0.6s ease 0.4s, visibility 0s;
}
.ses-dugme svg { width: 22px; height: 22px; overflow: visible; }
.ses-dugme path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ses-dugme .hoparlor { fill: currentColor; stroke-width: 1.2; }
.ses-dugme .carpi { display: none; }
.ses-dugme.sessiz { color: var(--soluk); }
.ses-dugme.sessiz .dalga { display: none; }
.ses-dugme.sessiz .carpi { display: inline; }
.ses-dugme:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------------------------------------------------------------- durdur / devam */
.kose-dugme {
  position: absolute;
  right: calc(env(safe-area-inset-right) + 14px);
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 18, 0.5);
  color: var(--metin);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s, background 0.3s, color 0.3s;
}
.ekran-zikir .kose-dugme { opacity: 1; visibility: visible; transition: opacity 0.6s ease 0.6s, visibility 0s; }
.kose-dugme .simge {
  width: 10px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.durdu .kose-dugme { background: var(--altin); color: #23170a; border-color: transparent; animation: cagir 2s ease-in-out infinite; }
.durdu .kose-dugme .simge {
  border: 0;
  width: 0;
  height: 0;
  border-left: 10px solid currentColor;
  border-top: 6.5px solid transparent;
  border-bottom: 6.5px solid transparent;
}
@keyframes cagir {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 214, 140, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(244, 214, 140, 0); }
}
.durdu #sahne { opacity: 0.72; }

.perde {
  position: absolute;
  inset: 0;
  background: #05060a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.perde.kapali { opacity: 1; }

/* ---------------------------------------------------------------- sahne hareketleri (ucuz: transform/opacity) */
.alev {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: titre 1.3s ease-in-out infinite alternate;
}
@keyframes titre {
  from { transform: scale(0.8, 0.7); opacity: 0.7; }
  to { transform: scale(1.05, 1.15); opacity: 1; }
}
.kivilcim { animation: yuksel 4s linear infinite; }
@keyframes yuksel {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translate(8px, -120px); opacity: 0; }
}
.yagmur-akis { animation: yag 0.6s linear infinite; }
@keyframes yag {
  from { transform: translate(0, 0); }
  to { transform: translate(-48px, 300px); }
}
.parilti {
  transform-box: fill-box;
  transform-origin: center;
  animation: parla 2.8s ease-in-out infinite;
}
@keyframes parla {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1); }
}
.akinti path { animation: akis 2.4s linear infinite; }
@keyframes akis { to { stroke-dashoffset: -14; } }
.suzul { animation: suz 22s ease-in-out infinite alternate; }
@keyframes suz { to { transform: translateX(12px); } }

@media (prefers-reduced-motion: reduce) {
  .alev, .kivilcim, .yagmur-akis, .parilti, .akinti path, .suzul, .ekran-giris #basla, .durdu .kose-dugme {
    animation: none !important;
  }
  #zikirUst, #magfiretUst, #giris, #kapanis, .ayet-kart, .ayet-kart.goster { transition-duration: 0.3s !important; }
  .ayet-kart.goster .kelime { transition-delay: 0s; }
}

/* Kısa ekranlar: üst bölümü sıkıştır */
@media (max-height: 680px) {
  :root { --ust-bosluk: 12px; }
  .arapca.buyuk { font-size: clamp(25px, 7.4vw, 32px); line-height: 1.7; }
  .sayac { font-size: clamp(40px, 12vw, 52px); }
  .tespih { margin-top: 6px; }
}
