/* ==========================================================================
   Mission Board — design system
   ========================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --ink: #1f2440;
  --ink-soft: #5b617d;
  --ink-faint: #9aa0bd;
  --line: #e7e9f5;
  --primary: #6c8cff;
  --primary-dark: #4d6ef0;
  --primary-soft: #eef1ff;
  --success: #2fb886;
  --success-soft: #e4f7ef;
  --warn: #f5a524;
  --danger: #ef4d6b;
  --danger-soft: #fdeaee;
  --star: #ffc23c;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 6px 24px rgba(31, 36, 64, 0.08);
  --shadow-sm: 0 2px 8px rgba(31, 36, 64, 0.06);
  --shadow-lg: 0 18px 48px rgba(31, 36, 64, 0.18);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--primary-dark); }
button { font-family: inherit; }
img { max-width: 100%; }

/* --- Boot spinner -------------------------------------------------------- */
.boot { height: 100vh; display: grid; place-content: center; gap: 18px; justify-items: center; }
.boot__logo { font-size: 54px; animation: bob 1.4s ease-in-out infinite; }
.boot__spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-8px);} }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--ink); transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--icon { padding: 8px; width: 36px; height: 36px; border-radius: 9px; }

/* --- Forms --------------------------------------------------------------- */
.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 15px; background: var(--surface);
  color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.error-text { color: var(--danger); font-size: 14px; margin: 8px 0; }

