/* ===========================
   VARIABLES (THEME CLAIR)
=========================== */
:root {
  --bg: #d6e6ff;
  --card-bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;

  --primary: #1e3a8a;
  --primary-dark: #162f6d;

  --accent: #EDB307;
  --accent-soft: #ffe680;

  --btn-text: #ffffff;

  --radius: 20px;
  --shadow: 0 10px 25px rgba(0,0,0,0.15);
  --transition: 0.25s ease;
}

/* ===========================
   THEME SOMBRE
=========================== */
body.dark {
  --bg: #0f172a;
  --card-bg: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;

  --primary: #60a5fa;
  --primary-dark: #1d4ed8;

  --btn-text: #111827;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===========================
   GLOBAL
=========================== */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 16px;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===========================
   HEADER
=========================== */
.header {
  padding: 10px;
}

.theme-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
}

.theme-label {
  font-size: 14px;
  color: var(--muted);
}

#themeSwitch {
  border: none;
  background: var(--card-bg);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}

/* ===========================
   LAYOUT GLOBAL
=========================== */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 16px;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  transition: background var(--transition), color var(--transition);
}

.screen {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}
/* ===========================
   CARDS
=========================== */
.card {
  background: var(--card-bg);
  width: 90%;
  max-width: 600px;
  padding: 25px;
  padding-bottom: 10px;
  border-radius: var(--radius);
  border: 5px solid var(--primary);
  box-shadow: var(--shadow);
  text-align: center;
  max-height: calc(100dvh - 120px);
  overflow-y: auto;

}

/* ===========================
   ACCUEIL / NIVEAU
=========================== */
.home-logo {
  width: 110px;
}

.home-title {
  font-size: 30px;
  color: var(--primary);
}

.home-subtitle {
  font-size: 17px;
  color: var(--muted);
}

.start-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}

.start-btn:hover {
  transform: scale(1.03);
}

/* ===========================
   NIVEAUX
=========================== */
.level-btn {
  padding: 15px;
  background: var(--accent);
  border-radius: var(--radius);
  margin: 10px 0;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  border: 3px solid var(--primary);
  transition: var(--transition);
}

.level-btn:hover {
  filter: brightness(1.05);
}

.level-btn.selected {
  background: var(--primary);
  color: white;
}

/* ===========================
   QUIZ
=========================== */
.hidden {
  display: none;
}

.score-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===========================
   RÉPONSES
=========================== */
.answer {
  padding: 12px;
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  font-weight: bold;
  background: var(--accent);
  cursor: pointer;
  color: #111827;
  transition: var(--transition);
}

.answer:hover {
  filter: brightness(1.1);
}

.answer.selected {
  background: var(--primary);
  color: white;
}

.answer.correct {
  background: #16a34a;
  color: white;
}
body.dark .answer.correct {
  background: #16a34a;
  color: white;
}
.answer.wrong {
  background: #990000;
  color: white;
}
body.dark .answer.wrong {
  background: #990000;
  color: white;
}
body.dark .answer {
  color: #111827;
  filter: brightness(1.15);
}

/* ===========================
   BOUTONS
=========================== */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.btn:hover {
  transform: scale(1.03);
}

#skip {
  background: #9ca3af;
  margin-top: 10px;
}


body.dark #skip {
  background: #6b7280;
}


.next {
  background: linear-gradient(135deg, #007bff, #00bfff);
}

body.dark .next {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}
.nav-arrows {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
  width: 100%;
}

.nav-arrows .quiz-logo {
  margin: 0 auto;
  flex: 0 0 auto;
  
}
.nav-arrows.hidden {
  display: none !important;
}

.arrow {
  font-size: 44px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  
  transition: var(--transition);
}
.arrow.hidden {visibility: hidden;}
.arrow:hover {  color:#EDB307;
  transform: scale(1.2);}

/* ===========================
   TEXTE QUIZ
=========================== */
#question-text {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
}

#feedback,
#definition {
  font-size: 18px;
}

/* ===========================
   TIMER
.timer {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}
=========================== */

/* ===========================
   RÉSULTATS
=========================== */
.result-stars {
  font-size: 32px;
  margin: 10px 0;
}

/*  Amélioration mode sombre */
body.dark .result-stars {
  color: var(--primary);
}
#definition {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.5;
}
#review-list {
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
}

.review-item {
  border-bottom: 1px solid #ddd;
  padding: 8px 0;
}

/*  Correction contraste mode sombre */
body.dark .review-item {
  border-bottom: 1px solid #444;
}

.review-item p {
  margin: 3px 0;
}

/* ===========================
   FOOTER
=========================== */
.footer {
  text-align: center;
  padding: 6px 0;        
  flex-shrink: 0;
}

.quiz-logo {
  width: 80px;
  margin-top: 10px;      
  pointer-events: none;
}

.footer-text {
  font-size: 16px;
  margin-bottom: 8px;
  color: #111827;
}

body.dark .footer-text {
  color: var(--text);
}

.footer-logo {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 900px) {
  .home-title { font-size: 26px; }
  #question-text { font-size: 20px; }
  .answers { grid-template-columns: 1fr; }
  .nav-arrows {padding: 0 5px;}
  .arrow {font-size: 36px;
    padding: 5px;}
}

@media (max-width: 600px) {
  .home-logo, .quiz-logo { width: 70px; }
  .home-title { font-size: 24px; }
  .home-subtitle { font-size: 15px; }
  #question-text { font-size: 18px; }
  .answer { font-size: 15px; padding: 10px; }
  .btn { font-size: 15px; padding: 12px; }
  .nav-arrows {padding: 0 5px;}
  .arrow {font-size: 36px;
    padding: 5px;}
}

@media (max-width: 380px) {
  .home-title { font-size: 20px; }
  #question-text { font-size: 16px; }
  .answer { font-size: 14px; padding: 8px; }
  .btn { font-size: 14px; padding: 10px; }
  .arrow {font-size: 32px;
    padding: 4px;}
}
