/* ─────────────────────────────────────────────────────────────────
   Shrutam Quiz Game — Lokmat Editorial typography (variant A pick
   2026-06-03).

   Editorial split:
     Reading body (q-stem, lead, feedback)  → Tiro Devanagari Marathi serif
     UI chrome    (cards, buttons, hud)     → Mukta sans

   Scoped to .quiz-app so it does not bleed into nav/homepage.
   ───────────────────────────────────────────────────────────────── */

.quiz-app {
  --sh-body-stack: "Tiro Devanagari Marathi", "Tiro Telugu",
                   "Noto Serif Devanagari", Georgia, "Times New Roman", serif;
  --sh-heading-stack: "Mukta", "Baloo Tammudu 2", "Noto Sans Devanagari",
                     "Nunito", system-ui, sans-serif;
  --sh-body-color:    #E9ECF1;
  --sh-heading-color: #FFFFFF;
  --sh-card-bg:       #1a2433;
  --sh-card-top:      #1f2a3d;
  --sh-soft-border:   rgba(255,255,255,.06);

  max-width: 880px;
  margin: 1.5rem auto 4rem;
  padding: 0 1rem;
  color: var(--sh-body-color);
  font-family: var(--sh-heading-stack);     /* default UI sans */
  font-size: 1rem;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: quizZoomIn .35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes quizZoomIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-app { animation: none; }
}

