/* ============================================================
   קוראים חכמים — עולם הקריאה | סגנון ראשי
   פלטה: עולם טבע מאויר — שמיים, דשא, שבילי עפר, שלטי עץ
   ============================================================ */
:root {
  --sky-top: #3f9fdc;
  --sky-bottom: #a8ddf5;
  --grass: #5cad35;
  --grass-dark: #3d8a24;
  --grass-light: #7cc94e;
  --path: #e2bd7a;
  --path-dark: #c99f57;
  --wood: #8a5a2b;
  --wood-dark: #5f3d1c;
  --wood-light: #b07f45;
  --cream: #fdf6e3;
  --cream-dark: #f3e6c8;
  --ink: #3d2b1a;
  --ink-soft: #6b543c;
  --gold: #f5b301;
  --green-ok: #3a9e3d;
  --red-err: #d9534f;
  --blue-btn: #2f88d0;
  --blue-btn-dark: #1f6aa8;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(40, 25, 5, .25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Heebo', sans-serif;
  color: var(--ink);
  background: var(--sky-bottom);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .font-display { font-family: 'Rubik', sans-serif; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }

#app, .screen { position: fixed; inset: 0; }

/* ============ כפתור ראשי משותף ============ */
.btn-main {
  display: inline-block;
  background: linear-gradient(180deg, #ffcf3f, var(--gold));
  border: 3px solid #c78e00;
  border-radius: 999px;
  padding: 12px 34px;
  font-family: 'Rubik';
  font-weight: 700;
  font-size: 1.15rem;
  color: #5f3d00;
  box-shadow: 0 4px 0 #a87800, var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.btn-main:hover { transform: translateY(-2px); }
.btn-main:active { transform: translateY(2px); box-shadow: 0 1px 0 #a87800; }
.btn-main:disabled { filter: grayscale(.8); opacity: .55; cursor: default; transform: none; }

.btn-soft {
  background: var(--cream);
  border: 2px solid var(--wood-light);
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 700;
  color: var(--ink-soft);
  box-shadow: 0 2px 0 var(--wood-light);
}

/* ============================================================
   מסך פתיחה
   ============================================================ */
#screen-onboarding { display: flex; align-items: center; justify-content: center; }
.ob-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 16%, rgba(255,240,170,.9) 0 46px, rgba(255,240,170,0) 120px),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 55%, var(--grass-light) 55.2%, var(--grass) 78%, var(--grass-dark) 100%);
}
.ob-card {
  position: relative;
  width: min(520px, 92vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--cream);
  border: 4px solid var(--wood);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 30px 26px;
  text-align: center;
  animation: pop-in .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } }

.ob-logo { font-size: 3rem; line-height: 1; margin-bottom: 6px; }
.ob-title { font-size: 2rem; font-weight: 900; color: var(--wood-dark); margin-bottom: 6px; }
.ob-sub { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 22px; }

.ob-input {
  width: min(300px, 100%);
  font-family: 'Heebo';
  font-size: 1.2rem;
  text-align: center;
  padding: 12px 16px;
  border: 3px solid var(--wood-light);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 18px;
  outline: none;
}
.ob-input:focus { border-color: var(--blue-btn); }

.ob-choices { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 22px; }
.ob-choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 104px; padding: 14px 6px;
  background: #fff;
  border: 3px solid var(--cream-dark);
  border-radius: 16px;
  font-weight: 700; font-size: .95rem; color: var(--ink);
  transition: transform .12s, border-color .12s;
}
.ob-choice .big { font-size: 2rem; }
.ob-choice:hover { transform: translateY(-3px); }
.ob-choice.selected { border-color: var(--gold); background: #fff8dd; box-shadow: 0 0 0 3px rgba(245,179,1,.35); }

.ob-avatar-row { display: flex; justify-content: center; margin-bottom: 14px; }

/* ============================================================
   הדמות (SVG + אביזרים)
   ============================================================ */
.avatar-box { position: relative; width: 110px; height: 130px; }
.avatar-box svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.avatar-hat  { position: absolute; top: -14%; left: 50%; transform: translateX(-50%); font-size: 42px; line-height: 1; }
.avatar-face { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); font-size: 30px; line-height: 1; }
.avatar-pet  { position: absolute; bottom: -4%; left: -18%; font-size: 34px; line-height: 1; }
.avatar-box.mini { width: 34px; height: 40px; }
.avatar-box.mini .avatar-hat { font-size: 14px; }
.avatar-box.mini .avatar-face { font-size: 10px; }
.avatar-box.mini .avatar-pet { display: none; }

/* ============================================================
   מפת העולם
   ============================================================ */
#screen-map { overflow: hidden; }
.map-world { position: absolute; inset: 0; }

.map-sky {
  position: absolute; inset: 0 0 55% 0;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}
.sun {
  position: absolute; top: 26px; left: 7%;
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle, #fff3b0 30%, #ffd94d 65%, rgba(255,217,77,0) 72%);
  box-shadow: 0 0 60px 24px rgba(255,225,120,.55);
}
.cloud {
  position: absolute;
  background: #fff; border-radius: 999px; opacity: .92;
  animation: drift 60s linear infinite;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: #fff; border-radius: 50%;
}
.c1 { top: 9%; right: 12%; width: 110px; height: 34px; }
.c1::before { width: 48px; height: 48px; top: -22px; right: 18px; }
.c1::after  { width: 34px; height: 34px; top: -14px; right: 55px; }
.c2 { top: 4%; right: 55%; width: 90px; height: 28px; animation-delay: -25s; }
.c2::before { width: 40px; height: 40px; top: -18px; right: 14px; }
.c2::after  { width: 28px; height: 28px; top: -12px; right: 46px; }
.c3 { top: 16%; right: 80%; width: 70px; height: 24px; animation-delay: -45s; }
.c3::before { width: 30px; height: 30px; top: -14px; right: 12px; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-60vw); } }

.map-ground {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 130% 62% at 50% 112%, var(--grass-dark) 0%, var(--grass) 55%, var(--grass-light) 78%, rgba(124,201,78,0) 79%),
    radial-gradient(ellipse 120% 30% at 20% 46%, var(--grass-light) 0 60%, rgba(124,201,78,0) 61%),
    radial-gradient(ellipse 120% 30% at 85% 42%, var(--grass-light) 0 60%, rgba(124,201,78,0) 61%);
}
/* עצים ופרחים דקורטיביים */
.map-deco { position: absolute; font-size: 30px; opacity: .95; text-shadow: 0 3px 3px rgba(0,0,0,.18); pointer-events: none; }

/* רקע תמונת ה-GPT — כשהקובץ קיים, שכבות ה-CSS המצוירות מוסתרות */
.map-world.photo-bg {
  background: url('../assets/img/map-background.png') center / cover no-repeat;
}
.map-world.photo-bg .map-sky,
.map-world.photo-bg .map-ground,
.map-world.photo-bg .map-deco { display: none; }

