/* Gazlı Kuş — arayüz stili (oyun tuvalin içinde, paneller üstünde) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Mobil dokunma parlamasını (ince mavi flaş) tamamen kapat */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  /* Mobil: adres çubuğu hesaba katılmış gerçek görünür yükseklik */
  height: 100dvh;
  background: #14202b; /* tuval ekranı tamamen kaplar, arka plan görünmez */
  font-family: "Segoe UI", Verdana, sans-serif;
  overflow: hidden;
  overscroll-behavior: none; /* aşağı çekince yenileme olmasın */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

canvas, button, input { outline: none; }

#sahne {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#oyunTuval {
  image-rendering: pixelated;
  cursor: pointer;
}

/* ---- Paneller ---- */
.panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(340px, 88vw);
  /* İçerik ekrandan uzunsa panel KESİLMEZ, kendi içinde kayar.
     (Aksi hâlde alçak ekranlarda üst satırlar — Google girişi gibi — kırpılır.) */
  max-height: 94dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #2a4356 transparent;
  background: rgba(20, 32, 43, 0.92);
  border: 2px solid #00b4d8;
  border-radius: 14px;
  padding: 22px 20px;
  text-align: center;
  color: #eef6fa;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: panelGel 0.25s ease-out;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: #2a4356; border-radius: 4px; }

