/* ============================================================
   Grammar Practice — tool-specific styles
   ============================================================ */

.panel-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 0 0 0.8rem; }

/* ---- Topic selection ---- */
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.topic-card {
  font: inherit; cursor: pointer; text-align: left;
  border: 2px solid var(--line); background: #fff; border-radius: var(--r-md);
  padding: 0.8rem 0.85rem; display: flex; flex-direction: column; gap: 0.2rem;
  transition: all 0.15s ease;
}
.topic-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.topic-card[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(15,118,110,0.16); }
.topic-icon { font-size: 1.45rem; }
.topic-name { font-weight: 850; font-size: 0.92rem; }
.topic-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }

.difficulty-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.diff-btn {
  font: inherit; font-weight: 800; font-size: 0.88rem; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0.5rem 1.15rem; color: var(--muted); transition: all 0.15s ease;
}
.diff-btn:hover { border-color: var(--brand); }
.diff-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.diff-btn.mixed[aria-pressed="true"] { background: #b45309; border-color: #b45309; }

.start-btn { margin-top: 1.3rem; font-size: 1.02rem; padding: 0.8rem 2rem; }
.selection-note { margin: 0.7rem 0 0; font-size: 0.85rem; color: var(--muted); font-weight: 600; }

/* ---- Quiz screen ---- */
.quiz-panel { max-width: 680px; margin: 1rem auto 0; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.7rem; }
.quiz-topic { font-weight: 850; color: var(--brand-strong); text-transform: capitalize; }

.progress-row { display: flex; align-items: center; gap: 0.75rem; }
.progress-track { flex: 1; height: 10px; background: #eee9db; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #14b8a6); transition: width 0.3s ease; }
.progress-text { font-size: 0.82rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.quiz-question {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 750; line-height: 1.45;
  margin: 1.1rem 0; letter-spacing: -0.01em;
}

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.option-btn {
  font: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 0.65rem;
  border: 2px solid var(--line); background: #fff; border-radius: var(--r-md);
  padding: 0.7rem 0.8rem; font-size: 0.98rem; font-weight: 600; transition: all 0.13s ease;
}
.option-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-softer); }
.option-letter {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px;
  background: #f1efe4; color: var(--muted); display: grid; place-items: center;
  font-weight: 850; font-size: 0.85rem;
}
.option-btn.correct { border-color: var(--ok); background: var(--ok-bg); }
.option-btn.correct .option-letter { background: var(--ok); color: #fff; }
.option-btn.incorrect { border-color: var(--bad); background: var(--bad-bg); }
.option-btn.incorrect .option-letter { background: var(--bad); color: #fff; }
.option-btn:disabled { cursor: default; }

.feedback { margin: 0.9rem 0 0; }
.explanation-box {
  margin-top: 0.6rem; background: #eff6ff; border: 1.5px solid #bfdbfe; color: #1e40af;
  border-radius: var(--r-md); padding: 0.65rem 0.85rem; font-size: 0.92rem; line-height: 1.5;
}
.action-row { display: flex; gap: 0.7rem; margin-top: 1rem; flex-wrap: wrap; }
.action-row .btn { flex: 1; min-width: 160px; }

/* ---- Results ---- */
.results-panel { max-width: 520px; margin: 1rem auto 0; text-align: center; }
.results-stars { font-size: 2.6rem; letter-spacing: 0.35rem; }
.results-panel h2 { margin: 0.3rem 0 0.2rem; font-size: 1.55rem; letter-spacing: -0.02em; }
.results-score { font-size: 1.35rem; font-weight: 850; margin: 0.25rem 0; font-variant-numeric: tabular-nums; }
.results-note { color: var(--muted); margin: 0.2rem 0 1.2rem; }
.results-actions { justify-content: center; }

@media (max-width: 900px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .options-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .topic-desc { display: none; }
}