/* --- Auth screen --------------------------------------------------------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #dfe6ff 0%, transparent 60%),
              radial-gradient(1000px 500px at 100% 0%, #ffe9f1 0%, transparent 55%), var(--bg);
}
.auth__card {
  width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 30px;
}
.auth__brand { text-align: center; margin-bottom: 22px; }
.auth__brand .logo { font-size: 44px; }
.auth__brand h1 { font-size: 26px; margin-top: 6px; }
.auth__brand p { color: var(--ink-soft); margin: 4px 0 0; }
.tabs { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tabs button {
  flex: 1; border: none; background: transparent; padding: 9px; border-radius: 9px;
  font-weight: 600; color: var(--ink-soft); cursor: pointer; font-size: 14px;
}
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth__mode { margin-bottom: 20px; font-weight: 700; font-size: 15px; text-align: center; text-align-last: center; cursor: pointer; }

/* --- App shell ----------------------------------------------------------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
}
.topbar__brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topbar__spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 14px; flex-wrap: wrap; }
.crumbs a { cursor: pointer; text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--primary-dark); }
.crumbs .sep { color: var(--ink-faint); }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }

/* --- Cards --------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; border: 1px solid var(--line); }
.card--pad-lg { padding: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.section-title h2 { font-size: 19px; }
.grid { display: grid; gap: 16px; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* --- Stat tiles ---------------------------------------------------------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 700; }
.stat__value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat__sub { font-size: 13px; color: var(--ink-soft); }

/* --- Child cards (dashboard) -------------------------------------------- */
.child-card { display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.child-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.child-card__head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; color: #fff; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 84px; height: 84px; font-size: 44px; border-radius: 22px; }
.avatar--xl { width: 120px; height: 120px; font-size: 64px; border-radius: 30px; }
.child-card__name { font-weight: 700; font-size: 17px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.pill--star { background: #fff6de; color: #b8860b; }
.pill--streak { background: #ffe9e0; color: #d1622a; }
.pill--code { background: var(--primary-soft); color: var(--primary-dark); font-family: ui-monospace, monospace; letter-spacing: 1px; }

/* --- Progress ------------------------------------------------------------ */
.progress { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--primary), #8aa4ff); border-radius: 999px; transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.progress__bar--done { background: linear-gradient(90deg, var(--success), #57d3a5); }
.progress-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }

.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%;
  background: conic-gradient(var(--success) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center; transition: --p 0.6s; }
.ring__inner { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring__pct { font-size: 30px; font-weight: 800; }
.ring__cap { font-size: 12px; color: var(--ink-soft); }

/* --- Tabs (child detail) ------------------------------------------------- */
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; overflow-x: auto; }
.subtabs button { border: none; background: none; padding: 12px 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs button.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* --- Task list (parent) -------------------------------------------------- */
.tasklist { display: flex; flex-direction: column; gap: 10px; }
.task {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.task--done { background: var(--success-soft); border-color: #cdeede; }
.task--skipped { opacity: 0.55; }
.task__icon { font-size: 22px; width: 30px; text-align: center; flex: none; }
.task__body { flex: 1; min-width: 0; }
.task__title { font-weight: 600; }
.task__meta { font-size: 12px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.task__meta .dot { color: var(--ink-faint); }
.task__actions { display: flex; gap: 6px; flex: none; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-soft); }
.tag--opt { background: #fff4de; color: #a9760b; }
.tag--manual { background: var(--primary-soft); color: var(--primary-dark); }
.tag--activity { background: #ede7ff; color: #6b3fd4; }
.tag--late { background: var(--danger-soft); color: var(--danger); }

/* --- Plan bar ------------------------------------------------------------ */
.plan-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.plan-bar__main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.plan-bar__label { font-weight: 700; font-size: 14px; }
.plan-bar__select { max-width: 320px; }
.plan-bar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-status { font-size: 12px; font-weight: 700; color: var(--ink-faint); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; }
.plan-status--active { color: var(--success); background: var(--success-soft); }

/* --- Weekly planner ------------------------------------------------------ */
.planner { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.day-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 150px; display: flex; flex-direction: column; }
.day-col__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; gap: 6px; }
.day-col__headtext { min-width: 0; }
.day-col__name { font-weight: 700; font-size: 14px; }
.day-col__total { display: block; font-size: 11px; font-weight: 700; color: var(--ink-faint); margin-top: 2px; }
.day-col__total:empty { display: none; }
.day-col__items { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 30px; }
.mini-task { background: var(--surface-2); border-radius: 9px; padding: 8px 10px; font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.mini-task__title { flex: 1; font-weight: 600; }
.mini-task__time { display: block; font-size: 11px; font-weight: 700; color: #6b3fd4; margin-top: 2px; }
.mini-task__x { cursor: pointer; color: var(--ink-faint); font-weight: 700; }
.mini-task__x:hover { color: var(--danger); }
.mini-task--activity { background: #f3f0ff; border-left: 3px solid #9b7dff; }
.day-add { margin-top: 8px; border: 1px dashed var(--line); background: transparent; color: var(--ink-soft); border-radius: 9px; padding: 7px; cursor: pointer; font-size: 13px; font-weight: 600; }
.day-add:hover { border-color: var(--primary); color: var(--primary-dark); }
.day-add--activity { margin-top: 6px; color: #6b3fd4; }
.day-add--activity:hover { border-color: #9b7dff; color: #6b3fd4; }

/* --- Date nav ------------------------------------------------------------ */
.datenav { display: flex; align-items: center; gap: 12px; }
.datenav__label { font-weight: 700; font-size: 17px; }

/* --- Reports ------------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bar__fill { width: 100%; max-width: 42px; background: linear-gradient(180deg, #8aa4ff, var(--primary)); border-radius: 8px 8px 4px 4px; min-height: 3px; transition: height 0.5s; }
.bar__fill--today { background: linear-gradient(180deg, #57d3a5, var(--success)); }
.bar__label { font-size: 11px; color: var(--ink-soft); }
.bar__val { font-size: 11px; font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.rate-badge { font-weight: 700; }
.list-clean { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-clean li { display: flex; justify-content: space-between; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }

/* --- Empty states -------------------------------------------------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty__emoji { font-size: 44px; }
.empty h3 { margin: 10px 0 4px; color: var(--ink); }

/* --- Modal --------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(24,28,52,0.5); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade 0.15s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; padding: 24px; max-height: 90vh; overflow-y: auto; animation: pop 0.18s ease; }
.modal h3 { font-size: 20px; margin-bottom: 16px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } }

/* Repeat-on day picker */
.daypick__chips { display: flex; gap: 6px; }
.daypick__chip { flex: 1; min-width: 0; padding: 9px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-soft); font-weight: 700; font-size: 13px; cursor: pointer; }
.daypick__chip.sel { background: var(--primary); border-color: var(--primary); color: #fff; }
.daypick__presets { display: flex; gap: 8px; margin-top: 8px; }
.daypick__preset { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.daypick__preset:hover { border-color: var(--primary); color: var(--primary-dark); }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.icon-grid button { font-size: 22px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.icon-grid button.sel { border-color: var(--primary); background: var(--primary-soft); }
.color-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.color-dot.sel { border-color: var(--ink); }

/* --- Toast --------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: all 0.25s ease; z-index: 200; max-width: 90vw;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }

/* ==========================================================================
   KID VIEW — big, playful, joyful
   ========================================================================== */
.kid {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% -10%, var(--kid-tint, #dfe6ff) 0%, transparent 60%), var(--bg);
  padding-bottom: 60px;
}
.kid__top { display: flex; align-items: center; gap: 16px; padding: 20px; max-width: 720px; margin: 0 auto; }
.kid__hi { flex: 1; }
.kid__hi h1 { font-size: 28px; }
.kid__hi p { color: var(--ink-soft); margin: 2px 0 0; }
.kid__scores { display: flex; gap: 10px; }
.score-chip { display: flex; flex-direction: column; align-items: center; background: var(--surface); border-radius: 16px; padding: 8px 14px; box-shadow: var(--shadow-sm); min-width: 62px; }
.score-chip .big { font-size: 22px; font-weight: 800; }
.score-chip .cap { font-size: 11px; color: var(--ink-soft); font-weight: 700; }

.kid__wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.kid-progress { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.kid-progress__text { flex: 1; }
.kid-progress__text h2 { font-size: 20px; }
.kid-progress__text p { color: var(--ink-soft); margin: 4px 0 0; }

/* Week navigator */
.kid-weeklabel { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.kid-thisweek { border: none; background: var(--surface); color: var(--primary-dark); font-weight: 700; border-radius: 999px; padding: 5px 12px; cursor: pointer; box-shadow: var(--shadow-sm); font-size: 13px; }
.kid-weeknav { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.kid-weekarrow { flex: none; width: 40px; height: 56px; border-radius: 14px; border: none; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 22px; font-weight: 800; color: var(--ink-soft); cursor: pointer; }
.kid-weekarrow:hover { color: var(--primary-dark); }
.kid-weekarrow--off, .kid-weekarrow:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.kid-weekarrow--off:hover, .kid-weekarrow:disabled:hover { color: var(--ink-soft); }
.kid-daystrip { display: flex; gap: 6px; flex: 1; }
.kid-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 2px solid transparent; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; }
.kid-day__dow { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; }
.kid-day__num { font-size: 18px; font-weight: 800; color: var(--ink); }
.kid-day__dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; font-weight: 800; background: transparent; }
.kid-day__dot--done { background: var(--success); }
.kid-day__dot--missed { background: #f3b4c0; }
.kid-day__dot--today { background: var(--primary); }
.kid-day__dot--future { background: var(--line); }
.kid-day--selected { border-color: var(--primary); }
.kid-day--today .kid-day__num { color: var(--primary-dark); }

.kid-tasks { display: flex; flex-direction: column; gap: 14px; }
.kid-task--readonly { cursor: default; }
.kid-task--readonly:hover { transform: none; box-shadow: var(--shadow-sm); }
.kid-task--future { opacity: 0.72; }
.kid-task__missed { font-size: 12px; font-weight: 700; color: var(--danger); background: var(--danger-soft); padding: 2px 8px; border-radius: 8px; }
.kid-task {
  display: flex; align-items: center; gap: 16px; background: var(--surface);
  border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow-sm);
  cursor: pointer; border: 2px solid transparent; transition: transform 0.12s, box-shadow 0.12s, background 0.2s;
  user-select: none;
}
.kid-task:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kid-task:active { transform: scale(0.99); }
.kid-task--done { background: var(--success-soft); border-color: #a9e6cd; }
.kid-check {
  width: 42px; height: 42px; border-radius: 14px; border: 3px solid var(--line);
  display: grid; place-items: center; font-size: 24px; color: #fff; flex: none; transition: all 0.2s;
}
.kid-task--done .kid-check { background: var(--success); border-color: var(--success); animation: pop 0.25s ease; }
.kid-task__emoji { font-size: 34px; flex: none; }
.kid-task__title { font-size: 20px; font-weight: 700; flex: 1; }
.kid-task--done .kid-task__title { text-decoration: line-through; color: var(--ink-soft); }
.kid-task__est { font-size: 13px; color: var(--ink-faint); font-weight: 700; }
.kid-task__time { font-size: 13px; color: #6b3fd4; font-weight: 800; white-space: nowrap; }
.kid-task__opt { font-size: 12px; font-weight: 700; color: #a9760b; background: #fff4de; padding: 2px 8px; border-radius: 8px; }
.kid-task--activity { border-left: 6px solid #9b7dff; }
.kid-task__cam { font-size: 16px; flex: none; }
/* Completed tasks are locked for kids (only a parent can reopen). */
.kid-task--done { cursor: default; }
.kid-task--done:hover { transform: none; box-shadow: var(--shadow-sm); }
.kid-task--done:active { transform: none; }

/* --- Photo evidence: kid capture modal ---------------------------------- */
.kid-modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 24px; text-align: center; max-height: 92vh; overflow-y: auto;
  animation: pop 0.18s ease;
}
.kid-modal__emoji { font-size: 52px; line-height: 1; }
.kid-modal h2 { font-size: 24px; margin: 6px 0 4px; }
.kid-modal .input { margin-top: 12px; text-align: left; }
.kid-modal__actions { display: flex; gap: 10px; margin-top: 16px; }
.ev-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ev-tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); padding: 0; }
.ev-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-tile__x {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none;
  background: rgba(24,28,52,0.65); color: #fff; font-size: 16px; font-weight: 800; line-height: 1; cursor: pointer;
}
.ev-tile--add {
  border: 2px dashed var(--line); background: var(--surface-2); cursor: pointer; color: var(--ink-soft);
  display: grid; place-items: center; gap: 4px; font-weight: 700;
}
.ev-tile--add:hover { border-color: var(--primary); color: var(--primary-dark); }
.ev-tile__plus { font-size: 30px; line-height: 1; }
.ev-tile__lbl { font-size: 12px; }

/* --- Photo evidence: parent thumbnail + lightbox ------------------------ */
.evthumb {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 10px 4px 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; max-width: 100%;
}
.evthumb:hover { border-color: var(--primary); }
.evthumb__imgwrap { position: relative; flex: none; width: 34px; height: 34px; }
.evthumb__img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--line); display: block; }
.evthumb__count { position: absolute; bottom: -3px; right: -5px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 999px; border: 2px solid var(--surface); }
.evthumb__cam { font-size: 13px; flex: none; }
.evthumb__note, .evthumb__label { font-size: 13px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evthumb__label { color: var(--ink-faint); }
.ev-lightbox__img { width: 100%; max-height: 55vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); margin-top: 8px; }
.ev-lightbox__strip { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ev-lightbox__thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--surface-2); }
.ev-lightbox__thumb.sel { border-color: var(--primary); }
.ev-lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-lightbox__note { margin: 12px 0 0; font-size: 15px; }

.kid-done-banner {
  text-align: center; padding: 30px; background: linear-gradient(135deg, #fff, var(--success-soft));
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-top: 18px; animation: pop 0.3s ease;
}
.kid-done-banner .big-emoji { font-size: 68px; animation: bob 1.6s ease-in-out infinite; }
.kid-done-banner h2 { font-size: 26px; margin: 8px 0 4px; }
.kid-logout { text-align: center; margin-top: 30px; }

.stars-row { display: flex; gap: 4px; justify-content: center; font-size: 22px; margin-top: 8px; }
.stars-row .star-on { color: var(--star); }
.stars-row .star-off { color: var(--line); }

/* --- Reward wheel -------------------------------------------------------- */
.kid-reward {
  text-align: center; padding: 22px; margin-top: 18px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff, #eef2ff); box-shadow: var(--shadow); animation: pop 0.3s ease;
}
.kid-reward .big-emoji { font-size: 60px; animation: bob 1.6s ease-in-out infinite; }
.kid-reward h2 { font-size: 24px; margin: 6px 0 4px; }
.kid-reward--done { background: linear-gradient(135deg, #fff, var(--success-soft)); }
.kid-reward__prize { font-size: 22px; font-weight: 800; color: var(--primary-dark); margin: 6px 0; }

.wheel-box {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 20px; text-align: center; max-height: 94vh; overflow-y: auto;
  animation: pop 0.2s ease; position: relative; z-index: 1;
}

/* Party background (confetti is separate/full-screen; these are the balloons). */
.party-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.party-item { position: absolute; bottom: -60px; line-height: 1; will-change: transform, opacity; animation-name: party-rise; animation-timing-function: ease-in; animation-fill-mode: forwards; }
@keyframes party-rise {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-108vh) translateX(var(--drift, 0)) rotate(35deg); opacity: 0; }
}

/* Parent reward management */
.reward-extra { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.reward-list { display: flex; flex-direction: column; gap: 8px; }
.reward-row { display: flex; align-items: center; gap: 8px; }
.reward-row__active { flex: none; display: flex; align-items: center; }
.reward-row .input { padding: 8px 10px; }
.reward-row__weight { max-width: 68px; text-align: center; }
.reward-row__wbox { display: flex; align-items: center; gap: 6px; flex: none; }
.reward-row__pct { font-size: 12px; font-weight: 700; color: var(--ink-faint); min-width: 34px; text-align: right; }
.reward-add { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.reward-add .input:first-child { flex: 1; }
.wheel-title { font-size: 20px; margin: 0 0 14px; }
.wheel-wrap { position: relative; width: min(80vw, 340px); height: min(80vw, 340px); margin: 0 auto 16px; }
.wheel-canvas {
  width: 100%; height: 100%; border-radius: 50%; transform-origin: 50% 50%;
  box-shadow: 0 8px 30px rgba(24,28,52,0.25), inset 0 0 0 6px #fff; background: #fff;
}
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-top: 26px solid #ff3b5c; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
}
.wheel-spin { font-size: 20px !important; padding: 14px !important; }
.wheel-result { margin-bottom: 12px; }
.wheel-result__emoji { font-size: 56px; animation: pop 0.3s ease; }
.wheel-result__title { font-size: 22px; font-weight: 800; margin-top: 4px; }
.wheel-result__prize { font-size: 20px; font-weight: 800; color: var(--primary-dark); margin-top: 2px; }

/* Parent-side reward summary */
.reward-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; background: linear-gradient(135deg, var(--surface), #fff5fb); }
.reward-banner__emoji { font-size: 34px; flex: none; }
.reward-banner__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 700; }
.reward-banner__prize { font-size: 18px; font-weight: 800; color: var(--primary-dark); }

/* --- Confetti ------------------------------------------------------------ */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti-piece { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.8s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(600deg); opacity: 0.9; } }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 640px) {
  .container { padding: 16px 14px 60px; }
  .kid__hi h1 { font-size: 24px; }
  .row { flex-direction: column; }
  .kid-progress { flex-direction: column; text-align: center; }
  .modal { max-width: 100%; }
}
