
 /* ==============================
   GLOBAL VARIABLES
================================ */
:root {
  /* Colors */
  --primary: #10b981;
  --primary-dark: #059669;
  --text-dark: #0f172a;
  --white: #ffffff;
  --light-gray: #f9f9f9;
  --border-light: #f0f0f0;

  /* Rank colors */
  --rank-1: #fff7d6;
  --rank-2: #e6f4ff;
  --rank-3: #ecfdf3;

  /* Font sizes */
  --fs-lg: 24px;
  --fs-md: 17px;
  --fs-sm: 16px;

  /* Radius */
  --radius-lg: 12px;
  --radius-md: 8px;

  /* Shadow */
  --shadow-soft: 0 4px 10px rgba(0,0,0,0.08);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
}

/* ==============================
   LEADERBOARD LAYOUT
================================ */
#leaderboard {
  margin-top: 20px;
  text-align: center;
}

#leaderboard h3 {
  margin-bottom: 20px;
  font-size: var(--fs-lg);
}

/* ==============================
   TABLE
================================ */
.leaderboard-table {
  width: 90%;
  max-width: 650px;
  margin: 0 auto;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 10px;
  text-align: center;
  white-space: nowrap;
}

.leaderboard-table th {
  background: var(--primary);
  color: var(--white);
  font-size: var(--fs-md);
}

.leaderboard-table td {
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-table tr:nth-child(even) {
  background: var(--light-gray);
}

/* ==============================
   RANK HIGHLIGHTS
================================ */
.rank-1 td {
  background: var(--rank-1) !important;
  font-weight: bold;
}

.rank-2 td {
  background: var(--rank-2) !important;
  font-weight: bold;
}

.rank-3 td {
  background: var(--rank-3) !important;
  font-weight: bold;
}

/* ==============================
   QUIZ OPTIONS (ARABIC)
================================ */
#quizOptions button {
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  direction: rtl;
  unicode-bidi: isolate;

  color: var(--text-dark);
  background: var(--light-gray);
  border: 2.5px solid #004d40;
  border-radius: var(--radius-lg);
  padding: 16px 20px;

  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

/* ==============================
   CENTER CONTAINER
================================ */
.center-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  width: 100%;
}

/* ==============================
   LEADERBOARD BUTTON
================================ */
.leaderboard-btn {
  padding: 12px 26px;
  margin-bottom: 20px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-normal);
}

.leaderboard-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}


.level-btn {
  padding: 12px 20px;
  margin: 6px;
  font-size: 16px;
  border-radius: 10px;
  border: 2px solid #004d40;
  background: #f0f0f0;
  cursor: pointer;
  transition: 0.2s;
}

.level-btn:hover {
  background: #e0f2f1;
}

.level-btn.completed {
  background: #10b981;
  color: white;
  border-color: #059669;
}



.level-btn.locked {
  background: #e5e7eb;
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

.level-btn.completed {
  background: #10b981;
  color: white;
  border-color: #059669;
}


/* ---------- NOTIFICATION ---------- */
#notification {
  display: none;
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  font-size: 1rem;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

/* ---------- QUIZ AREA ---------- */
#quizArea {
  text-align: center;
  margin-top: 40px;
}

#quizArea h3 {
  margin-bottom: 10px;
}

/* ---------- RESET BUTTON ---------- */
#resetProgress {
  margin-top: 15px;
  padding: 10px 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* ---------- LEVEL BUTTONS ---------- */
#levels {
  margin-bottom: 20px;
}

.level-btn {
  margin: 5px;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.level-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.level-btn.completed {
  border: 2px solid #4caf50;
}

/* ---------- START BUTTON ---------- */
#quizStart {
  padding: 10px 20px;
  font-size: 1rem;
}

#audioControls {
  margin-top: 10px;
}

/* ---------- PROMPT ---------- */
#quizPrompt {
  font-size: 28px;
  margin: 12px 0;
  text-align: center;
}

/* ---------- PROGRESS BAR ---------- */
#progressContainer {
  margin-top: 20px;
  width: 80%;
  height: 20px;
  background: #ddd;
  border-radius: 10px;
  margin-left: auto;
  margin-right: auto;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: #4caf50;
  border-radius: 10px;
}

/* ---------- OPTIONS ---------- */
#quizOptions {
  margin-top: 20px;
}

/* ---------- SCORE ---------- */
#quizScore {
  margin-top: 20px;
  font-weight: bold;
}

/* ---------- LEADERBOARD ---------- */
.center-container {
  text-align: center;
  margin-top: 30px;
}

.leaderboard-btn {
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

#leaderboard {
  margin-top: 20px;
}

/* ---------- ACHIEVEMENTS ---------- */
#achievementsSection {
  margin-top: 40px;
  padding: 20px;
  background: #001f1a;
  border-radius: 16px;
}

#achievementsSection h2 {
  text-align: center;
  color: #f97316;
}

#badgesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

#noBadges {
  text-align: center;
  color: #666;
  font-style: italic;
}



 