:root {
  --primary: #4A90D9;
  --primary-dark: #2E6BB5;
  --primary-light: #7FB3E8;
  --warm: #FF8C42;
  --warm-light: #FFB380;
  --success: #52B788;
  --success-light: #95D5B2;
  --gold: #FFD700;
  --bg: #FFF9F0;
  --bg-card: #FFFFFF;
  --text: #2D3142;
  --text-soft: #6B7280;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(45, 49, 66, 0.08);
  --shadow-md: 0 4px 12px rgba(45, 49, 66, 0.10);
  --shadow-lg: 0 12px 32px rgba(45, 49, 66, 0.14);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

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

html {
  direction: rtl;
  font-family: 'Assistant', -apple-system, sans-serif;
  font-size: 18px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); }

.btn-warm {
  background: var(--warm);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-warm:hover { background: #E67730; box-shadow: var(--shadow-lg); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary-light);
}
.btn-ghost:hover { background: var(--primary-light); color: white; }

input[type="text"], input[type="password"] {
  font-family: inherit;
  font-size: 1.1rem;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  width: 100%;
  transition: border 0.12s ease;
  text-align: right;
}
input:focus {
  outline: none;
  border-color: var(--primary);
}

/* === Login screen === */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.login-card {
  background: var(--bg-card);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
}

.login-emoji { font-size: 4rem; margin-bottom: 16px; }
.login-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.login-subtitle {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form button { margin-top: 12px; }
.login-error {
  color: #DC2626;
  font-size: 0.95rem;
  margin-top: 8px;
  min-height: 1.4em;
}

/* === Welcome screen === */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.welcome-card {
  background: var(--bg-card);
  padding: 48px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
}

.teacher-avatar-large {
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  background: white;
}
.teacher-avatar-large svg { width: 100%; height: 100%; }
.streak-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FF8C42, #FFD700);
  color: white;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: pulseGlow 2s ease infinite;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.welcome-text {
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 28px;
}
.welcome-text strong { color: var(--warm); }

/* === Header === */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: white;
}
.header-avatar svg { width: 100%; height: 100%; }
.header-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.header-subtitle { font-size: 0.85rem; color: var(--text-soft); }

.progress-bar {
  display: flex;
  gap: 3px;
  margin: 0 12px;
  flex: 1;
  max-width: 280px;
  height: 12px;
  align-items: center;
}
.progress-segment {
  flex: 1;
  height: 100%;
  border-radius: 4px;
  background: var(--border);
  transition: background 0.3s ease;
}
.progress-segment.complete { background: var(--success); }
.progress-segment.in-progress { background: var(--primary); }
.progress-segment.skipped { background: var(--gold); }

.progress-btn {
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  cursor: pointer;
}
.progress-btn:hover { background: var(--primary-light); color: white; }

/* === Topic menu === */
.topic-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 8px 0;
}

.topic-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.topic-card.locked { opacity: 0.55; cursor: not-allowed; }
.topic-card.locked:hover { transform: none; box-shadow: var(--shadow-sm); border-color: transparent; }
.topic-card.complete { border-color: var(--success); background: linear-gradient(180deg, #F0FDF4 0%, white 100%); }
.topic-card.in-progress { border-color: var(--primary); }

.topic-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.topic-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.topic-status {
  font-size: 0.85rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}
.topic-status.done { color: var(--success); font-weight: 600; }
.topic-status.current { color: var(--primary); font-weight: 600; }
.topic-section-title {
  grid-column: 1 / -1;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 16px 0 4px;
}
.topic-section-title:first-child { margin-top: 0; }

/* === Lesson card === */
.lesson-screen { display: flex; flex-direction: column; gap: 16px; }
.lesson-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.lesson-step-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 16px;
}
.lesson-explanation {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
}
.lesson-explanation strong { color: var(--warm); font-weight: 700; }
.lesson-visual {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius);
}
.worked-example {
  background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  border-right: 4px solid var(--warm);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-top: 16px;
}
.worked-example-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--warm);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.worked-example-question { font-weight: 700; margin-bottom: 12px; }
.worked-example-solution { display: flex; flex-direction: column; gap: 8px; line-height: 1.7; }
.worked-example-solution li { padding-right: 4px; }
.worked-example-highlight {
  margin-top: 12px;
  padding: 10px 14px;
  background: white;
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--primary-dark);
  font-weight: 600;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.step-dots { display: flex; gap: 6px; }
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.step-dot.active { background: var(--primary); }
.step-dot.done { background: var(--success); }

