/* Kids Learning Zone — custom styles layered on top of Tailwind */

:root{
  --brand:#7c3aed; --brand-light:#a78bfa; --brand-dark:#5b21b6;
  --sky:#38bdf8; --sun:#fbbf24; --grass:#34d399; --coral:#fb7185;
  --shadow: 0 10px 30px -10px rgba(76, 29, 149, .35);
}

*{ -webkit-tap-highlight-color: transparent; }
html,body{ height:100%; margin:0; overscroll-behavior:none; }

/* --- Phone frame ------------------------------------------------------- */
.app-shell{
  position:relative;
  width:100%; max-width:440px; height:100dvh;
  margin:0 auto;
  background:#fff;
  display:flex; flex-direction:column;
  overflow:hidden;
  box-shadow: var(--shadow);
}
@media (min-width:480px){
  body{ display:flex; align-items:center; justify-content:center;
        background:radial-gradient(120% 120% at 50% 0%, #ede9fe 0%, #e0f2fe 60%, #f0fdfa 100%); }
  .app-shell{ height:min(920px, 96dvh); border-radius:36px; border:10px solid #1e1b4b; }
}

.screen-host{ flex:1; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; }
.screen-host::-webkit-scrollbar{ width:0; }

/* --- Bottom nav -------------------------------------------------------- */
.bottom-nav{
  display:flex; justify-content:space-around; align-items:center;
  background:#fff; border-top:1px solid #eef2ff;
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow:0 -6px 20px -12px rgba(76,29,149,.4);
}
.nav-btn{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  font-size:11px; font-weight:600; color:#94a3b8; padding:6px 2px;
  border:none; background:none; border-radius:14px; transition:.15s;
}
.nav-btn .nav-ico{ font-size:20px; line-height:1; }
.nav-btn.active{ color:var(--brand); transform:translateY(-2px); }
.nav-btn.active .nav-ico{ filter:drop-shadow(0 4px 6px rgba(124,58,237,.4)); }

/* --- Reusable kid UI --------------------------------------------------- */
.kcard{
  background:#fff; border-radius:24px; padding:18px;
  box-shadow:0 8px 24px -12px rgba(30,27,75,.25);
  border:1px solid #f1f5f9;
}
.pill{ border-radius:999px; }
.big-btn{
  border:none; border-radius:20px; font-weight:700; font-size:18px;
  padding:16px 20px; color:#fff; cursor:pointer;
  box-shadow:0 8px 0 0 rgba(0,0,0,.12); transition:transform .08s, box-shadow .08s;
}
.big-btn:active{ transform:translateY(4px); box-shadow:0 4px 0 0 rgba(0,0,0,.12); }
.tile{
  border:none; border-radius:24px; padding:16px; color:#fff; cursor:pointer;
  display:flex; flex-direction:column; gap:6px; align-items:flex-start;
  min-height:112px; text-align:left; position:relative; overflow:hidden;
  box-shadow:0 10px 24px -12px rgba(30,27,75,.4); transition:transform .1s;
}
.tile:active{ transform:scale(.97); }
.tile .emoji{ font-size:34px; line-height:1; }
.tile .label{ font-weight:700; font-size:15px; }
.tile .sub{ font-size:11px; opacity:.9; font-weight:500; }

.chip{ display:inline-flex; align-items:center; gap:4px; font-weight:700;
  padding:5px 12px; border-radius:999px; font-size:13px; }

.badge-dot{ width:10px;height:10px;border-radius:999px;display:inline-block; }

/* Letter / number showcase */
.showcase-char{
  font-size:120px; font-weight:800; line-height:1;
  background:linear-gradient(180deg,var(--brand-light),var(--brand));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 6px 0 rgba(124,58,237,.12);
}

/* Progress bar */
.pbar{ height:12px; border-radius:999px; background:#eef2ff; overflow:hidden; }
.pbar > span{ display:block; height:100%; border-radius:999px;
  background:linear-gradient(90deg,var(--grass),var(--sky)); transition:width .5s; }

/* Screen transitions */
.screen-enter{ animation:pop .35s ease; }
@keyframes pop{ from{opacity:0; transform:translateY(10px) scale(.98);} to{opacity:1; transform:none;} }

.bounce{ animation:bounce 1.4s ease-in-out infinite; }
@keyframes bounce{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-10px);} }

.wiggle{ animation:wiggle 2.2s ease-in-out infinite; }
@keyframes wiggle{ 0%,100%{transform:rotate(-4deg);} 50%{transform:rotate(4deg);} }

/* Toast */
.toast{
  position:fixed; left:50%; bottom:96px; transform:translate(-50%, 30px);
  background:#1e1b4b; color:#fff; font-weight:600; font-size:14px;
  padding:12px 18px; border-radius:16px; opacity:0; pointer-events:none;
  transition:.3s; z-index:60; max-width:90%; text-align:center;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }

/* Confetti */
.confetti-canvas{ position:fixed; inset:0; width:100%; height:100%;
  pointer-events:none; z-index:70; }

/* Memory & quiz helpers */
.mcard{ aspect-ratio:1; border-radius:18px; border:none; cursor:pointer;
  font-size:34px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--brand-light),var(--brand)); color:#fff;
  transition:transform .3s; box-shadow:0 6px 16px -8px rgba(30,27,75,.5); }
.mcard.flipped{ background:#fff; border:2px solid #ede9fe; transform:rotateY(0); }
.mcard.matched{ background:#dcfce7; border:2px solid #86efac; }

.opt-btn{ width:100%; text-align:left; padding:16px 18px; border-radius:18px;
  border:2px solid #ede9fe; background:#fff; font-weight:700; font-size:16px;
  cursor:pointer; transition:.15s; }
.opt-btn:active{ transform:scale(.98); }
.opt-btn.correct{ background:#dcfce7; border-color:#4ade80; }
.opt-btn.wrong{ background:#fee2e2; border-color:#f87171; }

/* Drawing canvas */
.draw-wrap{ touch-action:none; }
canvas.pad{ background:#fff; border-radius:18px; border:2px dashed #ddd6fe; width:100%; display:block; }

/* Utility */
.hidden{ display:none !important; }
.tap{ cursor:pointer; }
.gradient-sky{ background:linear-gradient(180deg,#a78bfa,#7c3aed); }

.demo-banner{flex-shrink:0;text-align:center;background:#ede9fe;color:#5b21b6;padding:8px;font-size:11px;font-weight:700;letter-spacing:.05em}
.demo-login{padding:28px 24px 36px;text-align:center}.demo-mascot{font-size:64px;line-height:1.2;margin-bottom:12px}.demo-eyebrow{font-size:10px;font-weight:800;letter-spacing:.14em;color:#7c3aed;margin-bottom:8px}
.demo-login .kcard{text-align:left}.demo-label{display:block;font-weight:700;margin-bottom:6px}.demo-input{display:block;width:100%;font-size:16px;background:#f8fafc;border:2px solid #ede9fe;border-radius:14px;padding:12px;margin-bottom:16px;color:#1e293b}.demo-input:focus{outline:2px solid #7c3aed;outline-offset:2px}.demo-error{min-height:20px;font-size:14px;color:#b91c1c;margin-bottom:10px}.demo-credentials{margin-top:24px;border-radius:12px;padding:14px;background:#f5f3ff;font-size:13px;line-height:1.8;overflow-wrap:anywhere}.demo-note{font-size:12px;line-height:1.6;color:#64748b;margin-top:20px}button:disabled{opacity:.6;cursor:wait}button:focus-visible{outline:3px solid #7c3aed;outline-offset:3px}
