/* CoinCart Kids — app screens */

html, body { height: 100%; }

#root {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
  min-height: 100%;
}

/* ---------- chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  margin: 0 -16px 8px;
  padding-left: 16px;
  padding-right: 16px;
  background: var(--cream);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar__back {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.topbar__title {
  flex: 1;
  font-weight: 900;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bankchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--r-pill);
  background: var(--gold-pale);
  font-weight: 900;
  font-size: 1rem;
  color: var(--gold-deep);
  box-shadow: var(--shadow);
}
.bankchip svg { width: 24px; height: 24px; }
.bankchip.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* ---------- setup ---------- */

.setup { padding-top: 24px; text-align: center; }
.setup h1 { font-size: 1.7rem; font-weight: 900; margin: 12px 0 4px; }
.setup .lede { color: var(--ink-soft); margin-bottom: 24px; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}
.avatar-grid button {
  font-size: 2rem;
  padding: 10px 0;
  min-height: 60px;
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.avatar-grid button[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--gold), var(--shadow-pop);
  transform: scale(1.06);
}

.setup label { display: block; text-align: left; font-weight: 800; margin: 18px 0 6px; }
.setup input[type="text"] {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: var(--r-card);
  border: 2px solid var(--line);
  background: var(--paper);
  font-size: 1.1rem;
  font-weight: 700;
}

.age-pills { display: flex; gap: 8px; margin: 8px 0 26px; }
.age-pills button {
  flex: 1;
  min-height: 50px;
  border-radius: var(--r-pill);
  font-weight: 800;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.age-pills button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.setup .btn--big { width: 100%; }
.skip-link { display: inline-block; margin-top: 16px; color: var(--ink-soft); font-weight: 700; text-decoration: underline; background: none; }

/* ---------- home ---------- */

.home-hello { display: flex; align-items: center; gap: 12px; margin: 10px 0 18px; }
.home-hello .face { font-size: 2.4rem; }
.home-hello h1 { font-size: 1.45rem; font-weight: 900; line-height: 1.2; }
.home-hello p { color: var(--ink-soft); font-size: 0.95rem; }

.mission-grid { display: grid; gap: 14px; }

.mcard {
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 18px;
  border-top: 6px solid var(--accent, var(--gold));
  transition: transform 0.12s ease;
}
.mcard:active { transform: scale(0.985); }
.mcard__emoji { font-size: 2.1rem; line-height: 1; }
.mcard__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.mcard__titles { flex: 1; min-width: 0; }
.mcard h3 { font-size: 1.15rem; font-weight: 900; }
.mcard__meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.mcard__mins { color: var(--ink-soft); font-size: 0.82rem; font-weight: 700; }
.mcard p { color: var(--ink-soft); font-size: 0.95rem; }
.mcard__done {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--green);
}

.mcard--hero { padding: 24px 20px; border-top-width: 8px; box-shadow: var(--shadow-pop); }
.mcard--hero .mcard__emoji { font-size: 3rem; }
.mcard--hero h3 { font-size: 1.4rem; }

.home-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.92rem;
}
.home-foot button, .home-foot a { text-decoration: underline; background: none; color: var(--ink-soft); }

