/* ═══════════════════════════════════════════════════════════════
   ESL LISTENING QUIZ — styles.css
   Colour palette matches wireframe: teal header, white card
   ═══════════════════════════════════════════════════════════════ */

:root {
  --teal:          #ff9248;
  --teal-dark:     #ff6700;
  --teal-light:    #ffd7b5;
  --green-correct: #4e9e8c;
  --red-wrong:     #d94f4f;
  --option-bg:     #f0f0f0;
  --option-hover:  #e2e2e2;
  --option-border: #d4d4d4;
  --text-dark:     #1e2a28;
  --text-mid:      #4a5a58;
  --text-light:    #ffffff;
  --card-bg:       #ffffff;
  --page-bg:       #fafafa;
  --shadow:        0 8px 40px rgba(0,0,0,0.13);
  --radius-card:   6px;
  --radius-btn:    6px;
  --font-body:     'DM Sans', sans-serif;
  --font-display:  calibri, serif;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after {  margin: 0; padding: 0;   }

/* ── PAGE ──────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background-color: var(--page-bg);

  padding: 24px 16px;
}
#head1{box-sizing: content-box !important;}
#peloadr{display:none;}
 
/* ── QUIZ BOX ──────────────────────────────────────────────── */
.page-wrapper {box-sizing: border-box;
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-box {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 900px;
  overflow: hidden;
 min-height:450px;
}

/* ── HEADER BAR ────────────────────────────────────────────── */
.quiz-header {
  background: var(--teal);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.quiz-progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
}

/* ── QUIZ BODY ─────────────────────────────────────────────── */
.quiz-body {
  padding: 36px 32px 32px;
}

/* ── QUESTION LAYOUT: side by side ────────────────────────── */
.question-layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

/* Fade-in animation */
.question-layout.fade-in {
  animation: fadeSlideIn 0.35s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── LEFT: IMAGE ───────────────────────────────────────────── */
.question-image-wrap {
  flex: 0 0 38%;
  max-width: 340px;
}

/* When no image is present, content takes full width */
.question-layout.no-image {
  display: block;
}

.question-layout.no-image .question-content {
  width: 100%;
}

.question-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  object-fit: cover;
}

/* ── RIGHT: CONTENT ────────────────────────────────────────── */
.question-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── AUDIO ROW ─────────────────────────────────────────────── */
.audio-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Play button — green circle matching wireframe */
.play-btn {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, opacity 0.15s;
  margin-top: 2px;
}

.play-btn svg {
  width: 60px;
  height: 60px;
  display: block;
}

.play-btn:hover {
  transform: scale(1.08);
  opacity: 0.88;
}

.play-btn:active { transform: scale(0.96); }

/* Pulse animation while playing */
.play-btn.playing svg circle {
  animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { stroke: #4e9e8c; }
  to   { stroke: #2d7a68; }
}

/* ── QUESTION TEXT ─────────────────────────────────────────── */
.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
  padding-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* ── OPTIONS ───────────────────────────────────────────────── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  background: var(--option-bg);
  border: 1.5px solid var(--option-border);
  border-radius: var(--radius-btn);
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.option-btn:hover:not(:disabled) {
  background: var(--option-hover);
  transform: translateX(3px);
}

.option-btn .opt-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-btn .opt-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* Correct answer (chosen correctly) */
.option-btn.correct {
  background: #eaf6f3;
  border-color: var(--green-correct);
  color: #2d6b5e;
  cursor: default;
}

/* Wrong answer (chosen incorrectly) */
.option-btn.wrong {
  background: #fdf0f0;
  border-color: var(--red-wrong);
  color: #8b2424;
  cursor: default;
}

/* Correct answer revealed after wrong choice */
.option-btn.reveal-correct {
  background: #eaf6f3;
  border-color: var(--green-correct);
  color: #2d6b5e;
  cursor: default;
}

/* Disable pointer on all buttons after answer */
.options-list.answered .option-btn {
  pointer-events: none;
}

/* ── NEXT ROW ──────────────────────────────────────────────── */
.next-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 60px;
  margin-top: 12px;
}

.next-row.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.btn-next {
  background: var(--teal);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-btn);
  padding: 11px 28px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-next:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.btn-next:active { transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   END / SCORE SCREEN
   ══════════════════════════════════════════════════════════════ */
.end-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px 12px;
  gap: 12px;
}

.score-icon {
  font-size: 3.5rem;
  line-height: 1;
}

.score-heading {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-dark);
}

.score-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.score-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--teal-light);
  border-radius: 12px;
  padding: 16px 40px;
}

.score-display #scoreNum {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

.score-sep {
  font-size: 2rem;
  color: var(--text-mid);
}

.score-display #scoreTotal {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--text-mid);
  line-height: 1;
}

.score-message {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-top: 4px;
}

.btn-restart {
  margin-top: 8px;
  background: var(--teal);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 32px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-restart:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — image stacks above on small screens
   ══════════════════════════════════════════════════════════════ */
 

@media (max-width: 640px) {

  .question-content {
    width: 100%;
  }

  .options-list {
    width: 100%;
  }

  .option-btn {
    width: 100%;
    box-sizing: border-box;
  }
  
  .quiz-body {
    padding: 24px 10px 36px;
  }

  .next-row {
    min-height: 64px;
    margin-top: 14px;
  }

  .question-layout {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }

  .question-image-wrap {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .question-text {
    font-size: 1.1rem;
  }

  .play-btn,
  .play-btn svg {
    width: 48px;
    height: 48px;
  }

  .score-display {
    padding: 14px 28px;
  }

  .score-display #scoreNum {
    font-size: 3rem;
  }
}

@media (max-width: 400px) {
  .quiz-header { padding: 12px 16px; }
  .quiz-title  { font-size: 0.95rem; }
}