.map-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* אבני הדרך של השביל — משתלבות בציור במקום רצועה ישרה */
.map-path-svg .path-stone {
  fill: #eed9ac;
  stroke: #c2985f;
  stroke-width: .16;
  opacity: .92;
}
.map-path-svg .path-stone.alt { fill: #e4c890; }
.map-path-svg .path-stone-shadow {
  fill: rgba(80, 52, 18, .28);
}

.map-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border: 3px solid var(--wood-dark);
  border-radius: 14px;
  color: #fdf0d0;
  font-family: 'Rubik'; font-weight: 900; font-size: clamp(1.1rem, 3.4vw, 1.7rem);
  padding: 10px 26px;
  box-shadow: var(--shadow);
  z-index: 5;
  white-space: nowrap;
}
.banner-leaf { margin: 0 8px; }

/* תחנות */
.station {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  z-index: 4;
  transition: transform .15s;
}
.station:not(.locked):hover { transform: translate(-50%, -54%) scale(1.06); }
.station-circle {
  position: relative;
  width: clamp(58px, 9vw, 86px); height: clamp(58px, 9vw, 86px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbe9, var(--cream-dark));
  border: 5px solid var(--wood);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}
.station-num {
  position: absolute; top: -12px; right: -8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-btn); color: #fff;
  border: 3px solid #fff;
  font-family: 'Rubik'; font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
.station-label {
  background: rgba(95, 61, 28, .88);
  color: #fdf0d0;
  font-size: clamp(.68rem, 1.7vw, .85rem); font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
.station.done .station-circle { border-color: var(--green-ok); }
.station.done .station-num { background: var(--green-ok); }
.station .station-check {
  position: absolute; bottom: -8px; left: -6px;
  background: var(--green-ok); color: #fff; border-radius: 50%;
  width: 26px; height: 26px; font-size: .9rem;
  display: none; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.station.done .station-check { display: flex; }
.station.open .station-circle { animation: station-glow 1.6s ease-in-out infinite; cursor: pointer; }
@keyframes station-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,179,1,.65), var(--shadow); }
  50% { box-shadow: 0 0 0 14px rgba(245,179,1,0), var(--shadow); }
}
.station.locked { filter: grayscale(.85); opacity: .72; }
.station.locked .station-circle { cursor: default; font-size: clamp(1.2rem, 2.6vw, 1.7rem); }

/* הדמות על המפה */
.map-avatar {
  position: absolute; z-index: 6;
  transform: translate(-50%, -20%);
  transition: top 1.1s cubic-bezier(.5,0,.4,1), left 1.1s cubic-bezier(.5,0,.4,1);
  animation: bob 2.4s ease-in-out infinite;
  pointer-events: none;
}
.map-avatar .avatar-box { width: clamp(56px, 8vw, 84px); height: clamp(66px, 9.5vw, 100px); }
.map-avatar .avatar-hat { font-size: clamp(22px, 3.4vw, 34px); }
.map-avatar .avatar-face { font-size: clamp(15px, 2.4vw, 24px); }
.map-avatar .avatar-pet { font-size: clamp(18px, 2.8vw, 28px); }
@keyframes bob { 0%,100% { margin-top: 0; } 50% { margin-top: -7px; } }

/* HUD */
.hud {
  position: absolute; top: 12px; right: 12px; left: 12px;
  display: flex; justify-content: space-between; align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-left { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hud-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream);
  border: 3px solid var(--wood);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700; font-size: 1rem; color: var(--ink);
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}
.hud-chip.small { padding: 4px 12px; font-size: .95rem; }
.hud-btn { transition: transform .12s; }
.hud-btn:hover { transform: translateY(-2px); }
.hud-coins .coin-ico { font-size: 1.1rem; }
.hud-player { gap: 8px; }
.hud-mini-avatar { display: inline-block; }
.hud-gear { padding: 7px 10px; }
@media (max-width: 640px) {
  .hud-btn-txt { display: none; }
  .map-banner { top: 66px; }
}

/* ============================================================
   מסך יחידה
   ============================================================ */
#screen-unit {
  background:
    linear-gradient(rgba(30, 60, 20, .18), rgba(30, 60, 20, .18)),
    linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 45%, var(--grass) 46%, var(--grass-dark));
  display: flex; flex-direction: column;
}
/* רקע איור למסך השיעור (מוצב ב-JS לפי הנכס הזמין) */
#screen-unit.photo-bg {
  background-image:
    linear-gradient(rgba(20, 35, 15, .16), rgba(20, 35, 15, .16)),
    var(--unit-bg-url);
  background-size: cover;
  background-position: center bottom;
}
#screen-onboarding .ob-sky.photo-bg {
  background:
    linear-gradient(rgba(20, 35, 15, .22), rgba(20, 35, 15, .22)),
    var(--unit-bg-url) center / cover no-repeat;
}
.unit-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  z-index: 3;
}
.unit-exit {
  background: var(--cream); border: 3px solid var(--wood);
  border-radius: 999px; padding: 7px 14px;
  font-weight: 700; font-size: .95rem;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}
