/* ==========================================================================
   KYTHRION — OBSIDIAN (yalnızca ARKA PLAN katmanı)
   - Sadece site içi: body.site-shell (admin paneline dokunmaz)
   - Ön yüz (sayfa içerikleri, kartlar, yazılar, butonlar) değişmez.
   - Tüm renkler admin panelindeki tema ayarlarından gelir:
     --bg --bg2 --violet --violet2 --cyan --pink  (Site Ayarları > Tema)
     --grid-opacity  → arka plan desenin yoğunluğu (0 = kapalı)
     Tema "hareket" kapalıysa dönüş animasyonu da kapanır.
   ========================================================================== */

body.site-shell:not(.admin-body){
  --ob-a:var(--violet,#8b5cf6);
  --ob-a2:var(--violet2,#a78bfa);
  --ob-b:var(--cyan,#22d3ee);
  --ob-c:var(--pink,#f43f9a);
  --ob-k:var(--bg,#05060b);
  --ob-k2:var(--bg2,#080a12);
  --ob-int:min(1,calc(var(--grid-opacity,.5) * 1.7));
}

/* ---------- 1. ZEMİN: admin renklerinden ışık haritası ---------- */
body.site-shell:not(.admin-body):before{
  z-index:-3;
  background:
    radial-gradient(1200px 780px at 82% -10%,color-mix(in srgb,var(--ob-a) 24%,transparent),transparent 62%),
    radial-gradient(960px 720px at -8% 46%,color-mix(in srgb,var(--ob-b) 15%,transparent),transparent 66%),
    radial-gradient(1100px 820px at 64% 122%,color-mix(in srgb,var(--ob-c) 13%,transparent),transparent 62%),
    radial-gradient(ellipse 125% 95% at 50% 50%,transparent 52%,rgba(0,0,0,.58) 100%),
    linear-gradient(180deg,var(--ob-k2) 0%,var(--ob-k) 55%);
}

/* ---------- 2. İnce film grain (eski ızgara yerine) ---------- */
body.site-shell:not(.admin-body):after{
  z-index:-1;-webkit-mask-image:none;mask-image:none;background-size:240px 240px;
  opacity:calc(.35 + var(--ob-int) * .65);mix-blend-mode:soft-light;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- 3. Guilloché alanı (JS çizer, CSS döndürür) ---------- */
.ob-field{position:fixed;inset:0;z-index:-2;pointer-events:none;overflow:hidden;contain:strict;opacity:var(--ob-int,.85)}
.ob-layer{position:absolute;will-change:transform;transform:translate3d(var(--ox,0px),var(--oy,0px),0)}
.ob-layer canvas{display:block;width:100%;height:100%;
  -webkit-mask-image:radial-gradient(circle,#000 0,rgba(0,0,0,.85) 38%,transparent 68%);
  mask-image:radial-gradient(circle,#000 0,rgba(0,0,0,.85) 38%,transparent 68%);
  animation:ob-turn 420s linear infinite}
.ob-layer.ob-a{width:min(1500px,150vmax);height:min(1500px,150vmax);right:-34vmax;top:-46vmax;opacity:.78}
.ob-layer.ob-b{width:min(1100px,120vmax);height:min(1100px,120vmax);left:-40vmax;bottom:-52vmax;opacity:.7}
.ob-layer.ob-b canvas{animation-duration:560s;animation-direction:reverse}
@keyframes ob-turn{to{transform:rotate(360deg)}}

/* ---------- 4. Eski arka plan süsleri kapalı (hepsi dekoratif, tıklanamaz katmanlar) ---------- */
body.site-shell:not(.admin-body) .kxu-bg,
body.site-shell:not(.admin-body) .kxu-cursor,
body.site-shell:not(.admin-body) #kxp-particles,
body.site-shell:not(.admin-body) .kx-stage,
body.site-shell:not(.admin-body) .kx-hero,
body.site-shell:not(.admin-body) .kx-ph{display:none!important}

/* ---------- 5. Hero arka ışığı: admin renkleriyle ---------- */
body.site-shell:not(.admin-body) .hero-aurora{
  filter:none;opacity:1;
  background:
    radial-gradient(640px 380px at 66% 14%,color-mix(in srgb,var(--ob-a) 22%,transparent),transparent 70%),
    radial-gradient(520px 340px at 24% 40%,color-mix(in srgb,var(--ob-b) 11%,transparent),transparent 72%)}
body.site-shell:not(.admin-body) .hero-aurora i{display:none}

/* ---------- 6. Footer arka zemini ---------- */
body.site-shell:not(.admin-body) .site-footer{
  background:
    radial-gradient(900px 340px at 50% 0,color-mix(in srgb,var(--ob-a) 10%,transparent),transparent 70%),
    linear-gradient(180deg,transparent,color-mix(in srgb,var(--ob-k) 88%,#000) 40%)}

/* ---------- 7. Performans / erişilebilirlik ---------- */
@media (max-width:900px){
  .ob-layer.ob-a{width:150vmax;height:150vmax;right:-60vmax;top:-60vmax;opacity:.4}
  .ob-layer.ob-b{display:none}
}
@media (prefers-reduced-motion:reduce){
  .ob-layer canvas{animation:none}
  .ob-layer{transform:none}
}
html.kxu-lite .ob-layer.ob-b{display:none}

/* ---------- 8. DÜZELTME: yayıncı kartı avatarı (streamers.php / ana sayfa yayıncı kartları) ----------
   Avatar kutusu her zaman kare ve sabit boyutlu; fotoğraf oranı ya da çerçeve (frame) görseli
   ne olursa olsun şekil bozulmaz, kart içeriği aşağı kaymaz. */
body.site-shell .streamer-feature-card .streamer-identity{align-items:center;height:74px;min-height:74px;box-sizing:border-box}
body.site-shell .streamer-feature-card .streamer-identity-copy{min-width:0}
body.site-shell .streamer-feature-card .streamer-face-wrap{
  --sf:68px;width:var(--sf)!important;height:var(--sf)!important;min-width:var(--sf)!important;min-height:var(--sf)!important;
  max-width:var(--sf)!important;max-height:var(--sf)!important;flex:0 0 var(--sf)!important;
  aspect-ratio:1/1!important;align-self:center!important;margin:0!important;padding:0!important;border-radius:50%!important;
  transform:none!important;overflow:visible!important}
body.site-shell .home-streamer-card .streamer-face-wrap{--sf:62px}
body.site-shell .streamer-feature-card :is(.streamer-face-wrap>.kx-member-avatar-image,img.streamer-face){
  display:block!important;width:var(--sf,68px)!important;height:var(--sf,68px)!important;min-width:0!important;min-height:0!important;
  max-width:100%!important;max-height:100%!important;aspect-ratio:1/1!important;object-fit:cover!important;object-position:50% 22%!important;
  border-radius:50%!important;transform:none!important}
body.site-shell .streamer-feature-card img.streamer-face{--sf:68px;flex:0 0 68px!important}
body.site-shell .home-streamer-card img.streamer-face{--sf:62px;flex-basis:62px!important}
body.site-shell .streamer-feature-card .streamer-face-wrap>.kx-discord-avatar-frame{
  inset:-20%!important;width:140%!important;height:140%!important;max-width:none!important;max-height:none!important;
  aspect-ratio:1/1!important;object-fit:contain!important;object-position:center!important;transform:none!important}
@media(max-width:760px){
  body.site-shell .streamer-feature-card .streamer-face-wrap{--sf:54px}
  body.site-shell .streamer-feature-card img.streamer-face{--sf:54px;flex-basis:54px!important}
}

/* ---------- 9. Yayın platformu ikonları (rozet + platform başlığı) ---------- */
body.site-shell .kx-plat-icon{font-size:12px;margin-right:3px}
body.site-shell .streamer-platform-name h2 .kx-plat-icon,
body.site-shell .streamer-platform-name h2 .kick-platform-inline{font-size:.8em;margin-right:8px}
body.site-shell .kx-plat-youtube{color:#ff2a2a!important}
body.site-shell .kx-plat-twitch{color:#a970ff!important}
body.site-shell .kx-plat-tiktok{color:#fff!important;text-shadow:1.2px 1.2px 0 #ff0050,-1.2px -1.2px 0 #00f2ea}
body.site-shell .kx-plat-instagram{color:#ff5fa2!important}
body.site-shell .kx-plat-x{color:#fff!important}
body.site-shell .kx-plat-facebook{color:#4f8cff!important}
