:root {
  --marcus: #E85D26;
  --jenny: #7B2D8E;
  --cody: #1A7A4C;
  --harper: #D4A017;
  --nana: #C7254E;
  --accent-red: #FF6B6B;
  --accent-teal: #4ECDC4;
  --primary-dark: #2D1B4E;
  --primary-mid: #4A2266;
  --gold: #D4A017;
  --green: #1A7A4C;
  --orange: #E85D26;
  --white: #fff;
  --bg-subtle: #fafafa;
  --border: #eee;
  --text-light: #999;
  --text-muted: #888;
  --text-faint: #aaa;
  --text-dark: #2D1B4E;
  --bg-gradient: linear-gradient(160deg, #FFF8F0 0%, #F0E6FF 50%, #E6FFF0 100%);
  --header-gradient: linear-gradient(135deg, #2D1B4E 0%, #4A2266 100%);
  --add-gradient: linear-gradient(135deg, #E85D26, #D4A017);
  --font-display: 'Lilita One', cursive;
  --font-body: 'Nunito', sans-serif;
}

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

* { box-sizing: border-box; margin: 0; padding: 0; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.app-container {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg-gradient);
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
}
.confetti-piece {
  position: absolute;
  animation: confettiFall ease-out forwards;
}
.confetti-circle { border-radius: 50%; }
.confetti-square { border-radius: 2px; }

/* Header */
.header {
  padding: 24px 20px 16px;
  text-align: center;
  background: var(--header-gradient);
  border-radius: 0 0 28px 28px;
  box-shadow: 0 8px 30px rgba(45, 27, 78, 0.3);
  position: relative;
  overflow: hidden;
}
.header-circle-right {
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}
.header-circle-left {
  position: absolute;
  bottom: -20px; left: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}
.header-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--white);
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.header-subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  margin: 4px 0 0;
  font-weight: 600;
}

/* Leaderboard */
.leaderboard-wrapper { padding: 16px 16px 0; }
.leaderboard-card {
  background: var(--white);
  border-radius: 20px;
  padding: 16px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.leaderboard-title {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text-dark);
  margin: 0;
}
.leader-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  background: #FFF9E6;
  padding: 3px 10px;
  border-radius: 20px;
}
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease-out both;
}
.avatar-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.avatar-btn-selected {
  border-width: 3px;
  border-style: solid;
}
.score-bar-container { flex: 1; min-width: 0; }
.score-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.score-name { font-size: 13px; font-weight: 700; }
.score-points { font-size: 12px; font-weight: 800; color: var(--gold); }
.score-bar-track {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Controls */
.controls-bar {
  padding: 14px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.view-toggle {
  display: flex;
  background: var(--white);
  border-radius: 14px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.view-btn {
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #666;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.view-btn-active {
  background: var(--primary-dark);
  color: var(--white);
}
.add-btn {
  padding: 10px 18px;
  border-radius: 14px;
  border: none;
  background: var(--add-gradient);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232, 93, 38, 0.35);
  transition: all 0.2s;
}
.filter-bar { padding: 0 16px 8px; }
.filter-chip {
  padding: 5px 14px;
  border-radius: 20px;
  border: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Board View */
.chore-list {
  padding: 4px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chore-card {
  background: var(--white);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s;
  border-left: 4px solid;
  animation: slideUp 0.3s ease-out both;
}
.chore-card-done {
  box-shadow: none;
  opacity: 0.6;
}
.chore-card-bounce {
  animation: bounce 0.4s ease !important;
}
.check-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2.5px solid;
  color: var(--white);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}
.check-btn-done {
  border: none;
}
.chore-info { flex: 1; min-width: 0; }
.chore-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}
.chore-name-done {
  color: var(--text-faint);
  text-decoration: line-through;
}
.chore-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
  font-weight: 600;
}
.chore-points { color: var(--gold); }
.delete-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.delete-btn:hover { color: #e74c3c; }

/* Week View */
.week-view { padding: 4px 16px 100px; }
.week-day-group { margin-bottom: 16px; }
.week-day-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.week-day-complete {
  font-size: 12px;
  color: var(--green);
  font-family: var(--font-body);
  font-weight: 800;
}
.week-day-chores {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.week-chore-item {
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid;
}
.week-chore-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.25s;
}
.week-chore-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}
.week-chore-name-done {
  color: var(--text-faint);
  text-decoration: line-through;
}
.week-chore-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  width: 92%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-dark);
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
}
.modal-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.chore-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.chore-template-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg-subtle);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.15s;
}
.chore-template-btn-active {
  border-color: var(--jenny);
  background: #F5EAFA;
}
.template-points { color: var(--gold); font-weight: 700; }
.assignee-list {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.assignee-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg-subtle);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.15s;
}
.assignee-btn-active { border-width: 2px; border-style: solid; }
.day-list {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.day-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg-subtle);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.day-btn-active {
  border-color: var(--green);
  background: #E6F7EF;
}
.modal-submit {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #ddd;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.5;
}
.modal-submit-active {
  background: var(--add-gradient);
  opacity: 1;
}

/* Stats Footer */
.stats-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 20px;
  background: linear-gradient(0deg, var(--white) 80%, transparent);
  display: flex;
  justify-content: center;
  gap: 24px;
}
.stat-item { text-align: center; }
.stat-value {
  font-size: 20px;
  font-family: var(--font-display);
}
.stat-value-green { color: var(--green); }
.stat-value-gold { color: var(--gold); }
.stat-value-orange { color: var(--orange); }
.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-divider {
  width: 1px;
  background: var(--border);
}