.unit-progress { flex: 1; display: flex; gap: 5px; justify-content: center; }
.unit-progress .seg {
  width: clamp(16px, 4vw, 38px); height: 13px; border-radius: 999px;
  background: rgba(255,255,255,.45);
  border: 2px solid rgba(95,61,28,.4);
}
.unit-progress .seg.done {
  background: linear-gradient(180deg, #ffe27a 0%, var(--gold) 45%, #d89b00 100%);
  border-color: #c78e00;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.8), 0 1px 3px rgba(0,0,0,.25);
}
.unit-progress .seg.now { background: #fff; border-color: var(--blue-btn); animation: seg-pulse 1.2s infinite; }
@keyframes seg-pulse { 50% { transform: scaleY(1.35); } }
.unit-hud { display: flex; align-items: center; gap: 8px; }
.unit-strikes { font-size: 1.05rem; letter-spacing: 2px; }

/* אפס גלילה: הכרטיס מתכווץ אוטומטית להתאים למסך (fit-to-screen כמו מצגת) */
.unit-stage {
  flex: 1; overflow: hidden;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 4px 12px 10px;
}

/* פריסת משחק: מסגרת אחת מאוחדת — אלף בשליש הימני, הפעילות בשני השלישים */
.unit-layout {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 2.3fr;
  width: min(1420px, 100%);
  /* בלי max-height! עם הגבלת גובה הדפדפן מקצץ את תחתית הכרטיס (overflow: hidden)
     ומדווח גובה מקוצץ, ואז מנגנון ההתאמה למסך חושב שהכל נכנס ולא מקטין —
     כך כפתור "לשאלה הבאה" נעלם מתחת לקצה המסך. הכרטיס גדל לפי התוכן,
     ו-fitUnitCard() מקטין אותו כדי שיתאים (engine.js) */
  background: var(--cream);
  border: 4px solid var(--wood);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: top center;
}
/* רקע איור בתוך המסגרת המאוחדת. עוצמת שכבת ההבהרה נשלטת פר יחידה
   (cardBgOverlay ב-data.js) — רקע חיוור צריך שכבה עדינה כדי לא להימחק */
.unit-layout.photo-card {
  background-image:
    linear-gradient(rgba(253, 246, 227, var(--unit-card-overlay, .58)),
                    rgba(253, 246, 227, var(--unit-card-overlay, .58))),
    var(--unit-card-bg);
  background-size: cover;
  background-position: center;
}
.unit-side {
  background: rgba(255, 252, 240, .55);
  border-left: 3px solid rgba(138, 90, 43, .3);
  padding: 18px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
.side-kicker {
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border: 2px solid var(--wood-dark);
  border-radius: 10px; padding: 5px 16px;
  font-family: 'Rubik'; font-weight: 700; font-size: .88rem;
  color: #fdf0d0;
  box-shadow: 0 3px 0 var(--wood-dark);
}
.side-kicker:empty { display: none; }
.side-title {
  font-family: 'Rubik'; font-weight: 900;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  color: var(--wood-dark);
  min-height: 0;
}
.side-title:empty { display: none; }
.side-owl .guide-owl { width: auto; }
.side-owl svg { width: 104px; height: 114px; }
.side-owl img.owl-img { width: 104px; }
.side-bubble {
  border-radius: 16px;
  font-size: .98rem;
  width: 100%;
}
.side-bubble::before {
  bottom: auto; right: 50%;
  top: -17px;
  transform: translateX(50%);
  border: 9px solid transparent;
  border-left-color: transparent;
  border-bottom-color: var(--blue-btn);
}

@media (max-width: 900px) {
  .unit-layout { grid-template-columns: 1fr; }
  .unit-side { flex-direction: row; flex-wrap: wrap; text-align: right; padding: 10px 12px; gap: 8px; align-items: center; justify-content: flex-start; border-left: none; border-bottom: 3px solid rgba(138, 90, 43, .3); }
  .side-owl svg { width: 52px; height: 58px; }
  .side-owl img.owl-img { width: 52px; }
  .side-owl .guide-name { display: none; }
  .side-title { font-size: 1.05rem; }
  .side-bubble { width: auto; flex: 1; min-width: 200px; font-size: .9rem; }
  .side-bubble::before { display: none; }
}
/* גודל מצגת: הכרטיס רחב, אבל טקסט רץ נשאר ברוחב קריא באמצע */
.unit-card {
  width: 100%;
  padding: 18px clamp(18px, 3vw, 40px) 20px;
  animation: card-in .4s cubic-bezier(.2,1.4,.4,1);
}
.unit-card .guide-row,
.unit-card .part-inst,
.unit-card .q-text,
.unit-card .q-ref,
.unit-card .q-options,
.unit-card .feedback-box,
.unit-card .read-para,
.unit-card .read-title,
.unit-card .objectives,
.unit-card .summary-checks,
.unit-card .anecdote-card,
.unit-card .sentence-big {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
@keyframes card-in { from { transform: translateY(26px) scale(.97); opacity: 0; } }

/* שלט עץ קטן — כמו כותרת שלב במשחק */
.part-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border: 2px solid var(--wood-dark);
  border-radius: 10px; padding: 5px 18px;
  font-family: 'Rubik'; font-weight: 700; font-size: .92rem;
  color: #fdf0d0;
  box-shadow: 0 3px 0 var(--wood-dark), 0 4px 8px rgba(0,0,0,.2);
  margin-bottom: 14px;
}
.part-title { font-size: clamp(1.4rem, 4.5vw, 1.9rem); font-weight: 900; color: var(--wood-dark); margin-bottom: 8px; text-shadow: 0 2px 0 rgba(255,255,255,.7); }
.part-inst {
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 2px solid #e3cb96;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1.05rem; font-weight: 500;
  box-shadow: inset 0 2px 6px rgba(190, 150, 70, .15);
  margin-bottom: 18px;
}
.part-actions {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 12px;
  margin-top: 14px;
}

/* --- מסך intro של יחידה --- */
.intro-emoji { font-size: 3.4rem; text-align: center; }
.intro-topic { text-align: center; color: var(--ink-soft); font-weight: 700; margin-bottom: 16px; }
.objectives {
  background: #fff; border: 2px dashed var(--wood-light); border-radius: 14px;
  padding: 16px 20px; margin: 0 auto 8px; max-width: 480px;
}
.objectives h3 { color: var(--wood-dark); margin-bottom: 10px; font-size: 1.1rem; }
.objectives li { list-style: none; padding: 5px 0 5px 4px; display: flex; gap: 8px; align-items: flex-start; }
/* תבליט מצויר במקום אימוג'י — עיגול בצבעי המותג */
.objectives li::before {
  content: '';
  flex: 0 0 auto;
  width: 10px; height: 10px;
  margin-top: .45em;
  border-radius: 50%;
  background: var(--gold, #f5b301);
  border: 2px solid rgba(138, 90, 43, .45);
}

/* --- הטרמה: ציד מילים --- */
.hunt-scene {
  border-radius: 16px; overflow: hidden;
  border: 3px solid var(--wood-light);
  margin-bottom: 16px;
  background: #dff0fb;
  max-height: clamp(180px, 30vh, 300px);
  display: flex; align-items: center; justify-content: center;
}
.hunt-scene svg,
.hunt-scene img {
  display: block; width: 100%;
  max-height: clamp(180px, 30vh, 300px);
  object-fit: cover; object-position: center;
}
.hunt-words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
/* מילים — אסימוני משחק */
.hunt-word {
  background: linear-gradient(180deg, #ffffff, #ffe9b0);
  border: 3px solid #e0a92f;
  border-radius: 999px; padding: 9px 20px;
  font-size: 1.1rem; font-weight: 700; color: var(--ink);
  box-shadow: 0 3px 0 #c78e00, 0 5px 8px rgba(0,0,0,.12);
  transition: all .12s;
}
.hunt-word:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #c78e00, 0 7px 12px rgba(0,0,0,.15); }
.hunt-word:active { transform: translateY(2px); box-shadow: 0 1px 0 #c78e00; }
.hunt-word.picked-ok { background: #e2f6e3; border-color: var(--green-ok); color: var(--green-ok); }
.hunt-word.picked-bad { background: #fdeaea; border-color: var(--red-err); color: var(--red-err); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(5px); } 50% { transform: translateX(-5px); } 75% { transform: translateX(3px); } }

/* --- קריאה וסימון --- */
/* כותרת הקטע — שלט עץ של משחק */
.read-title {
  text-align: center; font-size: 1.4rem; font-weight: 900;
  color: #fdf0d0;
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border: 2px solid var(--wood-dark);
  border-radius: 12px;
  padding: 8px 26px;
  width: fit-content;
  box-shadow: 0 3px 0 var(--wood-dark), 0 5px 10px rgba(0,0,0,.2);
  margin-bottom: 16px;
}
/* מגילת קלף במקום קופסה לבנה */
.read-para {
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border-radius: 14px; border: 2px solid #e3cb96;
  box-shadow: inset 0 2px 8px rgba(190, 150, 70, .12), 0 3px 8px rgba(0,0,0,.08);
  padding: 14px 18px; margin-bottom: 12px;
  line-height: 1.9; font-size: 1.08rem;
  position: relative;
}
.read-para .para-num {
  position: absolute; top: -10px; right: 14px;
  background: var(--wood-light); color: #fff;
  border-radius: 999px; padding: 1px 12px;
  font-size: .75rem; font-weight: 700;
}
.read-para.marked { border-color: var(--gold); }
.sentence { cursor: pointer; border-radius: 6px; padding: 1px 3px; transition: background .15s; }
.sentence:hover { background: #fff3c4; }
.sentence.marked { background: linear-gradient(180deg, #ffe58a, #ffd94d); box-shadow: 0 1px 0 #d8a800; font-weight: 500; }
.read-hint { text-align: center; color: var(--ink-soft); font-size: .92rem; margin-top: 4px; }

/* --- שאלות רב ברירה --- */
.q-count { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
/* תמונה קטנה לשאלה */
.q-img {
  display: block;
  max-height: clamp(110px, 18vh, 170px);
  max-width: 90%;
  margin: 0 auto 10px;
  border-radius: 14px;
  border: 3px solid var(--wood-light);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  object-fit: cover;
}
.q-img.tiny { max-height: 110px; border: none; box-shadow: none; }
/* תמונת סצנה קטנה בקטעי קריאה */
/* סצנה "קטנה" (לצד פסקה גדולה): התמונה מוצגת שלמה, בלי חיתוך,
   והמסגרת מתכווצת סביבה */
.hunt-scene.small {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 16px;
  max-height: clamp(150px, 27vh, 270px);
}
.hunt-scene.small svg,
.hunt-scene.small img {
  width: auto;
  max-width: 100%;
  max-height: clamp(150px, 27vh, 270px);
  object-fit: contain;
}
/* השאלה — משימת קווסט */
.q-text { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.q-text::before { content: '🎯 '; }
.q-ref {
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 2px solid #e3cb96; border-radius: 12px;
  box-shadow: inset 0 2px 6px rgba(190, 150, 70, .12);
  padding: 10px 14px; margin-bottom: 14px;
  font-size: .98rem; color: var(--ink-soft); line-height: 1.8;
}
.q-ref summary { cursor: pointer; font-weight: 700; color: var(--blue-btn); }
.q-options { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
/* תשובות — תיבות אוצר */
.q-options.chests {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.q-opt.chest {
  flex-direction: column;
  gap: 4px;
  justify-content: flex-start;
  text-align: center;
  padding: 10px 12px 12px;
}
.chest-box { width: 92px; display: block; }
.chest-box svg { width: 100%; height: auto; }
.chest-label { font-size: 1.02rem; font-weight: 500; line-height: 1.5; }
.q-opt.opened { border-color: var(--green-ok); background: linear-gradient(180deg, #f2fbf0, #dff3da); }
.q-opt.opened .chest-box { animation: chest-pop .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes chest-pop { 40% { transform: scale(1.18) rotate(-3deg); } }
.q-opt {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #ffffff, #f6ecd2);
  border: 3px solid #d9b36c;
  border-radius: 16px; padding: 13px 16px;
  font-size: 1.05rem; font-weight: 500; text-align: right;
  box-shadow: 0 4px 0 #c99f57, 0 6px 10px rgba(0,0,0,.12);
  transition: all .12s;
}
.q-opt:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 #c99f57, 0 8px 14px rgba(0,0,0,.15); }
.q-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #c99f57; }
.q-opt .opt-letter {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold));
  border: 2px solid #c78e00;
  color: #5f3d00;
  font-family: 'Rubik'; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.q-opt.correct { border-color: var(--green-ok); background: #e2f6e3; }
.q-opt.correct .opt-letter { background: var(--green-ok); color: #fff; }
.q-opt.wrong { border-color: var(--red-err); background: #fdeaea; animation: shake .35s; }
.q-opt.wrong .opt-letter { background: var(--red-err); color: #fff; }
.q-opt:disabled { cursor: default; }

.feedback-box {
  margin-top: 14px; border-radius: 14px; padding: 13px 16px;
  font-weight: 500; font-size: 1.02rem;
  display: flex; gap: 10px; align-items: flex-start;
  animation: card-in .3s;
}
.feedback-box.good { background: #e2f6e3; border: 2px solid var(--green-ok); }
.feedback-box.bad { background: #fff4e0; border: 2px solid #e8a33d; }

/* --- מיון משפחות מילים --- */
.sort-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; min-height: 52px; }
.sort-chip {
  background: linear-gradient(180deg, #ffffff, #d9edff);
  border: 3px solid var(--blue-btn);
  border-radius: 999px; padding: 8px 18px;
  font-size: 1.05rem; font-weight: 700; color: var(--blue-btn-dark);
  box-shadow: 0 3px 0 var(--blue-btn-dark), 0 5px 8px rgba(0,0,0,.12);
  transition: all .12s;
  touch-action: none;
}
.sort-chip.selected { background: var(--blue-btn); color: #fff; transform: scale(1.08); box-shadow: 0 0 0 4px rgba(47,136,208,.3); }
.sort-chip.dragging { opacity: .5; }
.sort-bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.sort-bin {
  background: #fff; border: 3px dashed var(--wood-light);
  border-radius: 16px; padding: 10px;
  min-height: 110px;
  text-align: center;
  transition: all .15s;
}
.sort-bin.armed { border-color: var(--blue-btn); background: #eaf4fd; cursor: pointer; }
.sort-bin.over { border-style: solid; border-color: var(--blue-btn); background: #eaf4fd; }
.sort-bin.flash-bad { animation: shake .35s; border-color: var(--red-err); }
.sort-bin-root {
  font-family: 'Rubik'; font-weight: 900; font-size: 1.15rem;
  color: var(--wood-dark);
  background: var(--cream-dark); border-radius: 10px;
  padding: 4px 0; margin-bottom: 8px;
}
.sort-bin .placed {
  display: inline-block; margin: 3px;
  background: #e2f6e3; border: 2px solid var(--green-ok);
  border-radius: 999px; padding: 4px 12px;
  font-size: .95rem; font-weight: 700; color: var(--green-ok);
}

/* --- אנקדוטה --- */
.anecdote-card {
  background: linear-gradient(135deg, #fff8dd, #ffefb8);
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
}
.anecdote-card .bulb { font-size: 3rem; animation: bob 2s infinite; display: inline-block; }
.anecdote-words {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin: 18px 0;
}
.anecdote-words span {
  background: #fff; border: 2px solid var(--gold); border-radius: 12px;
  padding: 8px 18px; font-family: 'Rubik'; font-weight: 700; font-size: 1.2rem;
  color: var(--wood-dark);
}
.anecdote-text { font-size: 1.1rem; line-height: 1.8; }
.anecdote-tip {
  margin-top: 16px; background: rgba(255,255,255,.7); border-radius: 12px;
  padding: 12px 16px; font-weight: 500;
}

/* --- סיכום --- */
.summary-checks { max-width: 480px; margin: 0 auto 18px; }
.summary-check {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 2px solid #e3cb96; border-radius: 12px;
  box-shadow: inset 0 2px 6px rgba(190, 150, 70, .12);
  padding: 12px 16px; margin-bottom: 10px;
  font-size: 1.05rem; font-weight: 500;
  opacity: 0; transform: translateX(20px);
  animation: check-in .5s forwards;
}
.summary-check:nth-child(2) { animation-delay: .35s; }
.summary-check:nth-child(3) { animation-delay: .7s; }
/* וי מצויר במקום אימוג'י */
.summary-check .check-mark {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-ok, #3a9e3d);
  position: relative;
}
.summary-check .check-mark::after {
  content: '';
  position: absolute;
  left: 6px; top: 3px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(40deg);
}
@keyframes check-in { to { opacity: 1; transform: none; } }
.word-input-wrap { text-align: center; margin-top: 6px; }
.word-input-wrap label { display: block; font-weight: 700; margin-bottom: 10px; font-size: 1.1rem; }

/* --- התפתחות הדרקון --- */
.evolution-box {
  background: linear-gradient(135deg, #fff8dd, #ffe9f5);
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 14px 18px;
  margin: 12px auto;
  max-width: 440px;
  animation: pop-in .6s cubic-bezier(.2,1.6,.4,1);
}
.evolution-title { font-family: 'Rubik'; font-weight: 900; font-size: 1.15rem; color: var(--wood-dark); }
.evolution-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0; }
.evolution-pair .avatar-box { width: 84px; height: 98px; }
.evo-old { opacity: .55; filter: grayscale(.4); transform: scale(.85); }
.evo-new { animation: evo-pop 1s cubic-bezier(.2,1.8,.4,1); filter: drop-shadow(0 0 14px rgba(245,179,1,.8)); }
@keyframes evo-pop { 0% { transform: scale(0) rotate(-20deg); } 60% { transform: scale(1.25); } }
.evo-arrow { font-size: 1.6rem; color: var(--wood-dark); }
.evolution-name { font-size: 1.05rem; }

/* פרופיל הדמות: השלב הבא בצללית */
.creature-stage-name { font-family: 'Rubik'; font-weight: 700; color: var(--wood-dark); margin-bottom: 8px; }
.creature-next {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff8dd; border: 2px dashed var(--gold); border-radius: 14px;
  padding: 8px 14px;
}
.creature-silhouette { width: 54px; height: 62px; position: relative; }
.creature-silhouette svg,
.creature-silhouette img.creature-img { width: 100%; height: 100%; filter: brightness(0) opacity(.25); }

/* תמונת AI של הדמות — מכסה את ה-SVG כשהקובץ קיים */
.avatar-box img.creature-img,
.creature-silhouette img.creature-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: bottom;   /* הרגליים על הקרקע, כמו ב-SVG */
}
.avatar-box img.creature-img { filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.creature-silhouette img.creature-img { filter: brightness(0) opacity(.25); }
/* לתמונות ה-AI יש מרווח מעל הראש — מורידים את הכובע והפנים אל הדמות */
.avatar-box:has(img.creature-img) .avatar-hat { top: 2%; }
.avatar-box:has(img.creature-img) .avatar-face { top: 34%; }

/* --- מסך פרס --- */
.reward-stage { text-align: center; }
.reward-item-circle {
  width: 130px; height: 130px; margin: 14px auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbe9, #ffe9a8);
  border: 5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
  animation: reward-pop .6s cubic-bezier(.2,1.8,.4,1), glow-spin 3s linear infinite;
  box-shadow: 0 0 40px rgba(245,179,1,.55);
}
.journey-item-img {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  vertical-align: middle;
}
.reward-item-circle .journey-item-img { width: 92px; height: 92px; }
@keyframes reward-pop { from { transform: scale(0) rotate(-180deg); } }
@keyframes glow-spin { 50% { box-shadow: 0 0 60px rgba(245,179,1,.8); } }
.reward-coins { font-size: 1.3rem; font-weight: 700; color: var(--wood-dark); margin: 10px 0; }

/* ============================================================
   חלונות צפים (חנות / ספר מסע)
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 20, 5, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fade-in .25s;
}
@keyframes fade-in { from { opacity: 0; } }
.panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: var(--cream);
  border: 4px solid var(--wood);
  border-radius: 24px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  animation: pop-in .35s cubic-bezier(.2,1.5,.4,1);
}
.panel-close {
  position: absolute; top: 12px; left: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--cream-dark); font-size: 1.05rem; font-weight: 700;
  color: var(--ink-soft);
}
.panel-title { text-align: center; font-size: 1.6rem; font-weight: 900; color: var(--wood-dark); margin-bottom: 4px; }
.panel-sub { text-align: center; color: var(--ink-soft); margin-bottom: 16px; }

.shop-avatar-preview { display: flex; justify-content: center; margin-bottom: 14px; }
.shop-avatar-preview.big .avatar-box { width: 150px; height: 178px; }

.shop-cat-title { font-family: 'Rubik'; font-weight: 700; color: var(--wood-dark); margin: 16px 4px 8px; }
.shop-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.shop-item {
  background: #fff; border: 3px solid var(--cream-dark); border-radius: 16px;
  padding: 12px 8px; text-align: center;
  display: flex; flex-direction: column; gap: 5px; align-items: center;
  transition: transform .12s, border-color .12s;
}
.shop-item:hover { transform: translateY(-3px); }
.shop-item .si-emoji { font-size: 2rem; }
.shop-item .si-swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(0,0,0,.15);
  position: relative; display: flex; align-items: flex-end; justify-content: center;
}
/* תצוגה מקדימה של הדרקון בצבע הנבחר, עומד על עיגול הצבע */
.shop-item .si-swatch img.si-color-dragon {
  width: 46px; height: 46px; object-fit: contain;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}

/* פריט עם תמונת AI: האימוג'י מוסתר רק כשהתמונה נטענה */
.item-visual { position: relative; display: inline-block; line-height: 1; width: 1em; height: 1em; }
.item-visual .iv-emoji { display: block; width: 1em; height: 1em; line-height: 1; }
.item-visual img { display: none; }
.item-visual.img-ok .iv-emoji { visibility: hidden; }
.item-visual.img-ok img {
  display: block; position: absolute; inset: -10%;
  width: 120%; height: 120%; object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
.shop-item .si-name { font-weight: 700; font-size: .9rem; }
.shop-item .si-price { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.shop-item.owned { border-color: var(--blue-btn); }
.shop-item.equipped { border-color: var(--green-ok); background: #f0faf0; }
.shop-item.cant-afford { opacity: .55; }
/* קטע קריאה ארוך: גלילה פנימית כדי שכפתור ההמשך יישאר תמיד על המסך */
.read-scroll {
  max-height: min(44vh, 400px);
  overflow-y: auto;
  padding-inline-end: 8px;
  border: 2px solid rgba(138, 90, 43, .18);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255, 252, 240, .5);
  scrollbar-width: thin;
}
.read-scroll::-webkit-scrollbar { width: 10px; }
.read-scroll::-webkit-scrollbar-thumb { background: rgba(138, 90, 43, .35); border-radius: 6px; }
.read-scroll::-webkit-scrollbar-track { background: rgba(138, 90, 43, .08); border-radius: 6px; }
/* פריט יוקרה נעול: רואים מה מחכה, אבל אי אפשר לקנות עדיין */
.shop-item.locked { opacity: .65; filter: grayscale(.6); cursor: not-allowed; }
.shop-item.locked:hover { transform: none; }
.shop-item .si-lock { font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.si-badge { font-size: .75rem; font-weight: 700; color: var(--green-ok); }

.book-panel .book-section { font-family: 'Rubik'; color: var(--wood-dark); margin: 14px 4px 10px; }
.book-items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.book-item {
  background: #fff; border: 3px solid var(--gold); border-radius: 16px;
  padding: 14px 8px; text-align: center;
}
.book-item .bi-emoji { font-size: 2.2rem; }
.book-item .bi-name { font-weight: 700; margin-top: 4px; }
.book-item .bi-unit { font-size: .8rem; color: var(--ink-soft); }
.book-item.empty { border: 3px dashed var(--cream-dark); opacity: .6; }
.book-words-list { display: flex; flex-wrap: wrap; gap: 8px; }
.book-word {
  background: #fff8dd; border: 2px solid var(--gold); border-radius: 999px;
  padding: 6px 16px; font-weight: 700;
}
.book-empty-msg { color: var(--ink-soft); padding: 6px 4px; }

/* ============================================================
   אלף הינשוף — הדמות המלווה
   ============================================================ */
.guide-row {
  display: flex; align-items: flex-end; gap: 10px;
  margin: 6px 0 18px;
}
.guide-owl {
  flex-shrink: 0;
  width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.guide-owl svg { width: 64px; height: 70px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); animation: owl-bob 3s ease-in-out infinite; }
.guide-owl img.owl-img { width: 66px; height: auto; filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); animation: owl-bob 3s ease-in-out infinite; }
@keyframes owl-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.guide-name { font-size: .68rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.guide-bubble {
  position: relative;
  background: #eaf4fd;
  border: 2px solid var(--blue-btn);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  font-size: 1.02rem; font-weight: 500;
  line-height: 1.6;
}
.guide-bubble::before {
  content: '';
  position: absolute; bottom: 10px; right: -9px;
  border: 8px solid transparent;
  border-left-color: var(--blue-btn);
}

/* ============================================================
   משפט אחד — ציד מילות משפחה
   ============================================================ */
.family-tag {
  display: inline-block;
  background: linear-gradient(135deg, #fff8dd, #ffefb8);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 1rem; font-weight: 700; color: var(--wood-dark);
  margin-bottom: 14px;
}
.family-tag strong { font-family: 'Rubik'; font-size: 1.1rem; }
.sentence-big {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 3px solid #e3cb96;
  border-radius: 18px;
  box-shadow: inset 0 2px 8px rgba(190, 150, 70, .12), 0 3px 8px rgba(0,0,0,.08);
  padding: 26px 20px;
  margin-bottom: 8px;
}
.sentence-word {
  font-family: 'Heebo';
  font-size: clamp(1.25rem, 3.6vw, 1.7rem);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all .15s;
}
.sentence-word:hover:not(:disabled) { background: #fff3c4; border-color: var(--gold); transform: translateY(-2px); }
.sentence-word.found {
  background: linear-gradient(180deg, #ffe58a, #ffd94d);
  border-color: #d8a800;
  font-weight: 700;
  animation: pop-in .35s cubic-bezier(.2,1.6,.4,1);
}
.sentence-word.miss { background: #fdeaea; border-color: var(--red-err); animation: shake .35s; }

/* ============================================================
   זירת ארקייד — תופסים מילים בתנועה
   ============================================================ */
.arcade-status {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}
.arcade-count { font-weight: 700; color: var(--ink-soft); }
.arcade {
  position: relative;
  height: clamp(320px, 52vh, 470px);
  border-radius: 18px;
  border: 4px solid var(--wood);
  overflow: hidden;
  touch-action: manipulation;
}
.arcade-sky {
  background: url('../assets/img/arcade-sky.png') center / cover no-repeat;
}
.arcade-space {
  background: url('../assets/img/arcade-night.png') center / cover no-repeat;
}
.arcade-mail {
  background: url('../assets/img/arcade-mail.png') center / cover no-repeat;
}
.arcade-item {
  position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column; align-items: center;
  will-change: transform;
  z-index: 2;
  padding: 0; border: none; background: none;
}
.arcade-item .vessel-word {
  font-family: 'Heebo'; font-weight: 700;
  letter-spacing: .05em;   /* מרווח לניקוד קריא */
  white-space: nowrap;
}
/* מפלצות מעופפות — המוטיב האחיד של כל הארקיידים */
.arcade-item.monster-balloon,
.arcade-item.monster-fly,
.arcade-item.monster-mail { gap: 0; }
.arcade-item .monster-body { display: block; width: 74px; }
.arcade-item .monster-body svg,
.arcade-item .monster-body img.monster-img { width: 100%; height: auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.arcade-item .mini-balloon {
  font-size: 1.9rem; line-height: 1;
  margin-bottom: -6px;
  animation: balloon-sway 1.8s ease-in-out infinite;
}
@keyframes balloon-sway { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.arcade-item .mini-wings {
  font-size: 1.3rem; line-height: 1;
  margin-bottom: -8px;
  animation: wings-flap .5s ease-in-out infinite;
}
@keyframes wings-flap { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }
.arcade-item .mini-mail {
  font-size: 1.5rem; line-height: 1;
  margin-bottom: -8px;
  animation: mail-bob 1.4s ease-in-out infinite;
}
@keyframes mail-bob { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }
.arcade-item.monster-balloon .vessel-word,
.arcade-item.monster-fly .vessel-word,
.arcade-item.monster-mail .vessel-word {
  background: linear-gradient(180deg, #fdf6e3, #f3e6c8);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 1.02rem; color: var(--ink);
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
  margin-top: -8px;
}
/* מצבי פגיעה */
.arcade-item.caught { animation: catch-pop .4s forwards; }
@keyframes catch-pop {
  40% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
.arcade-item.caught .vessel-word { background: var(--green-ok) !important; color: #fff; border-color: var(--green-ok) !important; }
.arcade-item.wrong-hit .vessel-word { animation: shake .35s; background: #fdeaea !important; border-color: var(--red-err) !important; color: var(--red-err) !important; }
.arcade-item.faded { opacity: 0; transition: opacity .3s; }

/* ============================================================
   משחקון המחבואים — מפלצות מציצות ממחילות (whack-a-mole)
   ============================================================ */
.mole-field {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
  padding: 18px 16px 10px;
  border-radius: 18px;
  border: 4px solid var(--wood);
  background: url('../assets/img/mole-field-bg.png') center / cover no-repeat;
}
.mole-hole {
  position: relative;
  height: clamp(120px, 17vh, 160px);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.mole-mound {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 88%; height: 26px;
  background: radial-gradient(ellipse at 50% 0%, var(--path-dark) 0%, var(--wood) 75%);
  border-radius: 50% 50% 12px 12px / 100% 100% 12px 12px;
  box-shadow: inset 0 5px 6px rgba(0,0,0,.35);
  z-index: 1;
}
.mole-monster {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 0; margin-bottom: 8px;
  transform: translateY(130%);
  transition: transform .24s cubic-bezier(.2,1.4,.4,1);
  pointer-events: none;
}
.mole-monster.up { transform: translateY(0); pointer-events: auto; }
.mole-monster .monster-body { display: block; width: 64px; }
.mole-monster .monster-body svg,
.mole-monster .monster-body img.monster-img { width: 100%; height: auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.mole-monster .vessel-word {
  background: linear-gradient(180deg, #fdf6e3, #f3e6c8);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 5px 13px;
  font-family: 'Heebo'; font-weight: 700;
  letter-spacing: .05em;   /* מרווח לניקוד קריא */
  font-size: .98rem; color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
  margin-bottom: -6px;
}
.mole-monster.whacked { animation: catch-pop .35s forwards; }
.mole-monster.whacked .vessel-word { background: var(--green-ok) !important; color: #fff; border-color: var(--green-ok) !important; }
.mole-monster.wrong-hit .vessel-word { animation: shake .35s; background: #fdeaea !important; border-color: var(--red-err) !important; color: var(--red-err) !important; }

/* ============================================================
   כתיבה חופשית — השלמת כותרת והרחבת משפחה (יחידה 5+)
   ============================================================ */
.cloze-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px;
  font-family: 'Rubik'; font-weight: 700;
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  color: var(--wood-dark);
  background: linear-gradient(180deg, #fff8dd, #ffefb8);
  border: 3px solid var(--gold);
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.cloze-input {
  font-family: 'Heebo'; font-weight: 700;
  font-size: 1.15rem;
  text-align: center;
  width: min(180px, 45vw);
  padding: 9px 12px;
  border: 3px dashed var(--wood-light);
  border-radius: 12px;
  background: #fff;
  outline: none;
}
.cloze-input:focus { border-color: var(--blue-btn); border-style: solid; }
.cloze-input.good {
  border-style: solid; border-color: var(--green-ok);
  background: #eaf7ea; color: var(--green-ok);
}
.cloze-input.miss { animation: shake .35s; border-color: var(--red-err); background: #fdeaea; }

.fx-board {
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 3px solid var(--wood-light);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.fx-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
.fx-chip {
  font-weight: 700; font-size: 1.05rem;
  padding: 8px 18px; border-radius: 999px;
  letter-spacing: .04em;
}
.fx-chip.given {
  background: #fff; color: var(--ink-soft);
  border: 2px solid var(--cream-dark);
}
.fx-chip.mine {
  background: linear-gradient(180deg, #eaf7ea, #d7efd7);
  color: #226b24; border: 2px solid var(--green-ok);
  animation: pop-in .35s cubic-bezier(.2,1.6,.4,1);
}
.fx-input-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.fx-progress { text-align: center; font-weight: 700; color: var(--ink-soft); margin-top: 10px; }

/* קטע קצר — טקסט גדול ונדיב */
.read-para.short { font-size: 1.22rem; line-height: 2.1; padding: 20px 22px; }

/* ============================================================
   המפלצות הרעבות — האכלת משפחות מילים
   ============================================================ */
.feed-status { text-align: center; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.feed-word-zone { display: flex; justify-content: center; margin-bottom: 18px; min-height: 64px; }
.feed-word {
  font-family: 'Rubik'; font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  letter-spacing: .08em;   /* מרווח לניקוד קריא */
  color: var(--wood-dark);
  background: linear-gradient(180deg, #fff8dd, #ffefb8);
  border: 3px solid var(--gold);
  border-radius: 18px;
  padding: 12px 34px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.feed-word.word-in { animation: word-drop .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes word-drop { from { transform: translateY(-30px) scale(.6); opacity: 0; } }
.feed-word.flying {
  position: fixed; z-index: 96; margin: 0;
  transition: transform .45s cubic-bezier(.5,-.1,.7,.4), opacity .45s;
  pointer-events: none;
}
/* שורת המפלצות מתמרכזת לפי מספרן — גם 2 או 3 מפלצות יושבות באמצע */
.feed-monsters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
}
.feed-monster {
  flex: 1 1 0; max-width: 235px; min-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff;
  border: 3px solid var(--cream-dark);
  border-radius: 18px;
  padding: 12px 6px 10px;
  transition: transform .15s, border-color .15s;
}
.feed-monster:hover { transform: translateY(-4px); border-color: var(--blue-btn); }
.feed-monster svg,
.feed-monster img.monster-img { width: clamp(64px, 12vw, 120px); height: auto; }
.feed-monster .feed-family {
  font-family: 'Rubik'; font-weight: 900; font-size: 1.05rem;
  color: var(--wood-dark);
  background: var(--cream-dark);
  border-radius: 999px;
  padding: 3px 14px;
}
.feed-monster .fed-count { font-size: .8rem; min-height: 1.1em; letter-spacing: 1px; }
.feed-monster .monster-mouth { transform-origin: 60px 76px; transition: transform .15s; }
.feed-monster.eating { animation: chomp-squash .55s; }
.feed-monster.eating .monster-mouth { animation: mouth-chomp .55s; }
@keyframes chomp-squash {
  30% { transform: scale(1.12, .88); }
  60% { transform: scale(.94, 1.08); }
}
@keyframes mouth-chomp {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.5, 1.7); }
  55% { transform: scale(.6, .3); }
  80% { transform: scale(1.2, 1.2); }
}
.feed-monster.spit { animation: shake .45s; border-color: var(--red-err); background: #fdeaea; }
.feed-monster.happy { animation: happy-bounce .8s ease-in-out infinite; border-color: var(--green-ok); }
@keyframes happy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* ============ נצנוצים ============ */
.sparkle {
  position: fixed; z-index: 98;
  font-size: 1.1rem;
  pointer-events: none;
  animation: sparkle-fly .75s ease-out forwards;
}
@keyframes sparkle-fly {
  to { transform: translate(var(--dx), var(--dy)) scale(.3) rotate(120deg); opacity: 0; }
}

/* ============ רצף (קומבו) ============ */
.combo-badge {
  font-family: 'Rubik'; font-weight: 900;
  background: linear-gradient(180deg, #ff9a3d, #f0641e);
  color: #fff;
  border-radius: 999px;
  padding: 5px 16px;
  font-size: .95rem;
  box-shadow: 0 3px 8px rgba(240,100,30,.4);
}
.combo-badge.pulse { animation: combo-pop .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes combo-pop { from { transform: scale(.4); } 60% { transform: scale(1.25); } }

/* ============ גלגל הצלה: ניקוד ============ */
.hud-btn.active {
  border-color: var(--gold);
  background: #fff8dd;
  box-shadow: 0 0 0 3px rgba(245, 179, 1, .35);
}
/* טקסט מנוקד צריך יותר אוויר */
.nikud-on .unit-card { line-height: 2; }
.nikud-on .read-para { line-height: 2.4; font-size: 1.14rem; }
.nikud-on .read-para.short { line-height: 2.5; font-size: 1.28rem; }
.nikud-on .sentence-word { line-height: 1.9; }
.nikud-on .q-opt, .nikud-on .q-text, .nikud-on .guide-bubble { line-height: 2; }

/* ============ בועת הינשוף — טקסט מלא ומיידי (אפקט ההקלדה בוטל 2.8) ============ */
.guide-bubble { min-height: 2.6em; }

/* ============ רשת ביטחון לרזולוציות נמוכות: גלילה כשההקטנה לא מספיקה ============ */
.unit-stage.stage-scroll { overflow-y: auto; }

/* ============ חגיגת סיום הקורס ============ */
.celebration {
  position: fixed; inset: 0; z-index: 900;
  background: linear-gradient(180deg, #2a2e66 0%, #4a3f8f 45%, #f5953b 100%);
  overflow-y: auto;
}
.celebration.hidden { display: none; }
.celebration-inner {
  position: relative; min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.celebration-card {
  position: relative; z-index: 2;
  background: rgba(253, 246, 227, .96);
  border: 4px solid var(--wood, #8a5a2b);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  max-width: 560px; width: 100%;
  padding: 28px 26px;
  text-align: center;
}
.celebration-card h1 {
  font-family: Rubik, sans-serif; font-weight: 900;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  color: #5a2f96; margin-bottom: 6px;
}
.celebration-big { font-size: 1.15rem; font-weight: 700; color: var(--wood, #8a5a2b); margin-bottom: 12px; }
.celebration-card p { margin-bottom: 10px; line-height: 1.6; }
.celebration-stats {
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 2px solid #e3cb96; border-radius: 12px;
  padding: 10px 14px; margin: 12px 0;
  font-weight: 700; color: #6b4423;
}
.celebration-sub { font-size: .95rem; color: var(--ink-soft); }
/* הדרקון המלכותי עף על המסך */
.celebration-dragon {
  position: absolute; z-index: 1;
  top: 12%; left: -170px;
  width: 130px; height: 150px;
  animation: dragon-fly 9s linear infinite, dragon-bob 1.7s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .3));
  pointer-events: none;
}
.celebration-dragon.second {
  top: 68%; width: 90px; height: 104px;
  animation: dragon-fly-back 12s linear infinite, dragon-bob 2.1s ease-in-out infinite;
  animation-delay: 2.5s; opacity: .85;
}
.celebration-dragon svg { width: 100%; height: 100%; }
.celebration-dragon .creature-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
@keyframes dragon-fly {
  from { left: -170px; }
  to   { left: calc(100% + 170px); }
}
@keyframes dragon-fly-back {
  from { left: calc(100% + 170px); transform: scaleX(-1); }
  to   { left: -170px; transform: scaleX(-1); }
}
@keyframes dragon-bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -28px; }
}

/* ============ תזכורת משפחות במשחקי חזרה ============ */
.side-families { width: 100%; }
.side-families:not(:empty) { margin-top: 10px; }
.sf-title {
  font-size: .78rem; font-weight: 700; color: var(--ink-soft);
  margin-bottom: 6px; text-align: center;
}
.sf-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.sf-chip {
  background: linear-gradient(180deg, #fffdf4, #fdf3da);
  border: 1.5px solid #e3cb96;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .8rem; font-weight: 700; color: #6b4423;
  white-space: nowrap;
}

/* ============ כוח הדרקון: עזרה בפתרון, פעמיים ביחידה ============ */
.dragon-power { margin-top: 12px; width: 100%; }
.dragon-power-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 12px;
  border: 2px solid #7d48bd;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3ebff, #e2d1fb);
  box-shadow: 0 3px 0 #7d48bd33, inset 0 1px 0 #fff8;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
  transition: transform .15s, box-shadow .15s;
}
.dragon-power-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 10px #7d48bd44; }
.dragon-power-btn .dp-dragon {
  flex: 0 0 auto; width: 40px; height: 46px; position: relative; display: block;
}
.dragon-power-btn .dp-dragon svg { width: 100%; height: 100%; }
.dragon-power-btn .dp-dragon .creature-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.dragon-power-btn .dp-text { display: flex; flex-direction: column; gap: 2px; }
.dragon-power-btn .dp-text strong { font-size: .88rem; color: #5a2f96; line-height: 1.25; }
.dragon-power-btn .dp-text small { font-size: .74rem; color: var(--ink-soft); }
.dragon-power-btn.out {
  opacity: .55; filter: grayscale(.5); cursor: not-allowed;
}
.dragon-power-btn.out:hover { transform: none; box-shadow: 0 3px 0 #7d48bd33; }

/* ============ אונבורדינג גלגל ההצלה ============ */
.nikud-coach {
  position: fixed; z-index: 96;
  max-width: 280px;
  background: linear-gradient(180deg, #fff8dd, #ffefb8);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 1rem; font-weight: 500; line-height: 1.6;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  cursor: pointer;
  animation: coach-in .5s cubic-bezier(.2,1.5,.4,1);
}
@keyframes coach-in { from { transform: translateY(-14px) scale(.8); opacity: 0; } }
.coach-arrow {
  position: absolute; top: -11px;
  border: 9px solid transparent;
  border-bottom-color: var(--gold);
  transform: translateX(-50%);
}
.hud-btn.attention {
  animation: attention-pulse 1.3s ease-in-out infinite;
  border-color: var(--gold);
}
@keyframes attention-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,179,1,.7), 0 3px 8px rgba(0,0,0,.25); transform: scale(1); }
  50% { box-shadow: 0 0 0 10px rgba(245,179,1,0), 0 3px 8px rgba(0,0,0,.25); transform: scale(1.12); }
}

/* ============ טוסט ============ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--wood-dark); color: #fdf0d0;
  border-radius: 999px; padding: 12px 26px;
  font-weight: 700; font-size: 1.02rem;
  z-index: 99;
  box-shadow: var(--shadow);
  animation: toast-in .3s;
  max-width: 90vw; text-align: center;
}
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ============ מטבע מעופף ============ */
.fly-coin {
  position: fixed; z-index: 98;
  font-weight: 900; font-family: 'Rubik'; font-size: 1.3rem;
  color: var(--gold); text-shadow: 0 2px 0 #a87800, 0 0 12px rgba(255,255,255,.8);
  pointer-events: none;
  animation: fly-up 1s forwards;
}
@keyframes fly-up { to { transform: translateY(-70px); opacity: 0; } }

/* ============ קונפטי ============ */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 97; overflow: hidden; }
.confetti {
  position: absolute; top: -20px;
  width: 12px; height: 12px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); }
}
