/* ===== RESET ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: #f5f6fa;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
  z-index: 10;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #4f46e5;
}
.header-title {
  font-weight: 600;
  font-size: 1.05rem;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 880px;
  margin: auto;
  padding: 16px;
}
.card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 10px 32px rgba(0,0,0,.06);
}
.muted { color: #6b7280; }

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #4f46e5;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-secondary {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

/* ===== TAGS ===== */
.section-tag, .part-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 600;
}
.section-tag {
  background: #e5e7eb;
  color: #374151;
}
.part-tag {
  background: #eef2ff;
  color: #4338ca;
  margin-left: 6px;
}

/* ===== PROGRESS ===== */
.progress {
  font-size: .85rem;
  color: #6b7280;
}
.progress-bar-wrap {
  height: 10px;
  background: #e5e7eb;
  border-radius: 10px;
  margin: 10px 0;
}
.progress-bar {
  height: 10px;
  background: #4f46e5;
  border-radius: 10px;
}

/* ===== ANSWERS ===== */
.answer-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  margin: 6px 0;
  border-radius: 14px;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
}
.answer-letter {
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
}
.answer-btn.selected {
  border-color: #4f46e5;
  background: #eef2ff;
}
.answer-btn.selected .answer-letter {
  background: #4f46e5;
  color: #fff;
}
.answer-correct {
  border: 2px dashed #16a34a;
  background: #ecfdf5;
}
.answer-wrong {
  border: 2px solid #dc2626;
  background: #fee2e2;
}

/* ===== REVIEW ===== */
.review-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  margin-bottom: 8px;
  cursor: pointer;
}
.review-card.good { background: #ecfdf5; }
.review-card.bad { background: #f9fafb; }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  max-width: 640px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ===== REVIEW LIST – AÉRATION & STYLE ===== */

.review-group {
    margin-bottom: 28px;
  }
  
  .review-group-header {
    margin-bottom: 12px;
  }
  
  .review-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* 👈 espace entre les lignes */
  }
  
  .review-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
  }
  
  .review-card.good {
    background: #ecfdf5;
    border-color: #bbf7d0;
  }
  
  .review-card.bad {
    background: #fff;
  }
  
  .review-card .q-badge {
    display: inline-block;
    margin-bottom: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
  }
  
  .review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,.08);
  }

  .debug-actions .btn-secondary {
    background: linear-gradient(180deg,#fff,#f9fafb);
  }
  
  .debug-actions .btn-secondary:hover {
    border-color:#4f46e5;
    color:#4f46e5;
  }
  
  .debug-actions .material-icons {
    font-size:18px;
  }

  /* ===== SCORE TOEIC (FULL CENTER) ===== */

.score-box {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  .score-icon {
    font-size: 56px;
    color: #4f46e5;
  }
  
  .score-value {
    font-size: 96px;          /* 👈 GROS SCORE */
    font-weight: 900;
    letter-spacing: -2px;
    margin: 12px 0;
    color: #111827;
  }
  
  .score-sub {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 20px;
  }

  /* ===== SCORE TOEIC (FULL CENTER) ===== */

.score-box {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  .score-icon {
    font-size: 56px;
    color: #4f46e5;
  }
  
  .score-value {
    font-size: 96px;          /* 👈 GROS SCORE */
    font-weight: 900;
    letter-spacing: -2px;
    margin: 12px 0;
    color: #111827;
  }
  
  .score-sub {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 20px;
  }


  /* =========================
   OVERLAY SYSTEM (MODERNE)
   ========================= */

.overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65); /* slate-900 */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn .25s ease;
  }
  
  @keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .overlay-card {
    background: linear-gradient(180deg, #ffffff, #f9fafb);
    border-radius: 24px;
    padding: 28px;
    width: 92%;
    max-width: 420px;
    box-shadow:
      0 30px 80px rgba(0,0,0,.35),
      inset 0 1px 0 rgba(255,255,255,.6);
    text-align: center;
    animation: overlayPop .25s ease;
  }
  
  @keyframes overlayPop {
    from { transform: scale(.95); opacity: .6; }
    to   { transform: scale(1);   opacity: 1; }
  }
  
  /* ===== SCORE TOEIC ===== */
  
  .score-value {
    font-size: 104px;
    font-weight: 900;
    letter-spacing: -3px;
    margin: 10px 0;
    color: #111827;
  }
  
  .score-sub {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 22px;
  }
  
  .score-icon {
    font-size: 56px;
    color: #4f46e5;
  }
  
  /* ===== INTERSTITIELLE ===== */
  
  .interstitial-box {
    color: #fff;
    background: linear-gradient(180deg, #0f172a, #020617);
  }
  
  .interstitial-box .material-icons {
    font-size: 44px;
    opacity: .9;
  }
  
  
  
  
/* =========================
   MOBILE FRIENDLY TYPO
   ========================= */

/* Taille de base un peu plus grande */
body {
    font-size: 16.5px;
  }
  
  /* Titres */
  h2 {
    font-size: 1.4rem;
  }
  h3 {
    font-size: 1.25rem;
  }
  
  /* Texte des questions */
  .card p {
    font-size: 1.05rem;
    line-height: 1.5;
  }
  
  /* Boutons de réponses */
  .answer-btn {
    font-size: 1.05rem;
    padding: 14px;
  }
  
  /* Lettre A / B / C / D */
  .answer-letter {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
  }
  
  /* Boutons principaux */
  .btn-primary {
    font-size: 1.05rem;
    padding: 16px;
  }
  
  /* Boutons secondaires */
  .btn-secondary {
    font-size: 0.95rem;
  }
  
  /* Tags section / part */
  .section-tag,
  .part-tag {
    font-size: 0.85rem;
  }
  
  /* Révision */
  .review-card {
    font-size: 1rem;
  }
  
  /* =========================
     OVERLAYS (SCORE + PUB)
     ========================= */
  
  .score-value {
    font-size: 110px; /* 👈 impact mobile */
  }
  
  .score-sub {
    font-size: 1.05rem;
  }
  
  /* Overlay card padding un peu plus respirant */
  .overlay-card {
    padding: 30px;
  }
  
  /* =========================
     MOBILE ONLY BOOST
     ========================= */
  @media (max-width: 480px) {
  
    .container {
      padding: 12px;
    }
  
    .card {
      padding: 16px;
    }
  
    .answer-btn {
      font-size: 1.1rem;
    }
  
    .btn-primary {
      font-size: 1.1rem;
    }
  
    .score-value {
      font-size: 120px;
    }
  }


  /* =========================
   INTERSTITIELLE FULLSCREEN
   ========================= */

.interstitial-full {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #020617, #0f172a);
    color: #fff;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
  }
  
  .interstitial-full .material-icons {
    font-size: 52px;
    margin-bottom: 14px;
    opacity: 0.9;
  }
  
  .interstitial-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .interstitial-sub {
    font-size: 1rem;
    color: #c7d2fe;
    margin-bottom: 28px;
  }
  
  /* ===== PROGRESS BAR ===== */
  
  .interstitial-progress {
    width: 100%;
    max-width: 320px;
    height: 10px;
    background: rgba(255,255,255,.15);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 28px;
  }
  
  .interstitial-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #3b82f6);
    border-radius: 999px;
    transition: width 5s linear;
  }
  
  /* Bouton désactivé tant que pas fini */
  .interstitial-full .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }


  /* ===== NEXT BUTTON DISABLED STATE ===== */

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  background: #a5b4fc; /* violet atténué */
}

