* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
}

button {
  font: inherit;
}

.topbar {
  max-width: 900px;
  margin: auto;
  padding: 28px 24px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 25px;
  font-weight: 800;
}

.subtitle {
  color: #748096;
  margin-top: 3px;
}

.xp {
  background: white;
  padding: 11px 17px;
  border-radius: 18px;
  font-weight: 800;
  box-shadow: 0 5px 20px rgba(0,0,0,.06);
}

main {
  max-width: 900px;
  margin: auto;
  padding: 20px 24px 60px;
}

.welcome {
  background: linear-gradient(135deg,#e8f1ff,#f2ebff);
  padding: 30px;
  border-radius: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.eyebrow {
  color: #5369d7;
  font-weight: 800;
}

h1 {
  margin: 7px 0;
  font-size: 36px;
}

.welcome p {
  margin: 0;
  color: #596579;
  line-height: 1.5;
}

.audio-main {
  border: 0;
  background: #5268e8;
  color: white;
  padding: 15px 21px;
  border-radius: 18px;
  font-weight: 800;
  cursor: pointer;
}

.progress-card {
  margin: 22px 0 32px;
  padding: 20px;
  background: white;
  border-radius: 22px;
}

.progress-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-bar {
  height: 12px;
  background: #e8ebf2;
  border-radius: 20px;
  overflow: hidden;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: #5268e8;
  transition: width .4s;
}

h2 {
  font-size: 22px;
}

.lessons {
  display: grid;
  gap: 14px;
}

.lesson-card {
  width: 100%;
  border: 0;
  background: white;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 18px;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(40,50,80,.05);
  transition: transform .2s;
}

.lesson-card:hover {
  transform: translateY(-2px);
}

.lesson-number {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: #e9edff;
  color: #5268e8;
  font-size: 20px;
  font-weight: 900;
}

.lesson-content {
  flex: 1;
}

.lesson-content strong {
  display: block;
  font-size: 18px;
}

.lesson-content small {
  display: block;
  margin-top: 5px;
  color: #748096;
  font-size: 15px;
}

.arrow {
  font-size: 32px;
  color: #a2a9b7;
}


/* LEÇONS */

.lesson-screen {
  position: fixed;
  inset: 0;
  background: #f5f7fb;
  overflow-y: auto;
  padding: 25px;
  z-index: 10;
}

.lesson-screen > * {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.back {
  border: 0;
  background: white;
  padding: 12px 17px;
  border-radius: 15px;
  cursor: pointer;
  margin-bottom: 25px;
}

.lesson-title {
  font-size: 34px;
}

.big-hangul {
  font-size: 64px;
  font-weight: 800;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
  gap: 14px;
  margin: 25px 0;
}

.sound-card {
  border: 0;
  background: white;
  border-radius: 24px;
  padding: 24px 10px;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(40,50,80,.06);
  transition: transform .2s;
}

.sound-card:hover {
  transform: translateY(-2px);
}

.sound-card .hangul {
  display: block;
  font-size: 48px;
  font-weight: 800;
}

.sound-card .pronunciation {
  display: block;
  color: #748096;
  margin: 6px 0 12px;
}

.listen {
  color: #5268e8;
  font-weight: 800;
}


/* EXERCICES */

.quiz {
  background: white;
  padding: 25px;
  border-radius: 25px;
  margin-top: 25px;
}

.quiz h3 {
  margin-top: 0;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer {
  border: 2px solid #e7eaf1;
  background: white;
  padding: 16px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 18px;
  transition: .2s;
}

.answer:hover {
  border-color: #5268e8;
}

.answer.correct {
  border-color: #35a768;
  background: #eaf9f0;
}

.answer.wrong {
  border-color: #dc5960;
  background: #fff0f1;
}


/* BOUTON SUIVANT */

.next-button {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 30px auto 60px;
  padding: 18px 24px;
  border: 0;
  border-radius: 20px;
  background: #5268e8;
  color: white;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(82,104,232,.25);
  animation: appear .35s ease;
}

.next-button:hover {
  transform: translateY(-2px);
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* MESSAGE */

.feedback {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 24px;
  border-radius: 18px;
  background: #172033;
  color: white;
  font-weight: 800;
  z-index: 100;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}


/* MOBILE */

@media (max-width: 600px) {

  .welcome {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 29px;
  }

  .audio-main {
    width: 100%;
  }

  .sound-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .lesson-screen {
    padding: 18px;
  }

  .feedback {
    width: calc(100% - 30px);
    text-align: center;
    white-space: normal;
  }
}

.word-meaning {
  display: block;
  margin: 0 0 12px;
  color: #172033;
  font-size: 15px;
  font-weight: 700;
}

.sound-example {
  display: block;
  margin: 4px 0;
  font-size: 25px;
  font-weight: 800;
  color: #172033;
}


/* ============================================================
   BOUTON RESET
   ============================================================ */

.reset-button {
  display: block;
  margin: 32px auto 10px;
  padding: 13px 20px;

  border: 1px solid #d7dce5;
  border-radius: 14px;

  background: white;
  color: #687386;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
}

.reset-button:hover {
  background: #f5f7fa;
  color: #172033;
}


/* ============================================================
   🎓 INTERROGATION
   ============================================================ */

.exam-card {
  border: 2px solid #172033;
}

.exam-card strong {
  font-size: 18px;
}

.exam-score {
  font-weight: 800;
}

.exam-progress {
  margin-bottom: 18px;
  font-weight: 800;
  opacity: 0.65;
}

.exam-question {
  text-align: center;
}

.exam-question h3 {
  font-size: 22px;
}

.exam-question .answer {
  font-size: 30px;
}

.exam-result {
  text-align: center;
}

.exam-result h2 {
  font-size: 42px;
  margin: 10px 0;
}

.exam-medal {
  font-size: 46px;
}

.exam-errors {
  margin: 20px 0;
  text-align: left;
}

.exam-error {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 10px 0;

  border-bottom:
    1px solid #e4e7ec;
}

.exam-error .listen-button {
  flex-shrink: 0;
}

.exam-perfect {
  font-size: 20px;
  font-weight: 800;
}