/* === Exercise card === */
.exercise-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.exercise-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--warm);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.exercise-question {
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 20px;
}
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.choice {
  padding: 14px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.05rem;
  text-align: right;
  transition: all 0.12s ease;
}
.choice:hover { border-color: var(--primary-light); background: white; }
.choice.selected { border-color: var(--primary); background: var(--primary-light); color: white; }
.choice.correct { border-color: var(--success); background: var(--success-light); }
.choice.wrong { border-color: #FCA5A5; background: #FEE2E2; }

.feedback {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  line-height: 1.6;
}
.feedback.correct { background: #D1FAE5; color: #065F46; border-right: 4px solid var(--success); }
.feedback.encourage { background: #FEF3C7; color: #92400E; border-right: 4px solid var(--warm); }

/* === Bot panel === */
.bot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 49, 66, 0.4);
  display: flex;
  justify-content: flex-start;
  z-index: 100;
  animation: fadeIn 0.18s ease;
}
.bot-panel {
  background: var(--bg-card);
  width: min(440px, 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideInLeft 0.24s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* Joyful animations for kids */
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 144, 217, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(74, 144, 217, 0); }
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes sparkle { 0% { transform: scale(0) rotate(0deg); opacity: 0; } 50% { transform: scale(1.2) rotate(180deg); opacity: 1; } 100% { transform: scale(0) rotate(360deg); opacity: 0; } }
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes slideInUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Apply animations to existing elements */
.welcome-card, .login-card { animation: scaleIn 0.4s ease; }
.topic-card { animation: slideInUp 0.4s ease backwards; }
.topic-card:nth-child(1) { animation-delay: 0.05s; }
.topic-card:nth-child(2) { animation-delay: 0.1s; }
.topic-card:nth-child(3) { animation-delay: 0.15s; }
.topic-card:nth-child(4) { animation-delay: 0.2s; }
.topic-card:nth-child(5) { animation-delay: 0.25s; }
.topic-card:nth-child(6) { animation-delay: 0.3s; }
.topic-card:nth-child(7) { animation-delay: 0.35s; }
.topic-card:nth-child(8) { animation-delay: 0.4s; }
.topic-card:nth-child(9) { animation-delay: 0.45s; }
.topic-card:nth-child(10) { animation-delay: 0.5s; }
.topic-card:nth-child(11) { animation-delay: 0.55s; }
.topic-card:hover { transform: translateY(-4px) rotate(-1deg); }

.lesson-card, .exercise-card { animation: slideInUp 0.35s ease; }
.subject-card { animation: pop 0.5s ease backwards; }
.subject-card:nth-child(1) { animation-delay: 0.1s; }
.subject-card:nth-child(2) { animation-delay: 0.2s; }
.subject-card:nth-child(3) { animation-delay: 0.3s; }

.teacher-avatar-large { animation: float 3s ease-in-out infinite; }
.header-avatar { animation: float 4s ease-in-out infinite; }
.btn-warm { animation: pulseGlow 2s ease-in-out infinite; }

.feedback.correct {
  animation: pop 0.5s ease;
}
.feedback.encourage { animation: slideInUp 0.3s ease; }

.choice { transition: all 0.18s ease; }
.choice:hover { transform: translateY(-2px) scale(1.01); }
.choice.correct { animation: pop 0.4s ease; }

.bot-msg { animation: slideInUp 0.25s ease; }

/* Confetti container */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  top: -20px;
  animation: confettiFall linear forwards;
}

/* Celebration overlay */
.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 144, 217, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
}
.celebration-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 420px;
  animation: pop 0.5s ease;
}
.celebration-emoji { font-size: 5rem; animation: bounce 1s ease infinite; margin-bottom: 12px; }
.celebration-title { font-size: 2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 12px; }
.celebration-text { font-size: 1.1rem; line-height: 1.6; color: var(--text); margin-bottom: 24px; }

/* Sparkles around correct answer */
.sparkle {
  position: absolute;
  font-size: 1.5rem;
  animation: sparkle 0.8s ease forwards;
  pointer-events: none;
}

/* Star burst */
.star-burst {
  display: inline-block;
  animation: pop 0.5s ease, wiggle 0.5s ease 0.5s;
}

.bot-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.bot-close {
  margin-right: auto;
  background: var(--bg);
  border: none;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}
.bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bot-msg {
  padding: 12px 16px;
  border-radius: var(--radius);
  max-width: 85%;
  line-height: 1.6;
}
.bot-msg.tamar { background: var(--primary-light); color: white; align-self: flex-start; border-top-right-radius: 4px; }
.bot-msg.student { background: var(--bg); align-self: flex-end; border-top-left-radius: 4px; }
.bot-msg.thinking { background: var(--bg); color: var(--text-soft); font-style: italic; align-self: flex-start; }

.bot-input-row {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.bot-input-row input { flex: 1; }
.bot-send {
  padding: 0 18px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-weight: 700;
}

.bot-mic {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.bot-mic:hover { background: var(--primary-light); color: white; }
.bot-mic.recording {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
  animation: pulseGlow 1.2s ease infinite;
}

/* === Loading === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 1.1rem;
  color: var(--text-soft);
}

/* === Subject menu === */
.subject-menu-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 4px;
}
.subject-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 12px;
}
.subject-h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.subject-h2 {
  font-size: 1.15rem;
  color: var(--text-soft);
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 4px;
}
.subject-card {
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.subject-card.inactive { opacity: 0.6; cursor: not-allowed; background: linear-gradient(135deg, #94A3B8, #64748B) !important; }
.subject-card.placeholder { background: linear-gradient(135deg, #F1F5F9, #E2E8F0) !important; color: var(--text-soft); cursor: default; }
.subject-card.placeholder:hover { transform: none; box-shadow: var(--shadow-md); }
.subject-emoji { font-size: 3.5rem; margin-bottom: 4px; }
.subject-title { font-size: 1.6rem; font-weight: 800; }
.subject-subtitle { font-size: 0.95rem; opacity: 0.9; }
.subject-status {
  margin-top: 10px;
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,255,255,0.25);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* === Mobile === */
@media (max-width: 600px) {
  html { font-size: 16px; }
  #app { padding: 12px; }
  .lesson-card, .exercise-card, .login-card, .welcome-card { padding: 20px; }
  .topic-menu { grid-template-columns: 1fr 1fr; gap: 12px; }
  .topic-card { padding: 14px; }
  .progress-bar { max-width: 140px; }
}

/* === User bar === */
.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 12px;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.user-name { font-weight: 700; color: var(--primary-dark); }
.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
}
.logout-btn:hover { background: var(--bg); border-color: var(--primary-light); color: var(--primary); }

/* === Quiz chip === */
.quiz-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--primary-light);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s ease, transform 0.12s ease;
  font-family: inherit;
  align-self: flex-start;
}
.quiz-chip:hover { background: var(--primary); transform: scale(1.04); }
.topic-card.locked .quiz-chip { display: none; }

/* === Topic Intro card === */
.topic-intro-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  animation: scaleIn 0.35s ease;
}
.topic-intro-icon { font-size: 3.5rem; }
.topic-intro-title { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }
.topic-intro-meta { font-size: 0.9rem; color: var(--text-soft); }
.topic-intro-stats { display: flex; gap: 24px; margin: 8px 0; }
.intro-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.intro-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.intro-stat-label { font-size: 0.78rem; color: var(--text-soft); }
.intro-quiz-result {
  font-size: 1.05rem;
  color: var(--text-soft);
  padding: 6px 14px;
  background: var(--bg);
  border-radius: var(--radius-pill);
}
.intro-memory-tip {
  font-size: 0.95rem;
  color: var(--primary-dark);
  background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  border-right: 4px solid var(--warm);
  padding: 12px 16px;
  border-radius: var(--radius);
  text-align: right;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}
.topic-intro-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* === Rewards screen === */
.rewards-screen { display: flex; flex-direction: column; padding: 8px 0; }
.rewards-header { text-align: center; margin-bottom: 24px; }
.rewards-title { font-size: 2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 6px; }
.rewards-subtitle { font-size: 1rem; color: var(--text-soft); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.badge-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease;
}
.badge-card:hover { transform: translateY(-3px); }
.badge-card.earned {
  border-color: var(--gold);
  background: linear-gradient(180deg, #FFFBEB 0%, white 100%);
  animation: pop 0.4s ease;
}
.badge-card.locked { opacity: 0.55; }
.badge-emoji { font-size: 2.4rem; }
.badge-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.badge-desc { font-size: 0.8rem; color: var(--text-soft); line-height: 1.4; }

.rewards-btn {
  margin-top: 14px;
  background: linear-gradient(135deg, var(--gold), var(--warm-light));
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rewards-btn:hover { box-shadow: var(--shadow-md); transform: scale(1.04); }

/* === Print (formula sheet) === */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
}
