/* KidNova prototype — שפה חזותית מפרק 5: סגול חלל, טורקיז, צהוב כוכב, קרם */
:root {
  --purple: #6C4CE0; --teal: #2EC4B6; --star: #FFC93C; --coral: #FF6B6B;
  --cream: #FFF8EF; --dark: #3B3B4F; --card: #ffffff;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: "Rubik", "Heebo", "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 20% 10%, #2b2350 0%, #1a1533 55%, #120f24 100%);
  color: var(--dark); min-height: 100vh; overflow-x: hidden;
}

/* ---------- HUD ---------- */
#hud {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px;
  position: sticky; top: 0; z-index: 20;
}
.hud-item {
  background: rgba(255,255,255,.92); border-radius: 999px; padding: 6px 14px;
  font-weight: 700; font-size: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.hud-spacer { flex: 1; }
.dev-btn {
  background: rgba(255,255,255,.15); color: #cfc8f5; border: 1px dashed #7a6fd0;
  border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.dev-btn:hover { background: rgba(255,255,255,.28); }

/* ---------- Nova ---------- */
#nova { position: fixed; bottom: 18px; left: 18px; z-index: 30; display: flex; align-items: flex-end; gap: 8px; flex-direction: row-reverse; }
#nova-face {
  font-size: 54px; background: linear-gradient(145deg, var(--purple), #8f75ff);
  border-radius: 50%; width: 84px; height: 84px; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(108,76,224,.55); border: 3px solid #fff;
}
#nova-face.bounce { animation: bounce .6s ease; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 40%{transform:translateY(-14px) rotate(-6deg)} 70%{transform:translateY(0) rotate(3deg)} }
#nova-bubble {
  background: #fff; border-radius: 18px 18px 18px 4px; padding: 10px 16px;
  max-width: 240px; font-size: 16px; font-weight: 600; opacity: 0;
  transform: translateY(8px); transition: all .25s ease; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
#nova-bubble.pop { opacity: 1; transform: translateY(0); }

/* ---------- מסכים ---------- */
main { max-width: 680px; margin: 0 auto; padding: 8px 16px 130px; }
.screen.hidden { display: none; }
.title { color: #fff; text-align: center; font-size: 34px; margin: 8px 0 2px; text-shadow: 0 2px 12px rgba(108,76,224,.8); }
.subtitle { color: var(--star); text-align: center; font-size: 16px; margin-bottom: 16px; }

.cta {
  display: block; width: 100%; padding: 20px; font-size: 24px; font-weight: 800;
  font-family: inherit; color: #fff; border: none; border-radius: 22px; cursor: pointer;
  background: linear-gradient(135deg, var(--coral), #ff9e5e);
  box-shadow: 0 8px 0 #c94f4f, 0 12px 26px rgba(0,0,0,.35);
  transition: transform .08s ease; margin-bottom: 22px;
}
.cta:active { transform: translateY(6px); box-shadow: 0 2px 0 #c94f4f; }
.cta.done { background: linear-gradient(135deg, #57c88a, #3aa76d); box-shadow: 0 8px 0 #2c7d52; cursor: default; }

/* ---------- כוכבים ---------- */
.planets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.planet {
  background: rgba(255,255,255,.94); border-radius: 20px; padding: 16px 10px;
  text-align: center; position: relative; box-shadow: 0 5px 16px rgba(0,0,0,.3);
  transition: transform .15s ease;
}
.planet:not(.locked):hover { transform: translateY(-4px) scale(1.03); }
.planet.locked { opacity: .45; filter: grayscale(.7); }
.planet-emoji { font-size: 44px; }
.planet-name { font-weight: 700; font-size: 14px; margin-top: 6px; }
.lock { position: absolute; top: 8px; inset-inline-start: 10px; font-size: 18px; }

/* ---------- הרפתקה ---------- */
#adv-progress { background: rgba(255,255,255,.2); border-radius: 999px; height: 14px; margin: 10px 0 18px; overflow: hidden; }
#adv-plant { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #7be3a1); transition: width .6s ease; }
#adv-stage { background: var(--cream); border-radius: 26px; padding: 22px; min-height: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }

.act-intro { text-align: center; padding: 50px 0; animation: fadein .5s ease; }
.act-emoji { font-size: 74px; animation: bounce 1s ease; }
.act-title { font-size: 28px; font-weight: 800; margin-top: 8px; }
.act-kind { color: var(--purple); font-weight: 700; margin-top: 6px; }
@keyframes fadein { from{opacity:0} to{opacity:1} }

.q-prompt { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 18px; }
.q-prompt.math-q { font-size: 40px; letter-spacing: 2px; }
.speak-btn { border: none; background: var(--teal); color: #fff; border-radius: 50%; width: 44px; height: 44px; font-size: 20px; cursor: pointer; vertical-align: middle; }
.speak-btn.big { width: 64px; height: 64px; font-size: 30px; }

.opt-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.opt-card {
  background: #fff; border: 3px solid #e3ddf5; border-radius: 20px; cursor: pointer;
  min-width: 110px; min-height: 110px; font-size: 30px; font-weight: 800; font-family: inherit;
  display: grid; place-items: center; transition: transform .1s ease;
  box-shadow: 0 5px 0 #e3ddf5;
}
.opt-card:hover { transform: translateY(-3px); }
.opt-card:active { transform: translateY(3px); box-shadow: 0 1px 0 #e3ddf5; }
.opt-emoji { font-size: 56px; }
.opt-card.num { font-size: 36px; color: var(--purple); }
.opt-correct { border-color: #3aa76d !important; background: #e8fff1 !important; box-shadow: 0 5px 0 #3aa76d !important; }
.opt-wrong { border-color: var(--coral) !important; background: #fff0f0 !important; animation: shake .35s ease; }
.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }

/* זיכרון */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mem-card {
  position: relative; height: 92px; border: none; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--purple), #9b7bff); color: #fff;
  font-size: 22px; font-weight: 800; font-family: inherit; box-shadow: 0 4px 0 #4b34a8;
}
.mem-card .mem-back { display: none; }
.mem-card.flip { background: #fff; color: var(--dark); box-shadow: 0 4px 0 #d9d2f0; }
.mem-card.flip .mem-front { display: none; }
.mem-card.flip .mem-back { display: block; }

/* מרוץ */
.fuel-track { position: relative; background: #eee5d4; border-radius: 999px; height: 26px; margin-bottom: 20px; }
.fuel-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--star), var(--coral)); transition: width .4s ease; }
.fuel-car { position: absolute; top: -12px; inset-inline-start: calc(var(--p, 0%) - 10px); font-size: 26px; }

.count-field { font-size: 40px; text-align: center; letter-spacing: 6px; margin-bottom: 18px; line-height: 1.4; }

/* ---------- חגיגה ---------- */
.celebrate-card { background: var(--cream); border-radius: 26px; padding: 40px 24px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); margin-top: 30px; }
.cel-big { font-size: 84px; animation: bounce 1s ease infinite; }
.celebrate-card h2 { font-size: 26px; margin: 10px 0; }
.cel-stats { font-size: 18px; color: #6b6580; }
.cel-reward { font-size: 22px; font-weight: 800; color: var(--purple); margin: 12px 0 22px; }

/* ---------- קונפטי ---------- */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetto { position: absolute; top: -30px; animation: fall 2.2s linear forwards; }
@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); opacity: .6; }
}

@media (max-width: 480px) {
  .opt-card { min-width: 86px; min-height: 86px; }
  .opt-emoji { font-size: 44px; }
  #nova-face { width: 64px; height: 64px; font-size: 40px; }
  .mem-grid { grid-template-columns: repeat(4, 1fr); }
  .mem-card { height: 74px; font-size: 17px; }
}

/* ---------- בחירת ילד ---------- */
.child-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.child-card {
  background: rgba(255,255,255,.94); border: none; border-radius: 22px; cursor: pointer;
  width: 150px; padding: 20px 10px; text-align: center; font-family: inherit;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: transform .15s ease;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.child-card:hover { transform: translateY(-4px) scale(1.04); }
.child-card.add { background: rgba(255,255,255,.25); color: #fff; border: 2px dashed rgba(255,255,255,.5); }
.child-avatar { font-size: 52px; }
.child-name { font-weight: 800; font-size: 18px; }
.child-meta { font-size: 13px; color: #6b6580; }
.create-child {
  background: var(--cream); border-radius: 24px; padding: 24px; max-width: 420px;
  margin: 16px auto; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.create-child h2 { margin-bottom: 14px; }
.create-child input {
  width: 100%; padding: 14px; font-size: 20px; font-family: inherit; text-align: center;
  border: 3px solid #e3ddf5; border-radius: 14px; margin-bottom: 14px;
}
.avatar-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.avatar-pick {
  font-size: 30px; background: #fff; border: 3px solid #e3ddf5; border-radius: 14px;
  width: 54px; height: 54px; cursor: pointer;
}
.avatar-pick.sel { border-color: var(--purple); background: #f1ebff; transform: scale(1.1); }

/* ---------- שער הורים ---------- */
.gate-card {
  background: var(--cream); border-radius: 24px; padding: 30px; max-width: 380px;
  margin: 60px auto; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.gate-card p { font-size: 20px; margin: 14px 0; }
.gate-card input {
  width: 120px; padding: 12px; font-size: 24px; text-align: center; font-family: inherit;
  border: 3px solid #e3ddf5; border-radius: 14px; margin-bottom: 14px;
}
.cta.small { font-size: 18px; padding: 12px; }
.linkish { background: none; border: none; color: #8f86b8; cursor: pointer; font-family: inherit; font-size: 15px; margin-top: 10px; }

/* ---------- דשבורד הורים ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; color: #fff; margin: 8px 0 14px; }
.dash-card {
  background: var(--cream); border-radius: 22px; padding: 18px; margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
}
.dash-child { font-size: 20px; margin-bottom: 12px; }
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 14px; padding: 10px; text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--purple); }
.stat-label { font-size: 12px; color: #6b6580; }
.week-chart { display: flex; gap: 8px; align-items: flex-end; height: 96px; padding: 0 6px 4px; }
.wc-col { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.wc-bar { background: linear-gradient(180deg, var(--teal), #7be3a1); border-radius: 6px 6px 0 0; margin: 0 auto; width: 70%; }
.wc-label { font-size: 12px; color: #6b6580; margin-top: 4px; }
.dash-lists { font-size: 15px; line-height: 1.9; margin: 10px 0; }
.nova-tip { background: #f1ebff; border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.dash-note { color: #9a92c4; font-size: 13px; text-align: center; margin-top: 6px; }
@media (max-width: 480px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }

/* נכון/לא נכון + כפתורים רחבים (גל 2) */
.q-prompt.tf-q { font-size: 22px; line-height: 1.5; }
.opt-card.tf { min-width: 150px; font-size: 22px; }
.opt-card.wide { min-width: 150px; max-width: 260px; font-size: 17px; padding: 10px 14px; line-height: 1.4; }
