/* ========== TEMEL ========== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 50%, #ff6b9d 100%);
  background-attachment: fixed;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button { font-family: inherit; cursor: pointer; border: none; outline: none; touch-action: manipulation; }

/* ========== EKRAN GEÇİŞLERİ ========== */
.ekran {
  display: none;
  width: 100vw;
  height: 100vh;
  padding: 16px;
}
.ekran.aktif { display: flex; }

/* ========== GİRİŞ EKRANI ========== */
#ekranGiris { align-items: center; justify-content: center; }
.giris-kart {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 32px;
  padding: 48px 56px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: 900px;
  width: 92%;
  animation: girisIn 0.6s ease;
}
@keyframes girisIn { from { opacity: 0; transform: translateY(40px) scale(.95); } to { opacity: 1; transform: none; } }
.giris-kart h1 {
  font-size: 56px;
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255,255,0,.6);
  letter-spacing: 1px;
}
.alt-baslik { font-size: 22px; margin-bottom: 32px; opacity: .95; }

.oyuncu-girisleri {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.oyuncu-input { flex: 1; }
.oyuncu-input label { display: block; font-size: 22px; font-weight: bold; margin-bottom: 10px; }
.oyuncu-input input {
  width: 100%;
  padding: 18px 20px;
  font-size: 26px;
  border-radius: 16px;
  border: 3px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.95);
  color: #333;
  text-align: center;
  font-family: inherit;
  font-weight: bold;
}
.oyuncu-input input:focus { outline: none; border-color: #ffeb3b; box-shadow: 0 0 20px #ffeb3b; }
.vs { font-size: 40px; font-weight: bold; text-shadow: 2px 2px 0 #000; padding: 0 12px; }

.soru-secim { margin-bottom: 32px; }
.soru-secim label { font-size: 22px; font-weight: bold; display: block; margin-bottom: 14px; }
.soru-sayi-butonlari { display: flex; gap: 14px; justify-content: center; }
.soru-sayi-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  font-size: 32px; font-weight: bold;
  background: rgba(255,255,255,.25);
  color: #fff;
  border: 3px solid rgba(255,255,255,.5);
  transition: all .2s;
}
.soru-sayi-btn:hover { transform: scale(1.1); }
.soru-sayi-btn.aktif {
  background: linear-gradient(135deg, #ffeb3b, #ff9800);
  color: #333;
  border-color: #fff;
  box-shadow: 0 0 24px #ffeb3b;
  transform: scale(1.15);
}

.buyuk-btn {
  background: linear-gradient(135deg, #ff5722, #ff9800);
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  padding: 22px 60px;
  border-radius: 60px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 -4px 0 rgba(0,0,0,.2);
  text-shadow: 2px 2px 0 rgba(0,0,0,.3);
  transition: all .15s;
  letter-spacing: 1px;
}
.buyuk-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(0,0,0,.5); }
.buyuk-btn:active { transform: translateY(2px); }

/* ========== OYUN EKRANI ========== */
#ekranOyun { flex-direction: column; padding: 10px; gap: 10px; }

.ust-panel {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.skor-kart {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(14px);
  border: 3px solid rgba(255,255,255,.4);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.sol-skor { border-left: 8px solid #4fc3f7; }
.sag-skor { border-right: 8px solid #ff8a80; }
.skor-kart .oyuncu-ad { font-size: 28px; font-weight: bold; margin-bottom: 6px; text-shadow: 2px 2px 0 #000; word-break: break-word; }
.skor-kart .puan {
  font-size: 72px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow: 3px 3px 0 #000, 0 0 24px rgba(255,235,59,.6);
  line-height: 1;
}
.skor-kart .kazanc { font-size: 24px; font-weight: bold; min-height: 30px; margin-top: 4px; }
.kazanc.artar { color: #69f0ae; animation: pop .6s ease; }
.kazanc.azalir { color: #ff5252; animation: pop .6s ease; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 50% { transform: scale(1.4); } 100% { transform: scale(1); opacity: 1; } }

.orta-panel {
  background: rgba(255,255,255,.12);
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.tur-bilgi {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  background: rgba(0,0,0,.3);
  border-radius: 12px;
  padding: 4px 0;
}
.soru-cerceve {
  flex: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
  max-height: 70vh; /* prevent excessive height */
}

/* Improved image styling for readability */
.soru-cerceve img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 4px solid rgba(0,0,0,0.2);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  background: #fff;
}

.zaman-cubugu {
  height: 32px;
  background: rgba(0,0,0,.4);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.zaman-dolgu {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4caf50, #ffeb3b, #ff5722);
  border-radius: 16px;
  transition: width 1s linear;
}
.zaman-yazi {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}

/* ========== ALT PANEL — JOKER + ŞIK ========== */
.alt-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 210px;
  flex-shrink: 0;
  min-height: 0;
}
.oyuncu-panel {
  background: rgba(255,255,255,.10);
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 24px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.sol-panel { border-top: 8px solid #4fc3f7; }
.sag-panel { border-top: 8px solid #ff8a80; }

.joker-sira {
  display: flex;
  gap: 8px;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.joker-btn {
  width: 54px; height: 54px;
  border-radius: 14px;
  font-size: 26px;
  background: linear-gradient(135deg, #ffd54f, #ff9800);
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 22px rgba(255,213,79,.7);
  animation: jokerParla 1.4s ease-in-out infinite;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.joker-btn:active { transform: scale(.92); }
.joker-btn:disabled {
  filter: grayscale(.7);
  animation: none;
  opacity: .55;
  box-shadow: none;
}
@keyframes jokerParla {
  0%, 100% { box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 22px rgba(255,213,79,.7); }
  50% { box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 38px rgba(255,235,59,1); }
}
.joker-bos { font-size: 18px; opacity: .55; font-style: italic; }

.secenek-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
  gap: 8px;
  min-height: 0;
}
.secenek-btn {
  font-size: 44px;
  font-weight: bold;
  border-radius: 16px;
  color: #fff;
  text-shadow: 3px 3px 0 rgba(0,0,0,.3);
  border: 4px solid rgba(255,255,255,.5);
  box-shadow: 0 8px 20px rgba(0,0,0,.3), inset 0 -6px 0 rgba(0,0,0,.2);
  transition: transform .1s;
}
.secenek-btn:active { transform: scale(.95); }
.secenek-btn[data-sik="A"] { background: linear-gradient(135deg, #f06292, #ec407a); }
.secenek-btn[data-sik="B"] { background: linear-gradient(135deg, #4fc3f7, #29b6f6); }
.secenek-btn[data-sik="C"] { background: linear-gradient(135deg, #81c784, #66bb6a); }
.secenek-btn[data-sik="D"] { background: linear-gradient(135deg, #ffb74d, #ffa726); }

.secenek-btn.elendi {
  background: #555 !important;
  color: #999;
  position: relative;
  pointer-events: none;
  opacity: .4;
}
.secenek-btn.elendi::after {
  content: "❌";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.secenek-btn:disabled { filter: grayscale(.6); opacity: .45; pointer-events: none; }
.secenek-btn.dondu { background: linear-gradient(135deg, #b3e5fc, #81d4fa) !important; color: #0277bd; animation: titre .6s infinite; }
.secenek-btn.dogru {
  background: linear-gradient(135deg, #43a047, #1b5e20) !important;
  color: #fff !important;
  opacity: 1 !important;
  filter: none !important;
  border-color: #fff59d;
  box-shadow: 0 0 0 6px rgba(255, 241, 118, .55), 0 10px 24px rgba(0,0,0,.35);
  animation: dogruParlat .9s ease-in-out infinite alternate;
  position: relative;
}
.secenek-btn.dogru::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 54px;
  color: #fff59d;
  text-shadow: 2px 2px 0 rgba(0,0,0,.4);
}
@keyframes dogruParlat {
  from { box-shadow: 0 0 0 4px rgba(255, 241, 118, .4), 0 8px 18px rgba(0,0,0,.3); }
  to   { box-shadow: 0 0 0 10px rgba(255, 241, 118, .75), 0 12px 28px rgba(0,0,0,.45); }
}
@keyframes titre { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.oyuncu-panel.kapali { opacity: .35; pointer-events: none; }

/* ========== JOKER BİLDİRİM ========== */
.joker-bildirim {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #ff5722, #ffeb3b);
  color: #fff;
  font-size: 42px;
  font-weight: bold;
  padding: 28px 56px;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  text-align: center;
  text-shadow: 3px 3px 0 #000;
  z-index: 100;
  border: 4px solid #fff;
  pointer-events: none;
}
.joker-bildirim.goster { animation: jokerGoster 2.4s ease forwards; }
@keyframes jokerGoster {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-30deg); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2) rotate(0); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.5) rotate(20deg); opacity: 0; }
}

/* ========== CEVAP BİLDİRİM ========== */
.cevap-bildirim {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 120px;
  z-index: 90;
  pointer-events: none;
  text-shadow: 4px 4px 0 #000;
}
.cevap-bildirim.dogru { animation: dogruAn 1.4s ease forwards; }
.cevap-bildirim.yanlis { animation: yanlisAn 1.4s ease forwards; }
@keyframes dogruAn {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -150%) scale(.8); opacity: 0; }
}
@keyframes yanlisAn {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20%, 40%, 60% { transform: translate(-50%, -50%) scale(1.3) rotate(-15deg); opacity: 1; }
  30%, 50%, 70% { transform: translate(-50%, -50%) scale(1.3) rotate(15deg); }
  100% { transform: translate(-50%, -50%) scale(.7) rotate(0); opacity: 0; }
}

.gizli { display: none !important; }

/* ========== SORU BÜYÜTME KATMANI ========== */
.soru-cerceve img { cursor: zoom-in; }
.soru-buyut {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  animation: buyutFade .2s ease;
}
.soru-buyut img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  border: 6px solid #ffeb3b;
}
@keyframes buyutFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ========== SONUÇ EKRANI ========== */
#ekranSonuc { align-items: center; justify-content: center; }
.sonuc-kart {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(20px);
  border: 4px solid #ffeb3b;
  border-radius: 36px;
  padding: 40px 60px;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0,0,0,.5), 0 0 80px rgba(255,235,59,.4);
  max-width: 1000px; width: 92%;
  animation: girisIn .8s ease;
}
.kupa { font-size: 140px; animation: kupaParla 1.5s ease-in-out infinite; }
@keyframes kupaParla { 0%,100% { transform: scale(1) rotate(-5deg); } 50% { transform: scale(1.15) rotate(5deg); } }
#kazananBaslik {
  font-size: 60px;
  margin: 12px 0 28px;
  text-shadow: 3px 3px 0 #000, 0 0 30px #ffeb3b;
}
.sonuc-skor {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 30px;
  margin-bottom: 28px;
}
.sonuc-oyuncu .ad { font-size: 36px; font-weight: bold; text-shadow: 2px 2px 0 #000; }
.sonuc-oyuncu .puan {
  font-size: 100px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow: 4px 4px 0 #000;
}
.sonuc-vs { font-size: 56px; font-weight: bold; }
.konfeti { font-size: 56px; margin-bottom: 22px; animation: konfetiSall 2s ease-in-out infinite; }
@keyframes konfetiSall { 0%,100% { transform: translateX(-12px); } 50% { transform: translateX(12px); } }

.sonuc-oyuncu.kaybeden { opacity: .55; filter: grayscale(.6); }
.sonuc-oyuncu.kazanan { animation: kazananZipla 1s ease infinite; }
@keyframes kazananZipla { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