/* ─── Quiz hero ────────────────────────────────────────────────── */
.quiz-hero {
  background: linear-gradient(160deg, #1a2433 60%, #1f2a3d 100%);
  border: 1px solid var(--sh-soft-border);
  border-radius: 22px;
  padding: 2rem 1.6rem;
  text-align: center;
}
.quiz-hero h1 {
  font-family: var(--sh-heading-stack);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  margin: 0 0 .6rem;
  font-weight: 700;
  color: var(--sh-heading-color);
  letter-spacing: 0;
  line-height: 1.25;
}
.quiz-hero p.lead {
  font-family: var(--sh-body-stack);       /* reading text in serif */
  color: var(--sh-body-color);
  font-size: 1.125rem;
  line-height: 1.7;
  margin: 0 auto 1.5rem;
  max-width: 640px;
}
.quiz-hero .chips {
  display: flex; gap: .55rem; flex-wrap: wrap;
  justify-content: center; margin-bottom: 1.5rem;
}
.quiz-hero .chip {
  background: rgba(255,255,255,.06);
  color: var(--sh-body-color);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-family: var(--sh-heading-stack);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: 0;
}

/* ─── Difficulty picker ──────────────────────────────────────── */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}
.diff-card {
  background: var(--sh-card-bg);
  border: 1px solid var(--sh-soft-border);
  border-radius: 18px;
  padding: 1.3rem 1rem;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
  text-align: center;
}
.diff-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.diff-card .emoji { font-size: 2.1rem; }
.diff-card h3 {
  font-family: var(--sh-heading-stack);
  margin: .5rem 0 .25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sh-heading-color);
  letter-spacing: 0;
}
.diff-card .meta {
  color: #cbd5e1;
  font-family: var(--sh-heading-stack);
  font-size: .9rem;
  line-height: 1.5;
}
.diff-card .start-btn {
  display: inline-block; margin-top: .7rem; padding: .45rem 1.1rem;
  background: var(--accent, #f59e0b); color: var(--accent-on, #0f172a);
  border-radius: 999px;
  font-family: var(--sh-heading-stack);
  font-weight: 700; font-size: .92rem;
}

/* ─── Game stage ─────────────────────────────────────────────── */
.game-stage { display: none; }
.game-stage.active { display: block; }

.game-hud {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; flex-wrap: wrap;
  background: var(--sh-card-bg);
  border: 1px solid var(--sh-soft-border);
  border-radius: 14px;
  padding: .7rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--sh-heading-stack);
  font-size: .95rem; font-weight: 600;
  letter-spacing: 0;
}
.hud-bit { display: inline-flex; align-items: center; gap: .35rem; }
.hud-bit b { color: var(--accent, #f59e0b); }
.timer-bar {
  height: 6px; background: rgba(255,255,255,.06);
  border-radius: 999px; margin-bottom: 1rem; overflow: hidden;
}
.timer-bar .fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #22c55e, #f59e0b 70%, #ef4444);
  transition: width .25s linear;
}

/* ─── Question card ──────────────────────────────────────────── */
.q-card {
  background: var(--sh-card-bg);
  border: 1px solid var(--sh-soft-border);
  border-radius: 18px;
  padding: 1.6rem 1.4rem;
}
.q-progress {
  font-family: var(--sh-heading-stack);
  font-size: .9rem;
  color: #cbd5e1;
  margin-bottom: .55rem;
  letter-spacing: 0;
}
.q-stem {
  font-family: var(--sh-body-stack);       /* question text in serif */
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.6;
  margin: 0 0 1.1rem;
  color: var(--sh-heading-color);
}

.q-options { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.q-opt {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--sh-soft-border);
  border-radius: 12px;
  padding: .85rem 1.1rem;
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .1s;
  font-family: var(--sh-body-stack);       /* answer options in serif */
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--sh-body-color);
}
.q-opt:hover { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: rgba(255,255,255,.05); }
.q-opt.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.q-opt.correct  { border-color: #22c55e; background: color-mix(in srgb, #22c55e 18%, transparent); }
.q-opt.wrong    { border-color: #ef4444; background: color-mix(in srgb, #ef4444 18%, transparent); }
.q-opt.disabled { cursor: default; }

.q-input {
  width: 100%; padding: .75rem 1.1rem; font-size: 1.05rem;
  border: 1px solid var(--sh-soft-border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: var(--sh-heading-color);
  font-family: var(--sh-body-stack);
}

.q-foot { margin-top: 1rem; display: flex; gap: .65rem; justify-content: flex-end; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 999px;
  padding: .65rem 1.3rem;
  font-family: var(--sh-heading-stack);
  font-weight: 700; font-size: .95rem;
  cursor: pointer; transition: transform .1s;
  letter-spacing: 0;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent, #f59e0b); color: var(--accent-on, #0f172a); }
.btn-ghost   { background: transparent; color: var(--sh-body-color); border: 1px solid rgba(255,255,255,.15); }
.btn-hint    { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--sh-heading-color); }

.feedback {
  margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 12px;
  font-family: var(--sh-body-stack);       /* feedback explanation in serif */
  font-size: 1.05rem; line-height: 1.65;
  color: var(--sh-body-color);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 4px solid var(--accent);
}
.feedback.right { background: color-mix(in srgb, #22c55e 12%, transparent); border-left-color: #22c55e; }
.feedback.wrong { background: color-mix(in srgb, #ef4444 12%, transparent); border-left-color: #ef4444; }
.feedback details { margin-top: .5rem; }
.feedback summary {
  cursor: pointer;
  font-family: var(--sh-heading-stack);
  color: #cbd5e1;
  font-size: .92rem;
}

/* ─── Result screen ─────────────────────────────────────────── */
.result-stage { display: none; text-align: center; }
.result-stage.active { display: block; }

.result-hero {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 30%, transparent),
    color-mix(in srgb, #22c55e 10%, transparent));
  border-radius: 24px;
  padding: 2.2rem 1.6rem;
}
.result-hero h2 {
  font-family: var(--sh-heading-stack);
  font-size: 1.7rem; margin: 0 0 .25rem;
  font-weight: 700; color: var(--sh-heading-color);
}
.result-hero .score {
  font-family: var(--sh-heading-stack);
  font-size: 3.2rem; font-weight: 800;
  color: var(--accent); margin: .5rem 0;
}
.result-hero .acc {
  font-family: var(--sh-heading-stack);
  color: #cbd5e1;
  font-size: 1.05rem;
}
.badges { display: flex; gap: .55rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.badge {
  background: var(--sh-card-bg);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: .35rem .9rem;
  font-family: var(--sh-heading-stack);
  font-size: .9rem; font-weight: 600;
}
.result-actions { display: flex; justify-content: center; gap: .65rem; flex-wrap: wrap; margin-top: 1.5rem; }


/* ─── SEO fallback list (hidden by default) ──────────────────── */
.seo-fallback h2 { margin-top: 2rem; }
.seo-fallback ol { padding-left: 1.5rem; }
.seo-fallback ol > li { margin-bottom: 1rem; }
.seo-fallback .seo-q-stem { font-weight: 600; }
.seo-fallback ul.opts { padding-left: 1.2rem; }
.seo-fallback li.correct { color: #15803d; font-weight: 600; }


/* ─── About / FAQ sections (always visible for SEO) ──────────── */
.quiz-meta {
  margin-top: 2.5rem; padding: 1.2rem 1.4rem;
  background: var(--sh-card-bg);
  border: 1px solid var(--sh-soft-border);
  border-radius: 16px;
}
.quiz-meta h2 {
  margin-top: 0; font-size: 1.25rem;
  font-family: var(--sh-heading-stack);
  color: var(--sh-heading-color);
  font-weight: 700; letter-spacing: 0;
}
.quiz-meta dl dt {
  font-family: var(--sh-heading-stack);
  font-weight: 700;
  color: var(--sh-heading-color);
  margin-top: .8rem;
}
.quiz-meta dl dd {
  margin: .25rem 0 0 0;
  color: var(--sh-body-color);
  font-family: var(--sh-body-stack);
  font-size: 1.05rem;
  line-height: 1.65;
}

.quiz-related ul {
  list-style: none; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .55rem;
}
.quiz-related a {
  display: block; padding: .75rem 1rem;
  background: var(--sh-card-bg);
  border: 1px solid var(--sh-soft-border);
  border-radius: 12px;
  color: var(--sh-body-color);
  text-decoration: none;
  font-family: var(--sh-heading-stack);
  font-size: .95rem; font-weight: 600;
  letter-spacing: 0;
}
.quiz-related a:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--sh-card-bg));
}


@media (max-width: 600px) {
  .quiz-hero { padding: 1.5rem 1.2rem; }
  .q-card { padding: 1.2rem 1.1rem; }
  .q-stem { font-size: 1.1rem; }
}
