/* Sahne 1080x1920 (TikTok LIVE dikey). Ekrana oyun.js ölçekler.
   Yaşlıların da anlayacağı sadelik: üç kural, büyük yazı, tek durum satırı.
   TikTok izleyici arayüzü: üstte ~130px yayıncı şeridi, altta solda yorumlar (~%35).
   Kurallar arenanın üstünde; dereceler ve akış sağ altta (yorum katmanı solda). */
:root {
  --gece: #0a1238;
  --gece2: #1a1060;
  --kirmizi: #e30a17;
  --altin: #ffc531;
  --beyaz: #ffffff;
  --soluk: rgba(255, 255, 255, .7);
  --f-baslik: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --f-govde: "Rubik", "Arial Rounded MT Bold", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--f-govde); color: var(--beyaz); }

#sahne {
  position: absolute; left: 0; top: 0; width: 1080px; height: 1920px;
  transform-origin: 0 0; overflow: hidden;
  background:
    linear-gradient(180deg, transparent 55%, rgba(25,8,50,.55) 100%),
    radial-gradient(70% 35% at 50% 6%, rgba(255,230,150,.55), transparent 70%),
    linear-gradient(180deg, #ff9a5a 0%, #ff5f9e 30%, #a24bff 62%, #4b2ad1 100%);
}
.zemin {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: none;
}
#arena { position: absolute; inset: 0; width: 1080px; height: 1920px; }