.badge-teaser {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.badge-teaser .stars { font-size: 1.3rem; letter-spacing: 2px; }

/* ---------- mission stage shell ---------- */

.stage { padding-top: 6px; }
.stage-kicker {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stage h1 { font-size: 1.5rem; font-weight: 900; margin-bottom: 10px; }
.stage .lede { color: var(--ink-soft); margin-bottom: 16px; }

.needs-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 20px; }

.stage .btn--advance { width: 100%; margin-top: 10px; }

/* reflect cards */
.reflect-card {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 14px;
  border-left: 6px solid var(--sky);
}
.reflect-card .qnum { font-size: 0.78rem; font-weight: 900; color: var(--sky); letter-spacing: 0.1em; }
.reflect-card p { font-size: 1.15rem; font-weight: 800; margin-top: 4px; }

/* ---------- award ---------- */

.award {
  text-align: center;
  padding-top: 8vh;
}
.medallion {
  width: 150px;
  height: 150px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: radial-gradient(circle at 35% 30%, #FFD97A, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 0 0 8px var(--gold-pale), var(--shadow-pop);
  animation: medal-in 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes medal-in { from { transform: scale(0.2) rotate(-14deg); opacity: 0; } }
.award .kicker { font-weight: 900; letter-spacing: 0.14em; color: var(--gold-deep); font-size: 0.8rem; }
.award h1 { font-size: 1.9rem; font-weight: 900; margin: 4px 0 6px; }
.award .blurb { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 26px; }
.award .btn { width: 100%; margin-top: 10px; }

/* ---------- badges shelf ---------- */

.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.shelf-badge {
  text-align: center;
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 16px 8px 12px;
}
.shelf-badge .bemoji { font-size: 2.2rem; display: block; }
.shelf-badge .bname { font-weight: 900; font-size: 0.82rem; margin-top: 6px; display: block; }
.shelf-badge .bhint { color: var(--ink-soft); font-size: 0.72rem; display: block; margin-top: 2px; }
.shelf-badge--locked { opacity: 0.45; filter: grayscale(1); }

/* ---------- parent corner ---------- */

.parents section { margin-bottom: 22px; }
.parents h2 { font-size: 1.2rem; font-weight: 900; margin-bottom: 8px; }
.parents p, .parents li { color: var(--ink-soft); }
.parents ul { margin: 8px 0 0; padding-left: 20px; }
.parents li { margin-bottom: 6px; }
.needlist { display: grid; gap: 10px; margin-top: 10px; }
.needlist .card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.needlist .nemoji { font-size: 1.5rem; }
.needlist b { display: block; }
.needlist span { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- demo mode ---------- */

.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}
.demo-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.demo-card h1 { font-size: clamp(1.8rem, 7vw, 3rem); font-weight: 900; line-height: 1.15; }
.demo-card .big-emoji { font-size: 4.5rem; display: block; margin-bottom: 18px; }
.demo-card p { color: var(--ink-soft); font-size: 1.2rem; margin-top: 12px; }
.demo-caption {
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--ink);
  color: #fff;
}
.demo-caption small { display: block; font-weight: 600; opacity: 0.65; font-size: 0.78rem; margin-top: 4px; }
.demo-x {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 1.1rem;
  font-weight: 900;
  z-index: 101;
}
.demo-frame { width: 100%; max-width: 420px; text-align: left; }

/* sound toggle in chrome */
.topbar__snd {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-size: 1.1rem;
}

/* piggy bank goal */
.goalcard { text-align: center; padding-top: 12px; }
.goalcard__emoji { font-size: 3.4rem; display: block; margin-bottom: 8px; }
.goalcard h1 { font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.goalcard__nums { font-weight: 900; color: var(--gold-deep); font-size: 1.1rem; }
.goalcard__hint { color: var(--ink-soft); margin: 10px auto 16px; max-width: 30em; }
.goalcard__ready { font-weight: 900; letter-spacing: 0.1em; color: var(--green); margin: 12px 0 10px; }
.goalcard__label { display: block; text-align: left; font-weight: 800; margin: 16px 0 6px; }
.goalcard input[type="text"] {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: var(--r-card);
  border: 2px solid var(--line);
  background: var(--paper);
  font-size: 1.1rem;
  font-weight: 700;
}
.goalstep { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 20px; }
.goalstep button {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 1.6rem;
  font-weight: 900;
}
.goalstep .val { font-size: 2rem; font-weight: 900; min-width: 60px; }

.goalbar {
  display: block;
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
  margin: 12px 0;
}
.goalbar__fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width 0.5s ease;
}

.goalhome { width: 100%; text-align: left; margin-bottom: 16px; padding: 14px 16px; }
.goalhome__row { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.goalhome__nums { font-weight: 900; color: var(--gold-deep); font-size: 0.9rem; }
.goalhome .goalbar { margin: 10px 0 0; height: 10px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-pop);
  z-index: 90;
  animation: toast-in 0.25s ease;
  max-width: 90vw;
  text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* confetti canvas */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 120; }

@media (min-width: 700px) {
  .mission-grid { grid-template-columns: 1fr 1fr; }
  .mission-grid .mcard--hero { grid-column: 1 / -1; }
  .shelf { grid-template-columns: repeat(4, 1fr); }
}
