:root {
  --bg: #0f2038;
  --bg2: #16305a;
  --card: #ffffff;
  --ink: #16233a;
  --muted: #6b7c99;
  --accent: #ff6b9d;
  --accent2: #5b8def;
  --gold: #ffb400;
  --green: #22c07a;
  --star: #ffcf3f;
  --token: #a566ff;
  --radius: 22px;
  --shadow: 0 8px 24px rgba(0,0,0,.18);
  font-family: -apple-system, "SF Pro Rounded", "Baloo 2", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, var(--bg2), var(--bg));
  color: var(--ink);
  min-height: 100%;
  overscroll-behavior: none;
  user-select: none;
}
#app { max-width: 1100px; margin: 0 auto; padding: 18px 18px 60px; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 12px; color: #fff; padding: 6px 4px 16px; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.topbar .who .av { font-size: 30px; }
.topbar .spacer { flex: 1; }
.pill-btn {
  background: rgba(255,255,255,.14); color: #fff; border: none; border-radius: 999px;
  padding: 10px 16px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.pill-btn:active { transform: scale(.96); }

/* ── Profile picker ──────────────────────────────────────── */
.picker { text-align: center; color: #fff; padding-top: 6vh; }
.picker h1 { font-size: 30px; margin: 0 0 4px; }
.picker p { color: #b9c6de; margin: 0 0 30px; }
.profiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 560px; margin: 0 auto; }
.profile-card {
  background: var(--card); border: none; border-radius: var(--radius); padding: 26px 18px;
  cursor: pointer; box-shadow: var(--shadow); transition: transform .1s;
}
.profile-card:active { transform: translateY(2px) scale(.98); }
.profile-card .av { font-size: 62px; line-height: 1; }
.profile-card .nm { font-weight: 800; font-size: 22px; margin-top: 8px; color: var(--ink); }
.profile-card .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.profile-card.parent { background: linear-gradient(160deg,#fff, #eef3ff); }

/* ── Balance header (kid) ────────────────────────────────── */
.balances { display: flex; gap: 10px; margin-bottom: 16px; }
.bal {
  flex: 1; background: var(--card); border-radius: var(--radius); padding: 14px 8px;
  text-align: center; box-shadow: var(--shadow);
}
.bal .ic { font-size: 26px; }
.bal .v { font-size: 24px; font-weight: 900; margin-top: 2px; }
.bal .lb { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bal.coins .v { color: var(--gold); }
.bal.stars .v { color: #e0a800; }
.bal.tokens .v { color: var(--token); }

/* ── Ninja belt banner ───────────────────────────────────── */
.belt-card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.belt-badge { flex: 0 0 auto; line-height: 0; }
.belt-info { flex: 1; min-width: 0; }
.belt-name { font-weight: 900; font-size: 18px; color: var(--ink); }
.belt-name .belt-stars { font-size: 13px; color: #b58900; margin-left: 6px; font-weight: 800; }
.belt-bar { height: 12px; background: #eef1f6; border-radius: 999px; overflow: hidden; margin: 6px 0 5px; }
.belt-bar > i { display: block; height: 100%; border-radius: 999px; }
.belt-next { font-size: 13px; color: var(--muted); font-weight: 700; }

/* ── Today header + "coming up" ──────────────────────────── */
.today-head { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 20px; font-weight: 800; margin: 18px 4px 10px; }
.today-head span { flex: 1; }
.today-head b { color: var(--star); }
.later-list { display: flex; flex-direction: column; gap: 8px; }
.later-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 10px 14px; color: #dce6f7; }
.later-item .le-em { font-size: 24px; }
.later-item .le-t { flex: 1; font-weight: 700; }
.later-item .le-d { font-size: 12px; font-weight: 800; color: var(--star); background: rgba(255,207,63,.14); padding: 3px 8px; border-radius: 999px; }

/* ── Day-of-week picker (chore form) ─────────────────────── */
.day-row { display: flex; gap: 6px; }
.day-btn { flex: 1; padding: 10px 0; border: 2px solid #e4e9f2; background: #fff; border-radius: 10px; font-weight: 800; font-size: 15px; color: var(--muted); cursor: pointer; }
.day-btn.on { background: var(--accent2); border-color: var(--accent2); color: #fff; }

/* ── Section titles ──────────────────────────────────────── */
.section-title { color: #dce6f7; font-weight: 800; font-size: 16px; margin: 20px 4px 10px; display: flex; align-items: center; gap: 8px; }

/* ── Activity cards (kid) ────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.acard {
  background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
}
.acard .art { text-align: center; line-height: 1; margin: 4px 0 2px; }
.acard .art svg { width: 88px; height: 88px; display: block; margin: 0 auto; }
.acard .art .art-emoji { font-size: 54px; }
.acard .title { font-weight: 800; font-size: 17px; text-align: center; color: var(--ink); min-height: 42px; display: flex; align-items: center; justify-content: center; }
.acard .rewards { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 4px 9px; }
.chip.coins { background: #fff6e0; color: #b47b00; }
.chip.stars { background: #fff3d1; color: #b58900; }
.chip.tokens { background: #f0e6ff; color: #7a3fd0; }
.acard .row { display: flex; gap: 8px; }
.btn {
  border: none; border-radius: 14px; padding: 12px; font-size: 16px; font-weight: 800;
  cursor: pointer; flex: 1; color: #fff;
}
.btn:active { transform: scale(.97); }
.btn.done { background: var(--green); }
.btn.hear { background: #eaf0fb; color: var(--accent2); flex: 0 0 52px; font-size: 20px; }
.acard.pending { outline: 3px solid var(--gold); }
.acard .status { text-align: center; font-weight: 800; font-size: 14px; color: var(--gold); }
.acard .status.approved { color: var(--green); }

/* reading tracker */
.acard.count .progress { height: 12px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.acard.count .progress > i { display: block; height: 100%; background: linear-gradient(90deg,var(--accent2),var(--accent)); }
.acard.count .ptext { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.acard.count .ptext.goal { color: var(--green); }

/* category tint on the top strip */
.acard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; }
.acard.chore::before { background: var(--accent2); }
.acard.reading::before { background: var(--accent); }
.acard.helping::before { background: var(--green); }
.acard.kindness::before { background: var(--gold); }
.acard.bonus::before { background: var(--token); }

/* ── Spin wheel ──────────────────────────────────────────── */
.wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wheel-stage { position: relative; width: 260px; height: 260px; }
.wheel {
  width: 260px; height: 260px; border-radius: 50%; border: 8px solid #fff;
  box-shadow: var(--shadow); transition: transform 4s cubic-bezier(.17,.67,.2,1);
}
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); font-size: 34px; z-index: 2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.spin-btn { background: var(--token); color: #fff; font-size: 20px; font-weight: 900; padding: 14px 34px; border: none; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; }
.spin-btn:disabled { background: #97a6c0; }
.spin-result { color: #fff; font-weight: 800; font-size: 20px; text-align: center; min-height: 28px; }

/* ── Generic modal / sheet ───────────────────────────────── */
.sheet-bg { position: fixed; inset: 0; background: rgba(6,12,24,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.sheet h2 { margin: 0 0 14px; font-size: 22px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 12px; border: 2px solid #e4e9f2; border-radius: 12px; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.primary { background: var(--accent2); color: #fff; border: none; border-radius: 14px; padding: 15px; font-size: 17px; font-weight: 800; width: 100%; cursor: pointer; }
.ghost { background: #eef1f6; color: var(--ink); border: none; border-radius: 14px; padding: 13px; font-weight: 800; width: 100%; cursor: pointer; margin-top: 8px; }

/* PIN pad */
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 10px auto; }
.pinpad button { font-size: 26px; font-weight: 800; padding: 18px; border-radius: 16px; border: none; background: #fff; box-shadow: var(--shadow); cursor: pointer; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 16px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.25); }
.pin-dots i.on { background: #fff; }

/* ── Parent view ─────────────────────────────────────────── */
.parent-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.parent-tabs button { flex: 1; background: rgba(255,255,255,.12); color: #fff; border: none; padding: 12px; border-radius: 14px; font-weight: 800; cursor: pointer; }
.parent-tabs button.on { background: #fff; color: var(--ink); }
.list-card { background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.list-card .em { font-size: 30px; }
.list-card .grow { flex: 1; }
.list-card .t { font-weight: 800; }
.list-card .s { color: var(--muted); font-size: 13px; }
.mini { border: none; border-radius: 10px; padding: 9px 13px; font-weight: 800; cursor: pointer; font-size: 14px; }
.mini.ok { background: var(--green); color: #fff; }
.mini.no { background: #ffe1e6; color: #d33; }
.mini.gr { background: #eef1f6; color: var(--ink); }
.kid-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.kid-summary .k { flex: 1; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.kid-summary .k .nm { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.kid-summary .k .b { font-size: 13px; color: var(--muted); margin-top: 4px; }
.empty { color: #b9c6de; text-align: center; padding: 30px; font-weight: 700; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 8px; margin-left: 4px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #16233a; color: #fff; padding: 14px 22px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); z-index: 80; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 60% { transform: scale(1.1) } 100% { transform: scale(1); opacity: 1 } }
.pop { animation: pop .35s ease; }