/* Optionnel : petit effet quand activé */
.btn-primary:not(:disabled) {
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary:not(:disabled):active {
  transform: scale(0.98);
}

.q-image {
    display: block;
    max-width: 100%;
    max-height: 30vh;        /* 👈 clé : limite verticale */
    margin: 12px auto;
    object-fit: contain;    /* garde le ratio */
    border-radius: 12px;
    background: #f3f3f3;
  }
  .btn-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  
    width: 100%;
    margin: 12px 0;
  
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
  
    font-size: 15px;
    font-weight: 600;
  
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
  
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.35);
    cursor: pointer;
  
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  
  .btn-audio:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(30, 136, 229, 0.45);
  }
  
  .btn-audio:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(30, 136, 229, 0.3);
  }
  
  .btn-audio .material-icons {
    font-size: 20px;
  }
  

  .btn-audio.playing {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    box-shadow: 0 0 0 6px rgba(67, 160, 71, 0.15);
  }


  
  .answers-audio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
  }
  
  .answers-audio-grid .answer-btn {
    justify-content: center;
    padding: 14px 10px;
    font-size: 15px;
  }
  .answers-audio{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
  }
  .answers-text{
    display: flex;
    flex-direction: column;
}


/* =========================
   IMAGE + AUDIO FAB
   ========================= */

   .image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
  }
  
  .q-image {
    width: 100%;
    max-height: 50vh;
    object-fit: cover;
    border-radius: 12px;
  }
  
  /* FAB bouton audio */
  .audio-fab {
    position: absolute;
    bottom: 12px;
    right: 12px;
  
    width: 56px;
    height: 56px;
    border-radius: 50%;
  
    border: none;
    background: #2563eb; /* bleu visible */
    color: white;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
    cursor: pointer;
  
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  
  .audio-fab .material-icons {
    font-size: 28px;
  }
  
  .audio-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.55);
  }
  
  .audio-fab:active {
    transform: scale(0.95);
  }
  
  
  
  
  

  
  