/* QuestNest — mobile-first, kid-friendly, gender-neutral palette */
:root {
  --teal: #14b8a6; --teal-d: #0e8d80; --coral: #ff6b5e; --gold: #ffc93c; --gold-d: #e8a800;
  --indigo: #2d2a5e; --ink: #33305e; --bg: #f4f7fb; --card: #ffffff; --line: #e5e9f2;
  --ok: #22c55e; --bad: #ef4444; --pend: #f59e0b;
  --r: 18px; --shadow: 0 4px 14px rgba(45, 42, 94, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: "Baloo 2", "Nunito", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  background: linear-gradient(180deg, #e8f7f5 0%, var(--bg) 30%);
  color: var(--ink); min-height: 100vh;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 96px; min-height: 100vh; position: relative; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; margin: 10px 0; } h3 { font-size: 1rem; }
.center { text-align: center; }
.icn { width: 22px; height: 22px; vertical-align: -5px; color: inherit; flex: none; }
.icn.hdr { width: 26px; height: 26px; color: var(--teal); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #fff; border: 0;
  border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; box-shadow: var(--shadow); transition: transform .12s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; box-shadow: none; }
.btn.big { width: 100%; padding: 15px; font-size: 1.1rem; margin-top: 18px; }
.btn.slim { padding: 9px 16px; font-size: .9rem; margin: 6px 0; }
.btn.alt { background: linear-gradient(135deg, var(--coral), #e5503f); }
.btn.done-btn { background: linear-gradient(135deg, var(--gold), var(--gold-d)); color: #4a3800; padding: 10px 14px; font-size: .9rem; }
.btn.ok-btn { background: linear-gradient(135deg, var(--ok), #17963f); padding: 8px 13px; font-size: .85rem; }
.btn.rej-btn { background: #fff; color: var(--bad); border: 2px solid var(--bad); box-shadow: none; padding: 6px 13px; font-size: .85rem; }
.btn.sticky { position: sticky; bottom: 14px; }
.ghost { background: none; border: 0; color: var(--ink); opacity: .65; font: inherit; margin-top: 16px; cursor: pointer; }
.ghost.danger { color: var(--bad); display: block; margin: 24px auto; }
.iconbtn { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 7px; cursor: pointer; color: var(--ink); flex: none; }
.rowbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btncol { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* onboarding */
.setup { display: flex; flex-direction: column; padding-top: 28px; }
.logo-big { width: 130px; height: 130px; object-fit: contain; margin: 0 auto 8px; border-radius: 28px; display: block; }
.hero-title { text-align: center; font-size: 2.1rem; color: var(--indigo); letter-spacing: -.5px; }
.hero-tag { text-align: center; color: var(--teal-d); font-weight: 700; margin: 4px 0 18px; }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--teal); }
.hint { font-size: .85rem; opacity: .75; margin: 4px 0 10px; }
.langrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.langbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; font: inherit; font-size: .72rem; cursor: pointer; }
.langbtn.on { border-color: var(--teal); background: #e6f7f5; font-weight: 700; }

/* forms */
.fld { display: block; margin: 12px 0; font-weight: 700; font-size: .9rem; }
.fld input, .fld select {
  display: block; width: 100%; margin-top: 5px; padding: 12px; font: inherit;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.fld.row { display: flex; align-items: center; gap: 8px; }
.fld.row input, .fld.row select { display: inline-block; width: auto; margin: 0; }
.avrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.av { font-size: 1.5rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; cursor: pointer; }
.av.on { border-color: var(--coral); background: #fff0ee; }
.tvbox { background: #fff; border-radius: var(--r); padding: 6px 14px; box-shadow: var(--shadow); }

/* task picker */
.cath { margin: 18px 0 8px; color: var(--indigo); text-transform: uppercase; letter-spacing: .5px; font-size: .8rem; }
.pickgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 12px; font: inherit; cursor: pointer;
}
.pick .icn { width: 26px; height: 26px; color: var(--teal-d); }
.pick.on { border-color: var(--teal); background: #e6f7f5; }
.pick.on::after { content: "✓"; position: absolute; } .pick { position: relative; }
.pick.on::after { top: 8px; right: 10px; color: var(--teal-d); font-weight: 800; }
.pick-t { font-weight: 700; font-size: .85rem; line-height: 1.25; }
.pick-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* badges & pills */
.badge { font-size: .64rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.b-daily { background: #dcf5e8; color: #157347; }
.b-weekly { background: #e3ecfe; color: #2c5cc5; }
.b-monthly { background: #f3e5fd; color: #8236b8; }
.b-once, .b-goal { background: #fdeacc; color: #a06a00; }
.b-rej { background: #fde3e3; color: var(--bad); }
.tokpill { display: inline-flex; align-items: center; gap: 3px; background: #fff7dd; border: 1.5px solid var(--gold); color: #7a5c00; font-weight: 800; font-size: .78rem; border-radius: 999px; padding: 2px 9px 2px 4px; }
.tokpill .icn { width: 17px; height: 17px; }

/* pin */
.pinshow { text-align: center; font-size: 1.7rem; letter-spacing: 12px; margin: 14px 0; color: var(--teal-d); }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; }
.pinkey { width: 72px; height: 60px; font: inherit; font-size: 1.3rem; font-weight: 700; background: #fff; border: 2px solid var(--line); border-radius: 16px; cursor: pointer; color: var(--ink); }
.pinkey:active { background: #e6f7f5; border-color: var(--teal); }
.pinmsg { text-align: center; color: var(--bad); min-height: 1.2em; margin-top: 8px; }

/* who screen */
.who h2 { margin-top: 6px; }
.whorow { display: flex; gap: 12px; margin: 16px 0; }
.whocard {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 10px; border-radius: 22px; border: 0; font: inherit; cursor: pointer; color: #fff; box-shadow: var(--shadow);
}
.whocard.parent { background: linear-gradient(150deg, var(--indigo), #4a46a0); }
.whocard.kid { background: linear-gradient(150deg, var(--coral), #ff9345); }
.whocard b { font-size: 1.1rem; } .whocard span { font-size: .78rem; opacity: .9; }
.whocard .icn { width: 30px; height: 30px; } .whoav { font-style: normal; font-size: 2rem; }

/* child header */
.chead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.chead h1 { font-size: 1.2rem; color: var(--indigo); }
.mascot { width: 64px; height: 64px; object-fit: contain; border-radius: 18px; }
.chead > div { flex: 1; }
.bigbal { font-size: 1.05rem; margin-top: 2px; } .bigbal small { opacity: .7; }
.banner { width: 100%; border-radius: var(--r); margin: 4px 0 8px; box-shadow: var(--shadow); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 6px; }
.stat { background: var(--card); border-radius: 14px; padding: 9px 4px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 1.15rem; font-weight: 800; }
.stat-lab { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; opacity: .65; }
.s-av .stat-num { color: var(--teal-d); } .s-pe .stat-num { color: var(--pend); }
.s-ea .stat-num { color: var(--indigo); } .s-sp .stat-num { color: var(--coral); }

/* cards / tasks */
.card { background: var(--card); border-radius: var(--r); padding: 13px; box-shadow: var(--shadow); margin-bottom: 9px; }
.card.task, .card.reward { display: flex; align-items: center; gap: 11px; }
.ticon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.ticon .icn { width: 25px; height: 25px; }
.c-home { background: #e6f7f5; color: var(--teal-d); }
.c-school { background: #e3ecfe; color: #2c5cc5; }
.c-health { background: #dcf5e8; color: #157347; }
.c-kind { background: #ffe9e6; color: #d94433; }
.c-self { background: #f3e5fd; color: #8236b8; }
.tbody { flex: 1; min-width: 0; } .tbody b { font-size: .95rem; display: block; line-height: 1.25; }
.tmeta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 5px; }
.tmeta small { font-size: .72rem; opacity: .7; }
.tstate { font-size: .74rem; font-weight: 800; text-align: center; max-width: 92px; }
.tstate.wait { color: var(--pend); } .tstate.ok { color: var(--ok); }
.card.task.approved { opacity: .75; background: #f2fcf6; }
.card.task.pending { background: #fffaf0; }

/* rewards progress */
.prog { height: 12px; background: #eef1f7; border-radius: 999px; margin-top: 7px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--coral)); transition: width .5s; min-width: 4px; }
.prog-fill.full { background: linear-gradient(90deg, var(--ok), var(--teal)); }
.progtxt { font-size: .74rem; font-weight: 700; color: var(--teal-d); }

/* parent */
.phead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.phead h1 { font-size: 1.15rem; color: var(--indigo); flex: 1; }
.pbal { width: 100%; background: var(--indigo); color: #fff; border-radius: 14px; padding: 10px 14px; font-size: .92rem; order: 3; display: flex; align-items: center; gap: 5px; }
.pbal b { color: var(--gold); font-size: 1.05rem; }
.hrow { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .88rem; }
.hrow small { opacity: .6; flex: none; }

/* tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  display: flex; background: #fff; border-top: 2px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tabbar button { flex: 1; background: none; border: 0; font: inherit; font-size: .64rem; font-weight: 700; color: #9aa2b8; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; padding: 4px 0; }
.tabbar button.on { color: var(--teal-d); }
.tabbar button .icn { width: 23px; height: 23px; }
.tabbar .dot { position: absolute; top: 0; right: 22%; background: var(--coral); color: #fff; font-style: normal; font-size: .62rem; font-weight: 800; border-radius: 999px; min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(45, 42, 94, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px 16px 28px; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--indigo); color: #fff; font-weight: 700; padding: 11px 20px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 60; transition: all .35s; max-width: 88vw; text-align: center; font-size: .9rem;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--bad); }

/* confetti */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#confetti .bit { position: absolute; top: -30px; font-size: 1.4rem; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(360deg); opacity: .6; } }

.famcode { font-size: 2rem; font-weight: 800; letter-spacing: 8px; color: var(--teal-d); padding: 6px 0; }
.card.center { text-align: center; }

.empty { text-align: center; padding: 26px 10px; opacity: .85; }
.empty img { width: 78%; max-width: 300px; border-radius: var(--r); margin-bottom: 10px; }
.empty p { font-weight: 700; }

@media (min-width: 500px) { body { padding-top: 12px; } .wrap { border-radius: 26px; } }
