:root {
  --bg: #f6f5f2;
  --card-bg: #ffffff;
  --ink: #232323;
  --muted: #6b6b6b;
  --accent: #2b4c7e;
  --accent-dark: #1e3860;
  --green: #2e7d32;
  --green-bg: #e8f5e9;
  --red: #c62828;
  --red-bg: #fdecea;
  --amber: #8a6100;
  --amber-bg: #fff4e0;
  --border: #e0ddd5;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.app-header {
  text-align: center;
  padding: 28px 16px 12px;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--accent-dark);
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 60px;
}

.screen.hidden {
  display: none;
}

/* ---------- Home screen ---------- */
.stats-bar {
  text-align: center;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.list-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.list-card-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #eceae4;
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.list-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.list-card-footer span {
  font-size: 0.8rem;
  color: var(--muted);
}

.reset-row {
  text-align: center;
  margin-top: 28px;
}

.version-text {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 6px;
}

.help-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 18px 0 4px;
}

/* ---------- Buttons ---------- */
.primary-btn, .secondary-btn, .link-btn {
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.primary-btn:disabled {
  background: #b7b7b7;
  cursor: not-allowed;
}

.secondary-btn {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 9px 18px;
}

.secondary-btn:hover {
  background: rgba(43, 76, 126, 0.08);
}

.link-btn {
  background: none;
  color: var(--accent);
  padding: 4px 6px;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--accent-dark);
}

/* ---------- Practice screen ---------- */
.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

#practice-list-title {
  font-weight: 600;
  color: var(--accent-dark);
}

.session-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.session-progress-bar {
  flex: 1;
  height: 8px;
  background: #eceae4;
  border-radius: 6px;
  overflow: hidden;
}

#session-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.25s ease;
}

#session-progress-text {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.accent-help {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.accent-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}

.accent-help summary::-webkit-details-marker {
  display: none;
}

.accent-help summary::before {
  content: "▸ ";
}

.accent-help[open] summary::before {
  content: "▾ ";
}

.accent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.accent-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1.1rem;
  font-family: ui-monospace, Consolas, monospace;
  white-space: nowrap;
}

.accent-help-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.prompt-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.prompt-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.prompt-text {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 18px;
}

#answer-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

#answer-input:disabled {
  background: #f0efe9;
}

.feedback {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  max-height: 260px;
  overflow-y: auto;
}

.feedback.hidden {
  display: none;
}

.feedback-entry {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.feedback-entry:last-child {
  border-bottom: none;
}

.feedback-entry.correct {
  background: var(--green-bg);
  color: var(--green);
}

.feedback-entry.incorrect {
  background: var(--red-bg);
  color: var(--red);
}

.feedback-entry.hint {
  background: var(--amber-bg);
  color: var(--amber);
}

.feedback-entry .guess-line {
  font-style: italic;
  opacity: 0.85;
  margin-bottom: 4px;
}

.feedback .answer-line {
  font-weight: 600;
  margin-top: 4px;
}

.feedback .note-line {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.feedback .tip-line {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
  font-style: italic;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Complete screen ---------- */
.complete-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
}

.complete-card h2 {
  margin-top: 0;
  color: var(--accent-dark);
}

.complete-card p {
  color: var(--muted);
  margin-bottom: 24px;
}
