/* =========================
   Base
========================= */

:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  padding: 16px;
  background: #fafafa;
  color: #111;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

/* =========================
   Layout blocks
========================= */

.card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 980px) {
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Typography
========================= */

h1 {
  font-size: 18px;
  margin: 0 0 8px;
}

h2 {
  font-size: 14px;
  margin: 0 0 8px;
}

h3 {
  font-size: 13px;
  margin: 0 0 8px;
}

.muted {
  color: #666;
  font-size: 12px;
}

/* =========================
   Buttons & Inputs
========================= */

button,
input,
textarea,
select {
  font: inherit;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

button {
  cursor: pointer;
}

button.primary {
  background: #111;
  color: #fff;
  border-color: #111;
}

button.ghost {
  background: #f3f3f3;
  border-color: #e0e0e0;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea {
  width: 100%;
  min-height: 140px;
}

/* =========================
   Pills & badges
========================= */

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 12px;
}

/* =========================
   Tabs
========================= */

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* =========================
   Visibility helpers
========================= */

.hidden {
  display: none;
}

/* =========================
   Question blocks
========================= */

.q {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  background: #fcfcfc;
}

.q + .q {
  margin-top: 10px;
}

.q .stem {
  font-weight: 600;
  margin-bottom: 8px;
}

.q .choices {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.q label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.q input[type="radio"] {
  margin-top: 3px;
}

/* =========================
   Timer
========================= */

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* =========================
   Tables (stats)
========================= */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

th {
  color: #444;
  font-weight: 700;
}

.right {
  text-align: right;
}

/* =========================
   Spelling trainer
========================= */

.bigword {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f3f3;
  display: inline-block;
  min-width: 180px;
  text-align: center;
}

.ok {
  color: #0a7a2f;
  font-weight: 700;
}

.bad {
  color: #b00020;
  font-weight: 700;
}