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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #2d2d2d;
}

/* ===== SCREEN SYSTEM ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ===== WELCOME ===== */
.welcome-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 40px;
  gap: 24px;
}

.logo-area {
  text-align: center;
  color: white;
}

.ellora-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  margin-bottom: 10px;
}

.logo-area h1 {
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tagline {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-top: 6px;
}

.brand-tag {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 10px;
  background: rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: 20px;
  display: inline-block;
}

.brand { font-weight: 800; color: #ffe066; }

/* ===== CARD ===== */
.card {
  background: white;
  border-radius: 24px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #333;
}

.hint {
  font-size: 0.88rem;
  color: #888;
  margin-bottom: 16px;
}

/* ===== INPUTS ===== */
.big-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  margin-bottom: 14px;
  outline: none;
  transition: border 0.2s;
}

.big-input:focus { border-color: #764ba2; }

/* ===== BUTTONS ===== */
.btn-main {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(118,75,162,0.35);
}

.btn-main:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(118,75,162,0.45); }
.btn-main:active { transform: scale(0.97); }

.btn-no {
  width: 100%;
  padding: 14px;
  background: white;
  color: #888;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-no:hover { border-color: #764ba2; color: #764ba2; }

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-btn {
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
}

.top-title {
  color: white;
  font-weight: 800;
  font-size: 1rem;
  flex: 1;
  text-align: center;
}

.edit-fam-btn {
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
}

/* ===== PAGE WRAP ===== */
.page-wrap {
  padding: 24px 20px 40px;
  max-width: 480px;
  margin: 0 auto;
}

.section-title {
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ===== SETUP: ADD MEMBER ===== */
.add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.member-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  outline: none;
}

.member-input:focus { border-color: #764ba2; }

.btn-add {
  padding: 12px 20px;
  background: #764ba2;
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  min-height: 10px;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
}

.chip-remove {
  background: rgba(255,255,255,0.3);
  border: none;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* ===== FAMILY GRID ===== */
.family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.family-card {
  background: white;
  border: none;
  border-radius: 22px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: 'Nunito', sans-serif;
}

.family-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,0.2); }
.family-card:active { transform: scale(0.96); }

.family-card .fam-emoji { font-size: 2.4rem; margin-bottom: 8px; }
.family-card .fam-name { font-size: 1.1rem; font-weight: 800; color: #333; }

/* ===== TRACKER GRID ===== */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tracker-card {
  background: white;
  border: none;
  border-radius: 22px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.15s;
  font-family: 'Nunito', sans-serif;
}

.tracker-card:hover { transform: translateY(-4px); }
.tracker-card:active { transform: scale(0.96); }

.tc-icon { font-size: 2.2rem; margin-bottom: 8px; }
.tc-title { font-size: 1rem; font-weight: 800; color: #333; margin-bottom: 4px; }
.tc-desc { font-size: 0.78rem; color: #888; }

.school-card { border-top: 5px solid #4caf50; }
.money-card  { border-top: 5px solid #ff9800; }
.screen-card { border-top: 5px solid #9c27b0; }
.study-card  { border-top: 5px solid #2196f3; }
.work-card   { border-top: 5px solid #00897b; }
.work-box    { background: linear-gradient(135deg, #00897b, #4db6ac); }
.chores-card  { border-top: 5px solid #f06292; }
.chores-box   { background: linear-gradient(135deg, #f06292, #f48fb1); }
.classes-card { border-top: 5px solid #ff7043; }
.classes-box  { background: linear-gradient(135deg, #ff7043, #ffab91); }
.books-card   { border-top: 5px solid #5c6bc0; }
.books-box    { background: linear-gradient(135deg, #5c6bc0, #9fa8da); }

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.stat-box {
  border-radius: 20px;
  padding: 20px 14px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-num { font-size: 2rem; font-weight: 900; color: white; }
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.9); font-weight: 700; margin-top: 4px; }

.green-box  { background: linear-gradient(135deg, #56ab2f, #a8e063); }
.red-box    { background: linear-gradient(135deg, #f44336, #ff8a65); }
.purple-box { background: linear-gradient(135deg, #9c27b0, #ce93d8); }
.blue-box   { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.orange-box { background: linear-gradient(135deg, #e65100, #ff9800); }
.yellow-box { background: linear-gradient(135deg, #f9a825, #ffe082); }

/* ===== ACTION BUTTONS ===== */
.action-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.big-action-btn {
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: 18px;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}

.big-action-btn:hover { transform: translateY(-2px); }
.big-action-btn:active { transform: scale(0.97); }

.green-btn { background: linear-gradient(135deg, #56ab2f, #a8e063); color: white; }
.red-btn   { background: linear-gradient(135deg, #f44336, #ff8a65); color: white; }

/* ===== ENTRY CARD ===== */
.entry-card {
  background: white;
  border-radius: 20px;
  padding: 22px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.entry-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #333;
}

/* ===== TOGGLE (spent/saved) ===== */
.toggle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.active-toggle {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

/* ===== LOG BOX ===== */
.log-box {
  background: white;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 20px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.log-empty {
  text-align: center;
  color: #bbb;
  font-size: 0.9rem;
  padding: 20px 0;
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.log-item:last-child { border-bottom: none; }
.log-item .log-label { font-weight: 700; color: #444; }
.log-item .log-date  { font-size: 0.78rem; color: #aaa; }
.log-item .log-val   { font-weight: 800; }
.log-val.positive    { color: #4caf50; }
.log-val.negative    { color: #f44336; }
.log-val.neutral     { color: #764ba2; }

.cancel-entry-btn {
  width: 100%;
  padding: 14px;
  background: white;
  color: #f44336;
  border: 2px solid #f44336;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.15s;
}
.cancel-entry-btn:hover { background: #f44336; color: white; }

/* ===== SAVE HEART ===== */
.save-heart-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #ff6b8a, #ff8e53);
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 1.2rem;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255,107,138,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.save-heart-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(255,107,138,0.5); }
.save-heart-btn:active { transform: scale(0.96); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333;
  color: white;
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== DATE PICKER ROW ===== */
.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.date-label {
  font-weight: 800;
  color: #888;
  font-size: 0.9rem;
  white-space: nowrap;
}
.date-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #444;
  background: #f9f9f9;
}
.date-input:focus {
  border-color: #667eea;
  outline: none;
  background: white;
}

/* ===== NAUGHTY CARD ===== */
.naughty-card { background: linear-gradient(135deg, #1a1a2e, #e94560) !important; }
.naughty-box  { background: linear-gradient(135deg, #e94560, #1a1a2e) !important; color: white; }
.naughty-btn  { background: linear-gradient(135deg, #e94560, #1a1a2e) !important; }

/* ===== ACHIEVEMENT POPUP ===== */
.achievement-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  background: rgba(0,0,0,0.4);
}
.achievement-popup.show {
  opacity: 1;
  pointer-events: auto;
}
.achievement-inner {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  border-radius: 28px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 12px 50px rgba(0,0,0,0.4);
  transform: scale(0.7);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 300px;
}
.achievement-popup.show .achievement-inner {
  transform: scale(1);
}
.achievement-stars {
  font-size: 2rem;
  margin-bottom: 14px;
}
.achievement-msg {
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  line-height: 1.3;
}

/* ===== EMOJI COLORS PER PERSON ===== */
.color-0 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.color-1 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.color-2 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.color-3 { background: linear-gradient(135deg, #fa709a, #fee140); }
.color-4 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.color-5 { background: linear-gradient(135deg, #fccb90, #d57eeb); }

/* ✨ Cute bouncy buttons */
button {
    border-radius: 16px;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
button:hover {
    transform: scale(1.07) !important;
}
button:active {
    transform: scale(0.93) !important;
}
/* bouncy-buttons */
