:root {
  --bg-primary: #0a0118;
  --bg-secondary: #120828;
  --bg-card: rgba(20, 10, 35, 0.95);
  --purple-primary: #8b5cf6;
  --purple-secondary: #a78bfa;
  --purple-dark: #6d28d9;
  --gold-primary: #fbbf24;
  --gold-secondary: #f59e0b;
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --success: #10b981;
  --error: #ef4444;
  --border-glow: rgba(139, 92, 246, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding: 2rem;
}

/* Étoiles animées */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stars, .stars2, .stars3 {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 60px 70px, rgba(139, 92, 246, 0.6), transparent),
    radial-gradient(1px 1px at 50px 50px, rgba(251, 191, 36, 0.4), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 90px 10px, rgba(167, 139, 250, 0.5), transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: twinkle 15s ease-in-out infinite;
}

.stars2 {
  background-size: 250px 250px;
  animation: twinkle 20s ease-in-out infinite reverse;
  opacity: 0.7;
}

.stars3 {
  background-size: 300px 300px;
  animation: twinkle 25s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(-20px); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
/* lien vers la page des prophètes*/
.center-container {
  display: flex;
  justify-content: center; /* centre horizontalement */
  align-items: center;     /* centre verticalement */
 padding-bottom: 10px;          /* prend toute la hauteur de la fenêtre */
}

.link-btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: linear-gradient(135deg, #07035c, #170163);
  color: rgb(176, 175, 243);
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  text-align: center;
}

.link-btn:hover {
  background: linear-gradient(135deg, #4338ca, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}
/*navbuton Full screen*/

.nav-button {
  position: fixed;
  bottom: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(109, 40, 217, 0.9));
  border: 2px solid rgba(251, 191, 36, 0.6);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4),
              0 0 40px rgba(139, 92, 246, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.nav-button-left {
  left: 2rem;
}

.nav-button-right {
  right: 2rem;
}

.nav-button:hover {
  transform: scale(1.1) translateY(-4px);
  background: linear-gradient(135deg, rgba(139, 92, 246, 1), rgba(109, 40, 217, 1));
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6),
              0 0 60px rgba(251, 191, 36, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.nav-button:active {
  transform: scale(0.95) translateY(-2px);
}

.nav-button svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}
/* Écrans */
.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Menu Principal */
h1 {
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--purple-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
}

.subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.menu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.menu-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(29, 16, 51, 0.8) 100%);
  border: 1.5px solid var(--border-glow);
  border-radius: 20px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 4px 16px rgba(139, 92, 246, 0.2);
  position: relative;
  overflow: hidden;
}

.menu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
  transition: left 0.5s;
}

.menu-card:hover::before {
  left: 100%;
}

.menu-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--purple-primary);
  box-shadow: 0 12px 48px rgba(139, 92, 246, 0.4),
              0 8px 24px rgba(251, 191, 36, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.4));
}

.menu-card h3 {
  font-size: 1.5rem;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.menu-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

/* Boutons */
.back-btn, .btn-primary, .btn-secondary {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

.back-btn {
  background: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
  border: 1.5px solid var(--border-glow);
  display: block;
  margin: 0 auto;
}

.back-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: translateX(-5px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1.5px solid var(--border-glow);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* En-tête du jeu */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-btn-small {
  padding: 0.75rem 1.5rem;
  background: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
  border: 1.5px solid var(--border-glow);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn-small:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: translateX(-5px);
}

.game-info {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.score-display, .question-counter, .timer {
  background: var(--bg-card);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-glow);
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timer {
  color: var(--gold-primary);
}

.timer.warning {
  animation: pulse 1s infinite;
  color: var(--error);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Barre de progression */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-primary), var(--gold-primary));
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

/* Conteneur de questions */
.question-container {
  background: var(--bg-card);
  border: 1.5px solid var(--border-glow);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  min-height: 400px;
}

.question-title {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-text {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.6;
}

.question-arabic {
  font-family: 'Amiri', serif;
  font-size: 2.2rem;
  color: var(--gold-primary);
  margin-bottom: 1rem;
  text-align: center;
  direction: rtl;
  line-height: 2;
}

/* Options de réponse */
.options {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.option {
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  padding: 1.25rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.option:hover:not(.disabled) {
  background: rgba(139, 92, 246, 0.2);
  transform: translateX(5px);
  border-color: var(--purple-primary);
}

.option.correct {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  animation: correctPulse 0.5s ease;
}

.option.incorrect {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--error);
  animation: shake 0.5s ease;
}

.option.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Input pour réponse libre */
.answer-input {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.2rem;
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.answer-input:focus {
  outline: none;
  border-color: var(--purple-primary);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.submit-btn {
  width: 100%;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Matching game */
.matching-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.matching-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.match-item {
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  padding: 1.25rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.match-item:hover {
  background: rgba(139, 92, 246, 0.2);
  transform: scale(1.05);
}

.match-item.selected {
  border-color: var(--gold-primary);
  background: rgba(251, 191, 36, 0.2);
}

.match-item.matched {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.2);
  cursor: not-allowed;
}

/* Écran de résultats */
.result-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem;
}

.result-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: bounceIn 0.8s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

#resultTitle {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--purple-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.final-score {
  background: var(--bg-card);
  border: 2px solid var(--border-glow);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.score-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.score-value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.score-max {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: rgba(139, 92, 246, 0.1);
  border: 1.5px solid var(--border-glow);
  border-radius: 12px;
  padding: 1.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.result-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .menu-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .menu-card {
    padding: 1.5rem;
  }

  .game-header {
    flex-direction: column;
    align-items: stretch;
  }

  .game-info {
    justify-content: space-between;
    gap: 0.5rem;
  }

  .score-display, .question-counter, .timer {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }

  .question-container {
    padding: 1.5rem;
  }

  .question-text {
    font-size: 1.3rem;
  }

  .question-arabic {
    font-size: 1.8rem;
  }

  .matching-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .result-content {
    padding: 1.5rem;
  }

  .score-value {
    font-size: 3rem;
  }

  .result-buttons {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
  }
}