@keyframes panelGel {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.gizli { display: none !important; }

h1 {
  font-size: 34px;
  letter-spacing: 3px;
  color: #ffe066;
  text-shadow: 2px 3px 0 #b8860b, 0 0 18px rgba(255, 224, 102, 0.35);
  margin: 6px 0 4px;
}

h2 { color: #6fe3f7; letter-spacing: 2px; margin-bottom: 12px; }

.slogan { font-size: 13px; color: #b8ccd8; margin-bottom: 16px; }
.slogan b { color: #8fd14f; }

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 2px solid #2a4356;
  border-radius: 8px;
  background: #0d1620;
  color: #eef6fa;
  font-size: 15px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: #00b4d8; }

.buton {
  display: block;
  width: 100%;
  padding: 11px;
  margin-bottom: 9px;
  border: none;
  border-radius: 8px;
  background: #2a4356;
  color: #eef6fa;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s;
}
.buton:hover { filter: brightness(1.2); }
.buton:active { transform: scale(0.97); }
.buton.birincil { background: linear-gradient(180deg, #00b4d8, #0077a3); font-size: 17px; }
.buton.ikincil { background: #1c2f3e; color: #9fb8c8; }
.buton.kucuk { width: auto; display: inline-block; padding: 7px 12px; font-size: 13px; }

.katilSatir { display: flex; gap: 8px; }
.katilSatir input { flex: 1; margin-bottom: 9px; text-transform: uppercase; letter-spacing: 4px; font-weight: 700; }
.katilSatir .buton { flex: 1; }

#menuButonlar.bekliyor { opacity: 0.45; pointer-events: none; }

/* Renk seçici: 8 kuş avatarı — panel içine sığar */
#renkSecici {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
#renkSecici canvas {
  width: 32px;
  height: 29px;
  image-rendering: pixelated;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: #0d1620;
  transition: transform 0.1s, border-color 0.15s;
}
#renkSecici canvas:hover { transform: scale(1.1); }
#renkSecici canvas.secili { border-color: #ffe066; box-shadow: 0 0 10px rgba(255, 224, 102, 0.4); }

.ipucu { font-size: 12px; color: #7e95a6; margin-top: 8px; }

/* ---- Lobi ---- */
#odaKodKutu p { font-size: 13px; color: #b8ccd8; }
.kodSatir { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 14px; }
#odaKodYazi {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #ffe066;
  text-shadow: 2px 2px 0 #b8860b;
}

#oyuncuListe { margin: 6px 0 14px; max-height: 200px; overflow-y: auto; }

/* Google giriş satırı — hesap kartı panele sığar, taşan ad "…" ile kısalır */
#girisSatir {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  min-height: 40px;
  max-width: 100%;
  overflow: hidden; /* GSI butonu dar panelde yanlara taşmasın */
}
#googleGiris { display: flex; justify-content: center; max-width: 100%; }
#girisBilgi {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 6px 4px 4px;
  border: 2px solid #2a4356;
  border-radius: 20px;
  background: #0d1620;
  font-size: 13px;
  font-weight: 700;
}
#girisFoto {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: #2a4356;
  object-fit: cover;
}
#girisAd {
  color: #eef6fa;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#girisElo { color: #ffe066; flex: none; white-space: nowrap; }
#cikisButon {
  flex: none;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #1c2f3e;
  color: #9fb8c8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
#cikisButon:hover { background: #e8524a; color: #fff; }

/* 🏆 Liderlik tablosu */
.tabloUst { margin: -6px 0 10px; }
#tabloListe { margin-bottom: 10px; max-height: 46dvh; overflow-y: auto; }
.tabloSatir {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: #0d1620;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.tabloSatir.benim { outline: 2px solid #00b4d8; }
.tabloSira { width: 30px; flex: none; text-align: center; color: #7e95a6; }
.tabloSatir.ilk3 .tabloSira { font-size: 16px; }
.tabloAd { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabloElo { color: #ffe066; flex: none; font-variant-numeric: tabular-nums; }
#tabloBen { margin: 0 0 10px; color: #b8ccd8; }

/* ⚙ Ayarlar */
.ayarSatir {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #0d1620;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.ayarDugme {
  flex: none;
  min-width: 74px;
  padding: 6px 10px;
  border: 2px solid #2a4356;
  border-radius: 20px;
  background: #1c2f3e;
  color: #7e95a6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ayarDugme.acik { border-color: #8fd14f; color: #d9f2c9; background: #1f3320; }
.ayarDugme:active { transform: scale(0.96); }
#ayarSesSeviye {
  flex: 1;
  min-width: 0;
  max-width: 150px;
  accent-color: #00b4d8;
  cursor: pointer;
}

/* Maç içi çıkış butonu (sağ üst) */
#cikButon {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(159, 184, 200, 0.5);
  background: rgba(13, 22, 32, 0.6);
  color: #cfe0ea;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 6;
}
#cikButon:hover { border-color: #e8524a; color: #fff; background: rgba(232, 82, 74, 0.7); }
#cikButon:active { transform: scale(0.92); }

/* Ranked kart vurgusu + kilit */
.genelKart.ranked { border-color: #8a6d00; background: linear-gradient(180deg, #2a2410, #14110a); }
.genelKart.ranked:hover { border-color: #ffe066; }
.genelKart.ranked .genelUst span:first-child { color: #ffe066; }
.genelKart.kilitli { opacity: 0.65; }

/* Genel oda kartları — dönen lobiler */
#genelOdalar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.genelKart {
  padding: 10px 14px;
  border: 2px solid #2a4356;
  border-radius: 10px;
  background: linear-gradient(180deg, #16283a, #0d1620);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.08s;
}
.genelKart:hover { border-color: #00b4d8; }
.genelKart:active { transform: scale(0.98); }
.genelUst {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
  color: #eef6fa;
}
.genelSayac {
  font-variant-numeric: tabular-nums;
  color: #7e95a6;
  font-size: 13px;
}
.genelSayac.yakin { color: #8fd14f; }
.genelAlt { font-size: 11px; color: #7e95a6; margin-top: 2px; }

/* Maç modu seçici (kurucu görür) */
#modSecici { margin-bottom: 10px; }
#modListe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}
#duzenButon { width: 100%; }
.modButon {
  padding: 8px 6px;
  border: 2px solid #2a4356;
  border-radius: 8px;
  background: #1c2f3e;
  color: #9fb8c8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.modButon.secili { border-color: #00b4d8; color: #eef6fa; background: #0d1620; }
.oyuncuSatir {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 15px;
}
.oyuncuSatir canvas { image-rendering: pixelated; }

/* ---- Skor ---- */
#skorTablo { margin-bottom: 12px; }
.skorSatir {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin-bottom: 5px;
  border-radius: 8px;
  background: #0d1620;
  font-size: 16px;
  font-weight: 700;
}
.skorSatir.benim { outline: 2px solid #00b4d8; }
.madalya { width: 34px; text-align: center; font-size: 18px; }
.skorAd { flex: 1; text-align: left; }
.skorPuan { color: #ffe066; font-size: 19px; }

/* ---- Oyun içi ---- */
.pingEtiket {
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
}
.pingEtiket.iyi { color: #8fd14f; }
.pingEtiket.orta { color: #ffe066; }
.pingEtiket.kotu { color: #ff6b6b; }

#osurukButon {
  position: absolute;
  right: 18px;
  bottom: 22px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #8fd14f;
  background: rgba(90, 158, 47, 0.75);
  font-size: 32px;
  cursor: pointer;
  z-index: 6;
  touch-action: none;
}
#osurukButon:active { transform: scale(0.92); }

/* ---- Bildirimler ---- */
#toastKutu {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}
.toast {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(20, 32, 43, 0.92);
  border: 1px solid #00b4d8;
  color: #eef6fa;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  animation: toastGel 0.25s ease-out;
  transition: opacity 0.5s;
}
.toast.kayboluyor { opacity: 0; }
@keyframes toastGel {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
