/* Shared UI components: cards, buttons, chips, stars, progress bar, confetti,
   badges, level picker. Mirrors the style language of math-practice. */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.card:hover { transform: translateY(-3px); }
.card-icon svg { display: block; }
.card-title { font-size: 1.2rem; font-weight: 700; }
.card-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.4; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
/* The Calculator button: orange so it stands out beside the blue
   Start practice button. */
.btn-calc { background: #f97316; color: #ffffff; }
.btn-calc:hover:not(:disabled) { background: #ea580c; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }
/* The panel's hint path: amber for "Give me a Hint", red once it turns
   into "Show me the Answer". */
.btn-hint { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.btn-hint:hover:not(:disabled) { background: #fde68a; }
.btn-answer { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.btn-answer:hover:not(:disabled) { background: #fecaca; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-tutorial { background: #fef3c7; color: #92400e; }
.badge-practice { background: #e0e7ff; color: #3730a3; }

.level-picker { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0 1rem; }
.level-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.level-chip.selected { border-color: var(--primary); background: #eef2ff; }
.level-stars { color: var(--accent); font-size: 0.85rem; letter-spacing: 1px; }

.mode-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.mode-help { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.75rem; line-height: 1.45; }

.screen-title { font-size: 1.35rem; font-weight: 700; }
.screen-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 2px; }

.stars { display: inline-flex; gap: 2px; }
.stars .star { color: #cbd5e1; font-size: 2rem; line-height: 1; }
.stars .star.filled { color: var(--accent); }
.stars.small .star { font-size: 1.1rem; }

.progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s;
}

.confetti-piece {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 100;
  animation: confetti-fall 2.6s linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.6; }
}
