:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --text: #eef0f3;
  --muted: #9aa1ac;
  --accent: #5b8cff;
  --good: #3ecf8e;
  --bad: #ff6b6b;
  --border: #2a2e37;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 1.1rem; margin: 0; }
.stats { font-size: 0.85rem; color: var(--muted); }

#app { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }

.screen.hidden { display: none; }

.home-card, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
}

.due-count { font-size: 1.05rem; text-align: center; margin-bottom: 20px; }

.primary-btn, .secondary-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.primary-btn { background: var(--accent); color: white; }
.secondary-btn { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.primary-btn:active, .secondary-btn:active { opacity: 0.8; }

.word-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.word-header h2 { margin: 0; font-size: 1.6rem; text-transform: capitalize; }
.pos { color: var(--muted); font-style: italic; font-size: 0.9rem; }

.definition { font-size: 1.05rem; margin: 4px 0 18px; }

.block { margin-bottom: 16px; }
.block h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 4px; }
.block p { margin: 0; line-height: 1.45; }

.progress-bar { height: 4px; background: var(--border); border-radius: 4px; margin-bottom: 16px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.2s; }

.prompt { font-size: 1.05rem; line-height: 1.5; margin-bottom: 18px; }

.answer-area.hidden { display: none; }

.mcq-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #12141a;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}
.mcq-option:active { background: #22262f; }
.mcq-option.correct { border-color: var(--good); background: rgba(62,207,142,0.15); }
.mcq-option.incorrect { border-color: var(--bad); background: rgba(255,107,107,0.15); }

#fillInput, #freeInput {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #12141a;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 10px;
  font-family: inherit;
}

.grading-note { color: var(--muted); font-size: 0.8rem; margin-top: 6px; }

.feedback { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.feedback.hidden { display: none; }
#feedbackText { font-size: 1rem; margin-bottom: 10px; }
#feedbackText.correct { color: var(--good); }
#feedbackText.incorrect { color: var(--bad); }

.browse-card { max-height: 80vh; overflow-y: auto; }
.browse-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.box-tag {
  font-size: 0.75rem;
  color: var(--muted);
}
