/* ================= Akıllı Tahta Eğitici Oyunlar CSS ================= */
:root {
  --g-primary: #2563eb;
  --g-primary-dark: #1d4ed8;
  --g-success: #16a34a;
  --g-danger: #dc2626;
  --g-warning: #f59e0b;
  --g-bg: #f0f4fd;
  --g-card: #ffffff;
  --g-text: #1e293b;
  --g-border: #cbd5e1;
  --g-radius: 18px;
  --g-shadow: 0 10px 25px -5px rgba(30, 41, 59, 0.12), 0 8px 10px -6px rgba(30, 41, 59, 0.08);
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; font-family: 'Nunito', system-ui, sans-serif; background: var(--g-bg); color: var(--g-text); overflow-x: hidden; user-select: none; }
/* display:flex kuralları hidden özelliğini ezmesin (sonuç katmanı ekranı kapatıyordu) */
[hidden] { display: none !important; }

.g-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Üst Kontrol Çubuğu */
.g-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 2px solid var(--g-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  z-index: 20;
}
.g-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 900;
  color: var(--g-primary);
  text-align: center;
}
.g-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.g-score {
  font-size: 1.3rem;
  font-weight: 900;
  background: #fef3c7;
  color: #92400e;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid #fde68a;
}

/* Düğmeler - Dokunmatik Akıllı Tahta için Büyük */
.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
}
.g-btn:active { transform: scale(0.96); }
.g-btn-ghost { background: #f1f5f9; color: #334155; border: 2px solid var(--g-border); }
.g-btn-ghost:hover { background: #e2e8f0; }
.g-btn-big { padding: 18px 36px; font-size: 1.4rem; border-radius: 18px; }
.g-btn-go { background: linear-gradient(135deg, #22c55e, #16a34a); color: #ffffff; box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35); }
.g-btn-go:hover { background: #15803d; }

/* Ayar Ekranı (Ses Grubu ve Harf Seçimi) */
.g-setup {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 24px;
  border: 2px solid var(--g-border);
  box-shadow: var(--g-shadow);
  text-align: center;
}
.g-setup h2 {
  margin: 18px 0 12px;
  font-size: 1.4rem;
  font-weight: 900;
  color: #1e293b;
}
.g-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.g-chip {
  padding: 12px 20px;
  font-size: 1.2rem;
  font-weight: 800;
  background: #f8fafc;
  border: 2px solid var(--g-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.g-chip:hover { border-color: var(--g-primary); background: #eff6ff; }
.g-chip.active {
  background: var(--g-primary);
  color: #ffffff;
  border-color: var(--g-primary-dark);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
}
.g-chip-lg { min-width: 60px; height: 60px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }

/* Oyun Sahnesi */
.g-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* Soru Başlık Kartı */
.g-prompt {
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 24px;
  text-align: center;
  background: #ffffff;
  padding: 12px 30px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 2px solid #e2e8f0;
}
.g-prompt strong { color: var(--g-primary); text-decoration: underline; }

/* Eksik Harf Modu */
.g-word-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 30px 40px;
  border: 3px solid #e2e8f0;
  box-shadow: var(--g-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}
.g-word-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.08));
}
.g-boxes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.g-box {
  width: 65px;
  height: 75px;
  background: #f8fafc;
  border: 3px solid #cbd5e1;
  border-radius: 16px;
  font-size: 2.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
}
.g-box.empty {
  background: #fffbeb;
  border: 3px dashed #f59e0b;
  color: #d97706;
  animation: pulse 1.6s infinite;
}
.g-box.filled {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  animation: popIn 0.3s ease;
}

/* Seçenek Harfleri / Butonları */
.g-choices {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.g-choice-btn {
  min-width: 85px;
  height: 85px;
  background: #ffffff;
  border: 3px solid #94a3b8;
  border-radius: 20px;
  font-size: 2.4rem;
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.g-choice-btn:hover { border-color: var(--g-primary); transform: translateY(-3px); }
.g-choice-btn:active { transform: scale(0.93); }
.g-choice-btn.correct { background: #22c55e !important; color: #ffffff !important; border-color: #16a34a !important; }
.g-choice-btn.wrong { background: #ef4444 !important; color: #ffffff !important; border-color: #dc2626 !important; animation: shake 0.4s; }

/* Harf Avı Grid Modu */
.g-hunt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 880px;
}
.g-hunt-card {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.g-hunt-card:hover { border-color: var(--g-primary); transform: translateY(-4px); box-shadow: var(--g-shadow); }
.g-hunt-card img { width: 120px; height: 120px; object-fit: contain; }
.g-hunt-card span { font-size: 1.4rem; font-weight: 800; color: #1e293b; }

/* Balon Patlatma Modu */
.g-balloon-field {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 520px;
  background: radial-gradient(circle at 50% 20%, #e0f2fe 0%, #bae6fd 100%);
  border-radius: 28px;
  border: 4px solid #7dd3fc;
  overflow: hidden;
  box-shadow: var(--g-shadow);
}
.g-balloon {
  position: absolute;
  width: 110px;
  height: 130px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  box-shadow: inset -6px -6px 12px rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.1);
  transition: transform 0.1s;
}
.g-balloon::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 12px solid inherit;
}
.g-balloon:active { transform: scale(0.9); }

/* Hafıza Kartları Modu */
.g-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 720px;
}
.g-m-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}
.g-m-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s;
  transform-style: preserve-3d;
  border-radius: 18px;
}
.g-m-card.flipped .g-m-card-inner { transform: rotateY(180deg); }
.g-m-card.matched .g-m-card-inner { transform: rotateY(180deg); opacity: 0.6; pointer-events: none; }
.g-m-front, .g-m-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid #cbd5e1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.g-m-back { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #ffffff; font-size: 2.4rem; font-weight: 900; }
.g-m-front { background: #ffffff; transform: rotateY(180deg); padding: 8px; }
.g-m-front img { width: 65%; height: 65%; object-fit: contain; }
.g-m-front span { font-size: 1.1rem; font-weight: 800; color: #1e293b; margin-top: 4px; }

/* Say ve Bul Modu */
.g-count-area {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 28px;
  padding: 30px;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  margin-bottom: 24px;
}
.g-count-item {
  width: 85px;
  height: 85px;
  object-fit: contain;
  animation: popIn 0.4s ease;
}

/* Sonuç Ekranı */
.g-result {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.g-result-box {
  background: #ffffff;
  border-radius: 28px;
  padding: 40px;
  text-align: center;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: popIn 0.4s ease;
}
.g-result-emoji { font-size: 4rem; margin-bottom: 12px; }
.g-result-box h2 { font-size: 2.2rem; font-weight: 900; margin: 0 0 10px; color: #1e293b; }
.g-result-box p { font-size: 1.3rem; color: #64748b; margin: 0 0 28px; }
.g-result-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Konfeti Tuvali */
.g-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
}

/* Animasyonlar */
@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@media (max-width: 640px) {
  .g-memory-grid { grid-template-columns: repeat(3, 1fr); }
  .g-word-card { padding: 20px; }
  .g-box { width: 48px; height: 58px; font-size: 1.6rem; }
  .g-choice-btn { min-width: 65px; height: 65px; font-size: 1.8rem; }
}
