/*
  Vocab tool only. Everything shared with the other practice tools (tokens, page
  frame, setup panel, controls, feedback, results) lives in
  /tutoring/shared/practice.css, which must be loaded before this file.
*/

select {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

/* Two-level menu: subject, then word list within it. auto-fit means the subject
   menu takes the full width on its own when the word-list menu is hidden. */
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.picker-field > label { display: block; font-weight: 700; margin-bottom: 6px; }
.picker-field[hidden] { display: none; }

/* ---- set chips ---- */
.sets { display: flex; flex-wrap: wrap; gap: 8px; }
.set {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  user-select: none;
}
.set input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.set small { color: var(--ink-soft); }
.set.is-on { background: var(--tint); border-color: var(--accent); }

/* ---- learn ---- */
.card {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: 28px 24px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-align: center;
  position: relative;
  transition: background-color 120ms, border-color 120ms;
}
.card.is-flipped { background: var(--tint); border-color: var(--accent); }
.card-face { display: none; }
.card-word { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 700; line-height: 1.15; }
.card-def { font-size: 1.25rem; line-height: 1.45; max-width: 48ch; margin: 0 auto; }
.card:not(.is-flipped) .card-word { display: block; }
.card.is-flipped .card-def { display: block; }
.card-hint { position: absolute; left: 0; right: 0; bottom: 14px; color: var(--ink-soft); font-size: 0.85rem; }
@media (min-width: 480px) { .card { min-height: 300px; display: grid; place-items: center; } }

.nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.tools { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--ink-soft); font-size: 0.95rem; }
.set-tag { color: var(--ink-soft); }

/* ---- test ---- */
.progress { display: flex; justify-content: space-between; color: var(--ink-soft); margin-bottom: 14px; }
.prompt {
  border-left: 4px solid var(--accent);
  padding: 8px 0 8px 16px;
  margin-bottom: 20px;
}
.prompt-def { margin: 0; font-size: 1.3rem; line-height: 1.4; }

.choices { display: grid; gap: 10px; }
@media (min-width: 480px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice {
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
  font-size: 1.1rem;
}
.choice:not(:disabled):hover { border-color: var(--accent); }
.choice.is-correct { border-color: var(--good); background: var(--good-tint); }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-tint); }
.choice:disabled { opacity: 1; }

.type-form { display: flex; gap: 10px; }
.type-input {
  flex: 1;
  font: inherit;
  font-size: 1.15rem;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.type-input.is-correct { border-color: var(--good); background: var(--good-tint); }
.type-input.is-wrong { border-color: var(--bad); background: var(--bad-tint); }

/* ---- missed words ---- */
.missed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--tint);
}
.missed-row[hidden] { display: none; }
.missed-count { font-weight: 700; }
.missed-actions { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.missed-actions .btn { padding: 7px 14px; font-size: 0.95rem; background: var(--paper); }
.missed-actions .link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-size: 0.9rem; }
.missed-actions .link[hidden] { display: none; }

/* The set chips drive nothing while the missed list is the source. */
#sets-row.is-muted { opacity: 0.45; }
