:root {
  --bg: #eaf6ff;          /* sky */
  --card: #ffffff;
  --ink: #1e2a3a;
  --muted: #7a8aa0;
  --accent: #ff8f3f;      /* warm orange */
  --happy: #34c47c;       /* success green */
  --danger: #ff5d5d;
  --radius: 18px;
  --shadow: 0 4px 14px rgba(30, 42, 58, .10);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }
button { font-family: inherit; cursor: pointer; border: none; border-radius: 12px; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 24px; width: 100%; max-width: 420px; text-align: center; }
.login-card h1 { margin: 0; font-size: 40px; letter-spacing: 4px; color: var(--accent); }
.login-card .sub { color: var(--muted); margin-bottom: 18px; }
.avatar-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.avatar-btn { width: 64px; height: 64px; border-radius: 50%; font-size: 30px;
  background: var(--bg); border: 3px solid transparent; transition: transform .1s; }
.avatar-btn.sel { border-color: var(--accent); transform: scale(1.12); background: #fff3e6; }
.avatar-btn .nm { display: block; font-size: 10px; color: var(--muted); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px auto; max-width: 260px; }
.pinpad button { padding: 16px 0; font-size: 22px; background: var(--bg); border-radius: 14px; }
.pinpad button:active { background: var(--accent); color: #fff; }
.pin-dots { font-size: 26px; letter-spacing: 8px; min-height: 34px; color: var(--accent); }

/* shell */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 5; }
.topbar .logo { font-weight: 800; font-size: 22px; color: var(--accent); letter-spacing: 3px; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.topbar .score { background: #fff3e6; color: var(--accent); font-weight: 800;
  padding: 6px 12px; border-radius: 999px; }
.tabs { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; }
.tab { padding: 10px 14px; border-radius: 999px; background: var(--card); color: var(--muted);
  font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); }
.tab.active { background: var(--accent); color: #fff; }
main { padding: 12px 14px 80px; max-width: 760px; margin: 0 auto; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px; }
.card .title { font-size: 18px; font-weight: 700; }
.card .due { font-size: 13px; color: var(--muted); margin-top: 4px; }
.card .due.overdue { color: var(--danger); font-weight: 700; }
.card .due.due-soon { color: var(--accent); font-weight: 700; }
.card .pts { float: right; background: #e9fbf2; color: var(--happy);
  font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn { padding: 12px 16px; border-radius: 12px; background: var(--bg); font-weight: 700; }
.btn.primary { background: var(--happy); color: #fff; font-size: 16px; }
.badge { font-size: 11px; border: 1px solid var(--muted); color: var(--muted);
  border-radius: 999px; padding: 2px 8px; margin-right: 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 18px; }
.err { color: var(--danger); padding: 10px; }

/* leaderboard */
.lb-row { display: flex; align-items: center; gap: 12px; }
.lb-row .avatar { font-size: 34px; }
.lb-row .bar-wrap { flex: 1; background: var(--bg); border-radius: 999px; height: 22px; }
.lb-row .bar { height: 100%; border-radius: 999px; min-width: 6%;
  transition: width .6s ease; }
.lb-row .pts { font-weight: 800; min-width: 56px; text-align: right; }
.streak { font-size: 13px; color: var(--accent); }

/* grocery */
.g-add { display: flex; gap: 8px; margin-bottom: 12px; }
.g-add input { flex: 1; padding: 14px; font-size: 16px; border: 2px solid #d8e6f5; border-radius: 12px; }
.g-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid #edf3fa; font-size: 17px; }
.g-item.checked .nm { text-decoration: line-through; color: var(--muted); }
.g-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--happy); background: #fff; }
.g-item.checked .g-check { background: var(--happy); color: #fff; }
.g-meta { margin-left: auto; font-size: 12px; color: var(--muted); }

/* calendar */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal-cell { background: var(--card); border-radius: 10px; min-height: 64px; padding: 4px;
  font-size: 11px; box-shadow: var(--shadow); }
.cal-cell.other { opacity: .4; }
.cal-cell.today { outline: 3px solid var(--accent); }
.cal-cell .dnum { font-weight: 700; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 1px; }
.cal-day-detail { margin-top: 12px; }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-tile { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-tile .meta { padding: 6px 8px; font-size: 12px; }

/* confetti */
.confetti-bit { position: fixed; width: 10px; height: 10px; z-index: 99; pointer-events: none;
  animation: cfall 1.1s ease-in forwards; }
@keyframes cfall { to { transform: translateY(110vh) rotate(540deg); opacity: 0; } }

/* composer */
.composer { margin-bottom: 12px; }
.composer .form { display: grid; gap: 8px; margin-top: 10px; }
.composer input, .composer select { padding: 12px; font-size: 15px; border: 2px solid #d8e6f5; border-radius: 12px; }
