/* ZippyZebra LearnLand
   Tablet-first, big buttons, bright gradients, gentle animation.
*/

:root{
  --bg1:#0ea5e9;
  --bg2:#7c3aed;
  --bg3:#f97316;
  --ink:#0b1220;
  --card:#ffffffea;
  --stroke:#e5e7eb;
  --shadow: 0 18px 40px rgba(0,0,0,.14);
  --round: 22px;
  --radius: 18px;
  --font: "Fredoka", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--ink);
  background: radial-gradient(1200px 600px at 10% 10%, rgba(14,165,233,.30), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(124,58,237,.26), transparent 55%),
              radial-gradient(1000px 700px at 30% 95%, rgba(249,115,22,.20), transparent 55%),
              linear-gradient(180deg, #f8fafc, #eef2ff);
  overflow-x:hidden;
}

.abc-bg{
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background-image:
    radial-gradient(circle at 10% 15%, rgba(124,58,237,.4), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(14,165,233,.45), transparent 55%),
    radial-gradient(circle at 30% 80%, rgba(249,115,22,.35), transparent 50%);
}

.abc-bg::before{
  content:"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5";
  position:absolute;
  inset:-30%;
  font-weight:700;
  letter-spacing:22px;
  line-height:2.2;
  font-size: clamp(22px, 4vw, 56px);
  transform: rotate(-14deg);
  color: rgba(11,18,32,.35);
  filter: blur(.2px);
  animation: drift 28s linear infinite;
  white-space: pre-wrap;
}

@keyframes drift{
  from{ transform: translate3d(-2%, -2%, 0) rotate(-14deg); }
  to  { transform: translate3d(2%, 2%, 0) rotate(-14deg); }
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.72);
  border-bottom:1px solid rgba(229,231,235,.9);
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand-badge{
  width:46px; height:46px;
  border-radius:14px;
  display:grid; place-items:center;
  color:white; font-weight:800;
  background: linear-gradient(135deg, var(--bg2), var(--bg1));
  box-shadow: 0 10px 24px rgba(124,58,237,.25);
}
.brand-name{ font-weight:800; font-size:18px; letter-spacing:.2px; }
.brand-tag{ font-size:12px; opacity:.8; }

