/* Kid side: big, bright, chunky. */
body.kid {
  background:
    radial-gradient(120% 60% at 50% 0%, #fff6cf 0%, rgba(255, 246, 207, 0) 60%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 55%);
  background-repeat: no-repeat;
}
html:has(body.kid) { background: var(--sky-2); }
.kid-wrap {
  max-width: 620px; margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

/* ---------- Picker ---------- */
.picker { text-align: center; }
.picker-hero { width: min(340px, 82%); margin: 4px auto -6px; animation: bob 3.2s ease-in-out infinite; }
.picker h1 { font-size: clamp(2rem, 8vw, 2.8rem); margin-top: 6px; }
.picker .sub { color: var(--ink-2); margin: 6px 0 22px; font-size: 1.05rem; }
.kids-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 18px 12px; justify-items: center; }
.kid-tile {
  border: 0; background: none; padding: 0;
  display: grid; justify-items: center; gap: 18px;
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.kid-tile:nth-child(2) { animation-delay: .06s; }
.kid-tile:nth-child(3) { animation-delay: .12s; }
.kid-tile:nth-child(4) { animation-delay: .18s; }
.kid-tile .name { font-family: var(--display); font-weight: 600; font-size: 1.35rem; }
.kid-tile:active .ava { transform: scale(.94); }
.ava {
  --c: var(--kid);
  width: 120px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff 0%, color-mix(in srgb, var(--c) 28%, #fff) 70%);
  box-shadow: 0 0 0 6px var(--c), 0 10px 0 6px color-mix(in srgb, var(--c) 55%, #000 10%);
  display: grid; place-items: end center; overflow: hidden;
  transition: transform .1s;
}
.ava img { width: 84%; height: 84%; object-fit: contain; object-position: bottom; }
.ava.sm { width: 52px; box-shadow: 0 0 0 4px var(--c); }
.ava.lg { width: 140px; }
.empty-kids img { width: 200px; margin: 0 auto; }
.empty-kids p { color: var(--ink-2); }
.parent-link { display: inline-block; margin-top: 30px; color: var(--ink-2); font-size: .9rem; text-decoration: none; opacity: .75; }

/* ---------- PIN ---------- */
.pin { text-align: center; padding-top: 8px; }
.pin .back { position: absolute; left: 16px; top: max(18px, env(safe-area-inset-top)); }
.pin h2 { font-size: 1.9rem; margin: 22px 0 4px; }
.pin .hint { color: var(--ink-2); min-height: 1.4em; }
.dots { display: flex; gap: 16px; justify-content: center; margin: 18px 0 24px; }
.dots i { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--line); transition: background .1s, transform .1s; }
.dots i.on { background: var(--c, var(--kid)); box-shadow: none; transform: scale(1.12); }
.dots.shake { animation: shake .4s; }
.pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; justify-content: center; }
.pad button {
  height: 84px; border: 0; border-radius: 50%;
  background: #fff; font-family: var(--display); font-weight: 600; font-size: 2rem;
  box-shadow: 0 5px 0 var(--line);
}
.pad button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.pad .muted { background: transparent; box-shadow: none; font-size: 1.6rem; }

/* ---------- Home ---------- */
.top { display: flex; align-items: center; gap: 12px; }
.top h1 { font-size: 1.6rem; flex: 1; }
.top h1 small { display: block; font-family: var(--body); font-size: .85rem; color: var(--ink-2); font-weight: 700; }

.balance {
  position: relative; margin: 22px 0 8px; padding: 22px 22px 24px;
  border-radius: 32px; color: #fff; overflow: hidden;
  background:
    radial-gradient(90% 120% at 100% 100%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(140deg, color-mix(in srgb, var(--c) 92%, #fff) 0%, color-mix(in srgb, var(--c) 80%, #000 20%) 100%);
  min-height: 210px;
}
.balance .lbl { font-size: 1rem; opacity: .92; }
.balance .amt { font-family: var(--display); font-weight: 700; line-height: 1; margin-top: 8px; font-size: clamp(3rem, 15vw, 4.6rem); letter-spacing: -.01em; }
.balance .amt small { font-size: .42em; font-weight: 600; margin-right: .15em; vertical-align: .55em; }
.balance .note { margin-top: 10px; font-size: .95rem; opacity: .95; max-width: 58%; }
.balance img { position: absolute; right: -8px; bottom: -14px; width: min(46%, 230px); pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18)); }

.cashout { width: 100%; font-size: 1.35rem; padding: 1em; margin: 14px 0 6px; }

.goal { display: flex; align-items: center; gap: 16px; margin: 22px 4px 4px; }
.goal svg { flex: none; width: 74px; height: 92px; }
.goal .t { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.goal .s { color: var(--ink-2); font-size: .95rem; margin-top: 2px; }
.goal .bar { height: 12px; border-radius: 99px; background: #fff; margin-top: 8px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); }
.goal .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coin), var(--coin-deep)); transition: width 1s ease-out; }

.sec { font-size: 1.3rem; margin: 30px 4px 10px; }
.pending { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pending .row { background: #fff8dc; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .85); border-radius: 20px; padding: 12px 14px;
}
.row .badge { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--sky-2); }
.row .badge.earn { background: #dcf7ec; }
.row .badge.withdraw { background: #ffe7d6; }
.row .what { flex: 1; min-width: 0; }
.row .what b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 1.02rem; line-height: 1.25; }
.row .what span { color: var(--ink-2); font-size: .85rem; }
.row .amt { font-family: var(--display); font-weight: 600; font-size: 1.25rem; white-space: nowrap; }
.row .amt.plus { color: var(--mint); }
.row .amt.minus { color: var(--coral); }
.empty { text-align: center; color: var(--ink-2); padding: 10px 0; }
.empty img { width: min(260px, 70%); margin: 0 auto 6px; }

/* ---------- Withdraw sheet ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip {
  border: 0; border-radius: 999px; padding: .6em 1.1em;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  background: var(--sky-2); box-shadow: inset 0 0 0 2px var(--line);
}
.chip.on { background: var(--coin); box-shadow: inset 0 0 0 2px var(--coin-deep); }
.chip[disabled] { opacity: .35; }
.can { color: var(--ink-2); margin: -4px 0 14px; }
.asked { text-align: center; }
.asked img { width: 100%; max-width: 340px; margin: -6px auto 4px; }
.asked h2 { font-size: 1.6rem; }
.asked p { color: var(--ink-2); font-size: 1.05rem; }

/* ---------- Celebrate ---------- */
.party {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 45%, #fff6cf, #bfe6ff 70%);
  padding: 16px; animation: fade .2s;
}
.party canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.party .in { position: relative; max-width: 460px; }
.party img { width: min(420px, 92vw); margin: 0 auto; animation: hop .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.party .plus { font-family: var(--display); font-weight: 700; color: var(--mint); font-size: clamp(3rem, 16vw, 4.4rem); line-height: 1; margin-top: 4px; animation: pop .5s .25s cubic-bezier(.2, 1.4, .4, 1) both; }
.party .why { font-family: var(--display); font-weight: 600; font-size: 1.4rem; margin: 8px 0 22px; }

@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes hop { 0% { transform: translateY(40px) scale(.8); opacity: 0; } 60% { transform: translateY(-10px) scale(1.03); opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

@media (min-width: 700px) {
  .kid-wrap { padding-top: 40px; }
  .ava { width: 150px; }
  .ava.sm { width: 56px; }
  .picker { min-height: calc(100dvh - 80px); display: flex; flex-direction: column; justify-content: center; }
  .picker-hero { width: 440px; }
  .kids-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 200px)); justify-content: center; }
}
