@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── CSS Custom Properties ──────────────────────────── */
:root {
  --bg: linear-gradient(135deg, #ffd4c8 0%, #ffc7b3 22%, #cec3ee 62%, #bfe8d2 100%);
  --surface: #ffffff;
  --surface-2: #fdf9f7;
  --surface-3: #fff5f1;
  --text: #2d1b14;
  --muted: #6b5a4a;
  --primary: #ff6a7a;
  --primary-hover: #ff5870;
  --primary-glow: rgba(255,71,87,0.4);
  --purple: #a855f7;
  --purple-glow: rgba(168,85,247,0.4);
  --green: #10b981;
  --green-glow: rgba(16,185,129,0.4);
  --amber: #f59e0b;
  --amber-glow: rgba(245,158,11,0.4);
  --red: #ef4444;
  --blue: #3b82f6;
  --pink: #ec4899;
  --pink-glow: rgba(236,72,153,0.4);
  --hero-gradient: linear-gradient(130deg, #ffa897 0%, #ff86ad 48%, #b09cf4 100%);
  --hero-shadow: rgba(255,127,110,0.24);
  --xp-bar-gradient: linear-gradient(90deg, #ffd87c, #ff9eb8);
  --yellow: #eab308;
  --yellow-glow: rgba(234,179,8,0.4);
  --border: #f3e7df;
  --shadow: 0 10px 30px rgba(242, 121, 147, 0.14);
  --shadow-lg: 0 16px 44px rgba(242, 121, 147, 0.2);
  --shadow-purple: 0 6px 24px rgba(168,85,247,0.15);
  --shadow-green: 0 6px 24px rgba(16,185,129,0.15);
  --shadow-amber: 0 6px 24px rgba(245,158,11,0.15);
  --radius: 28px;
  --radius-sm: 16px;
  --radius-pill: 999px;
  font-family: 'Nunito', 'Avenir Next', 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', 'Avenir Next', 'Segoe UI', Helvetica, Arial, sans-serif;
  background: linear-gradient(155deg, #fffaf6 0%, #fff1e9 55%, #f2faf5 100%);
  min-height: 100dvh;
  color: var(--text);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,127,110,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(155,142,196,0.03) 0%, transparent 50%),
    radial-gradient(circle at 60% 10%, rgba(126,200,164,0.02) 0%, transparent 50%);
  animation: background-float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
@keyframes background-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    filter: hue-rotate(0deg);
  }
  25% {
    transform: translateY(-5px) rotate(0.5deg);
    filter: hue-rotate(5deg);
  }
  50% {
    transform: translateY(-10px) rotate(0deg);
    filter: hue-rotate(10deg);
  }
  75% {
    transform: translateY(-5px) rotate(-0.5deg);
    filter: hue-rotate(5deg);
  }
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── App Header ──────────────────────────────────────── */
.app-header {
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(218, 146, 121, 0.14);
  padding: 2px 20px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header .header-logo-img { width: 140px; height: auto; object-fit: contain; flex-shrink: 0; }
.app-header .header-actions { position: absolute; right: 12px; display: flex; align-items: center; gap: 8px; }

/* ── Container ───────────────────────────────────────── */
.container { max-width: 540px; margin: 0 auto; padding: 0 20px; }
/* Use longhand so .container's left/right padding isn't clobbered */
.page-content { padding-top: 20px; padding-bottom: 100px; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.95);
  backdrop-filter: blur(4px);
}
.card-sm { padding: 14px 16px; border-radius: var(--radius-sm); }
.card-title { font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-weight: 800; font-size: 0.95rem;
  padding: 0 20px; height: 52px; border-radius: var(--radius-pill);
  border: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s, filter 0.15s;
  letter-spacing: 0.01em; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #ff8d9b);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 122, 145, 0.38);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #ff8196);
  box-shadow: 0 10px 24px rgba(255, 122, 145, 0.44);
  transform: translateY(-1px);
  filter: saturate(1.06);
}
.btn-full { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary { background: var(--surface2, #334155); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,0.3); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(126,200,164,0.35); }
.btn-success:hover { background: #5eb48a; }
.btn-purple { background: var(--purple); color: #fff; box-shadow: 0 4px 14px rgba(155,142,196,0.35); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 0.85rem; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--radius-sm); font-size: 1.1rem; }

/* ── Form Elements ───────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 700; font-size: 0.88rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; height: 52px; padding: 0 16px;
  font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none; -webkit-appearance: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,127,110,0.18); background: #fff;
}
.form-group input::placeholder { color: #c4c8d4; font-weight: 600; }
.form-group textarea { height: auto; min-height: 80px; padding: 12px 16px; resize: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Tab Navigation ──────────────────────────────────── */
.tab-nav {
  display: flex; background: var(--surface-2); border-radius: var(--radius-pill);
  padding: 4px; gap: 2px; margin-bottom: 20px;
  border: 1px solid #f5e6de;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: fit-content; height: 42px; padding: 0 12px;
  font-family: inherit; font-size: 0.82rem; font-weight: 800; color: var(--muted);
  background: transparent; border: none; border-radius: var(--radius-pill);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  position: relative; -webkit-tap-highlight-color: transparent;
}
.tab-btn.active { background: linear-gradient(135deg, var(--primary), #ff8d9b); color: #fff; box-shadow: 0 6px 14px rgba(255,122,145,0.32); }
.tab-btn .tab-badge {
  position: absolute; top: 4px; right: 4px; width: 16px; height: 16px;
  background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 900;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ── Child-side Tab Navigation ───────────────────────── */
.child-tabs {
  display: flex; background: var(--surface-2); border-radius: var(--radius-pill);
  padding: 4px; gap: 2px; margin-bottom: 20px;
  border: 1px solid #f5e6de;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.child-tabs::-webkit-scrollbar { display: none; }
.child-tab-btn {
  flex: 1; min-width: fit-content; height: 42px; padding: 0 12px;
  font-family: inherit; font-size: 0.82rem; font-weight: 800; color: var(--muted);
  background: transparent; border: none; border-radius: var(--radius-pill);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  position: relative; -webkit-tap-highlight-color: transparent;
}
.child-tab-btn.active {
  background: linear-gradient(135deg, var(--primary), #ff8d9b); color: #fff; box-shadow: 0 6px 14px rgba(255,122,145,0.32);
  animation: tab-active-pulse 2s ease-in-out infinite;
}
@keyframes tab-active-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(255,127,110,0.35); }
  50% { box-shadow: 0 2px 12px rgba(255,127,110,0.5); }
}
.child-tab-btn:hover:not(.active) {
  background: var(--surface-3); color: var(--primary);
}
.child-tab-btn .tab-count {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 900;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.child-tab-btn .tab-icon { font-size: 1.1rem; }

/* ── Child Hero ──────────────────────────────────────── */
.child-hero {
  background: var(--hero-gradient, linear-gradient(135deg, #ff9a8b 0%, #ff7f6e 40%, #9b8ec4 100%));
  border-radius: var(--radius); padding: 24px 20px; color: #fff; margin-bottom: 20px;
  position: relative; overflow: hidden; box-shadow: 0 12px 34px var(--hero-shadow, rgba(255,127,110,0.3));
  border: 1px solid rgba(255,255,255,0.28);
}
.child-hero::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px; background: rgba(255,255,255,0.1); border-radius: 50%;
}
.child-hero::after {
  content: ''; position: absolute; bottom: -20px; left: 30%;
  width: 80px; height: 80px; background: rgba(255,255,255,0.07); border-radius: 50%;
}
.child-hero-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; position: relative; z-index: 1; }
.child-avatar {
  width: 64px; height: 64px; background: rgba(255,255,255,0.2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; flex-shrink: 0; border: 3px solid rgba(255,255,255,0.4);
  animation: float 4s ease-in-out infinite;
}
.child-hero-info { flex: 1; }
.child-hero-greeting { font-size: 0.9rem; font-weight: 700; opacity: 0.85; margin-bottom: 2px; }
.child-hero-name { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; line-height: 1.1; }
.level-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.35);
  color: #fff; font-size: 0.78rem; font-weight: 800; padding: 4px 10px;
  border-radius: var(--radius-pill); backdrop-filter: blur(4px);
}

/* ── XP Bar ──────────────────────────────────────────── */
.xp-bar-container {
  background: rgba(255,255,255,0.18); border-radius: var(--radius-pill);
  height: 10px; overflow: hidden; margin-bottom: 12px; position: relative; z-index: 1;
}
.xp-bar-fill {
  height: 100%; background: var(--xp-bar-gradient, linear-gradient(90deg, #f5d27a, #ff9a8b));
  border-radius: var(--radius-pill); width: var(--xp-pct, 0%);
  animation: xp-fill 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.xp-label { font-size: 0.75rem; font-weight: 700; opacity: 0.85; margin-bottom: 6px; position: relative; z-index: 1; }

/* ── Stats Row ───────────────────────────────────────── */
.stats-row { display: flex; gap: 10px; position: relative; z-index: 1; }
.stat { flex: 1; background: rgba(255,255,255,0.18); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; backdrop-filter: blur(4px); }
.stat-value { font-size: 1.2rem; font-weight: 900; line-height: 1; margin-bottom: 2px; }
.stat-label { font-size: 0.7rem; font-weight: 700; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Progress Section ────────────────────────────────── */
.progress-section {
  background: var(--surface); border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.progress-text { flex: 1; }
.progress-title { font-size: 0.85rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.progress-count { font-size: 1.1rem; font-weight: 900; color: var(--text); }
.progress-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 120px; }
.progress-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); transition: all 0.3s; }
.progress-dot.done { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); animation: pop 0.35s ease; }

/* ── Chore Cards ─────────────────────────────────────── */
.chores-section { margin-bottom: 80px; }
.chores-section-title { font-size: 0.82rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; padding: 0 4px; }
.chore-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px; border: 2px solid transparent;
  transition: all 0.25s; animation: slide-up 0.3s ease both; position: relative; overflow: hidden;
}
.chore-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.chore-card-inner { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.chore-emoji-circle {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; flex-shrink: 0; transition: all 0.25s;
}
.chore-info { flex: 1; min-width: 0; }
.chore-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 4px; word-break: break-word; }
.chore-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chore-reward { font-size: 0.82rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.chore-reward-money { color: var(--amber); }
.chore-reward-xp { color: var(--purple); }

/* Status variants */
.status-todo { border-color: rgba(59,130,246,0.3); }
.status-todo .chore-emoji-circle { background: #eff6ff; }
.status-pending { border-color: var(--amber); background: linear-gradient(135deg, #fff 0%, #fffbf0 100%); }
.status-pending .chore-emoji-circle { background: #fffbeb; }
.status-pending::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(245,158,11,0.08) 50%, transparent 100%);
  background-size: 200% 100%; animation: shimmer 2s ease-in-out infinite;
  pointer-events: none; border-radius: inherit;
}
.status-approved { border-color: var(--green); background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%); }
.status-approved .chore-emoji-circle { background: #dcfce7; }
.status-rejected { border-color: var(--red); background: linear-gradient(135deg, #fff 0%, #fff5f5 100%); }
.status-rejected .chore-emoji-circle { background: #fee2e2; }

/* Done button */
.done-btn {
  width: 100%; height: 56px; background: linear-gradient(135deg, var(--primary), #ff8d9b); color: #fff;
  font-family: inherit; font-size: 1rem; font-weight: 900; border: none;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.02em; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 16px rgba(255,122,145,0.35); animation: glow-pulse 2s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.done-btn:hover { background: linear-gradient(135deg, var(--primary-hover), #ff8196); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(255,122,145,0.4); }
.done-btn:active { transform: scale(0.97); }

.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; font-weight: 800; padding: 6px 12px;
  border-radius: var(--radius-pill); width: 100%; justify-content: center;
}
.status-chip-pending { background: #fffbeb; color: var(--amber); border: 1.5px solid rgba(245,158,11,0.3); }
.status-chip-approved { background: #dcfce7; color: var(--green); border: 1.5px solid rgba(16,185,129,0.3); }
.status-chip-rejected { background: #fee2e2; color: var(--red); border: 1.5px solid rgba(239,68,68,0.3); }

/* ── Focus Mode FAB ──────────────────────────────────── */
.focus-mode-fab {
  position: fixed; bottom: 24px; right: 20px;
  width: 58px; height: 58px; background: var(--purple); color: #fff;
  border: none; border-radius: 50%; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(139,92,246,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 90; animation: float 3s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.focus-mode-fab:hover { transform: scale(1.1); }
.focus-mode-fab:active { transform: scale(0.95); }
.focus-mode-fab.active { background: var(--primary); animation: glow-pulse 1.5s ease-in-out infinite; }

/* Focus mode styles */
.focus-mode .chore-card { display: none; }
.focus-mode .chore-card.focus-visible { display: block; }
.show-all-btn {
  width: 100%; margin: 12px 0; height: 46px; background: var(--surface);
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.88rem; font-weight: 800; color: var(--muted);
  cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.show-all-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Celebration ─────────────────────────────────────── */
.celebration-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 500; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.celebration-overlay.active { opacity: 1; pointer-events: all; }
.celebration-card {
  background: var(--surface); border-radius: 32px; padding: 40px 32px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: celebration-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-width: 320px; width: 90%;
}
.celebration-emoji { font-size: 5rem; display: block; margin-bottom: 12px; animation: bounce-in 0.5s ease both 0.1s; }
.celebration-title {
  font-size: 1.8rem; font-weight: 900; margin-bottom: 8px;
  background: linear-gradient(135deg, #ff7f6e, #9b8ec4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.celebration-subtitle { font-size: 1rem; font-weight: 700; color: var(--muted); }

/* ── Confetti ────────────────────────────────────────── */
#confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -20px; width: 10px; height: 10px; border-radius: 2px;
  animation: confetti-fall linear forwards;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.confetti-piece.confetti-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: confetti-fall-spin linear forwards;
}
.confetti-piece.confetti-heart {
  clip-path: path('M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z');
  background: none !important;
  color: var(--primary);
}
.confetti-piece.confetti-triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.confetti-piece.confetti-diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.confetti-piece.confetti-coin {
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  box-shadow: 0 0 8px rgba(255,215,0,0.6);
  animation: confetti-fall-bounce linear forwards;
}
.confetti-piece.confetti-spark {
  background: linear-gradient(45deg, var(--primary), var(--pink));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: confetti-fall-spark linear forwards;
}
.confetti-piece.confetti-gem {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: confetti-fall-gem linear forwards;
}

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 300; min-width: 240px; max-width: calc(100vw - 40px);
  padding: 14px 20px; background: var(--text); color: #fff;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem;
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slide-down-in 0.3s ease both; pointer-events: none;
}
.toast.hidden { display: none; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--purple); }

/* ── Notice ──────────────────────────────────────────── */
.notice {
  display: flex; align-items: center; gap: 10px;
  background: #eff6ff; border: 1.5px solid rgba(59,130,246,0.25); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.88rem; font-weight: 700; color: var(--blue);
  margin-bottom: 14px; animation: slide-up 0.3s ease both;
}
.notice-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Push Prompt ─────────────────────────────────────── */
.push-prompt {
  background: linear-gradient(135deg, #f3e8ff, #e0e7ff); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
  animation: slide-up 0.3s ease both; border: 1.5px solid rgba(139,92,246,0.2);
}
/* When outside a container (login/setup) keep it from bleeding to edges */
#app > .push-prompt { margin-left: 20px; margin-right: 20px; }
.push-prompt-text { flex: 1; font-size: 0.85rem; font-weight: 700; color: #4c1d95; }
.push-prompt-actions { display: flex; gap: 6px; }

/* ── Setup / Login ───────────────────────────────────── */
.setup-screen {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 20px 80px;
}
.setup-hero { text-align: center; margin-bottom: 20px; }
.setup-hero .big-emoji { font-size: 4rem; display: block; margin-bottom: 8px; animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.setup-hero h2 { font-size: 1.8rem; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.setup-hero p { font-size: 1rem; color: var(--muted); font-weight: 600; }
.setup-card { width: 100%; max-width: 400px; }

.login-options { display: grid; gap: 12px; margin-bottom: 24px; }
.login-option-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px; cursor: pointer; transition: all 0.2s; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.login-option-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,127,110,0.18); }
.login-option-emoji { font-size: 2.5rem; margin-bottom: 8px; }
.login-option-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.login-option-subtitle { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-top: 2px; }

.child-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 16px; }
.child-select-btn {
  background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 8px; cursor: pointer; text-align: center; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.child-select-btn:hover, .child-select-btn.selected { border-color: var(--primary); background: #fff8f5; }
.child-select-btn .child-sel-emoji { font-size: 2rem; margin-bottom: 4px; }
.child-select-btn .child-sel-name { font-size: 0.8rem; font-weight: 800; color: var(--text); }

/* PIN input */
.pin-display { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--border); transition: all 0.2s; }
.pin-dot.filled { background: var(--primary); box-shadow: 0 0 8px rgba(255,127,110,0.4); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 240px; margin: 14px auto 0; }
.pin-key {
  height: 60px; font-size: 1.3rem; font-weight: 800; background: var(--surface-2);
  border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.12s; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; font-family: inherit; color: var(--text);
}
.pin-key:hover { background: var(--surface); border-color: var(--primary); }
.pin-key:active { transform: scale(0.94); background: #fff8f5; }
.pin-key.pin-clear { font-size: 1rem; color: var(--red); }
.pin-error { color: var(--red); font-weight: 700; font-size: 0.88rem; text-align: center; margin-top: 8px; animation: shake 0.4s ease; }

/* ── Parent Dashboard ────────────────────────────────── */
.parent-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 4px; margin-bottom: 16px; }
.parent-header h2 { font-size: 1.2rem; font-weight: 900; color: var(--text); }

/* Approval cards */
.approval-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--amber);
  animation: slide-up 0.3s ease both;
}
.approval-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.approval-emoji { width: 44px; height: 44px; background: #fffbeb; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.approval-info { flex: 1; }
.approval-chore-name { font-size: 1rem; font-weight: 800; color: var(--text); }
.approval-child-name { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.approval-reward { font-size: 0.82rem; font-weight: 700; color: var(--amber); }
.approval-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Activity feed */
.activity-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.activity-item:last-child { border-bottom: none; }
.activity-item .activity-icon { font-size: 1.1rem; }

/* ── Chore Budget Overview ───────────────────────────── */
.budget-card { margin-bottom: 16px; }
.budget-table { display: flex; flex-direction: column; gap: 0; }
.budget-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  gap: 8px;
}
.budget-row:last-child { border-bottom: none; }
.budget-label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.budget-avatar { font-size: 1.1rem; flex-shrink: 0; }
.budget-name { font-size: 0.9rem; font-weight: 800; color: var(--text); white-space: nowrap; }
.budget-count { font-size: 0.72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.budget-amounts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.budget-assigned-val { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.budget-total-val { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.budget-row-shared .budget-name { color: var(--primary); }
.budget-row-shared .budget-total-val { color: var(--primary); font-weight: 800; }
.budget-row-bonus .budget-name { color: var(--amber); }
.budget-row-bonus .budget-total-val { color: var(--amber); font-weight: 800; }
.budget-row-total { padding-top: 12px; margin-top: 4px; border-top: 2px solid var(--border) !important; border-bottom: none; }
.budget-row-total .budget-name { font-size: 0.88rem; font-weight: 900; color: var(--text); }
.budget-grand-total { font-size: 1.15rem; font-weight: 900; color: var(--primary); }
.chore-wk-val { color: var(--primary); font-weight: 800; }

/* ── Chore Group Headers ──────────────────────────────── */
.chore-group-header {
  font-size: 0.82rem; font-weight: 900; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 14px 4px 6px; display: flex; align-items: center; gap: 8px;
}
.chore-group-meta { font-weight: 700; color: var(--primary); text-transform: none; letter-spacing: 0; font-size: 0.8rem; margin-left: auto; }

/* Chore list item */
.chore-list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 8px;
  border: 1.5px solid var(--border);
}
.chore-list-emoji { width: 44px; height: 44px; background: var(--surface); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.chore-list-info { flex: 1; }
.chore-list-title { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.chore-list-meta { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.chore-list-actions { display: flex; gap: 6px; }

/* Children cards */
.child-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.child-card-avatar { width: 56px; height: 56px; background: linear-gradient(135deg, #f3e8ff, #e0e7ff); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; }
.child-card-info { flex: 1; }
.child-card-name { font-size: 1rem; font-weight: 800; color: var(--text); }
.child-card-stats { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.child-stat-pill { font-size: 0.75rem; font-weight: 800; padding: 3px 8px; border-radius: var(--radius-pill); }
.pill-money { background: #fffbeb; color: var(--amber); }
.pill-xp { background: #f3e8ff; color: var(--purple); }
.pill-streak { background: #fff7ed; color: var(--primary); }
.child-card-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* ── Day Picker ──────────────────────────────────────── */
.day-picker { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.day-pill {
  height: 38px; padding: 0 10px; font-family: inherit; font-size: 0.78rem; font-weight: 800;
  color: var(--muted); background: var(--surface-2); border: 2px solid var(--border);
  border-radius: var(--radius-pill); cursor: pointer; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.day-pill:hover { border-color: var(--primary); color: var(--primary); }
.day-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(255,127,110,0.35); }

/* ── Emoji Picker ────────────────────────────────────── */
.emoji-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-top: 8px; }
.emoji-btn {
  width: 44px; height: 44px; font-size: 1.5rem; background: var(--surface-2);
  border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.emoji-btn:hover { background: #fff; border-color: var(--primary); transform: scale(1.1); }
.emoji-btn.selected { background: #fff8f5; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,127,110,0.18); transform: scale(1.08); }

/* ── Settings ────────────────────────────────────────── */
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-weight: 700; font-size: 0.95rem; }
.settings-row-desc { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.toggle { width: 52px; height: 28px; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; border: none; -webkit-tap-highlight-color: transparent; }
.toggle.on { background: var(--green); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.toggle.on::after { transform: translateX(24px); }

/* ── Bonus Toggle Row ───────────────────────────────── */
.bonus-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 14px;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius-sm);
}
.bonus-toggle-label { font-weight: 800; font-size: 0.95rem; color: var(--text); }
.bonus-toggle-desc { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-top: 2px; }

/* ── Empty States ────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state-emoji { font-size: 3rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.empty-state-text { font-size: 0.88rem; font-weight: 600; }

/* Section heading */
.section-heading { font-size: 0.82rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 20px 0 10px; display: flex; align-items: center; gap: 6px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* All done card */
.all-done-card { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border: 2px solid rgba(16,185,129,0.3); border-radius: var(--radius); padding: 28px; text-align: center; animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.all-done-emoji { font-size: 3.5rem; display: block; margin-bottom: 8px; }
.all-done-title { font-size: 1.2rem; font-weight: 900; color: var(--green); margin-bottom: 4px; }
.all-done-sub { font-size: 0.88rem; font-weight: 700; color: #059669; }

/* Star particles */
.star-particle { position: absolute; pointer-events: none; font-size: 1.2rem; z-index: 200; animation: float-away 0.8s ease forwards; }
@keyframes float-away { 0% { opacity: 1; transform: scale(1) translateY(0); } 100% { opacity: 0; transform: scale(0.5) translateY(-60px) rotate(20deg); } }

/* ── Keyframe Animations ─────────────────────────────── */
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-down-in { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes bounce-in { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }
@keyframes xp-fill { from { width: 0; } to { width: var(--xp-pct, 0%); } }
@keyframes shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,127,110,0.4); } 50% { box-shadow: 0 0 0 8px rgba(255,127,110,0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes celebration-pop { 0% { transform: scale(0) rotate(-10deg); } 60% { transform: scale(1.2) rotate(3deg); } 100% { transform: scale(1) rotate(0deg); } }

/* ── Character Buddy System ──────────────────────────── */

/* Buddy area — fixed at bottom of screen */
.buddy-inline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 -2px 12px rgb(0 0 0 / 0.06);
  padding: 8px 20px 12px;
  display: flex;
  justify-content: center;
}
.buddy-inline:empty {
  padding: 0;
  box-shadow: none;
  background: transparent;
}
.buddy-inline .buddy-panel {
  opacity: 0;
  transform: translateY(20px);
  animation: buddy-slide-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.buddy-inline.hiding .buddy-panel {
  animation: buddy-slide-out 0.35s ease forwards;
}
@keyframes buddy-slide-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes buddy-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}

.buddy-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border-radius: 26px;
  padding: 14px 18px 14px 14px;
}
.buddy-panel-celebrate {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
}

.buddy-char { width: 80px; height: 80px; flex-shrink: 0; }
.buddy-char svg { width: 100%; height: 100%; display: block; }
.buddy-char-sm { width: 58px; height: 58px; flex-shrink: 0; }
.buddy-char-sm svg { width: 100%; height: 100%; display: block; }
.buddy-char-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.buddy-svg-fallback svg { width: 100%; height: 100%; display: block; }

.buddy-trio {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.buddy-bubble {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  position: relative;
  background: #fff;
  border: 2px solid #ede8e2;
  border-radius: 18px 18px 18px 4px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.buddy-bubble::before {
  content: '';
  position: absolute;
  bottom: 10px;
  left: -10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right-color: #ede8e2;
  border-left: 0;
}
.buddy-bubble::after {
  content: '';
  position: absolute;
  bottom: 11px;
  left: -7px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-right-color: #fff;
  border-left: 0;
}
/* Celebrate bubble: centred, no tail */
.buddy-panel-celebrate .buddy-bubble {
  border-radius: 18px;
  padding: 12px 18px;
}
.buddy-panel-celebrate .buddy-bubble::before,
.buddy-panel-celebrate .buddy-bubble::after {
  display: none;
}
.buddy-name {
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.buddy-msg {
  font-size: 0.97rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.buddy-celebrate-msg {
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Bloop animations ─────────────────────────────────── */
@keyframes bloop-float {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-6px) rotate(1deg) scale(1.02); }
  50% { transform: translateY(-12px) rotate(0deg) scale(1.04); }
  75% { transform: translateY(-6px) rotate(-1deg) scale(1.02); }
}
@keyframes bloop-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  10% { transform: translateY(-2px) rotate(0.5deg); }
  20% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-1px) rotate(-0.3deg); }
  40% { transform: translateY(0) rotate(0deg); }
  60% { transform: translateY(-1px) rotate(0.2deg); }
  70% { transform: translateY(0) rotate(0deg); }
  80% { transform: translateY(-0.5px) rotate(-0.1deg); }
  90% { transform: translateY(0) rotate(0deg); }
}
@keyframes bloop-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.1); }
}
.char-bloop svg {
  animation: bloop-float 2.4s ease-in-out infinite, bloop-idle 8s ease-in-out infinite 1s;
  transform-origin: center bottom;
}
.char-bloop.mood-curious svg {
  animation: bloop-float 1.9s ease-in-out infinite, bloop-idle 6s ease-in-out infinite 0.5s;
  filter: hue-rotate(30deg) saturate(1.25);
}
.char-bloop.mood-happy svg {
  animation: bloop-bounce 1.5s ease-in-out infinite, bloop-idle 5s ease-in-out infinite;
  filter: brightness(1.12) saturate(1.1);
}
.char-bloop.mood-surprised svg {
  animation: bloop-bounce 0.8s ease-in-out infinite, bloop-idle 4s ease-in-out infinite;
  filter: hue-rotate(160deg) saturate(1.3) brightness(1.1);
}
.char-bloop.mood-celebrate svg {
  animation: bloop-bounce 0.6s ease-in-out infinite, bloop-idle 3s ease-in-out infinite;
  filter: brightness(1.2) saturate(1.4) hue-rotate(45deg);
}

/* ── Mossy animations ─────────────────────────────────── */
@keyframes mossy-sway {
  0%, 100% { transform: rotate(-4deg) scale(1) translateY(0); }
  25% { transform: rotate(-2deg) scale(1.02) translateY(-3px); }
  50% { transform: rotate(4deg) scale(1.03) translateY(-6px); }
  75% { transform: rotate(2deg) scale(1.02) translateY(-3px); }
}
@keyframes mossy-glow {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 4px rgba(0,184,148,0.3)); }
  50% { filter: brightness(1.08) drop-shadow(0 0 12px rgba(0,184,148,0.55)); }
}
@keyframes mossy-idle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  15% { transform: translateX(1px) rotate(0.5deg); }
  30% { transform: translateX(0) rotate(0deg); }
  45% { transform: translateX(-1px) rotate(-0.3deg); }
  60% { transform: translateX(0) rotate(0deg); }
  75% { transform: translateX(0.5px) rotate(0.2deg); }
  90% { transform: translateX(0) rotate(0deg); }
}
@keyframes mossy-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.08); }
}
.char-mossy svg {
  animation: mossy-sway 3.2s ease-in-out infinite,
             mossy-glow 3.2s ease-in-out infinite,
             mossy-idle 7s ease-in-out infinite 2s;
  transform-origin: center bottom;
}
.char-mossy.mood-curious svg {
  animation: mossy-sway 2.8s ease-in-out infinite,
             mossy-glow 2.8s ease-in-out infinite,
             mossy-idle 5s ease-in-out infinite 1s;
  filter: brightness(1.05) saturate(1.2);
}
.char-mossy.mood-happy svg {
  animation: mossy-bounce 1.8s ease-in-out infinite,
             mossy-glow 1.8s ease-in-out infinite,
             mossy-idle 4s ease-in-out infinite;
  filter: brightness(1.1) saturate(1.3);
}
.char-mossy.mood-surprised svg {
  animation: mossy-bounce 1.2s ease-in-out infinite,
             mossy-glow 1.2s ease-in-out infinite,
             mossy-idle 3s ease-in-out infinite;
  filter: brightness(1.15) saturate(1.4) hue-rotate(20deg);
}
.char-mossy.mood-celebrate svg {
  animation: mossy-bounce 0.8s ease-in-out infinite,
             mossy-glow 0.8s ease-in-out infinite,
             mossy-idle 2s ease-in-out infinite;
  filter: brightness(1.2) saturate(1.5) hue-rotate(40deg);
}

/* ── Zappo animations ─────────────────────────────────── */
@keyframes zappo-bounce {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  20% { transform: translateY(-8px) rotate(2deg) scale(1.05); }
  40% { transform: translateY(-16px) rotate(4deg) scale(1.07); }
  60% { transform: translateY(-8px) rotate(-2deg) scale(1.05); }
  80% { transform: translateY(-4px) rotate(0deg) scale(1.02); }
}
@keyframes zappo-spark {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 5px rgba(253,203,110,0.4)); }
  50% { filter: brightness(1.18) drop-shadow(0 0 16px rgba(253,203,110,0.75)); }
}
@keyframes zappo-idle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  12% { transform: translateX(2px) rotate(1deg); }
  25% { transform: translateX(0) rotate(0deg); }
  37% { transform: translateX(-1px) rotate(-0.5deg); }
  50% { transform: translateX(0) rotate(0deg); }
  62% { transform: translateX(1px) rotate(0.8deg); }
  75% { transform: translateX(0) rotate(0deg); }
  87% { transform: translateX(-0.5px) rotate(-0.2deg); }
}
@keyframes zappo-energy {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}
.char-zappo svg {
  animation: zappo-bounce 1.3s ease-in-out infinite,
             zappo-spark 1.3s ease-in-out infinite,
             zappo-idle 5s ease-in-out infinite 1.5s;
  transform-origin: center bottom;
}
.char-zappo.mood-active svg {
  animation: zappo-bounce 0.9s ease-in-out infinite,
             zappo-spark 0.9s ease-in-out infinite,
             zappo-idle 3.5s ease-in-out infinite;
  filter: brightness(1.1) saturate(1.2);
}
.char-zappo.mood-alert svg {
  animation: zappo-energy 0.5s ease-in-out infinite,
             zappo-spark 0.65s ease-in-out infinite,
             zappo-idle 2.5s ease-in-out infinite;
  filter: brightness(1.2) saturate(1.4) hue-rotate(15deg);
}
.char-zappo.mood-celebrate svg {
  animation: zappo-energy 0.4s ease-in-out infinite,
             zappo-spark 0.4s ease-in-out infinite,
             zappo-idle 2s ease-in-out infinite;
  filter: brightness(1.3) saturate(1.6) hue-rotate(30deg);
}

/* ── Reduced Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .xp-bar-fill { width: var(--xp-pct, 0%) !important; animation: none !important; }
  .buddy-inline { transition: none; }
}

/* ── Landing Page ────────────────────────────────────── */
.landing-screen {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 20px 80px;
}
.landing-hero {
  text-align: center; margin-bottom: 20px;
}
.landing-characters {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 8px; margin-bottom: 20px;
}
.landing-char { animation: float 3.5s ease-in-out infinite; }
.landing-char:nth-child(2) { animation-delay: 0.5s; }
.landing-char:nth-child(3) { animation-delay: 1s; }
.landing-char-sm { width: 80px; height: 80px; }
.landing-char-lg { width: 110px; height: 110px; }
.landing-hero h2 {
  font-size: 1.9rem; font-weight: 900; color: var(--text);
  margin-bottom: 10px; line-height: 1.15;
}
.landing-hero p { font-size: 1rem; color: var(--muted); font-weight: 600; max-width: 300px; margin: 0 auto; }
.landing-features {
  display: grid; gap: 10px; width: 100%; max-width: 400px; margin-bottom: 32px;
}
.landing-feature {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
}

/* ── Accessibility polish ───────────────────────────── */
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.tab-btn:focus-visible,
.child-tab-btn:focus-visible {
  outline: 3px solid rgba(168, 85, 247, 0.38);
  outline-offset: 2px;
}
.landing-feature-icon { font-size: 1.6rem; flex-shrink: 0; }
.landing-feature-text { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.landing-feature-sub { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.landing-actions {
  display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 400px;
}
.landing-footer { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-align: center; margin-top: 24px; }

/* Family code display */
.family-code-display {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #f3e8ff, #fce8e8);
  border-radius: var(--radius-sm); padding: 14px 18px;
  font-size: 1.5rem; font-weight: 900; letter-spacing: 0.1em;
  color: var(--text); border: 2px solid rgba(155,142,196,0.3);
  margin: 12px 0;
}
.family-code-label { font-size: 0.75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .approval-actions { grid-template-columns: 1fr; }
  .child-hero { padding: 20px 16px; }
  .child-avatar { width: 56px; height: 56px; font-size: 1.8rem; }
  .child-hero-name { font-size: 1.3rem; }
}
@media (min-width: 600px) {
  .container { padding: 0 28px; }
  .chore-card  { padding: 20px; }
}

/* ── Leaderboard ────────────────────────────────────── */
.leaderboard { padding: 14px 16px; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.9rem; color: var(--text);
  transition: background 0.15s;
}
.lb-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.lb-medal { font-size: 1.2rem; width: 28px; text-align: center; flex-shrink: 0; }
.lb-name { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-current { background: rgba(255,127,110,0.1); border-radius: var(--radius-sm); border: 2px solid rgba(255,127,110,0.3); }

/* ── Badge Grid ─────────────────────────────────────── */
.badge-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.badge-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 6px; border-radius: var(--radius-sm);
  text-align: center; transition: all 0.2s;
}
.badge-emoji { font-size: 1.8rem; }
.badge-title { font-size: 0.7rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.badge-earned {
  background: linear-gradient(135deg, #fffbeb, #f3e8ff);
  border: 2px solid rgba(245,158,11,0.3);
  box-shadow: 0 2px 8px rgba(245,158,11,0.15);
}
.badge-locked {
  background: var(--surface-2); border: 2px solid var(--border);
  opacity: 0.55; filter: grayscale(0.6);
}
.badge-locked .badge-emoji { filter: grayscale(1); opacity: 0.4; }
.badge-locked .badge-title { color: var(--muted); }

/* ── Bonus Badge Chip ───────────────────────────────── */
.bonus-badge {
  display: inline-flex; align-items: center; gap: 2px;
  background: linear-gradient(135deg, #fffbeb, #fff5e0);
  color: var(--amber); font-size: 0.72rem; font-weight: 900;
  padding: 2px 8px; border-radius: var(--radius-pill);
  border: 1.5px solid rgba(245,158,11,0.35);
  vertical-align: middle; margin-left: 4px;
}

/* ── Streak Fire Glow ───────────────────────────────── */
.streak-fire { display: inline; }
.streak-fire-glow {
  animation: fire-glow 1.5s ease-in-out infinite;
  border: 2px solid rgba(255,127,110,0.4);
}
@keyframes fire-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(255,127,110,0.3), 0 0 8px rgba(245,158,11,0.2); }
  50% { box-shadow: 0 0 12px rgba(255,127,110,0.5), 0 0 20px rgba(245,158,11,0.35); }
}

/* ── Weekly Challenge Card ──────────────────────────── */
.weekly-challenge-card {
  background: linear-gradient(135deg, #f3e8ff 0%, #e8f4f8 50%, #fef3e8 100%) !important;
  border: 2px solid rgba(155,142,196,0.3);
}

/* ── Multi-Parent Login ─────────────────────────────── */
.parent-login-option { min-height: 80px; }

/* ── Celebration Epic ───────────────────────────────── */
.celebration-card-epic {
  padding: 48px 36px;
  background: linear-gradient(135deg, #fff 0%, #f3e8ff 50%, #fff5e0 100%);
}
.celebration-card-epic .celebration-emoji { font-size: 6rem; }
.celebration-level-title {
  font-size: 1.4rem; font-weight: 900; margin-top: 12px;
  background: linear-gradient(135deg, var(--primary), var(--purple), var(--amber));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ══════════════════════════════════════════════════════════
   ENHANCED ANIMATIONS — Gamification & Micro-interactions
   ══════════════════════════════════════════════════════════ */

/* ── A. Confetti improvements ───────────────────────── */
.confetti-circle { border-radius: 50%; }
.confetti-rect { border-radius: 2px; }
.confetti-star { border-radius: 0; background: none !important; line-height: 1; }
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
  25% { transform: translateY(27vh) rotate(calc(var(--spin, 360deg) * 0.25)) scale(1.1); }
  50% { transform: translateY(55vh) rotate(calc(var(--spin, 360deg) * 0.5)) scale(0.9); opacity: 0.9; }
  75% { transform: translateY(82vh) rotate(calc(var(--spin, 360deg) * 0.75)) scale(1.05); opacity: 0.6; }
  100% { transform: translateY(110vh) rotate(var(--spin, 720deg)) scale(0.8); opacity: 0; }
}

/* ── B. Floating +XP animation ──────────────────────── */
.floating-xp {
  position: absolute;
  pointer-events: none;
  z-index: 500;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--purple);
  text-shadow: 0 2px 8px rgba(155,142,196,0.5);
  animation: float-xp 1.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  transform: translateX(-50%);
}
@keyframes float-xp {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.7); }
  30% { opacity: 1; transform: translateX(-50%) translateY(-30px) scale(1.3); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-90px) scale(1); }
}

/* ── C. Floating gem/coin emoji animation ───────────── */
.floating-emoji {
  position: absolute;
  pointer-events: none;
  z-index: 500;
  font-size: 2rem;
  animation: float-emoji 1.3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  transform: translateX(-50%);
}
@keyframes float-emoji {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.5) rotate(0deg); }
  40% { opacity: 1; transform: translateX(-50%) translateY(-40px) scale(1.4) rotate(15deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-100px) scale(0.8) rotate(-10deg); }
}

/* ── D. Streak fire animation ───────────────────────── */
.streak-fire-glow {
  animation: streak-fire-pulse 1.5s ease-in-out infinite !important;
  border: 2px solid rgba(255,127,110,0.4) !important;
  position: relative;
}
@keyframes streak-fire-pulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(255,127,110,0.4), 0 0 12px rgba(245,158,11,0.2), inset 0 0 6px rgba(255,127,110,0.1);
    border-color: rgba(255,127,110,0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(255,127,110,0.6), 0 0 28px rgba(245,158,11,0.4), inset 0 0 12px rgba(255,127,110,0.2);
    border-color: rgba(245,158,11,0.6);
  }
}

/* ── E. Badge unlock celebration ────────────────────── */
.badge-starburst {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.5) 0%, rgba(245,158,11,0.15) 40%, transparent 70%);
  animation: starburst 1.5s ease-out forwards;
  pointer-events: none;
  z-index: 499;
}
@keyframes starburst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(2.5); opacity: 0.8; }
  100% { transform: scale(4); opacity: 0; }
}
.badge-bounce-emoji {
  animation: badge-big-bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.1s !important;
  font-size: 5.5rem !important;
}
@keyframes badge-big-bounce {
  0% { transform: scale(0) rotate(-20deg); }
  50% { transform: scale(1.4) rotate(10deg); }
  70% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.badge-celebration-card {
  background: linear-gradient(135deg, #fff 0%, #fffbeb 40%, #f3e8ff 100%) !important;
  border: 2px solid rgba(245,158,11,0.4);
}

/* ── F. Level-up enhancements ───────────────────────── */
.screen-flash {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 600;
  pointer-events: none;
  animation: screen-flash-anim 0.5s ease-out forwards;
}
@keyframes screen-flash-anim {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}
.celebration-card-glow {
  animation: celebration-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             celebration-glow-pulse 2s ease-in-out infinite 0.5s !important;
}
@keyframes celebration-glow-pulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 0 rgba(255,127,110,0.3); }
  50% { box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 30px 10px rgba(155,142,196,0.4); }
}

/* ── G. Chore card micro-animations ─────────────────── */
.chore-card {
  animation: chore-card-entrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes chore-card-entrance {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.chore-card:hover {
  transform: translateY(-2px) scale(1.01) !important;
  box-shadow: var(--shadow-lg) !important;
}
.chore-card:active {
  transform: scale(0.98) !important;
}

/* Ready button pulsing glow */
.done-btn {
  animation: ready-btn-pulse 2s ease-in-out infinite !important;
}
@keyframes ready-btn-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(255,127,110,0.35), 0 0 0 0 rgba(255,127,110,0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(255,127,110,0.5), 0 0 0 8px rgba(255,127,110,0);
  }
}

/* Done checkmark pop animation */
.status-chip-approved {
  animation: checkmark-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes checkmark-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── H. Character bounce & wobble ───────────────────── */
.buddy-char, .buddy-char-sm {
  animation: buddy-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes buddy-bounce-in {
  0% { transform: scale(0) translateY(20px); }
  60% { transform: scale(1.1) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}
.buddy-char-img, .buddy-svg-fallback {
  animation: buddy-wobble 3s ease-in-out infinite;
}
@keyframes buddy-wobble {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  25% { transform: rotate(2deg) scale(1.02); }
  50% { transform: rotate(-1deg) scale(1); }
  75% { transform: rotate(1.5deg) scale(1.01); }
}

/* ── I. Weekly challenge progress bar animation ─────── */
.weekly-challenge-card .xp-bar-fill {
  animation: wc-bar-fill 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wc-bar-fill {
  from { width: 0; }
  to { width: var(--xp-pct, 0%); }
}

/* ── J. Leaderboard rank change arrow ───────────────── */
.lb-rank-up {
  display: inline-block;
  animation: rank-up-bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  margin-left: 4px;
}
@keyframes rank-up-bounce {
  0% { transform: translateY(8px); opacity: 0; }
  50% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ── Progress dots enhanced ─────────────────────────── */
.progress-dot.done {
  animation: dot-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes dot-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Landing character bounce enhancement ───────────── */
.landing-char {
  animation: landing-bounce 3s ease-in-out infinite !important;
}
.landing-char:nth-child(1) { animation-delay: 0s !important; }
.landing-char:nth-child(2) { animation-delay: 0.4s !important; }
.landing-char:nth-child(3) { animation-delay: 0.8s !important; }
@keyframes landing-bounce {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  30% { transform: translateY(-10px) rotate(1deg); }
  60% { transform: translateY(-4px) rotate(0deg); }
}

/* ── All-done card extra celebration ────────────────── */
.all-done-card {
  animation: all-done-entrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes all-done-entrance {
  0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ── Child avatar bounce ────────────────────────────── */
.child-avatar {
  animation: avatar-float 4s ease-in-out infinite, avatar-entrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes avatar-entrance {
  0% { transform: scale(0) rotate(-10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ── Hero stats entrance ────────────────────────────── */
.stats-row .stat {
  animation: stat-entrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.stats-row .stat:nth-child(1) { animation-delay: 0.1s; }
.stats-row .stat:nth-child(2) { animation-delay: 0.2s; }
.stats-row .stat:nth-child(3) { animation-delay: 0.3s; }
@keyframes stat-entrance {
  0% { transform: translateY(10px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── XP bar shimmer effect ──────────────────────────── */
.xp-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: xp-shimmer 2s ease-in-out infinite;
  border-radius: inherit;
}
.xp-bar-fill { position: relative; overflow: hidden; }
@keyframes xp-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Badge grid entrance ────────────────────────────── */
.badge-item {
  animation: badge-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.badge-item:nth-child(1) { animation-delay: 0.05s; }
.badge-item:nth-child(2) { animation-delay: 0.1s; }
.badge-item:nth-child(3) { animation-delay: 0.15s; }
.badge-item:nth-child(4) { animation-delay: 0.2s; }
.badge-item:nth-child(5) { animation-delay: 0.25s; }
.badge-item:nth-child(6) { animation-delay: 0.3s; }
.badge-item:nth-child(7) { animation-delay: 0.35s; }
.badge-item:nth-child(8) { animation-delay: 0.4s; }
@keyframes badge-entrance {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.badge-earned:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

/* ── Leaderboard row entrance ───────────────────────── */
.lb-row {
  animation: lb-row-entrance 0.3s ease both;
}
.lb-row:nth-child(1) { animation-delay: 0.05s; }
.lb-row:nth-child(2) { animation-delay: 0.15s; }
.lb-row:nth-child(3) { animation-delay: 0.25s; }
@keyframes lb-row-entrance {
  0% { transform: translateX(-10px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ── Approval card entrance ─────────────────────────── */
.approval-card {
  animation: approval-entrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes approval-entrance {
  0% { transform: translateX(-15px) scale(0.95); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* ── Focus FAB pulse when active ────────────────────── */
.focus-mode-fab.active {
  animation: fab-active-pulse 1.2s ease-in-out infinite !important;
}
@keyframes fab-active-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 20px rgba(255,127,110,0.45); }
  50% { transform: scale(1.08); box-shadow: 0 8px 28px rgba(255,127,110,0.6); }
}

/* ── Buddy Picker (child profile) ───────────────────── */
.buddy-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.buddy-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 12px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface-2);
  min-width: 80px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  user-select: none;
}
.buddy-pick-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155,142,196,0.25);
}
.buddy-pick-card.buddy-pick-selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(255,127,110,0.08), rgba(155,142,196,0.12));
  box-shadow: 0 4px 14px rgba(255,127,110,0.25);
}

/* ── Undo button in activity rows ───────────────────── */
.activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}
.activity-item:last-child {
  border-bottom: none;
}

/* ── Amber button (for balance adjustments) ─────────── */
.btn-amber {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245,164,74,0.35);
}
.btn-amber:hover { background: #e0923a; box-shadow: 0 6px 20px rgba(245,164,74,0.45); transform: translateY(-1px); }

/* ── Sanction card (parent side) ────────────────────── */
.sanction-card {
  border: 1.5px solid rgba(245,164,74,0.25);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(245,164,74,0.05) 100%);
}

/* ── Sanction history item ──────────────────────────── */
.sanction-history-item {
  align-items: flex-start;
}

/* ── Child-side sanctions card ──────────────────────── */
.child-sanctions-card {
  border: 1.5px solid rgba(155,142,196,0.2);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(155,142,196,0.05) 100%);
}
.child-sanction-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.child-sanction-item:last-child { border-bottom: none; }
.child-sanction-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.child-sanction-body { flex: 1; min-width: 0; }
.child-sanction-amount {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}
.child-sanction-reason {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.child-sanction-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════
   GAMIFICATION OVERHAUL — Part 2: ADHD/ASD Friendly UI
   ══════════════════════════════════════════════════════════ */

/* ── Balance Adjustment Form ────────────────────────── */
.adjustment-card {
  border: 1.5px solid rgba(155,142,196,0.25);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(155,142,196,0.05) 100%);
}
.adj-type-toggle {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.adj-type-btn {
  flex: 1; height: 44px; border-radius: var(--radius-pill);
  font-family: inherit; font-weight: 800; font-size: 0.88rem;
  border: 2px solid var(--border); background: var(--surface-2);
  cursor: pointer; transition: all 0.15s;
}
.adj-type-btn.active.adj-type-add {
  background: var(--green); color: #fff; border-color: var(--green);
  box-shadow: 0 3px 10px rgba(126,200,164,0.4);
}
.adj-type-btn.active.adj-type-deduct {
  background: var(--amber); color: #fff; border-color: var(--amber);
  box-shadow: 0 3px 10px rgba(245,164,74,0.4);
}

/* ── Child Adjustment Card ──────────────────────────── */
.child-adj-card {
  border: 1.5px solid rgba(155,142,196,0.2);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(126,200,164,0.05) 100%);
}
.child-adj-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.child-adj-item:last-child { border-bottom: none; }
.child-adj-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.child-adj-body { flex: 1; min-width: 0; }
.child-adj-amount { font-size: 0.9rem; font-weight: 800; }
.adj-amount-add { color: var(--green); }
.adj-amount-deduct { color: var(--amber); }
.child-adj-reason { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.child-adj-date { font-size: 0.75rem; font-weight: 600; color: var(--muted); flex-shrink: 0; margin-top: 2px; }

/* ── Progress Ring SVG ──────────────────────────────── */
.progress-ring { display: block; }
.progress-ring-bg { }
.progress-ring-circle {
  transform-origin: center;
  animation: ring-fill-in 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes ring-fill-in {
  from { stroke-dasharray: 0 var(--ring-circ, 999); }
  to   { stroke-dasharray: var(--ring-dash, 0) var(--ring-gap, 999); }
}
.child-hero-ring {
  flex-shrink: 0;
  animation: avatar-entrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.1s;
}

/* ── Enhanced Leaderboard ───────────────────────────── */
.leaderboard-enhanced {
  padding: 16px;
}
.leaderboard-awards {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.award-chip {
  font-size: 0.72rem; font-weight: 800; padding: 4px 10px;
  border-radius: var(--radius-pill); white-space: nowrap;
}
.award-star {
  background: linear-gradient(135deg, #fffbeb, #fff5e0);
  color: var(--amber); border: 1.5px solid rgba(245,164,74,0.3);
}
.award-streak {
  background: linear-gradient(135deg, #fff5e0, #ffe8d6);
  color: var(--primary); border: 1.5px solid rgba(255,127,110,0.3);
}
.podium-wrap {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 6px; margin-bottom: 10px;
}
.podium-slot {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 8px 8px; border-radius: var(--radius-sm);
  min-width: 80px; text-align: center; border: 2px solid transparent;
  transition: all 0.2s;
}
.podium-empty { min-width: 80px; }
.podium-first {
  background: linear-gradient(135deg, #fffbeb, #fff5e0);
  border-color: rgba(245,164,74,0.4); padding-top: 18px;
  box-shadow: 0 4px 16px rgba(245,164,74,0.2);
  animation: podium-rise 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.1s;
}
.podium-second {
  background: linear-gradient(135deg, #f8faff, #eff2ff);
  border-color: rgba(91,164,207,0.3);
  animation: podium-rise 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.2s;
}
.podium-third {
  background: linear-gradient(135deg, #fff8f5, #fef3e8);
  border-color: rgba(255,127,110,0.25);
  animation: podium-rise 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.3s;
}
.podium-me {
  outline: 3px solid var(--primary); outline-offset: 2px;
}
@keyframes podium-rise {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.podium-avatar { font-size: 2.2rem; line-height: 1; margin-bottom: 2px; }
.podium-medal  { font-size: 1.4rem; margin-bottom: 4px; }
.podium-name   { font-size: 0.75rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.podium-xp     { font-size: 0.7rem; font-weight: 800; color: var(--purple); margin-top: 2px; }
.lb-context-msg {
  text-align: center; font-size: 0.82rem; font-weight: 800;
  padding: 8px 12px; border-radius: var(--radius-sm); margin-top: 8px;
}
.lb-context-lead {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: var(--green); border: 1.5px solid rgba(126,200,164,0.3);
}
.lb-context-chase {
  background: linear-gradient(135deg, #fff5e0, #fef3e8);
  color: var(--primary); border: 1.5px solid rgba(255,127,110,0.25);
}

/* ── Daily Goal Card ────────────────────────────────── */
.daily-goal-card {
  background: linear-gradient(135deg, #faf8ff, #f8fbff) !important;
  border: 1.5px solid rgba(155,142,196,0.2) !important;
}
.daily-goal-ring-wrap {
  flex-shrink: 0;
  animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.2s;
}
.daily-goal-ring { display: block; }

/* ── Streak Heatmap ─────────────────────────────────── */
.streak-card {
  background: linear-gradient(135deg, #fff8f5, #fffbf5) !important;
  border: 1.5px solid rgba(255,127,110,0.15) !important;
}
.streak-heatmap {
  display: flex; gap: 6px; justify-content: space-between;
}
.streak-day {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex: 1;
}
.streak-day-label {
  font-size: 0.6rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase;
}
.streak-day-dot {
  font-size: 1.1rem; line-height: 1;
}
.streak-day-empty .streak-day-dot { opacity: 0.3; font-size: 0.9rem; }
.streak-day-done  { }
.streak-day-partial { }
.streak-day-today .streak-day-label {
  color: var(--primary); font-weight: 900;
}

/* ── XP Levels Path ─────────────────────────────────── */
.xp-levels-card { }
.levels-path {
  display: flex; flex-direction: column; gap: 8px;
}
.level-node {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); transition: all 0.2s;
}
.level-node-done {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: rgba(126,200,164,0.4);
  opacity: 0.8;
}
.level-node-current {
  background: linear-gradient(135deg, #fff5e0, #fef3e8);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,127,110,0.15);
  animation: level-current-pulse 2s ease-in-out infinite;
}
@keyframes level-current-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,127,110,0.15); }
  50%       { box-shadow: 0 0 0 6px rgba(255,127,110,0.08); }
}
.level-node-locked {
  background: var(--surface-2); opacity: 0.65;
}
.level-node-emoji { font-size: 1.6rem; flex-shrink: 0; }
.level-node-info  { flex: 1; }
.level-node-num   { font-size: 0.7rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.level-node-title { font-size: 0.95rem; font-weight: 900; color: var(--text); }
.level-node-status { font-size: 0.75rem; font-weight: 700; margin-top: 2px; }
.level-status-done    { color: var(--green); }
.level-status-current { color: var(--primary); }
.level-status-next    { color: var(--purple); font-weight: 800; }
.level-status-locked  { color: var(--muted); }

/* ── Badge Collection Grid ──────────────────────────── */
.badge-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.badge-item-lg {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 10px 6px; border-radius: var(--radius-sm);
  text-align: center; transition: all 0.2s; border: 2px solid transparent;
}
.badge-item-lg.badge-earned {
  background: linear-gradient(135deg, #fffbeb, #f3e8ff);
  border-color: rgba(245,158,11,0.3);
  box-shadow: 0 2px 8px rgba(245,158,11,0.15);
}
.badge-item-lg.badge-locked {
  background: var(--surface-2);
  border-color: var(--border);
  opacity: 0.7;
}
.badge-item-lg.badge-item-close {
  background: linear-gradient(135deg, #fffbeb, #fff5e0);
  border-color: rgba(245,164,74,0.4);
  animation: badge-near-pulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(245,164,74,0);
}
@keyframes badge-near-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(245,164,74,0.3); }
  50%       { box-shadow: 0 0 16px rgba(245,164,74,0.55); }
}
.badge-next {
  padding: 10px 14px;
  background: linear-gradient(135deg, #f3e8ff, #fef3e8);
  border-radius: var(--radius-sm);
  border: 2px solid rgba(155,142,196,0.3);
}

/* ── Milestone Rewards Path ─────────────────────────── */
.reward-path {
  display: flex; flex-direction: column; gap: 10px;
}
.reward-node {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); transition: all 0.2s;
}
.reward-claimed {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: rgba(126,200,164,0.4);
}
.reward-locked {
  background: var(--surface-2); opacity: 0.8;
}
.reward-close {
  background: linear-gradient(135deg, #fffbeb, #fff5e0);
  border-color: rgba(245,164,74,0.4);
  animation: badge-near-pulse 2s ease-in-out infinite;
}
.reward-node-emoji { font-size: 1.8rem; flex-shrink: 0; }
.reward-node-info  { flex: 1; }
.reward-node-title { font-size: 0.92rem; font-weight: 900; color: var(--text); }
.reward-node-xp    { font-size: 0.75rem; font-weight: 700; color: var(--muted); margin-top: 2px; }
.reward-progress-bar-wrap {
  height: 6px; background: rgba(0,0,0,0.08);
  border-radius: 99px; overflow: hidden; margin-top: 6px;
}
.reward-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--purple), var(--primary));
  border-radius: 99px; transition: width 1s ease;
}

/* ── This week's star card ──────────────────────────── */
.week-star-card {
  background: linear-gradient(135deg, #fffbeb, #f3e8ff);
  border: 2px solid rgba(245,164,74,0.3);
}

/* ── Adj history item ───────────────────────────────── */
.adj-history-item { align-items: flex-start; }

/* ── Weekly Schedule View ────────────────────────────── */
.week-schedule-list { display: flex; flex-direction: column; gap: 8px; }
.week-day-row {
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  padding: 10px 12px; background: var(--surface-2); transition: all 0.2s;
}
.week-day-today {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(255,127,110,0.06), rgba(155,142,196,0.06));
  box-shadow: 0 2px 10px rgba(255,127,110,0.12);
}
.week-day-past { opacity: 0.6; }
.week-day-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap;
}
.week-day-name { font-weight: 900; font-size: 0.9rem; color: var(--text); min-width: 28px; }
.week-day-date { font-weight: 700; font-size: 0.82rem; color: var(--muted); }
.week-today-badge {
  background: var(--primary); color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.week-done-badge {
  background: var(--green); color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.week-day-potential-label {
  margin-left: auto; font-size: 0.75rem; font-weight: 800; color: var(--muted);
}
.week-day-chores { display: flex; flex-direction: column; gap: 4px; }
.week-chore-chip {
  display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700;
  padding: 5px 8px; border-radius: 8px; background: rgba(0,0,0,0.04); color: var(--text);
}
.week-chore-chip.week-chore-done { background: rgba(126,200,164,0.15); color: var(--green); }
.week-chore-chip.week-chore-pending { background: rgba(245,164,74,0.15); color: #b36b00; }
.week-chore-chip.week-chore-missed { opacity: 0.45; text-decoration: line-through; }
.week-chore-name { flex: 1; }
.week-chore-val { font-weight: 800; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.week-chore-chip.week-chore-done .week-chore-val { color: var(--green); }
.week-free-day { font-size: 0.82rem; font-weight: 700; color: var(--muted); font-style: italic; }

/* ── Earning potential stats row ─────────────────────── */
.earning-potential-row {
  display: flex; gap: 8px; margin-top: 10px;
}
.ep-stat {
  flex: 1; text-align: center; padding: 10px 6px 8px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}
.ep-stat-bonus {
  border-color: rgba(155,142,196,0.4);
  background: rgba(155,142,196,0.07);
}
.ep-stat-val, .ep-stat-value {
  font-size: 1.1rem; font-weight: 900; color: var(--text); display: block; line-height: 1.1;
}
.ep-stat-val.ep-green, .ep-stat-value.ep-green   { color: var(--green); }
.ep-stat-val.ep-purple, .ep-stat-value.ep-purple  { color: var(--purple); }
.ep-stat-val.ep-primary, .ep-stat-value.ep-primary{ color: var(--primary); }
.ep-stat-label {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px;
}
.ep-progress-wrap { margin-top: 10px; }
.ep-progress-bar {
  height: 8px; border-radius: var(--radius-pill);
  background: var(--border); overflow: hidden;
}
.ep-progress-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transition: width 0.6s ease;
}
.ep-progress-label {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-align: right; margin-top: 4px;
}

/* ── Notifications FAB badge ─────────────────────────── */
.notif-fab { /* position: fixed inherited from .focus-mode-fab */ }
.notif-fab-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--primary); color: #fff;
  font-size: 0.6rem; font-weight: 900; line-height: 1;
  min-width: 16px; height: 16px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none;
}

/* ── Notifications overlay ───────────────────────────── */
.notif-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 300; display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in 0.15s ease;
}
.notif-overlay-card {
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 480px; max-height: 75dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
  animation: slide-up 0.25s cubic-bezier(0.34,1.2,0.64,1);
}
.notif-overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.notif-overlay-body {
  overflow-y: auto; padding: 12px 20px 24px; flex: 1;
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Notifications card ───────────────────────────────── */
.notif-card { border-left: 4px solid var(--purple); }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; padding-bottom: 0; }
.notif-item-new { background: rgba(155,142,196,0.07); border-radius: var(--radius-sm); padding: 10px 8px; margin: 0 -8px; }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.notif-text  { font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-time  { font-size: 0.72rem; font-weight: 700; color: var(--muted); margin-top: 4px; }

/* ── Confetti celebration for daily goal completion ─── */
@keyframes daily-goal-complete-ring {
  0%   { stroke: var(--primary); }
  50%  { stroke: var(--green); filter: drop-shadow(0 0 8px rgba(126,200,164,0.7)); }
  100% { stroke: var(--green); }
}


/* ── Payout Celebration Overlay ───────────────────────────────── */
#payout-celebration {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
#payout-celebration.payout-cel-show {
  opacity: 1; pointer-events: all;
}
.payout-cel-inner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 28px 32px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  transform: scale(0.85) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
#payout-celebration.payout-cel-show .payout-cel-inner {
  transform: scale(1) translateY(0);
}
.payout-cel-emoji {
  font-size: 4rem; line-height: 1; margin-bottom: 8px;
  animation: payout-bounce 0.6s 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes payout-bounce {
  from { transform: scale(0.5) rotate(-10deg); opacity:0; }
  to   { transform: scale(1) rotate(0deg);    opacity:1; }
}
.payout-cel-title {
  font-size: 2rem; font-weight: 900; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--primary), var(--green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.payout-cel-amount {
  font-size: 3.5rem; font-weight: 900; color: var(--green);
  line-height: 1; margin-bottom: 12px;
  animation: payout-pop 0.5s 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes payout-pop {
  from { transform: scale(0.7); opacity:0; }
  to   { transform: scale(1);   opacity:1; }
}
.payout-cel-msg {
  font-size: 1rem; font-weight: 700; color: var(--muted);
  line-height: 1.5; margin-bottom: 24px;
}
.payout-cel-close {
  font-size: 1.1rem; padding: 14px 32px; width: 100%;
  animation: payout-fade-in 0.4s 0.9s both;
}
@keyframes payout-fade-in {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── Combo System ─────────────────────────────────────────────── */
.combo-popup {
  position: absolute; z-index: 9990; pointer-events: none;
  font-family: 'Nunito', sans-serif; font-weight: 900; text-align: center;
  transform: translate(-50%, -100%) scale(0.5);
  animation: combo-in 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.combo-hot  { font-size: 1.4rem; color: #f59e0b; }
.combo-epic { font-size: 1.8rem; color: #ef4444; }
.combo-legendary { font-size: 2.2rem; color: #a855f7; text-shadow: 0 0 20px rgba(168,85,247,0.6); }
.combo-x { letter-spacing: 0.06em; }
.combo-num { font-size: 120%; }
@keyframes combo-in {
  0%   { transform: translate(-50%,-100%) scale(0.5); opacity:0; }
  50%  { transform: translate(-50%,-100%) scale(1.3); opacity:1; }
  70%  { transform: translate(-50%,-100%) scale(0.95); }
  100% { transform: translate(-50%,-100%) scale(1) translateY(-20px); opacity:0; }
}

/* Screen shake for big combos */
.screen-shake { animation: shake 0.4s ease-in-out; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  10%     { transform: translateX(-4px) rotate(-0.5deg); }
  30%     { transform: translateX(4px) rotate(0.5deg); }
  50%     { transform: translateX(-3px); }
  70%     { transform: translateX(3px); }
  90%     { transform: translateX(-1px); }
}

/* ── Sticker Drop Overlay ─────────────────────────────────────── */
.sticker-drop-overlay {
  position: fixed; inset:0; z-index:9998;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,0.4);
  opacity:0; pointer-events:none; transition: opacity 0.3s;
}
.sticker-drop-overlay.show { opacity:1; pointer-events:all; }
.sticker-drop-inner {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 32px 28px; text-align:center;
  transform: scale(0.8) rotate(-5deg);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.sticker-drop-overlay.show .sticker-drop-inner { transform: scale(1) rotate(0); }
.sticker-drop-label {
  font-size:0.8rem; font-weight:900; letter-spacing:0.1em;
  color:var(--purple); text-transform:uppercase; margin-bottom:8px;
}
.sticker-drop-emoji {
  font-size: 5rem; line-height:1;
  animation: sticker-bounce 0.6s 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes sticker-bounce {
  from { transform: scale(0) rotate(-20deg); }
  to   { transform: scale(1) rotate(0); }
}
.sticker-drop-msg {
  font-size:0.85rem; font-weight:700; color:var(--muted); margin-top:8px;
}

/* ── Sticker Collection Grid ──────────────────────────────────── */
.sticker-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.sticker-item {
  font-size: 3.5rem; width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: rgba(155, 142, 196, 0.05) 0px 0px 0px 3px, rgba(0, 0, 0, 0.15) 1px 5px 5px, rgba(0, 0, 0, 0.1) 0px 2px 4px;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.sticker-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 17px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 40%, transparent 70%);
  pointer-events: none;
}
.sticker-item::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.95);
  border-radius: 0 0 24px 0;
  box-shadow:
    -3px 3px 6px rgba(0,0,0,0.15),
    inset -1px 1px 2px rgba(255,255,255,0.8);
  transform: perspective(40px) rotateX(35deg);
  pointer-events: none;
  border: 1px solid rgba(0,0,0,0.05);
}
.sticker-item:hover {
  transform: scale(1.15) rotate(-2deg);
  box-shadow:
    0 0 0 4px var(--primary),
    0 10px 24px rgba(0,0,0,0.2);
}

/* .mystery-bonus-popup removed — now uses showToast() */

/* ── Daily Login Bonus Overlay ────────────────────────────────── */
.daily-bonus-overlay {
  position:fixed; inset:0; z-index:9999;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,0.55);
  opacity:0; pointer-events:none; transition: opacity 0.4s;
}
.daily-bonus-overlay.show { opacity:1; pointer-events:all; }
.daily-bonus-inner {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 36px 28px; text-align:center; max-width:300px; width:85%;
  transform: scale(0.85) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.daily-bonus-overlay.show .daily-bonus-inner { transform: scale(1) translateY(0); }
.daily-bonus-wave {
  font-size:3.5rem; line-height:1; margin-bottom:8px;
  animation: wave-hand 0.8s ease-in-out;
}
@keyframes wave-hand {
  0%,100% { transform: rotate(0); }
  25%     { transform: rotate(20deg); }
  50%     { transform: rotate(-10deg); }
  75%     { transform: rotate(15deg); }
}
.daily-bonus-title {
  font-size:1.3rem; font-weight:900; color:var(--text); margin-bottom:12px;
}
.daily-bonus-xp {
  font-size:3rem; font-weight:900; line-height:1;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  animation: daily-xp-pop 0.5s 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes daily-xp-pop {
  from { transform: scale(0.5); opacity:0; }
  to   { transform: scale(1); opacity:1; }
}
.daily-bonus-label {
  font-size:0.85rem; font-weight:700; color:var(--muted); margin-top:4px; margin-bottom:8px;
}
.daily-bonus-streak {
  font-size:0.9rem; font-weight:800; color:var(--primary); margin-bottom:12px;
  animation: streak-glow 1.5s ease-in-out infinite alternate;
}
@keyframes streak-glow {
  from { text-shadow: 0 0 4px rgba(255,127,110,0.3); }
  to   { text-shadow: 0 0 12px rgba(255,127,110,0.6); }
}
.daily-bonus-close { width:100%; font-size:1rem; padding:12px; margin-top:8px; }

/* ── Enhanced Streak Fire ─────────────────────────────────────── */
.streak-fire-glow {
  animation: fire-pulse 1.5s ease-in-out infinite alternate !important;
}
@keyframes fire-pulse {
  from { filter: drop-shadow(0 0 4px rgba(255,127,110,0.3)); }
  to   { filter: drop-shadow(0 0 12px rgba(255,100,50,0.6)); }
}

/* ── Theme Picker ─────────────────────────────────────────────── */
.theme-picker {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 8px;
}
.theme-pick-card {
  border: 2.5px solid var(--border); border-radius: var(--radius);
  padding: 0; text-align: center; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative; overflow: hidden;
  background: var(--surface-2);
}
.theme-pick-card:active { transform: scale(0.95); }
.theme-pick-selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow), 0 6px 20px rgba(0,0,0,0.12);
  transform: scale(1.02);
}
.theme-pick-selected .theme-pick-check {
  opacity: 1; transform: scale(1);
}
.theme-pick-check {
  position: absolute; top: 6px; right: 6px;
  background: var(--primary); color: #fff; width: 22px; height: 22px;
  border-radius: 50%; font-size: 0.7rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 2;
}
.theme-pick-preview {
  width: 100%; height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  position: relative;
}
.theme-pick-preview-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
}
.theme-pick-dots {
  display: flex; gap: 4px; align-items: center;
}
.theme-pick-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); }
.theme-pick-body {
  padding: 8px 10px 10px; display: flex; align-items: center; gap: 8px;
}
.theme-pick-emoji { font-size: 1.6rem; line-height: 1; }
.theme-pick-name { font-size: 0.78rem; font-weight: 800; color: var(--text); text-align: left; }

/* ── Enhanced Card Animations ─────────────────────────────────── */
.chore-card {
  animation: card-slide-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.chore-card:nth-child(1) { animation-delay: 0s; }
.chore-card:nth-child(2) { animation-delay: 0.06s; }
.chore-card:nth-child(3) { animation-delay: 0.12s; }
.chore-card:nth-child(4) { animation-delay: 0.18s; }
.chore-card:nth-child(5) { animation-delay: 0.24s; }
.chore-card:nth-child(6) { animation-delay: 0.3s; }
@keyframes card-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bounce on done button hover */
.done-btn {
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.done-btn:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 20px rgba(255,127,110,0.45) !important;
}
.done-btn:active {
  transform: scale(0.95) !important;
}

/* ── Stat Counter Animations ──────────────────────────────────── */
.stat-value {
  animation: stat-count-in 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes stat-count-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Card Hover Lift ──────────────────────────────────────────── */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

/* ── Badge Earned Sparkle ─────────────────────────────────────── */
.badge-earned {
  animation: badge-sparkle 3s ease-in-out infinite;
}
@keyframes badge-sparkle {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50%      { filter: drop-shadow(0 0 8px rgba(245,158,11,0.5)); }
}

/* ── Daily Goal Ring Pulse on 100% ────────────────────────────── */
.daily-goal-ring-complete {
  animation: goal-ring-celebrate 1.5s ease-in-out infinite;
}
@keyframes goal-ring-celebrate {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(16,185,129,0.3)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 16px rgba(16,185,129,0.6)); transform: scale(1.05); }
}

/* ── XP Bar Shimmer ───────────────────────────────────────────── */
.xp-progress-fill {
  position: relative; overflow: hidden;
}
.xp-progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: xp-shimmer 2s ease-in-out infinite;
}
@keyframes xp-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Tab Switch Animation ─────────────────────────────────────── */
#child-tab-content {
  animation: tab-fade-in 0.3s ease both;
}
@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Sticker Hover Wobble ─────────────────────────────────────── */
.sticker-item:hover {
  animation: sticker-wobble 0.5s ease-in-out;
}
@keyframes sticker-wobble {
  0%   { transform: scale(1.3) rotate(0deg); }
  25%  { transform: scale(1.3) rotate(10deg); }
  50%  { transform: scale(1.3) rotate(-8deg); }
  75%  { transform: scale(1.3) rotate(5deg); }
  100% { transform: scale(1.3) rotate(0deg); }
}

/* ── Floating Particle Ambient ────────────────────────────────── */
@keyframes ambient-float {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ── Release polish pass: premium motion tuning ───────────────── */
:root {
  --motion-premium-fast: 180ms;
  --motion-premium-med: 280ms;
  --motion-premium-slow: 480ms;
  --ease-premium-ui: cubic-bezier(0.22, 1, 0.36, 1);
}

.app-header::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 146, 169, 0.36) 50%, transparent 100%);
  pointer-events: none;
}

.card,
.chore-card,
.landing-feature,
.login-option-card,
.child-select-btn,
.buddy-pick-card,
.tab-btn,
.child-tab-btn,
.btn,
.done-btn {
  transition:
    transform var(--motion-premium-med) var(--ease-premium-ui),
    box-shadow var(--motion-premium-med) var(--ease-premium-ui),
    border-color var(--motion-premium-fast) ease,
    background var(--motion-premium-med) ease,
    filter var(--motion-premium-fast) ease !important;
}

.card:hover,
.landing-feature:hover,
.login-option-card:hover,
.child-select-btn:hover,
.buddy-pick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(228, 126, 159, 0.16);
}

.chore-card {
  border-color: rgba(255, 216, 206, 0.45);
}
.chore-card:hover {
  transform: translateY(-2px) scale(1.003) !important;
  border-color: rgba(255, 170, 150, 0.5) !important;
  box-shadow: 0 18px 34px rgba(228, 126, 159, 0.2) !important;
}

.done-btn {
  animation-duration: 2.6s !important;
}
.done-btn:hover {
  transform: translateY(-1px) scale(1.02) !important;
}

.tab-btn.active,
.child-tab-btn.active {
  box-shadow: 0 8px 18px rgba(255, 122, 145, 0.34);
}

.child-hero {
  animation: hero-premium-breathe 6s ease-in-out infinite;
}
@keyframes hero-premium-breathe {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 12px 34px rgba(255, 127, 170, 0.2);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(255, 127, 170, 0.28);
  }
}

#child-tab-content,
#parent-tab-content {
  animation: tab-fade-premium var(--motion-premium-med) ease both;
}
@keyframes tab-fade-premium {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .child-hero,
  #child-tab-content,
  #parent-tab-content {
    animation: none !important;
  }
}

/* ── Mini-Game ────────────────────────────────────────────────── */
.mini-game-icon-wrap {
  font-size: 2.2rem; width: 52px; height: 52px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  animation: mini-game-pulse 2s ease-in-out infinite;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.mini-game-icon-wrap.played {
  background: var(--surface-2); box-shadow: none; animation: none; filter: grayscale(0.5);
}
@keyframes mini-game-pulse {
  0%,100% { transform: scale(1) rotate(0deg); }
  50%     { transform: scale(1.08) rotate(-3deg); }
}

/* Overlay */
.mini-game-overlay {
  position: fixed; inset: 0; z-index: 9995;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.mini-game-overlay.show { opacity: 1; pointer-events: all; }

.mini-game-inner {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px 16px; width: 92%; max-width: 380px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.mini-game-overlay.show .mini-game-inner { transform: scale(1) translateY(0); }

.mini-game-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mini-game-title { font-size: 1.2rem; font-weight: 900; color: var(--text); }
.mini-game-meta { display: flex; align-items: center; gap: 8px; }
.mini-game-moves { font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.mini-game-msg { font-size: 0.82rem; font-weight: 800; color: var(--green);
  animation: mini-msg-pop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes mini-msg-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Card grid */
.mini-game-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 12px;
}
.mg-card {
  aspect-ratio: 1; border-radius: 10px; cursor: pointer;
  perspective: 600px;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.mg-card:active:not(.matched) { transform: scale(0.9); }

.mgc-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
  border-radius: 10px;
}
.mg-card.flipped .mgc-inner,
.mg-card.matched .mgc-inner { transform: rotateY(180deg); }

.mgc-front, .mgc-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
}
.mgc-front {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: rgba(255,255,255,0.7); font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mgc-back {
  background: var(--surface-2); border: 2px solid var(--border);
  transform: rotateY(180deg);
}
.mg-card.matched .mgc-back {
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.06));
  border-color: var(--green);
  animation: matched-bounce 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes matched-bounce {
  0%   { transform: rotateY(180deg) scale(0.8); }
  60%  { transform: rotateY(180deg) scale(1.15); }
  100% { transform: rotateY(180deg) scale(1); }
}
.mini-game-hint { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-align: center; }

/* Win screen */
.mini-game-complete { text-align: center; padding: 32px 20px; }
.mini-game-win-emoji {
  font-size: 4rem; line-height: 1; margin-bottom: 10px;
  animation: win-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes win-bounce {
  from { transform: scale(0) rotate(-10deg); }
  to   { transform: scale(1) rotate(0); }
}
.mini-game-win-grade { font-size: 1.5rem; font-weight: 900; color: var(--text); margin-bottom: 12px; }
.mini-game-win-stats { font-size: 0.9rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; line-height: 1.8; }
.mini-game-xp-reward {
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: xp-reward-pop 0.5s 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes xp-reward-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.mini-game-done-btn { width: 100%; font-size: 1rem; padding: 13px; margin-top: 16px; }
