/* AltınHafız — ortak biçim dosyası */

:root {
  --yesil: #0b6b63;
  --yesil-koyu: #084b46;
  --altin: #c8a13a;
  --altin-acik: #e6c766;
  --kirmizi: #c0392b;
  --zemin: #f4f1ea;
  --kart: #ffffff;
  --metin: #1d2321;
  --soluk: #6b7573;
  --cerceve: #ddd6c7;
  --golge: 0 2px 10px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--zemin);
  color: var(--metin);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--yesil); }

/* ----------------------------------------------------------- üst şerit */

.ust-serit {
  background: #fff;
  border-bottom: 1px solid var(--cerceve);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ust-serit img.logo { height: 42px; width: auto; display: block; }

.ust-serit .ad {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--yesil-koyu);
  letter-spacing: .2px;
}

.ust-serit .ad span {
  display: block;
  font-weight: 400;
  font-size: .8rem;
  color: var(--soluk);
  letter-spacing: 0;
}

/* --------------------------------------------------------------- giriş */

.kabuk { max-width: 880px; margin: 0 auto; padding: 24px 16px 60px; }

.kart {
  background: var(--kart);
  border: 1px solid var(--cerceve);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--golge);
  margin-bottom: 20px;
}

.kart h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--yesil-koyu); }
.kart p.aciklama { margin: 0 0 16px; color: var(--soluk); font-size: .95rem; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .92rem; }

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cerceve);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fdfdfb;
}

input:focus, select:focus { outline: 2px solid var(--altin); border-color: var(--altin); }

.kod-girdi {
  font-size: 1.8rem;
  letter-spacing: .5rem;
  text-align: center;
  font-weight: 700;
}

.dugme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--yesil);
  color: #fff;
  transition: filter .15s;
}

