/* The quizzes made with js/quiz-kit.js (2026-10-17 on): the classic look of the first three quizzes
   (addition, subtraction, number recognition), whose styles are inline in their own pages, plus
   picture questions, word and picture answers and the read-aloud button. Class names are the
   first quizzes', so css/purple-quiz.css dresses these pages too. */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: #f1f5f9; min-height: 100vh; }

/* ===== Site header (the router swaps in the shared one; these are its classic styles) ===== */
.site-header { background: white; border-bottom: 1px solid #e5e7eb; height: 64px; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.site-logo { display: flex; align-items: center; text-decoration: none; }
.site-logo-img { height: 44px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { font-size: 14px; font-weight: 600; color: #64748b; text-decoration: none; padding: 8px 14px; border-radius: 8px; transition: all 0.2s; }
.nav-links a:hover { background: #f1f5f9; color: #1a1a2e; }
.nav-links a.active { background: #fef3c7; color: #92400e; }
.hamburger-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger-btn span { display: block; width: 24px; height: 2.5px; background: #64748b; border-radius: 2px; transition: all 0.3s; margin: 5px 0; }
.hamburger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5.5px); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5.5px); }
@media (max-width: 768px) {
  .hamburger-btn { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: white; flex-direction: column; padding: 8px 16px 16px; border-bottom: 1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0,0,0,0.08); gap: 2px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; font-size: 16px; }
}

/* ===== Quiz layout ===== */
.quiz-wrapper { min-height: calc(100vh - 64px); background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%); display: flex; flex-direction: column; align-items: center; padding: 40px 20px 60px; }
.quiz-title-wrap { text-align: center; margin-bottom: 24px; }
.quiz-title { font-family: 'DM Sans', sans-serif; font-size: 32px; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.quiz-subtitle { font-size: 15px; color: #64748b; }

.range-pills { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; justify-content: center; }
.range-pill { padding: 8px 20px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; border: 2px solid #e2e8f0; border-radius: 100px; background: white; color: #64748b; cursor: pointer; transition: all 0.15s; }
.range-pill:hover { border-color: #f59e0b; color: #92400e; }
.range-pill.active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

/* ===== Card ===== */
.quiz-card { background: white; border-radius: 20px; border: 1px solid #e5e7eb; box-shadow: 0 4px 20px rgba(0,0,0,0.08); padding: 40px; width: 100%; max-width: 560px; }
.progress-wrap { margin-bottom: 28px; }
.progress-label { font-size: 12px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.progress-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #ea580c); border-radius: 3px; transition: width 0.4s ease; }

/* the question: a picture (optional), then the question line with its read-aloud button */
.question-display { text-align: center; margin-bottom: 26px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.q-pic { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; max-width: 100%; }
.q-pic svg { display: block; max-width: 100%; height: auto; }
.question-equation { font-family: 'DM Sans', sans-serif; font-size: 44px; font-weight: 700; color: #1e293b; line-height: 1.1; }
.q-line { display: flex; align-items: flex-start; justify-content: center; gap: 10px; }
.question-text { font-family: 'DM Sans', sans-serif; font-size: 22px; font-weight: 600; color: #475569; line-height: 1.35; }
.question-text.story { font-size: 20px; text-align: left; }
.say-btn { flex: none; width: 34px; height: 34px; margin-top: -2px; border-radius: 50%; border: 2px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s; }
.say-btn:hover { border-color: #f59e0b; color: #92400e; }
.say-btn svg { width: 17px; height: 17px; }
.say-btn.on { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

/* ===== Answers ===== */
.choices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.choices-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.choices-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.choices-grid.c1 { grid-template-columns: 1fr; }
.choice-btn { padding: 20px 12px; font-family: 'DM Sans', sans-serif; font-size: 30px; font-weight: 700; color: #1e293b; background: white; border: 2px solid #e2e8f0; border-radius: 14px; cursor: pointer; transition: all 0.15s; line-height: 1; }
.choice-btn:hover:not(:disabled) { border-color: #f59e0b; background: #fffbeb; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.2); }
.choice-btn.word { font-size: 20px; line-height: 1.25; padding: 16px 12px; }
.choice-btn.pic { padding: 10px; display: flex; align-items: center; justify-content: center; min-height: 100px; }
.choice-btn.pic svg, .choice-btn.pic img { display: block; max-width: 100%; height: auto; }
.choice-btn.correct { background: #dcfce7; border-color: #16a34a; color: #15803d; animation: correct-pulse 0.32s ease-out; }
.choice-btn.wrong   { background: #fee2e2; border-color: #dc2626; color: #b91c1c; animation: wrong-shake 0.4s ease-out; }
.choice-btn.dim     { opacity: 0.3; }
/* a picture answer keeps its picture's own colours when marked: the frame says right or wrong */
.choice-btn.pic.correct { background: #f0fdf4; box-shadow: 0 0 0 3px #16a34a inset; }
.choice-btn.pic.wrong { background: #fef2f2; box-shadow: 0 0 0 3px #dc2626 inset; }

.feedback { text-align: center; font-size: 16px; font-weight: 600; min-height: 24px; margin-bottom: 16px; line-height: 1.4; }
.feedback.correct-msg { color: #16a34a; }
.feedback.wrong-msg   { color: #dc2626; }
.next-btn { display: block; width: 100%; padding: 16px; font-family: 'DM Sans', sans-serif; font-size: 17px; font-weight: 700; color: white; background: linear-gradient(135deg, #f59e0b, #ea580c); border: none; border-radius: 14px; cursor: pointer; transition: opacity 0.15s, transform 0.15s; }
.next-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== Score ===== */
.score-screen { text-align: center; padding: 16px 0 8px; }
.score-emoji  { font-size: 64px; margin-bottom: 16px; line-height: 1; }
.score-number { font-family: 'DM Sans', sans-serif; font-size: 60px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; line-height: 1; }
.score-label  { font-size: 20px; color: #64748b; margin-bottom: 32px; }
.play-again-btn { padding: 16px 48px; font-family: 'DM Sans', sans-serif; font-size: 18px; font-weight: 700; color: white; background: linear-gradient(135deg, #f59e0b, #ea580c); border: none; border-radius: 14px; cursor: pointer; transition: opacity 0.15s, transform 0.15s; }
.play-again-btn:hover { opacity: 0.9; transform: translateY(-1px); }

@keyframes correct-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.09); box-shadow: 0 0 0 8px rgba(22,163,74,0.18); } 100% { transform: scale(1); } }
@keyframes wrong-shake { 0%,100% { transform: translateX(0); } 15% { transform: translateX(-7px); } 35% { transform: translateX(7px); } 55% { transform: translateX(-5px); } 75% { transform: translateX(5px); } 90% { transform: translateX(-2px); } }
@keyframes confetti-burst { 0% { transform: translate(0,0) rotate(0deg); opacity: 1; } 100% { transform: translate(var(--end-x), var(--end-y)) rotate(var(--rot)); opacity: 0; } }
@keyframes confetti-fall { 0% { transform: translate(0, 0) rotate(0deg); opacity: 1; } 90% { opacity: 0.9; } 100% { transform: translate(var(--drift), 110vh) rotate(var(--rot)); opacity: 0; } }
.confetti-piece { position: fixed; pointer-events: none; z-index: 9999; animation: confetti-burst 0.7s ease-out forwards; }
@media (prefers-reduced-motion: reduce) {
  .choice-btn.correct, .choice-btn.wrong { animation: none; }
  .confetti-piece { display: none; }
}

@media (max-width: 560px) {
  .quiz-wrapper { padding: 28px 16px 48px; }
  .quiz-card    { padding: 26px 18px; }
  .choice-btn   { font-size: 24px; padding: 16px 8px; }
  .choice-btn.word { font-size: 17px; padding: 14px 8px; }
  .choice-btn.pic { min-height: 80px; padding: 6px; }
  .choices-grid.c4 { grid-template-columns: 1fr 1fr; }
  .question-equation { font-size: 36px; }
  .question-text { font-size: 19px; }
  .question-text.story { font-size: 18px; }
  .quiz-title   { font-size: 26px; }
  .score-number { font-size: 48px; }
}
