/* Pricey! shared design system — bright single-theme kids' world by design. */
:root {
  --sky: #BFE3F5;
  --sky-deep: #8FC9E8;
  --sun: #FFC93C;
  --sun-deep: #E8A400;
  --ink: #2B3A4A;
  --ink-soft: #5A6B7C;
  --card: #FFFFFF;
  --kea: #5C7A3B;
  --kea-soft: #EDF3E2;
  --wing: #E05A2B;
  --wing-soft: #FBEAE2;
  --good: #3E9C55;
  --good-soft: #E4F4E8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Long-press must never start text selection or the iOS callout (breaks the parent gate). */
button, .btn, .choice-tile, .avatar-tile, .speak-btn, .prompt-bubble, h1, h2, h3, label {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
input, select, textarea { -webkit-user-select: text; user-select: text; }
html, body { margin: 0; }
body {
  min-height: 100svh;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  color: var(--ink);
  font-family: ui-rounded, "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  padding: max(env(safe-area-inset-top), 0.8rem) 1rem calc(env(safe-area-inset-bottom) + 1.2rem);
}
.shell { max-width: 480px; margin: 0 auto; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 0.5rem; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }

.card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(43, 58, 74, 0.14);
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

/* Big kid-friendly buttons: >=64px targets, chunky and springy */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 20px;
  background: var(--sun);
  box-shadow: 0 5px 0 var(--sun-deep);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.8rem 1.2rem;
  transition: transform 0.08s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sun-deep); }
.btn.quiet { background: var(--card); box-shadow: 0 5px 0 #D7DEE5; }
.btn.green { background: var(--good-soft); box-shadow: 0 5px 0 var(--good); }
.btn:focus-visible { outline: 3px solid var(--wing); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; }

.coin-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--card); border-radius: 999px;
  padding: 0.35rem 0.9rem; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 3px 10px rgba(43, 58, 74, 0.12);
}
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; min-height: 48px; }
.speak-btn {
  border: 0; background: var(--card); border-radius: 999px;
  width: 64px; height: 64px; font-size: 1.7rem;
  box-shadow: 0 4px 12px rgba(43, 58, 74, 0.15);
}

/* Choice tiles for game rounds */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.choices.one-col { grid-template-columns: 1fr; }
.choice-tile {
  border: 3px solid transparent;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(43, 58, 74, 0.14);
  padding: 1.2rem 0.6rem 1rem;
  text-align: center;
  min-height: 140px;
}
.choice-tile .art { font-size: 3.4rem; line-height: 1.1; display: block; }
.choice-tile .label { display: block; font-weight: 700; font-size: 1.05rem; margin-top: 0.5rem; }
.choice-tile.picked-right { border-color: var(--good); background: var(--good-soft); }
.choice-tile.picked-wrong { border-color: var(--wing); background: var(--wing-soft); }
.choice-tile.reveal { border-color: var(--sun-deep); }
.choice-tile .price-tag { display: inline-block; margin-top: 0.4rem; background: var(--sun); border-radius: 999px; padding: 0.15rem 0.7rem; font-weight: 700; font-size: 0.95rem; }

.avatar-tile {
  border: 3px solid transparent; border-radius: 22px; background: var(--card);
  box-shadow: 0 6px 18px rgba(43,58,74,0.14);
  padding: 1rem 0.4rem; text-align: center; min-height: 110px;
}
.avatar-tile .art { font-size: 2.8rem; display: block; }
.avatar-tile .label { font-weight: 700; margin-top: 0.3rem; display: block; }
.avatar-tile.selected { border-color: var(--kea); background: var(--kea-soft); }

.prompt-bubble {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--kea-soft); border-radius: 18px;
  padding: 0.8rem 1rem; margin-bottom: 1rem;
  font-size: 1.2rem; font-weight: 700;
}
.progress-dots { display: flex; gap: 0.4rem; justify-content: center; margin: 0.8rem 0; }
.progress-dots span { width: 14px; height: 14px; border-radius: 50%; background: rgba(43,58,74,0.18); }
.progress-dots span.done { background: var(--sun-deep); }

.field { margin-bottom: 0.9rem; }
.field label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--ink-soft); }
.field input, .field select {
  width: 100%; border: 2px solid #D7DEE5; border-radius: 14px;
  padding: 0.85rem 1rem; font-size: 1.05rem; background: var(--card);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--sun-deep); }

.muted { color: var(--ink-soft); font-size: 0.9rem; }
.error-note { background: var(--wing-soft); color: var(--wing); border-radius: 12px; padding: 0.6rem 0.9rem; font-weight: 700; margin: 0.6rem 0; }
.center { text-align: center; }
.hidden { display: none !important; }

footer.appfoot { text-align: center; font-size: 0.75rem; color: var(--ink-soft); opacity: 0.8; margin-top: 1.5rem; }

/* Celebration overlay */
.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(43, 58, 74, 0.35); z-index: 50; padding: 1rem;
}
.overlay .card { max-width: 420px; width: 100%; text-align: center; margin: 0; }
.big-emoji { font-size: 4rem; line-height: 1.1; }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.overlay .card { animation: pop 0.35s ease; }
@media (prefers-reduced-motion: reduce) { .overlay .card { animation: none; } .btn { transition: none; } }

/* Stats grid (parent + admin) */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.stat { background: var(--kea-soft); border-radius: 14px; padding: 0.7rem 0.9rem; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; }