.toolbar{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.pill{
  border:1px solid rgba(229,231,235,.9);
  background:white;
  padding:10px 12px;
  border-radius:999px;
  font-family:var(--font);
  font-weight:600;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.pill:hover{ transform: translateY(-1px); box-shadow: 0 12px 24px rgba(0,0,0,.08); }
.pill:active{ transform: translateY(0px) scale(.99); }
.pill.ghost{ background: rgba(255,255,255,.55); }

.dot{
  display:inline-block;
  width:10px; height:10px;
  border-radius:99px;
  margin-right:6px;
  background:#22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}

.layout{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:14px;
  padding:14px;
  max-width: 1280px;
  margin:0 auto;
}

.sidebar .panel{
  background: var(--card);
  border:1px solid rgba(229,231,235,.9);
  border-radius: var(--round);
  padding:14px;
  box-shadow: var(--shadow);
}
.panel + .panel{ margin-top:12px; }
.panel-title{
  margin:0 0 10px 0;
  font-size:16px;
}
.nav{
  display:grid;
  gap:10px;
}
.nav button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-radius: 18px;
  border:1px solid rgba(229,231,235,.9);
  background:white;
  font-family:var(--font);
  font-weight:700;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}
.nav button:hover{ transform: translateY(-1px); box-shadow: 0 12px 24px rgba(0,0,0,.08); }
.nav button .left{ display:flex; align-items:center; gap:10px; }
.badge{
  width:34px; height:34px; border-radius:14px;
  display:grid; place-items:center;
  color:white; font-weight:900;
}
.k{ background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.p{ background: linear-gradient(135deg, #7c3aed, #f97316); }
.n{ background: linear-gradient(135deg, #ef4444, #f59e0b); }
.c{ background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.w{ background: linear-gradient(135deg, #f97316, #ec4899); }
.g{ background: linear-gradient(135deg, #10b981, #a3e635); }
.nav button.active{
  outline: 4px solid rgba(124,58,237,.15);
  border-color: rgba(124,58,237,.35);
}

.mini{ margin-top:14px; padding-top:12px; border-top:1px dashed rgba(0,0,0,.12); }
.mini-title{ font-weight:800; }
.stars{ display:flex; gap:6px; flex-wrap:wrap; padding:8px 0; }
.star{
  width:28px; height:28px; border-radius:12px;
  background: linear-gradient(135deg, #f59e0b, #fde047);
  display:grid; place-items:center;
  box-shadow: 0 10px 18px rgba(245,158,11,.25);
}
.star.off{
  opacity:.22;
  background: rgba(0,0,0,.08);
  box-shadow:none;
}
.mini-note{ font-size:12px; opacity:.8; }

.tips ul{ margin: 8px 0 0 18px; padding:0; }
.tips li{ margin: 7px 0; opacity:.9; }

.stage{
  min-height: calc(100vh - 110px);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.stage-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.crumbs{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  background: rgba(255,255,255,.70);
  border:1px solid rgba(229,231,235,.9);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}
.crumb{ font-weight:800; }
.sep{ opacity:.5; }

.progress{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  background: rgba(255,255,255,.70);
  border:1px solid rgba(229,231,235,.9);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}
.progress-bar{
  width:160px; height:12px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow:hidden;
}
#progressFill{
  height:100%;
  width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9, #7c3aed);
  transition: width .2s ease;
}
.progress-text{ font-weight:800; }

.card{
  background: var(--card);
  border:1px solid rgba(229,231,235,.9);
  border-radius: var(--round);
  padding:18px;
  box-shadow: var(--shadow);
}
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
  align-items:center;
}
.hero h1{
  margin:0 0 8px 0;
  font-size: clamp(26px, 3vw, 40px);
}
.highlight{
  background: linear-gradient(90deg, #7c3aed, #0ea5e9);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.hero p{ margin:0; font-size:16px; opacity:.92; }
.hero-actions{ display:flex; gap:12px; margin-top:14px; flex-wrap:wrap; }

.big{
  padding:14px 16px;
  border-radius: 18px;
  border:1px solid rgba(229,231,235,.9);
  background:white;
  font-family:var(--font);
  font-weight:900;
  font-size:16px;
  cursor:pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.big:hover{ transform: translateY(-1px); box-shadow: 0 16px 28px rgba(0,0,0,.10); }
.big:active{ transform: translateY(0px) scale(.99); }
.big.ghost{ background: rgba(255,255,255,.55); }

.chips{ display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.chip{
  padding:8px 10px;
  border-radius: 999px;
  background: rgba(124,58,237,.10);
  border: 1px solid rgba(124,58,237,.20);
  font-weight:800;
  font-size:12px;
}

.mascot{
  position:relative;
  width: 220px; height: 220px;
  margin: 0 auto;
}
.mascot-face{
  position:absolute;
  inset:20px 20px 70px 20px;
  border-radius: 44px;
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  border: 3px solid rgba(0,0,0,.12);
  box-shadow: 0 18px 30px rgba(124,58,237,.15);
  display:flex;
  align-items:center;
  justify-content:space-around;
  padding: 34px 22px 0;
  animation: bob 2.8s ease-in-out infinite;
}
@keyframes bob{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}
.eye{
  width:26px; height:26px;
  border-radius:999px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0 18%, #0b1220 20% 100%);
}
.nose{
  position:absolute;
  top: 58%;
  width: 18px; height: 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.16);
}
.smile{
  position:absolute;
  top: 68%;
  width: 76px; height: 40px;
  border-bottom: 7px solid rgba(0,0,0,.20);
  border-radius: 0 0 80px 80px;
}
.mascot-body{
  position:absolute;
  left: 36px; right: 36px; bottom: 22px;
  height: 70px;
  border-radius: 32px;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  box-shadow: 0 18px 34px rgba(14,165,233,.22);
}
.mascot-shadow{
  position:absolute;
  left: 22px; right: 22px; bottom: 10px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  filter: blur(1px);
}

.speech{ display:flex; justify-content:center; margin-top:10px; }
.bubble{
  background: white;
  border: 2px solid rgba(0,0,0,.10);
  border-radius: 18px;
  padding: 10px 12px;
  font-weight:800;
  box-shadow: 0 10px 18px rgba(0,0,0,.08);
}

.activity{ padding: 14px 14px 12px; }
.activity-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.activity-head h2{ margin:0; font-size:22px; }
.activity-tools{ display:flex; gap:10px; flex-wrap:wrap; }

.prompt{
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(14,165,233,.10);
  border: 1px solid rgba(14,165,233,.18);
}
.board{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
.tile{
  min-height: 86px;
  border-radius: 22px;
  border: 2px solid rgba(0,0,0,.08);
  background: white;
  box-shadow: 0 12px 22px rgba(0,0,0,.06);
  font-family:var(--font);
  font-weight:900;
  font-size: clamp(20px, 3vw, 34px);
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px;
  user-select:none;
}
.tile:hover{ transform: translateY(-2px); box-shadow: 0 18px 30px rgba(0,0,0,.09); }
.tile:active{ transform: translateY(0px) scale(.99); }

.tile.small{ font-size: clamp(18px, 2.6vw, 28px); }
.tile.good{ border-color: rgba(34,197,94,.55); outline: 4px solid rgba(34,197,94,.14); }
.tile.bad{ border-color: rgba(239,68,68,.55); outline: 4px solid rgba(239,68,68,.14); }

.feedback{
  margin-top:12px;
  font-weight: 900;
  font-size: 18px;
  min-height: 26px;
}
.feedback.good{ color:#16a34a; }
.feedback.bad{ color:#dc2626; }

.activity-foot{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.navbtn{
  padding: 14px 16px;
  border-radius: 18px;
  border:1px solid rgba(229,231,235,.9);
  background: white;
  font-family:var(--font);
  font-weight:900;
  font-size:16px;
  cursor:pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.navbtn:hover{ transform: translateY(-1px); box-shadow: 0 16px 28px rgba(0,0,0,.10); }
.navbtn.ghost{ background: rgba(255,255,255,.55); }

.footer{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding: 2px 2px 12px;
  opacity:.9;
  font-weight:700;
}
.footer-right{ display:flex; gap:10px; }

.modal{
  border:none;
  padding:0;
  background: transparent;
}
.modal::backdrop{
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(4px);
}
.modal-card{
  width:min(720px, calc(100vw - 20px));
  background: white;
  border-radius: 26px;
  border:1px solid rgba(229,231,235,.9);
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  overflow:hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(229,231,235,.9);
  background: linear-gradient(135deg, rgba(124,58,237,.10), rgba(14,165,233,.10));
}
.modal-title{ font-weight: 900; font-size: 18px; }
.modal-body{ padding: 14px; font-weight: 700; line-height: 1.55; }

.mobile-only{ display:none; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ position: fixed; inset: 70px 12px 12px 12px; z-index: 15; display:none; }
  .sidebar.open{ display:block; }
  .mobile-only{ display:inline-flex; }
  .hero{ grid-template-columns: 1fr; }
  .progress-bar{ width: 120px; }
  .board{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce){
  .abc-bg::before, .mascot-face{ animation: none; }
}


/* --- Extra advanced UI --- */
.profilebar{ margin:10px 0 12px; }
.profilechip{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius: 18px;
  border:1px solid rgba(229,231,235,.9);
  background: linear-gradient(135deg, rgba(14,165,233,.10), rgba(124,58,237,.10));
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease;
}
.profilechip:hover{ transform: translateY(-1px); }
.profilechip .avatar{ font-size:22px; }
.profilechip .pname{ font-weight:900; }
.profilechip .psmall{ margin-left:auto; font-weight:800; font-size:12px; opacity:.78; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.92);
  border:1px solid rgba(229,231,235,.9);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
  font-weight: 900;
  z-index: 30;
  display:none;
}

.confetti{
  position: fixed;
  inset: 0;
  pointer-events:none;
  z-index: 25;
  overflow:hidden;
}
.confetti i{
  position:absolute;
  width:12px; height:18px;
  border-radius: 6px;
  opacity:.9;
  animation: fall 1.25s linear forwards;
}
@keyframes fall{
  from{ transform: translate3d(0,-20px,0) rotate(0deg); }
  to{ transform: translate3d(0,110vh,0) rotate(720deg); }
}

.grid2{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; }
.sticker-grid{ display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:10px; margin-top:10px; }
.sticker{
  border-radius: 18px;
  border:1px solid rgba(229,231,235,.9);
  background: linear-gradient(135deg, rgba(249,115,22,.10), rgba(14,165,233,.10));
  padding: 12px;
  min-height: 78px;
  display:grid;
  place-items:center;
  font-size: 34px;
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
}
.sticker.off{
  opacity:.22;
  filter: grayscale(1);
  background: rgba(0,0,0,.04);
  box-shadow:none;
}
.smallnote{ font-size:12px; opacity:.75; font-weight:800; }



/* --- Tracing canvas --- */
.trace-wrap{
  grid-column: 1 / -1;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,.10);
  background: linear-gradient(135deg, rgba(255,255,255,.80), rgba(255,255,255,.55));
  box-shadow: 0 18px 46px rgba(0,0,0,.10);
  padding: 12px;
}
.trace-canvas{
  width: 100%;
  height: 320px;
  border-radius: 18px;
  background: rgba(14,165,233,.08);
  border: 1px dashed rgba(14,165,233,.35);
  touch-action: none;
}
.trace-tools{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.meter{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 18px;
  border:1px solid rgba(34,197,94,.18);
  background: rgba(34,197,94,.10);
  font-weight: 900;
}
.meter .bar{
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  flex: 1;
  overflow:hidden;
}
.meter .bar > i{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
}


/* --- Animated ABC Background --- */
/* Floating letters behind the UI, kid-friendly and colorful */
.abc-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .9;
}
.abc-bg i{
  position:absolute;
  font-weight: 1000;
  font-family: ui-rounded, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  text-shadow: 0 16px 36px rgba(0,0,0,.10);
  filter: saturate(1.25);
  animation: floaty var(--dur, 18s) linear infinite;
  transform: translate3d(0, 110vh, 0) rotate(0deg);
}
@keyframes floaty{
  from{ transform: translate3d(var(--x,0), 110vh, 0) rotate(0deg); }
  to{ transform: translate3d(var(--x,0), -140px, 0) rotate(360deg); }
}

/* make the whole app feel more playful */
:root{
  --kidShadow: 0 24px 70px rgba(0,0,0,.16);
}
body{
  background: radial-gradient(circle at 12% 8%, rgba(255, 209, 102, .55), transparent 45%),
              radial-gradient(circle at 88% 18%, rgba(98, 255, 181, .40), transparent 46%),
              radial-gradient(circle at 20% 92%, rgba(147, 197, 253, .48), transparent 52%),
              radial-gradient(circle at 92% 92%, rgba(244, 114, 182, .42), transparent 52%),
              linear-gradient(135deg, rgba(14,165,233,.20), rgba(124,58,237,.18));
}

/* lift main cards above background letters */
.app, header, main, .sidebar, .card, .modal{
  position: relative;
  z-index: 2;
}

.card{
  border-radius: 28px !important;
  box-shadow: var(--kidShadow) !important;
  border: 1px solid rgba(255,255,255,.8) !important;
  backdrop-filter: blur(10px);
}

.tile{
  border-radius: 26px !important;
  font-weight: 1000;
  box-shadow: 0 18px 44px rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.8);
}
.tile:hover{ transform: translateY(-2px) scale(1.01); }

.pill{
  border-radius: 999px !important;
  font-weight: 1000;
  box-shadow: 0 14px 30px rgba(0,0,0,.10);
}
