/* JayDay tutor app — additions on top of the shared assessment stylesheet */

#stats { display: flex; gap: 8px; margin-left: auto; }
.stat {
  background: rgba(255,255,255,.18); color: #fff; font-weight: 800;
  border-radius: 999px; padding: 6px 12px; font-size: .95rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ---------- journey map (home) ---------- */
.journey { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.journey-stop { display: flex; align-items: center; gap: 12px; }
.journey-dot {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: #e8e4fb; border: 3px solid #d5d0ee;
}
.journey-stop.reached .journey-dot { background: #fff3c4; border-color: var(--accent); }
.journey-stop.current .journey-dot { box-shadow: 0 0 0 4px rgba(255,183,3,.35); }
.journey-label { font-weight: 700; font-size: .95rem; }
.journey-stop .journey-sub { font-size: .78rem; color: #9a96b8; }
.journey-line { width: 3px; height: 18px; background: #d5d0ee; margin-left: 21px; border-radius: 2px; }
.journey-stop.reached + .journey-line { background: var(--accent); }

/* ---------- daily goal ring ---------- */
.goal-row { display: flex; align-items: center; gap: 10px; }
.goal-dot { width: 16px; height: 16px; border-radius: 50%; background: #e8e4fb; border: 2px solid #d5d0ee; }
.goal-dot.done { background: var(--good); border-color: var(--good); }

/* ---------- skill grid ---------- */
.track-tabs { display: flex; gap: 10px; width: 100%; }
.track-tab {
  flex: 1; border: none; cursor: pointer; font-family: inherit;
  border-radius: 16px; padding: 12px; font-size: 1.05rem; font-weight: 800;
  background: var(--btn); color: var(--ink); box-shadow: 0 3px 0 #d5d0ee;
}
.track-tab.active { background: var(--accent); color: #4a3200; box-shadow: 0 3px 0 #d99a00; }

.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.skill-card {
  border: 3px solid #e8e4fb; background: var(--btn); border-radius: 20px;
  padding: 14px 10px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.skill-card:active { transform: scale(.97); }
.skill-emoji { font-size: 2.2rem; }
.skill-name { font-weight: 800; font-size: .95rem; text-align: center; }
.skill-stars { font-size: .8rem; letter-spacing: 2px; }
.skill-card.mastered { background: #fff3c4; border-color: var(--accent); }
.skill-card.suggested { border-color: var(--good); box-shadow: 0 0 0 3px rgba(46,194,126,.25); }

/* ---------- avatar ---------- */
#avatar-dock {
  position: fixed; left: 10px; bottom: 10px; z-index: 40;
  display: flex; align-items: flex-end; gap: 8px; pointer-events: none;
  max-width: 92vw;
}
#avatar-svg { width: 92px; height: 92px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
#avatar-bubble {
  background: #fff; border-radius: 16px 16px 16px 4px; padding: 10px 14px;
  font-size: .95rem; font-weight: 700; color: var(--ink);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  max-width: 240px; margin-bottom: 26px;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
#avatar-bubble.visible { opacity: 1; transform: translateY(0); }

@keyframes avatar-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#avatar-svg.cheer { animation: avatar-bob .5s ease 3; }

/* ---------- fluency timer ---------- */
.fluency-track { width: 100%; height: 8px; background: #e8e4fb; border-radius: 999px; overflow: hidden; }
.fluency-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #ffd166, #ff9f6b); border-radius: 999px; }
.fluency-bar.draining { transition: width 10s linear; width: 0%; }

/* ---------- help button & hints ---------- */
.help-btn {
  font-family: inherit; border: none; cursor: pointer;
  background: #e5f6ff; color: #1a6a99; font-weight: 700; font-size: 1rem;
  border-radius: 14px; padding: 10px 18px; box-shadow: 0 3px 0 #bfe0f2;
  opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.help-btn.visible { opacity: 1; pointer-events: auto; }
.help-btn:disabled { opacity: .5; pointer-events: none; }
.opt.dimmed { opacity: .3; }
.hint-text { font-size: 1.05rem; font-weight: 700; color: #1a6a99; text-align: center; }

/* ---------- memory guide ring ---------- */
.mem-btn.guide { box-shadow: 0 0 0 4px rgba(46,194,126,.55); border-color: var(--good); }

/* ---------- rewards ---------- */
.egg-progress { display: flex; align-items: center; gap: 10px; font-size: 2rem; }
.egg-bar { flex: 1; height: 12px; background: #e8e4fb; border-radius: 999px; overflow: hidden; }
.egg-fill { height: 100%; background: linear-gradient(90deg, #2ec27e, #6fe0ab); border-radius: 999px; transition: width .6s ease; }
.dino-shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.dino-slot {
  background: var(--btn); border: 3px solid #e8e4fb; border-radius: 16px;
  min-height: 64px; display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.dino-slot.empty { filter: grayscale(1); opacity: .45; font-size: 1.6rem; }
@keyframes hatch-pop { 0% { transform: scale(.2) rotate(-20deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1); } }
.hatched { animation: hatch-pop .7s ease; }

/* ---------- parent dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.dash-tile { background: var(--btn); border-radius: 14px; padding: 12px; }
.dash-tile b { font-size: 1.3rem; display: block; font-variant-numeric: tabular-nums; }
.dash-tile span { font-size: .8rem; color: #6b678c; }
.gap-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; width: 100%; background: #e8e4fb; }
.gap-lang { background: #58b7e6; }
.gap-concept { background: #ff9f6b; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: #6b678c; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }

.home-actions { display: flex; gap: 10px; width: 100%; }
.home-actions .btn { flex: 1; font-size: 1.05rem; padding: 14px 10px; }

#brand { display: flex; align-items: center; gap: 6px; }
#brand-logo { width: 30px; height: 30px; }

/* ---------- Daily Mission ---------- */
.mission-card { margin-bottom: 12px; }
.mission-slots { display: flex; gap: 8px; width: 100%; justify-content: space-between; }
.mission-slot {
  flex: 1; background: var(--btn); border: 2px solid #e8e4fb; border-radius: 14px;
  padding: 8px 4px; text-align: center; font-size: 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.mission-slot span { font-size: .6rem; color: #6b678c; font-weight: 700; }
.mission-slot.done { background: #d9f7e8; border-color: var(--good); }

/* ---------- worlds ---------- */
.world-header {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 1.05rem; margin: 12px 0 8px;
  padding: 8px 12px; background: #f4f1ff; border-radius: 12px;
}
.world-header.locked { opacity: .55; }
.world-progress { font-size: .85rem; color: #6b678c; font-weight: 700; }
#screen > .card + .card { margin-top: 12px; }

/* ---------- the jay, front and center ---------- */
.jay-md { width: 44px; height: 44px; flex: none; }
.jay-lg { width: 100px; height: 100px; }
.jay-dot { width: 38px; height: 38px; }
.jay-trophy { display: flex; align-items: flex-end; justify-content: center; gap: 4px; font-size: 3.4rem; }
@keyframes jay-bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
.jay-lg.bob { animation: jay-bob 1.6s ease-in-out infinite; }

/* ---------- mom, center stage ---------- */
.mom-stage svg.mom-lg { width: 170px; height: 170px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.jay-trophy svg.mom-md { width: 92px; height: 92px; }
#avatar-svg { width: 104px; height: 104px; }


/* ---------- hosts bar: mom & jay at the top ---------- */
#hosts-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 2px 12px 0; pointer-events: none;
  max-width: 640px; margin: 0 auto; width: 100%;
}
#jay-host {
  width: 68px; height: 68px; pointer-events: auto; cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
  transition: transform .15s ease;
}
#jay-host:hover { transform: scale(1.1) rotate(-5deg); }
@keyframes jay-flap { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-9deg) translateY(-5px); } 60% { transform: rotate(6deg); } }
#jay-host.flap { animation: jay-flap .5s ease; }
#avatar-dock {
  position: relative; inset: auto; display: flex; flex-direction: column; align-items: flex-end;
  pointer-events: none; max-width: none;
}
#avatar-svg { width: 72px; height: 72px; }
#avatar-bubble {
  position: absolute; top: 100%; right: 0; margin-top: 2px; margin-bottom: 0;
  border-radius: 16px 4px 16px 16px; width: max-content; max-width: 60vw;
}


/* ---------- story passages ---------- */
.passage-box {
  width: 100%; background: #fffbe9; border: 2px solid #f2e2ae; border-radius: 14px;
  padding: 14px 16px; font-size: 1.25rem; line-height: 1.7; color: #4a3a10;
  font-weight: 600;
}
.passage-box.small { font-size: 1rem; padding: 10px 12px; line-height: 1.5; }


/* ---------- school report ---------- */
.report-area {
  width: 100%; min-height: 260px; font-family: ui-monospace, Menlo, monospace;
  font-size: .72rem; line-height: 1.5; border: 2px dashed #c9c3ea; border-radius: 12px;
  padding: 12px; color: #444; resize: vertical; white-space: pre;
}

/* ============================================================
   POLISH LAYER (v18) — commercial-grade visual pass
   ============================================================ */

/* living night sky */
body::before, body::after {
  content: ''; position: fixed; inset: -60px; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 12% 20%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(2px 2px at 32% 68%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 84%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(2.5px 2.5px at 88% 52%, rgba(255,209,102,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 88%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(2px 2px at 48% 8%, rgba(255,209,102,.6), transparent 60%);
  animation: sky-drift 90s linear infinite;
}
body::after { animation-duration: 140s; animation-direction: reverse; opacity: .6; transform: scale(1.4); }
@keyframes sky-drift { from { transform: translateY(0); } to { transform: translateY(60px); } }
#app, #hosts-bar { position: relative; z-index: 1; }

/* cards float softer */
.card { border-radius: 26px; box-shadow: 0 16px 44px rgba(10,8,40,.35), 0 2px 8px rgba(10,8,40,.18); }

/* buttons: gradient + lift */
.btn {
  background: linear-gradient(180deg, #ffd166, #ffb703);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #d99a00, 0 10px 20px rgba(0,0,0,.15); filter: brightness(1.03); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d99a00; }
.btn.secondary { background: linear-gradient(180deg, #faf8ff, #efeafd); }
.btn.whatsapp { background: linear-gradient(180deg, #3fdf7c, #25d366); }
.track-tab.active { background: linear-gradient(180deg, #ffd166, #ffb703); }

/* answer tiles: hover life */
.opt { transition: transform .1s ease, background .15s, border-color .15s, box-shadow .15s; }
.opt:not(:disabled):hover { transform: translateY(-2px); border-color: #cfc7f5; box-shadow: 0 6px 14px rgba(74,58,173,.12); }

/* mission card: hero treatment */
.mission-card { background: linear-gradient(165deg, #fffdf5, #fff6dc); border: 2px solid #ffe1a1; }
.mission-slot { transition: transform .2s ease, background .2s, border-color .2s; }
.mission-slot.done { transform: scale(1.04); }

/* subject color-coding */
.world-header { border-left: 6px solid #d5d0ee; }
.world-header.track-english { border-left-color: #4aa3e0; background: #eef6fd; }
.world-header.track-math { border-left-color: #b78bfa; background: #f5effe; }
.world-header.track-science { border-left-color: #2ec27e; background: #eafaf2; }

/* mastered skills shimmer */
.skill-card { position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.skill-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(74,58,173,.14); }
.skill-card.mastered::after {
  content: ''; position: absolute; top: -60%; left: -80%; width: 50%; height: 220%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.75), transparent);
  transform: rotate(15deg); animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine { 0%, 70% { left: -80%; } 100% { left: 160%; } }

/* chest begs to be opened */
@keyframes chest-bounce {
  0%, 100% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.12) rotate(-4deg); }
  60% { transform: scale(1.06) rotate(3deg); }
}
.chest-pulse { animation: chest-bounce 1.4s ease-in-out infinite; }

/* celebration particles refined */
.feedback-burst { animation: burst 1.3s cubic-bezier(.2,.7,.3,1) forwards; text-shadow: 0 2px 10px rgba(0,0,0,.2); }
@keyframes burst {
  0% { transform: translate(-50%,-50%) scale(.2) rotate(-20deg); opacity: 0; }
  25% { transform: translate(-50%,-70%) scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: translate(-50%,-160%) scale(.9) rotate(20deg); opacity: 0; }
}

/* journey path: golden dotted trail */
.journey-line { background: repeating-linear-gradient(180deg, #d5d0ee 0 4px, transparent 4px 8px); width: 4px; }
.journey-stop.reached + .journey-line { background: repeating-linear-gradient(180deg, var(--accent) 0 4px, transparent 4px 8px); }
.journey-stop.current .journey-dot { animation: chest-bounce 2.2s ease-in-out infinite; }

/* glassy stat chips */
.stat { background: rgba(255,255,255,.14); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); }


/* ============================================================
   BRAND LAYER (v19) — BitStage-family palette, kid-friendly fonts
   Stage Navy sky · Spotlight Green actions · Orange Glyph accents
   ============================================================ */
.title, .thai-prompt, #brand, .world-header, .btn, .track-tab { font-family: 'Baloo 2', 'Itim', sans-serif; }
.btn {
  background: linear-gradient(180deg, #6fdb63, #4faf3d);
  color: #ffffff; box-shadow: 0 4px 0 #3a8a2c; text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.btn:hover { box-shadow: 0 7px 0 #3a8a2c, 0 10px 20px rgba(0,0,0,.15); }
.btn:active { box-shadow: 0 1px 0 #3a8a2c; }
.btn.secondary { background: linear-gradient(180deg, #ffffff, #eef2f5); color: #002242; box-shadow: 0 4px 0 #DCE0E3; text-shadow: none; }
.btn.whatsapp { background: linear-gradient(180deg, #3fdf7c, #25d366); box-shadow: 0 4px 0 #1da851; }
.track-tab.active { background: linear-gradient(180deg, #6fdb63, #4faf3d); color: #fff; box-shadow: 0 3px 0 #3a8a2c; }
.help-btn { background: #fef2e2; color: #b36a08; box-shadow: 0 3px 0 #f3d9b4; }
.mission-card { background: linear-gradient(165deg, #FAF9F7, #fdf3e2); border-color: #F7931A55; }
.card { color: #002242; }
.subtitle { color: #6A7881; }
