/* Common Ratios and Percentages — drill page.
   Layered on modernist.css tokens + learn.css's hero/wrap layout. */

/* ── intro ──────────────────────────────────────────────────────────────── */
.ratio-last {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.ratio-last p { margin: var(--space-1) 0 0; font-size: 13px; }

#screen-intro .btn { margin-top: var(--space-4); }

/* ── drill ──────────────────────────────────────────────────────────────── */
.ratio-drill { padding-block: clamp(20px, 4vw, 40px); }

.ratio-drill-header {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.ratio-timer {
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-heading-weight);
  font-size: 18px;
}
.ratio-stats {
  margin-left: auto;
  font-size: 13px;
  opacity: 0.7;
}

.ratio-card {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-6);
  gap: var(--space-4);
}

.ratio-prompt {
  font-size: 17px;
  line-height: 1.5;
  text-align: center;
}
.ratio-prompt .katex-display { margin: var(--space-2) 0; }

.ratio-answer-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.ratio-answer-row .input {
  flex: 1;
  font-size: 18px;
  text-align: center;
  min-height: 44px;
}
.ratio-unit {
  font-size: 15px;
  font-weight: var(--font-heading-weight);
  opacity: 0.7;
  white-space: nowrap;
}

/* Fraction-answer question ("what fraction is 25%?"): a stacked "1" / bar /
   input, like a real fraction, instead of the input filling the row. Default
   (non-fraction) state keeps the group acting exactly like a bare input --
   .is-fraction is the only state that narrows and centers it. */
.ratio-fraction-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ratio-fraction-group.is-fraction {
  flex: none;
  width: 64px;
}
.ratio-fraction-num {
  text-align: center;
  font-size: 20px;
  font-weight: var(--font-heading-weight);
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 3px solid var(--color-text);
}

.ratio-feedback {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-neutral-200);
}
.ratio-feedback::before {
  margin-right: 6px;
  font-weight: 800;
}
.ratio-feedback.is-correct { background: #eef7f0; color: #1a6b3c; }
.ratio-feedback.is-correct::before { content: "\2713"; }
.ratio-feedback.is-close { background: #fff6dd; color: #7a5b00; }
.ratio-feedback.is-close::before { content: "\2717"; }
.ratio-feedback.is-off { background: #fbebea; color: #a52a1a; }
.ratio-feedback.is-off::before { content: "\2717"; }
.ratio-feedback.is-blank { background: var(--color-neutral-200); color: var(--color-text); font-weight: 400; }

/* ── results ────────────────────────────────────────────────────────────── */
.ratio-results { padding-block: clamp(20px, 4vw, 40px); max-width: 480px; margin-inline: auto; }

.ratio-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.ratio-stat {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.ratio-stat-value {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 22px;
}

.ratio-results-actions {
  display: flex;
  gap: var(--space-2);
}
.ratio-results-actions .btn { flex: 1; justify-content: center; }

@media (max-width: 420px) {
  .ratio-card { padding: var(--space-4); }
  .ratio-results-grid { grid-template-columns: 1fr; }
}
