/* ============================================
   SBY - Oyun Modülü Stilleri
   ============================================ */

/* ── OYUN HUB ── */
.games-hub { max-width: 800px; margin: 0 auto; }

.games-status-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.time-info { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.time-icon { font-size: 2rem; }
.time-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.time-value { font-size: 1.6rem; font-weight: 900; color: var(--primary); line-height: 1; }
.time-bar-wrap { flex: 1; min-width: 150px; }
.time-bar-bg { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.time-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 5px; transition: width 0.5s ease; }
.time-bar-fill.warning { background: linear-gradient(90deg, #ff9800, #f44336); }

/* ── OYUN KARTLARı ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-lt); }
.game-card:active { transform: translateY(-1px); }
.game-card.locked { opacity: 0.6; cursor: not-allowed; }
.game-card.locked:hover { transform: none; box-shadow: var(--shadow); }

.game-card-emoji { font-size: 3rem; margin-bottom: 0.75rem; }
.game-card-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.3rem; }
.game-card-desc { font-size: 0.82rem; color: var(--text-muted); }
.game-card-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: var(--primary); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}

/* ── OYUN EKRANI ── */
.game-screen {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.game-topbar h3 { flex: 1; font-size: 1rem; }
.game-timer {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 2px solid var(--primary-lt);
}
.game-timer.urgent { color: var(--danger); border-color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.game-score {
  font-size: 0.9rem; font-weight: 700;
  background: var(--surface);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 2px solid var(--border);
}

.game-body { padding: 1.5rem; min-height: 400px; }

/* ── HAFIZA OYUNU ── */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 380px;
  margin: 0 auto;
}
.memory-card {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.2s;
  box-shadow: 0 3px 8px rgba(155,89,182,0.2);
  position: relative;
  transform-style: preserve-3d;
}
.memory-card:hover { transform: scale(1.05); }
.memory-card.flipped { background: var(--bg2); }
.memory-card.matched { background: #e8f5e9; cursor: default; opacity: 0.7; }
.memory-card-front { display: none; }
.memory-card.flipped .memory-card-front,
.memory-card.matched .memory-card-front { display: block; }
.memory-card-back { color: transparent; }
.memory-card.flipped .memory-card-back,
.memory-card.matched .memory-card-back { display: none; }

/* ── MATEMATIK OYUNU ── */
.math-arena {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}
.math-question {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  margin: 1.5rem 0;
  line-height: 1.2;
}
.math-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.math-option {
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--bg2);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.math-option:hover { border-color: var(--primary); background: var(--primary-lt); }
.math-option.correct { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }
.math-option.wrong   { background: #fde8e8; border-color: #c62828; color: #c62828; }
.math-progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 1.5rem; }
.math-progress-fill { height: 100%; background: var(--primary); transition: width 0.1s linear; }

/* ── BALON PATLA ── */
.balloon-arena {
  position: relative;
  height: 400px;
  background: linear-gradient(180deg, #87CEEB 0%, #b0e0ff 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
}
.balloon {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
  animation: rise linear forwards;
}
.balloon:hover { transform: scale(1.1); }
.balloon::after {
  content: '';
  position: absolute;
  bottom: -12px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 14px;
  background: rgba(0,0,0,0.3);
}
@keyframes rise {
  from { bottom: -80px; }
  to   { bottom: 110%; }
}
.balloon-pop {
  position: absolute;
  font-size: 2rem;
  pointer-events: none;
  animation: pop 0.4s ease forwards;
}
@keyframes pop {
  0%   { transform: scale(0.5); opacity: 1; }
  50%  { transform: scale(1.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* ── KELİME BUL ── */
.word-search-wrap { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.word-grid {
  display: grid;
  gap: 3px;
  user-select: none;
}
.word-cell {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg2);
  border: 2px solid transparent;
  transition: var(--transition);
  text-transform: uppercase;
}
.word-cell:hover { border-color: var(--primary-lt); }
.word-cell.selected { background: var(--primary-lt); border-color: var(--primary); }
.word-cell.found { background: linear-gradient(135deg, var(--primary), var(--primary-dk)); color: #fff; }

.word-list { min-width: 140px; }
.word-list h4 { margin-bottom: 0.75rem; font-size: 0.9rem; color: var(--text-muted); }
.word-item {
  font-size: 0.95rem; font-weight: 700;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.3rem;
  transition: var(--transition);
}
.word-item.found { text-decoration: line-through; color: var(--text-muted); background: var(--bg2); }

/* ── SONUÇ EKRANI ── */
.game-result {
  text-align: center;
  padding: 2rem;
}
.result-emoji { font-size: 4rem; margin-bottom: 1rem; }
.result-score { font-size: 2.5rem; font-weight: 900; color: var(--primary); }
.result-label { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── KILITLI EKRAN ── */
.game-locked {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.game-locked .emoji { font-size: 4rem; margin-bottom: 1rem; }
.game-locked h3 { color: var(--text); margin-bottom: 0.5rem; }

@media (max-width: 600px) {
  .games-grid { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .word-search-wrap { flex-direction: column; align-items: center; }
}

/* ── SKRİBBL ARAÇLARI ── */
.skribbl-tool {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg2);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  padding: 0;
}
.skribbl-tool:hover { border-color: var(--primary-lt); background: var(--primary-lt); }
.skribbl-tool.active { border-color: var(--primary); background: var(--primary-lt); }

.color-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
  padding: 0;
}
.color-dot:hover { transform: scale(1.2); }
.color-dot.selected { transform: scale(1.15); }

#skribbl-canvas { display: block; }
