:root {
  --levha: #FFD23F;      /* yol levhası sarısı */
  --kerb: #E63B2E;
  --cim: #2E9E52;
  --murekkep: #15181D;
  --kagit: #FFFFFF;
  --gok: #BFE2F7;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--gok); color: var(--murekkep); font-family: "Barlow Condensed", "Arial Narrow", sans-serif; overflow: hidden; }

/* 1080×1920 sahne; pencereye sığacak şekilde ölçeklenir (--olcek JS'ten) */
.sahne {
  width: 1080px; height: 1920px; position: fixed; left: 50%; top: 50%; overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--olcek, .5));
  background: linear-gradient(#7FC3EE, #CFEAF8 45%, #8CC77A 46%);
}
.dunya { position: absolute; inset: 0; }
.dunya canvas { display: block; width: 1080px !important; height: 1920px !important; }
.etiket-katmani { position: absolute; inset: 0; pointer-events: none; }

/* Araç etiketleri (3D sahnede aracın üstünde) */
.e3 {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; white-space: nowrap;
  background: rgba(255,255,255,.94); border: 3px solid var(--murekkep); border-radius: 40px;
  font-size: 28px; font-weight: 800; line-height: 1; transition: opacity .25s ease-out;
}
.e3 .av { width: 44px; height: 44px; border-radius: 50%; background: var(--renk) center / cover; color: #fff; display: grid; place-items: center; font-size: 22px; overflow: hidden; flex: none; border: 2px solid var(--renk); }
.e3 .av img { width: 100%; height: 100%; object-fit: cover; }
.e3 .no { font-family: "Bungee", sans-serif; font-size: 24px; min-width: 30px; text-align: center; }
.e3[data-s="1"] { background: var(--levha); }
.e3.kucuk { padding: 3px; gap: 0; }
.e3.kucuk .ad, .e3.kucuk .no { display: none; }
.e3.kucuk .av { width: 34px; height: 34px; font-size: 18px; }
.e3.gizli { opacity: 0; }

/* Üst */
.ust { position: absolute; left: 36px; right: 36px; top: 34px; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 24px; z-index: 4; }
.levha { background: var(--levha); border: 7px solid var(--murekkep); border-radius: 26px; padding: 12px 24px 12px; box-shadow: 0 10px 0 var(--murekkep); min-width: 0; }
.levha-ust { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.marka { font-family: "Bungee", sans-serif; font-weight: 400; font-size: 60px; line-height: 1; }
.yaris-no { font-size: 32px; font-weight: 700; white-space: nowrap; }
/* Levhada dönüşümlü: hangi hediye kaç metre attırır */
.levha-hediye { margin-top: 8px; height: 92px; border-top: 4px solid var(--murekkep); padding-top: 8px; overflow: hidden; }
.lh { display: flex; align-items: center; gap: 14px; height: 84px; animation: lhGir .45s cubic-bezier(.2,.8,.2,1); }
@keyframes lhGir { from { transform: translateY(60px); opacity: 0; } }
.lh img { width: 76px; height: 76px; object-fit: contain; flex: none; }
.lh .lh-ikon { width: 76px; height: 76px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--murekkep); color: var(--levha); font-family: "Bungee", sans-serif; font-size: 26px; }
.lh .lh-ad { font-size: 40px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; }
.lh .lh-m { font-size: 50px; font-weight: 800; white-space: nowrap; line-height: 1; }
.sayac { text-align: center; min-width: 330px; background: rgba(255,255,255,.9); border: 7px solid var(--murekkep); border-radius: 26px; padding: 10px 20px 12px; box-shadow: 0 10px 0 var(--murekkep); }
.sayac-deger { display: block; font-family: "Bungee", sans-serif; font-size: 104px; line-height: 1; font-variant-numeric: tabular-nums; }
.sayac-alt { display: block; font-size: 32px; font-weight: 700; margin-top: 4px; }
.sahne[data-acil="1"] .sayac-deger { color: var(--kerb); animation: nabiz 1s ease-out infinite; }
@keyframes nabiz { 0% { transform: scale(1.08); } 100% { transform: scale(1); } }

.onceki {
  position: absolute; left: 36px; right: 36px; top: 290px; z-index: 4; display: flex; align-items: center; gap: 16px;
  background: var(--murekkep); color: var(--kagit); border-radius: 18px; padding: 0 24px; height: 78px; font-size: 32px;
}
.onceki-baslik { color: var(--levha); font-weight: 700; white-space: nowrap; }
.onceki-ad { font-weight: 800; font-size: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.onceki-m { font-size: 36px; font-weight: 800; white-space: nowrap; }
.avatar { border-radius: 50%; background: var(--murekkep) center / cover no-repeat; color: var(--kagit); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.kucuk { width: 56px; height: 56px; flex: none; font-size: 26px; border: 3px solid var(--kagit); }

/* Sıralama tablosu */
.tablo {
  position: absolute; right: 36px; top: 390px; width: 360px; z-index: 4;
  background: rgba(255,255,255,.92); border: 5px solid var(--murekkep); border-radius: 20px; padding: 10px 14px;
}
.tablo ol { list-style: none; display: grid; gap: 4px; }
.tablo li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; font-size: 28px; font-weight: 700; height: 44px; }
.tablo .no { font-family: "Bungee", sans-serif; font-size: 24px; text-align: center; border-radius: 50%; }
.tablo li:first-child .no { background: var(--levha); border: 3px solid var(--murekkep); height: 38px; line-height: 32px; }
.tablo .ad { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tablo .renk { width: 14px; height: 14px; border-radius: 50%; background: var(--renk); border: 2px solid var(--murekkep); flex: none; }
.tablo .m { font-weight: 800; font-variant-numeric: tabular-nums; }
.tablo-toplam { font-size: 24px; font-weight: 700; color: #3A4048; margin-top: 6px; text-align: right; }

/* Bekleme ve geri sayım */
.pano {
  position: absolute; z-index: 5; left: 70px; right: 70px; top: 760px;
  background: rgba(255,255,255,.95); border: 7px solid var(--murekkep); border-radius: 28px; padding: 40px 44px;
  box-shadow: 0 12px 0 var(--murekkep); text-align: center; transition: opacity .3s ease-out, transform .3s ease-out;
}
.sahne:not([data-durum="bekleme"]) .bekleme-pano { opacity: 0; transform: scale(.94); pointer-events: none; }
.pano-baslik { font-family: "Bungee", sans-serif; font-size: 62px; line-height: 1.05; }
.pano-metin { font-size: 40px; font-weight: 600; margin-top: 16px; line-height: 1.2; }
.sampiyonlar { margin-top: 26px; border-top: 4px dashed var(--murekkep); padding-top: 22px; }
.sampiyon-baslik { font-size: 34px; font-weight: 800; }
.sampiyonlar ol { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 26px; margin-top: 14px; font-size: 30px; font-weight: 700; }
.sampiyonlar li { display: flex; align-items: center; gap: 10px; }
.geri-sayim { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.sahne[data-durum="geri-sayim"] .geri-sayim { opacity: 1; }
.geri-sayim span { font-family: "Bungee", sans-serif; font-size: 420px; line-height: 1; color: var(--levha); -webkit-text-stroke: 14px var(--murekkep); paint-order: stroke fill; }
.geri-sayim span.vur { animation: vur .8s cubic-bezier(.2,.8,.2,1); }
@keyframes vur { 0% { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* Alt: akış + hediye rehberi */
.alt { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; gap: 14px; }
.akis { list-style: none; display: grid; gap: 8px; padding: 0 36px; }
.akis li {
  display: flex; align-items: center; gap: 14px; font-size: 32px; font-weight: 600; height: 62px; padding: 4px 18px 4px 6px;
  background: rgba(255,255,255,.94); border: 3px solid var(--murekkep); border-radius: 40px;
  animation: akisGir .35s cubic-bezier(.2,.8,.2,1);
}
.akis li b { font-weight: 800; }
.akis .hediye-ikon { width: 52px; height: 52px; object-fit: contain; flex: none; }
.akis .nokta { width: 52px; height: 52px; border-radius: 50%; background: var(--renk); border: 3px solid var(--murekkep); flex: none; }
.akis .artis { margin-left: auto; font-size: 34px; font-weight: 800; color: #17803F; white-space: nowrap; }
.akis .metin { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes akisGir { from { transform: translateX(-40px); opacity: 0; } }
.rehber { background: var(--levha); border-top: 7px solid var(--murekkep); padding: 16px 30px 22px; display: grid; gap: 10px; }
.rehber-baslik { font-size: 36px; font-weight: 800; text-align: center; }
.rehber-alt { font-size: 28px; font-weight: 600; text-align: center; }
.katalog { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; min-height: 150px; }
.katalog li {
  display: grid; justify-items: center; align-content: center; gap: 2px; text-align: center; min-width: 0;
  background: var(--kagit); border: 3px solid var(--murekkep); border-radius: 16px; padding: 8px 4px;
  animation: kartGir .45s cubic-bezier(.2,.8,.2,1) both;
}
.katalog li:nth-child(2) { animation-delay: .05s; } .katalog li:nth-child(3) { animation-delay: .1s; }
.katalog li:nth-child(4) { animation-delay: .15s; } .katalog li:nth-child(5) { animation-delay: .2s; } .katalog li:nth-child(6) { animation-delay: .25s; }
@keyframes kartGir { from { transform: translateY(16px) scale(.95); opacity: 0; } }
.katalog img { width: 68px; height: 68px; object-fit: contain; }
.katalog .k-ad { font-size: 22px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.katalog .k-m { font-size: 30px; font-weight: 800; color: #17803F; line-height: 1; }
.katalog .kural { grid-column: 1 / -1; font-size: 40px; font-weight: 800; }

/* Sonuç */
.sonuc {
  position: absolute; inset: 0; z-index: 10; background: linear-gradient(rgba(21,24,29,.15), rgba(21,24,29,.55));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 30px; padding: 60px 60px 120px;
  animation: belir .5s ease-out;
}
@keyframes belir { from { opacity: 0; } }
.sonuc-baslik { font-family: "Bungee", sans-serif; font-size: 92px; text-align: center; line-height: 1; color: var(--levha); -webkit-text-stroke: 8px var(--murekkep); paint-order: stroke fill; }
.podyum { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: end; gap: 20px; width: 100%; }
.basamak { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; min-width: 0; animation: yuksel .7s cubic-bezier(.2,.8,.2,1) both; }
.basamak:nth-child(1) { animation-delay: .5s; } .basamak:nth-child(2) { animation-delay: .9s; } .basamak:nth-child(3) { animation-delay: .2s; }
@keyframes yuksel { from { transform: translateY(80px); opacity: 0; } }
.basamak .avatar { width: 150px; height: 150px; font-size: 64px; border: 7px solid var(--murekkep); }
.basamak[data-s="1"] .avatar { width: 210px; height: 210px; border-color: var(--levha); box-shadow: 0 0 0 7px var(--murekkep); }
.basamak .b-ad { font-size: 40px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--kagit); border-radius: 12px; padding: 0 12px; }
.basamak .b-m { font-size: 36px; font-weight: 800; color: var(--kagit); text-shadow: 0 3px 0 var(--murekkep); }
.basamak .blok { width: 100%; background: var(--murekkep); color: var(--levha); font-family: "Bungee", sans-serif; font-size: 90px; display: grid; place-items: center; border-radius: 18px 18px 0 0; }
.basamak[data-s="1"] .blok { height: 280px; background: var(--levha); color: var(--murekkep); border: 7px solid var(--murekkep); }
.basamak[data-s="2"] .blok { height: 200px; }
.basamak[data-s="3"] .blok { height: 140px; }
.sonuc-alt { font-size: 38px; font-weight: 700; text-align: center; color: var(--kagit); text-shadow: 0 3px 0 var(--murekkep); }

/* Büyük hediye bandı */
.roket {
  position: absolute; left: 0; right: 0; top: 520px; z-index: 9; background: var(--kerb); color: var(--kagit);
  border-block: 8px solid var(--murekkep); padding: 28px 40px; text-align: center;
  font-family: "Bungee", sans-serif; font-size: 58px; line-height: 1.1;
  animation: bant 3.2s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes bant { 0% { transform: translateX(-100%); } 12%, 85% { transform: translateX(0); } 100% { transform: translateX(100%); } }

.ses-ac { position: absolute; left: 50%; top: 560px; translate: -50% 0; z-index: 30; font: 800 44px "Barlow Condensed", sans-serif; padding: 18px 40px; border-radius: 20px; border: 6px solid var(--murekkep); background: var(--levha); cursor: pointer; }
.baglanti-uyari, .webgl-uyari { position: absolute; left: 50%; top: 20px; translate: -50% 0; z-index: 20; background: var(--murekkep); color: var(--kagit); padding: 10px 20px; border-radius: 10px; font-size: 28px; max-width: 900px; text-align: center; }
.webgl-uyari { top: 600px; }
.js-yok { position: fixed; inset: auto 0 0 0; padding: 16px; background: var(--murekkep); color: var(--kagit); text-align: center; font-size: 20px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
