/* ═══════════════════════════════════════════════════
   SUMAIYA'S LEARNING WORLD — GAMES STYLES
   All Games Page · Game Modal · Play Area · Feedback
═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   ALL GAMES PAGE
═══════════════════════════════════════════════════ */

.games-section {
  padding: 20px 0 60px;
}

.all-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ═══════════════════════════════════════════════════
   GAME MODAL
═══════════════════════════════════════════════════ */

.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
}

.game-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 2px solid var(--pink-soft);
  flex-wrap: wrap;
  gap: 12px;
}

.game-modal-title {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin: 0;
}

.game-score {
  background: var(--yellow-soft);
  color: var(--text-dark);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.1rem;
}

.game-play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
}

.game-modal-footer {
  padding: 20px 0;
  text-align: center;
  border-top: 2px solid var(--pink-soft);
}

.btn-next {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.btn-next:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* ═══════════════════════════════════════════════════
   GAME QUESTION AREA
═══════════════════════════════════════════════════ */

.game-content {
  width: 100%;
}

.game-question {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--pink-soft);
}

.question-label {
  font-size: 1rem;
  color: var(--text-mid);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.question-word {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 8px;
  font-family: 'Nunito', sans-serif;
}

.question-pronunciation {
  font-size: 1rem;
  color: var(--text-mid);
  font-family: 'Courier New', monospace;
  background: var(--yellow-soft);
  padding: 4px 12px;
  border-radius: 15px;
  display: inline-block;
}

.question-sentence {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.6;
  font-style: italic;
}

.question-sentence .blank {
  color: var(--purple);
  font-weight: 800;
  border-bottom: 3px dashed var(--purple);
  padding: 0 8px;
}

.question-fact {
  font-size: 1.2rem;
  color: var(--text-dark);
  font-weight: 600;
  line-height: 1.5;
  padding: 16px;
  background: var(--purple-soft);
  border-radius: var(--radius-sm);
}

.question-ayah-arabic {
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  direction: rtl;
  font-family: 'Traditional Arabic', 'Scheherazade', serif;
}

.question-ayah-ref {
  font-size: 0.9rem;
  color: var(--text-mid);
  background: var(--pink-soft);
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════
   GAME OPTIONS
═══════════════════════════════════════════════════ */

.game-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.game-option-btn {
  background: white;
  border: 2px solid var(--pink-soft);
  padding: 20px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--text-dark);
}

.game-option-btn:hover:not(:disabled) {
  background: var(--pink-soft);
  border-color: var(--pink);
  transform: translateX(8px);
}

.game-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.game-option-btn.correct {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: var(--green);
  color: #155724;
  animation: correctPulse 0.5s ease;
}

.game-option-btn.wrong {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border-color: var(--pink);
  color: #721c24;
  animation: shake 0.5s ease;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* ═══════════════════════════════════════════════════
   FEEDBACK
═══════════════════════════════════════════════════ */

.game-feedback {
  margin-top: 16px;
}

.feedback {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback.correct {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: 2px solid var(--green);
}

.feedback.wrong {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border: 2px solid var(--pink);
}

.feedback-icon {
  font-size: 2rem;
  margin-right: 8px;
  vertical-align: middle;
}

.feedback-text {
  font-size: 1.2rem;
  font-weight: 700;
  vertical-align: middle;
}

.feedback.correct .feedback-text {
  color: #155724;
}

.feedback.wrong .feedback-text {
  color: #721c24;
}

.feedback-hint {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text-mid);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════
   MATH GAMES STYLES
═══════════════════════════════════════════════════ */

.math-question {
  background: linear-gradient(145deg, #FFF9E6, #FFF0C7);
  border: 3px solid var(--yellow);
}

.math-problem {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
  font-family: 'Nunito', sans-serif;
  margin: 16px 0;
}

.math-problem.missing {
  color: var(--purple);
  letter-spacing: 2px;
}

/* Timer bar for Quick Math */
.math-timer {
  width: 100%;
  height: 8px;
  background: #E8E8E8;
  border-radius: 4px;
  margin-top: 16px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
  border-radius: 4px;
  width: 100%;
}

/* Number buttons for Bigger/Smaller */
.number-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.number-btn {
  background: linear-gradient(145deg, var(--pink-soft), var(--purple-soft));
  border: 3px solid var(--pink);
  border-radius: var(--radius-md);
  padding: 20px 40px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Nunito', sans-serif;
}

.number-btn:hover:not(:disabled) {
  transform: scale(1.05);
  background: linear-gradient(145deg, var(--pink), var(--purple));
  color: white;
  box-shadow: 0 4px 16px rgba(247, 142, 160, 0.4);
}

.number-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.number-btn.correct {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: var(--green);
  color: #155724;
}

.number-btn.wrong {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border-color: var(--pink);
  color: #721c24;
}

.vs {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
}

.number-compare {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 8px;
}

/* Emoji display for Count Objects */
.emoji-display {
  font-size: 2.5rem;
  letter-spacing: 4px;
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: var(--radius-md);
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

/* Math options styling */
.math-options {
  gap: 12px;
}

.math-options .game-option-btn {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  padding: 16px 24px;
}

.math-options.true-false .game-option-btn {
  font-size: 1.3rem;
  min-width: 140px;
}

/* Game card colors for math games */
.game-quickmath .game-bg-shape {
  background: linear-gradient(135deg, #FFD93D, #FFA62B);
}

.game-missing .game-bg-shape {
  background: linear-gradient(135deg, #A8E6CF, #7FD8BE);
}

.game-truefalse .game-bg-shape {
  background: linear-gradient(135deg, #FFB6B9, #FF8C94);
}

.game-bigger .game-bg-shape {
  background: linear-gradient(135deg, #B4E7CE, #8FD3F4);
}

.game-count .game-bg-shape {
  background: linear-gradient(135deg, #FFD3B6, #FFAAA5);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE GAMES
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Games Mobile */
  .game-modal {
    padding: 12px;
  }

  .game-modal-header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }

  .game-modal-title {
    font-size: 1.1rem;
  }

  .game-score {
    font-size: 1rem;
  }

  .game-question {
    padding: 20px 16px;
  }

  .question-word {
    font-size: 2rem;
  }

  .question-sentence {
    font-size: 1.1rem;
  }

  .game-option-btn {
    padding: 16px;
    font-size: 1rem;
  }

  .question-ayah-arabic {
    font-size: 1.5rem;
  }

  .all-games-grid {
    grid-template-columns: 1fr;
  }

  /* Math Games Mobile */
  .math-problem {
    font-size: 1.8rem;
  }

  .number-btn {
    font-size: 1.5rem;
    padding: 16px 28px;
  }

  .emoji-display {
    font-size: 1.8rem;
  }

  .math-options .game-option-btn {
    font-size: 1.2rem;
  }
}

/* Tablet responsive for games */
@media (max-width: 768px) {
  .game-question {
    padding: 24px 20px;
  }

  .question-word {
    font-size: 2.2rem;
  }

  .math-problem {
    font-size: 2rem;
  }
}