.dugme:hover { filter: brightness(1.1); }
.dugme:disabled { opacity: .5; cursor: not-allowed; }
.dugme.genis { width: 100%; }
.dugme.altin { background: var(--altin); color: #2a2200; }
.dugme.kirmizi { background: var(--kirmizi); }
.dugme.sade { background: #eee9dd; color: var(--metin); }

.rol-secim { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 8px; }
@media (max-width: 560px) { .rol-secim { grid-template-columns: 1fr; } }

.rol-kutu {
  border: 2px solid var(--cerceve);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  background: #fdfdfb;
  text-align: center;
}

.rol-kutu.secili { border-color: var(--yesil); background: #eef7f5; }
.rol-kutu strong { display: block; font-size: 1.05rem; color: var(--yesil-koyu); }
.rol-kutu small { color: var(--soluk); }

.uyari {
  background: #fff8e6;
  border: 1px solid #e8d79a;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .9rem;
  color: #6b551a;
}

.hata-kutu {
  background: #fdecea;
  border: 1px solid #f3b8b1;
  color: #8c241a;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
  display: none;
}

/* ---------------------------------------------------------------- oda */

body.oda-govde { background: #10130f; overflow: hidden; }

.oda {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #10130f;
}

.oda-ust {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #0b0d0a;
  border-bottom: 1px solid #23291f;
  color: #e8e6df;
  flex-wrap: wrap;
}

.oda-ust img.logo { height: 30px; }
.oda-ust .kod { font-weight: 700; color: var(--altin-acik); letter-spacing: 2px; }
.oda-ust .bosluk { flex: 1 1 auto; }

.durum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: #b9c0b4;
}

.durum .nokta {
  width: 10px; height: 10px; border-radius: 50%;
  background: #7a6; display: inline-block;
}
.durum.bekliyor .nokta { background: #d6a338; }
.durum.kopuk .nokta { background: #c0392b; }

.oda-govde-ic { flex: 1 1 auto; position: relative; overflow: hidden; }

/* Ezber verenin ekranı: sadece karşıdaki yüz */
.tam-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}

/* Dinleyenin ekranı: mushaf + küçük kamera */
.mushaf-alan {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1b1e18; overflow: auto;
}

.mushaf-alan canvas,
.mushaf-alan iframe {
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 0, 0, .6);
  border: 0;
}

.kamera-kutu {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 30vw;
  max-width: 320px;
  min-width: 160px;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--altin);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
  z-index: 5;
  resize: both;
}

.kamera-kutu video { width: 100%; height: 100%; object-fit: cover; display: block; }

.kamera-kutu .etiket {
  position: absolute; left: 6px; bottom: 4px;
  font-size: .72rem; color: #fff;
  text-shadow: 0 0 4px #000, 0 0 4px #000;
}

/* ------------------------------------------------------- soru katmanı */

.soru-katman {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  pointer-events: none;   /* kamera ve sayfa görünür kalsın */
  z-index: 20;
}

.soru-katman.acik { display: flex; }

.soru-metin {
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  color: #ffffff;
  font-size: clamp(28px, 6.2vw, 78px);
  /* Harflerin kenarına kalın çerçeve: arka plan ne renk olursa olsun okunur */
  -webkit-text-stroke: 7px #000;
  paint-order: stroke fill;
  text-shadow:
    -4px -4px 0 #000, 0 -4px 0 #000, 4px -4px 0 #000,
    -4px 0 0 #000, 4px 0 0 #000,
    -4px 4px 0 #000, 0 4px 0 #000, 4px 4px 0 #000,
    0 0 14px rgba(0, 0, 0, .85);
  max-width: 100%;
  word-break: break-word;
}

.soru-katman.alt { align-items: flex-end; }
.soru-katman.alt .soru-metin { font-size: clamp(24px, 4.4vw, 56px); margin-bottom: 4vh; }

.soru-rozet {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .95rem;
  font-weight: 700;
  color: var(--altin-acik);
  text-shadow: 0 0 6px #000, 0 0 6px #000;
}

.cevap-rozet {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  border: 1px solid var(--altin);
  border-radius: 999px;
  padding: 7px 18px;
  font-weight: 700;
  font-size: 1rem;
}

.cevap-rozet b { color: var(--altin-acik); }

/* ------------------------------------------------------------ alt bar */

.oda-alt {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #0b0d0a;
  border-top: 1px solid #23291f;
  flex-wrap: wrap;
}

.oda-alt .bosluk { flex: 1 1 auto; }

.ikon-dugme {
  border: 1px solid #2f362a;
  background: #191d16;
  color: #e8e6df;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.ikon-dugme:hover { background: #222719; }
.ikon-dugme:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.ikon-dugme:disabled:hover { background: #191d16; }
.ikon-dugme.kapali { background: #4a1f1a; border-color: #7a3227; }
.ikon-dugme.vurgu { background: var(--altin); color: #2a2200; border-color: var(--altin); }
.ikon-dugme.cik { background: #6d2018; border-color: #8c2a20; color: #fff; }

.sayfa-secim { display: flex; align-items: center; gap: 6px; color: #cfd4c9; font-size: .9rem; }
.sayfa-secim input {
  width: 74px; padding: 8px; text-align: center;
  border-radius: 8px; border: 1px solid #2f362a;
  background: #191d16; color: #e8e6df; font-size: .95rem;
}

.bilgi-satiri {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  color: #e8e6df; background: rgba(0, 0, 0, .55);
  padding: 8px 16px; border-radius: 999px; font-size: .9rem; z-index: 10;
}

@media (max-width: 640px) {
  .oda-alt { gap: 6px; padding: 6px; }
  .ikon-dugme { padding: 9px 11px; font-size: .85rem; }
  .kamera-kutu { width: 38vw; min-width: 130px; right: 8px; bottom: 8px; }
}

/* ------------------------------------------------------- süre sayacı */

.sure {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: #e8e6df;
  background: #191d16;
  border: 1px solid #2f362a;
  border-radius: 999px;
  padding: 5px 12px;
  letter-spacing: .5px;
}

.sure .sure-ikon { font-size: .9em; opacity: .8; }

.sure.uyari {
  color: #2a2200;
  background: var(--altin);
  border-color: var(--altin);
}

.sure.son {
  color: #fff;
  background: var(--kirmizi);
  border-color: var(--kirmizi);
  animation: sure-yanip-son 1s steps(1, end) infinite;
}

@keyframes sure-yanip-son {
  50% { opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
  .sure.son { animation: none; }
}

/* ------------------------------------------- süre bitti perdesi */

.perde {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 9, .92);
  z-index: 60;
  padding: 24px;
  text-align: center;
}

.perde.acik { display: flex; }

.perde-ic { max-width: 440px; color: #e8e6df; }
.perde-ic h2 { margin: 10px 0 8px; color: var(--altin-acik); font-size: 1.4rem; }
.perde-ic p { margin: 0 0 20px; color: #b9c0b4; font-size: .98rem; }
.perde-ikon { font-size: 3rem; line-height: 1; }

/* Kendi görüntüsünü izleyen kişi için ayna etkisi (doğal görünsün) */
.tam-video.ayna { transform: scaleX(-1); }

/* -------------------------------------------- oda numarası bekleme */

.bekleme {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 9, .93);
  z-index: 40;
  padding: 20px;
  text-align: center;
}

.bekleme.acik { display: flex; }

.bekleme-ic { max-width: 420px; color: #e8e6df; }

.bekleme-baslik {
  font-size: .95rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9aa394;
}

.bekleme-kod {
  font-size: clamp(88px, 30vw, 190px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .06em;
  color: var(--altin);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 14px;
}

.bekleme-not { color: #b9c0b4; font-size: .98rem; margin-bottom: 18px; }

.bekleme-durum {
  display: inline-block;
  font-size: .9rem;
  color: #cfd4c9;
  border: 1px solid #2f362a;
  background: #191d16;
  border-radius: 999px;
  padding: 7px 16px;
}

/* Giriş sayfasındaki iki yol */

.yol-secim {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin-top: 22px;
}

@media (max-width: 620px) { .yol-secim { grid-template-columns: 1fr; } }

.yol {
  border: 1px solid var(--cerceve);
  border-radius: 12px;
  padding: 16px;
  background: #fdfdfb;
  display: flex;
  flex-direction: column;
}

.yol h3 { margin: 0 0 4px; font-size: 1rem; color: var(--yesil-koyu); }
.yol p { margin: 0 0 12px; font-size: .88rem; color: var(--soluk); flex: 1 1 auto; }
.yol .kod-girdi { margin-bottom: 10px; }
