/* Shared by the kid side and the parent side. Light only. */
:root {
  --sky: #bfe6ff;
  --sky-2: #e8f6ff;
  --ink: #1d2747;
  --ink-2: #5a6485;
  --line: #d7e3f2;
  --paper: #ffffff;
  --coin: #ffc93c;
  --coin-deep: #e8a500;
  --mint: #12a77a;
  --coral: #e5484d;
  --kid: #3d8bff;
  --r: 22px;
  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-weight: 700;
  color: var(--ink);
  background: var(--sky-2);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.15; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 999px; padding: .85em 1.4em;
  font-family: var(--display); font-weight: 600; font-size: 1.1rem;
  background: var(--ink); color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.coin { background: var(--coin); color: var(--ink); box-shadow: 0 4px 0 var(--coin-deep); }
.btn.coin:active { box-shadow: 0 1px 0 var(--coin-deep); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--coral); box-shadow: 0 4px 0 #b8313a; }
.btn.small { font-size: .95rem; padding: .55em 1em; }

/* Modal (js/modal.js). */
html.modal-open, html.modal-open body { overflow: hidden; }
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(29, 39, 71, .45);
  display: flex; justify-content: center; align-items: flex-start;
  padding: max(5vh, env(safe-area-inset-top)) 16px 16px;
  overflow-y: auto;
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 440px;
  background: var(--paper); border-radius: 28px;
  padding: 22px 20px 20px;
  animation: pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-h h2 { font-size: 1.5rem; }
.modal-x { border: 0; background: var(--sky-2); width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .9rem; color: var(--ink-2); }
.field input, .field select {
  width: 100%; border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 14px; background: #fff; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--kid); }
.err { color: var(--coral); font-size: .95rem; min-height: 1.2em; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Installed app (Add to Home Screen): feel native, not like a web page. */
body { overscroll-behavior-y: none; }
button, .btn, .kid-tile, .pad { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
img { -webkit-touch-callout: none; -webkit-user-drag: none; }
