:root {
  --bg: #f9f9fc;
  --card-bg: #ffffff;
  --text: #2c2c2c;
  --accent: #3b6cb4;
  --good: #2e7d32;
  --hard: #ef6c00;
  --again: #c62828;
  --perfect: #2e7d32;
  --border: #e0e0e0;
  --shadow: 0 6px 18px rgba(0,0,0,0.06);
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1.2rem;
}

.app-shell {
  width: 100%;
  max-width: 680px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, opacity 0.2s;
  outline: none;
}

button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: default; }
button.secondary { background: #757575; }
button.danger { background: var(--again); }
button.small { padding: 0.3rem 0.9rem; font-size: 0.8rem; }

input, textarea {
  width: 100%;
  padding: 0.8rem;
  margin: 0.4rem 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fafafa;
}

.hidden { display: none !important; }

.tab-nav {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.6rem 1.4rem;
  background: #f0f0f0;
  color: #333;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  color: #555;
}

.card-face {
  background: #fdfdfd;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  position: relative;
}

.question-text {
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.answer-area { margin: 1rem 0; }

#user-answer {
      height: auto;
      min-height: 2.5rem;
}

.feedback-box {
  padding: 1rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-weight: 500;
}

.feedback-box.again {
  background: #ffebee;
  border-left: 4px solid var(--again);
}

.feedback-box.hard {
  background: #fff3e0;
  border-left: 4px solid var(--hard);
}

.feedback-box.good {
  background: #e8f5e9;
  border-left: 4px solid var(--good);
}

.feedback-box.perfect {
  background: #e8f5e9;
  border-left: 4px solid var(--perfect);
}

.extra-info {
  background: #f3f5fd;
  padding: 1rem;
  border-radius: 10px;
  margin: 1rem 0;
  line-height: 1.5;
}

.forbidden-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.forbidden-btn:hover { color: var(--again); }

.settings-block {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.settings-block h3 { margin-bottom: 0.8rem; }

.category-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-checks label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Grid de indicadores */
.card-grid {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.card-dot {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  cursor: default;
  transition: background 0.2s;
}

.dot-pending  { background: #9e9e9e; }
.dot-new      { background: #fdd835; color: #333; }
.dot-again    { background: #c62828; }
.dot-hard     { background: #ef6c00; }
.dot-good     { background: #2e7d32; }
.dot-perfect  { background: #1976d2; }
.dot-mastered { background: #7b1fa2; }
.dot-forbidden{ background: #e53935; }
