/* Sesli müdür — tam ekran avatar (plan madde 6): dört döngü videosu üst üste, etkin olan görünür; durum yazısı
   üstte, alt yazı altta, ikisi de koyu geçişle videonun üstünde. Bağlantı kopukken görüntü soluklaşır. */
:root {
  --dinliyor: #0b1622;
  --avatar-zemin: #4d4037;   /* videonun arka plan rengi; video yüklenene kadar görünen */
  --yazi: #f2f4f7;
  --soluk: #9aa7b6;
  --sen: #9fd0ff;
  --mudur: #ffe3a3;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--dinliyor); color: var(--yazi);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

#sahne { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  background: var(--avatar-zemin); overflow: hidden; }

#avatar { position: absolute; inset: 0; background: var(--avatar-zemin) url(/avatar/poster.jpg?v=1) 50% 20% / cover no-repeat;
  transition: filter .45s ease; }
#avatar video, #avatar canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: 50% 20%; opacity: 0; pointer-events: none; }
/* Geçiş: gelen video üstte 0,3 sn'de belirir, giden altında tam görünür kalır (arada zemin görünmez), sonra durur. */
#avatar video.etkin { opacity: 1; z-index: 2; transition: opacity .3s ease; }
#avatar video.onceki { opacity: 1; z-index: 1; }
/* 0.5.1 konuşmadan çıkış: dönüş tuvali (WebGL üçgen ağ) videoların üstünde belirir, dönüşüm bitince bekleme altta ilk
   karesinden açılır (ani), tuval kalkar. Tuval kurulamazsa kısa karışım (hizli). Tuvalin kısa belirişi renk farkını örter. */
#avatar video.etkin.hizli { transition: opacity .15s ease; }
#avatar video.etkin.ani { transition: none; }
#avatar canvas { z-index: 3; transition: opacity .08s linear; }
#avatar canvas.etkin { opacity: 1; }
#sahne[data-durum="kopuk"] #avatar { filter: grayscale(.7) brightness(.55); }

#durum { position: relative; z-index: 3; width: 100%; text-align: center; font-size: 15px; letter-spacing: .04em;
  color: #e3e8ee; min-height: 20px; padding: calc(env(safe-area-inset-top) + 16px) 0 30px;
  background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,0)); text-shadow: 0 1px 3px rgba(0,0,0,.7); }

#altyazi { position: relative; z-index: 3; margin-top: auto; width: 100%; min-height: 9.5em; display: flex;
  flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 3.5em 20px calc(env(safe-area-inset-bottom) + 28px);
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.6) 55%, rgba(0,0,0,0) 100%);
  text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.satir { font-size: 19px; line-height: 1.38; opacity: 1; transition: opacity .3s; }
.satir.eski { opacity: .5; }
.satir .kim { font-size: 13px; font-weight: 600; margin-right: 6px; letter-spacing: .03em; }
.satir.sen .kim { color: var(--sen); }
.satir.mudur .kim { color: var(--mudur); }
.satir.bilgi { font-size: 15px; color: #c3ccd6; }
.satir.kalin .metin { font-weight: 700; }

#eslestir { position: fixed; inset: 0; background: var(--dinliyor); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center; }
#eslestir[hidden], #perde[hidden] { display: none; }
#eslestir h1 { font-size: 24px; font-weight: 600; margin: 0 0 10px; }
#eslestir p { color: var(--soluk); margin: 6px 0; font-size: 16px; }
#kod { margin: 18px 0 8px; width: 12ch; font-size: 32px; letter-spacing: .25em; text-align: center;
  background: #142233; color: var(--yazi); border: 1px solid #2c4058; border-radius: 10px; padding: 10px 6px;
  -webkit-user-select: text; user-select: text; }
#eslestir-not { min-height: 1.4em; }

#perde { position: fixed; inset: 0; background: rgba(5,10,16,.78); display: flex; align-items: center;
  justify-content: center; padding: 30px; text-align: center; }
#perde p { font-size: 20px; line-height: 1.4; }

/* 0.3.2 — mikrofon düğmesi (Fatih 25.11: "Küçük bir mikrofon düğmesi koy. Kapalıyken kırmızı, açıkken, hazırken yeşil").
   Görünen 44 px; ::before ile dokunma alanı 72 px (parmakla rahat). Perde düğmenin üstünde kalır. */
#mik { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
       z-index: 4; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
       color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
       -webkit-tap-highlight-color: transparent; touch-action: manipulation; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
#mik::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; }
#mik[data-durum="acik"] { background: #1f9d55; }
#mik[data-durum="kapali"] { background: #d64545; }
#mik svg { width: 22px; height: 22px; }
#mik .cizgi { display: none; }
#mik[data-durum="kapali"] .cizgi { display: inline; }
#perde { z-index: 10; }
