/* Homework — shared styles. Kid screens are big, warm and plain; the desert scene behind
   them stays still (PLAN.md §4: no motion that plays by itself). */
:root {
  --sand: #F6E7CF;
  --sand-2: #EED3A8;
  --dune: #E2B47A;
  --dune-2: #CF925A;
  --sky: #FFF4E2;
  --ink: #3B2A1E;
  --ink-2: #6E5543;
  --card: #FFFDF8;
  --line: #E9D9C0;
  --sage: #6E9B6A;
  --sage-dark: #4F7A4C;
  --clay: #C8643B;
  --clay-dark: #A44E2C;
  --sun: #FFC857;
  --oasis: #4FA3A5;
  --outpost: #D07A3A;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(59, 42, 30, .12), 0 14px 30px rgba(59, 42, 30, .12);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sky);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 .4em; line-height: 1.15; }
.lead { font-size: 1.25rem; color: var(--ink-2); margin: .2em 0 1em; }
.small { font-size: .9rem; color: var(--ink-2); margin: 0 0 .6em; }
.note { text-align: center; color: var(--ink-2); margin-top: 1.5rem; }

/* ---------- desert backdrop (static) ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(#FFF6E6 0%, #FDE9CC 55%, var(--sand) 100%); }
.sun { position: absolute; width: 140px; height: 140px; right: 8%; top: 7%; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #FFE29A, var(--sun)); opacity: .85; }
.dune { position: absolute; left: -20%; right: -20%; border-radius: 50% 50% 0 0; }
.d1 { bottom: -38%; height: 62%; background: var(--sand-2); }
.d2 { bottom: -46%; height: 58%; background: var(--dune); left: 30%; right: -40%; }
.d3 { bottom: -52%; height: 56%; background: var(--dune-2); left: -40%; right: 45%; }

/* ---------- layout ---------- */
.screen { min-height: 100vh; min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 20px 32px; }
.center { display: grid; place-items: center; }
.title { text-align: center; font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-top: 4vh; }
.card { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.narrow { max-width: 440px; width: 100%; text-align: center; margin: 0 auto; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: 700 1.05rem var(--font); color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 999px; padding: .7em 1.3em; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease; }
.btn:active { transform: translateY(2px) scale(.98); }
.btn.big { font-size: 1.25rem; padding: .85em 1.6em; }
.btn.primary { background: var(--sage); border-color: var(--sage-dark); color: #fff; box-shadow: 0 4px 0 var(--sage-dark); }
.btn.primary:active { box-shadow: 0 1px 0 var(--sage-dark); }
.btn.danger { color: var(--clay-dark); border-color: #EBC2AE; }
.btn.ghost { background: rgba(255, 253, 248, .8); }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- picker ---------- */
.kids { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 4vw, 44px); margin-top: 6vh; }
.kid-card { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(42vw, 280px);
  padding: 28px 16px 22px; border: 0; border-radius: 32px; background: var(--card); box-shadow: var(--shadow);
  font: inherit; color: inherit; cursor: pointer; transition: transform .12s ease; }
.kid-card:active { transform: scale(.96); }
.kid-name { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
.avatar { display: grid; place-items: center; width: min(30vw, 180px); aspect-ratio: 1; border-radius: 50%;
  font-size: clamp(3rem, 9vw, 5.5rem); font-weight: 800; color: #fff; background: var(--ink-2);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .12); }
.avatar.big { width: min(40vw, 200px); margin: 4vh auto 0; }
.k-oasis .avatar, .avatar.k-oasis { background: radial-gradient(circle at 35% 30%, #7FCBC9, var(--oasis)); }
.k-outpost .avatar, .avatar.k-outpost { background: radial-gradient(circle at 35% 30%, #F2A766, var(--outpost)); }
.k-test .avatar, .avatar.k-test { background: #8A8F98; }

/* ---------- kid home ---------- */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pill { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: .35em .9em; font-size: .9rem; color: var(--ink-2); }
.home-body { text-align: center; }

.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--sage);
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- grown-up pages ---------- */
body.grown { background: var(--sky); }
.grown main { max-width: 760px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 18px 48px; }
.grown header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.grown section { margin-bottom: 18px; }
.grown h2 { font-size: 1.2rem; }
.grown table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.grown th, .grown td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.grown th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; font-weight: 700; margin: 0 0 12px; }
input[type=email], input[type=password], input[type=text] { display: block; width: 100%; margin-top: 6px; font: 1.05rem var(--font);
  padding: .7em .8em; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
input:focus { outline: 3px solid rgba(110, 155, 106, .35); border-color: var(--sage); }
label.show { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.err { color: var(--clay-dark); font-weight: 700; }
.ok { color: var(--sage-dark); font-weight: 700; }
.switch-mode { margin-top: 14px; }
.login { max-width: 420px; margin: 8vh auto; padding: 0 18px; text-align: center; }
.login form { text-align: left; margin-top: 18px; }
.login .btn { width: 100%; }