/* Başlık + tek durum satırı */
.baslik { position: absolute; top: 128px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; pointer-events: none; }
.bant {
  display: flex; align-items: baseline; gap: 20px; padding: 2px 42px 6px;
  background: var(--kirmizi); transform: skewX(-8deg);
  box-shadow: 0 8px 0 rgba(0,0,0,.25), 0 0 50px rgba(227,10,23,.5);
}
.bant span, .bant b { display: inline-block; transform: skewX(8deg); font-family: var(--f-baslik); font-weight: 400; line-height: 1.05; }
.bant span { font-size: 52px; color: var(--altin); }
.bant b { font-size: 82px; letter-spacing: 3px; }
.durum {
  font: 900 40px/1 var(--f-govde); padding: 14px 32px; border-radius: 999px; letter-spacing: .5px;
  background: var(--altin); color: #1b1300; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.durum.savas { background: var(--kirmizi); color: #fff; }
.durum.az { animation: nabiz .5s infinite alternate; }

/* Üç kural */
.kurallar { position: absolute; top: 352px; left: 30px; right: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kurallar div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px 16px; border-radius: 20px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.kurallar i { grid-row: 1 / 3; font-style: normal; font-size: 50px; }
.kurallar b { font: 900 32px/1.05 var(--f-govde); }
.kurallar small { font: 500 26px/1.15 var(--f-govde); color: var(--soluk); }
.kurallar .altin { background: rgba(255,197,49,.2); box-shadow: inset 0 0 0 3px rgba(255,197,49,.6); }

/* Arena boşken */
.bekle { position: absolute; top: 760px; left: 0; right: 0; text-align: center; pointer-events: none; }
.bekle-buyuk { font: 400 150px/1.05 var(--f-baslik); color: var(--altin); text-shadow: 0 8px 0 rgba(0,0,0,.35); animation: nabiz 1s infinite alternate; }
.bekle-alt { font: 700 40px/1.3 var(--f-govde); }

/* Hediye tablosu: arenanın hemen altında (elmas → ne olur) */
.hediyeler { position: absolute; top: 1282px; left: 30px; right: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hediyeler div { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 6px; border-radius: 16px; background: rgba(0,0,0,.35); font: 400 34px/1 var(--f-govde); white-space: nowrap; }
.hediyeler b { font: 400 34px/1 var(--f-baslik); color: var(--altin); display: inline-flex; align-items: baseline; gap: 3px; }
.hediyeler b small { font: 700 16px/1 var(--f-govde); color: var(--altin); }
.hediyeler span { font: 900 22px/1 var(--f-govde); }
.hediyeler .kiyamet { background: linear-gradient(90deg, rgba(166,77,255,.55), rgba(227,10,23,.55)); }

/* Puan harcama satırı */
.harcama { position: absolute; top: 1350px; left: 30px; right: 30px; text-align: center; font: 500 26px/1.2 var(--f-govde); color: var(--soluk); white-space: nowrap; }
.harcama b { color: #7fe9ff; font-weight: 900; }

/* Sıradakiler: harcama satırının altında tek satır */
.sira { position: absolute; top: 1392px; left: 30px; right: 30px; text-align: center; font: 700 30px/1.3 var(--f-govde); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sira b { color: var(--altin); }
.sira:empty { display: none; }

/* Dereceler (sağ alt) */
.derece { position: absolute; top: 1440px; right: 30px; width: 470px; padding: 16px 20px; border-radius: 22px; background: rgba(0,0,0,.4); }
.derece h3 { margin: 0 0 10px; font: 900 26px/1 var(--f-govde); color: var(--altin); letter-spacing: 1px; }
.derece ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.derece li { display: flex; align-items: center; gap: 10px; font: 700 28px/1.1 var(--f-govde); white-space: nowrap; }
.derece li span { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.derece li em { font-style: normal; color: var(--altin); font-variant-numeric: tabular-nums; }
.derece li.bos { color: var(--soluk); font-weight: 500; }
.derece-alt { margin: -2px 0 10px; font: 700 22px/1.3 var(--f-govde); color: #ffe7a0; }

/* Olay akışı (sağ alt, derecelerin altında) */
.akis { position: absolute; top: 1735px; right: 30px; width: 620px; height: 140px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.olay { align-self: flex-end; max-width: 100%; padding: 9px 18px; border-radius: 14px; background: rgba(10,18,56,.88); border: 2px solid rgba(255,255,255,.14); font: 500 24px/1.25 var(--f-govde); animation: kay .35s ease-out; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.olay b { color: var(--altin); }
.olay.hed { background: rgba(255,197,49,.94); color: #1b1300; border-color: transparent; font-weight: 700; }
.olay.hed b { color: #7a0008; }
.olay.dus { background: rgba(227,10,23,.88); border-color: transparent; }
.olay.dus b { color: #fff; }

.baglanti { position: absolute; top: 40px; right: 30px; font: 700 22px/1 var(--f-govde); padding: 10px 16px; border-radius: 999px; background: rgba(0,0,0,.45); color: var(--soluk); }
.baglanti:empty { display: none; }
.baglanti.bagli { color: #55ff99; }

/* Büyük an yazısı (arena üstünde) */
.afis { position: absolute; left: 50%; top: 700px; transform: translate(-50%, -50%); pointer-events: none; text-align: center; opacity: 0; width: 1040px; }
.afis.goster { animation: afis 2.4s ease-out forwards; }
.afis .a1 { font: 900 44px/1.2 var(--f-govde); text-shadow: 0 4px 0 rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afis .a2 { font: 400 128px/1.05 var(--f-baslik); color: var(--altin); text-shadow: 0 8px 0 rgba(0,0,0,.55), 0 0 40px rgba(255,197,49,.6); white-space: nowrap; }
.afis.kirmizi .a2 { color: #ff3b4a; text-shadow: 0 8px 0 rgba(0,0,0,.55), 0 0 50px rgba(255,40,60,.7); }

/* Turlar arası: tur atlayanlar (arenanın üstünde) */
.ara { position: absolute; top: 560px; left: 70px; right: 70px; padding: 30px 26px; border-radius: 30px; background: rgba(40,10,90,.88); box-shadow: 0 0 0 4px var(--altin), 0 20px 60px rgba(0,0,0,.4); text-align: center; display: flex; flex-direction: column; gap: 20px; z-index: 3; animation: buyu .5s cubic-bezier(.2,.9,.25,1.3); }
.ara-baslik { font: 400 72px/1.05 var(--f-baslik); color: var(--altin); }
.ara-liste { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ara-liste span { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; background: rgba(255,255,255,.14); font: 900 32px/1 var(--f-govde); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ara-liste i { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--renk); font: 400 26px/1 var(--f-baslik); font-style: normal; flex: none; }
.ara-not { font: 700 28px/1.3 var(--f-govde); color: #ffd36b; }

/* Kazanan + kürsü */
.kazanan { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 40%, rgba(90,30,160,.88), rgba(20,8,60,.92)); display: grid; place-items: center; }
.kazanan canvas { position: absolute; inset: 0; }
.kz-icerik { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: buyu .7s cubic-bezier(.2,.9,.25,1.3); }
.kz-ust { font: 400 90px/1 var(--f-baslik); color: var(--altin); letter-spacing: 4px; }
.kz-top { width: 220px; height: 220px; border-radius: 50%; display: grid; place-items: center; font: 400 110px/1 var(--f-baslik); background: var(--renk, var(--kirmizi)); box-shadow: 0 0 0 10px rgba(255,255,255,.25), 0 0 80px var(--renk, var(--kirmizi)); }
.kz-ad { font: 900 92px/1.1 var(--f-govde); max-width: 1000px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kz-il { font: 700 48px/1 var(--f-govde); color: var(--soluk); }
.kursu { margin: 26px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.kursu li { font: 700 46px/1.2 var(--f-govde); white-space: nowrap; }
.kz-sonraki { font: 500 34px/1.3 var(--f-govde); color: var(--soluk); margin-top: 24px; }

/* Demo düğmeleri (yalnız deneme sayfasında, sahnenin dışında) */
.demo { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 5px; z-index: 5; max-width: calc(100vw - 16px); }
.demo button { font: 700 14px/1 var(--f-govde); padding: 10px 9px; border-radius: 999px; border: 0; background: var(--altin); color: #1b1300; cursor: pointer; white-space: nowrap; }
.demo button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@keyframes nabiz { to { transform: scale(1.05); } }
@keyframes kay { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes afis { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%,-50%) scale(1.12); } 22% { transform: translate(-50%,-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-62%) scale(1); } }
@keyframes buyu { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .durum, .bekle-buyuk { animation: none !important; } }
