/* ============================================================
   Building TIN — סגנון ראשי · המפעל הניאוני
   ============================================================
   🔴 הוחלט 8.10.2026: הקורס עבר מ"סדנת המצאות" חמימה למפעל ניאוני
   בשעת דמדומים, לכיתות ג׳ וד׳. טורקיז, ורוד ניאון, גרפיט ואפור בהיר.
   מה שנשאר מהשפה הקודמת: עולם מלא מסך, לוח שצף מעליו, אפס גלילה,
   וכפתורים עבים עם שפה תחתונה שנלחצת.

   ⚠️ שני כללי קריאות שלא מתפשרים עליהם בגלל הניאון:
   1. **אותיות באנגלית כהות על אריח בהיר.** ניאון זוהר יפה בכותרת, אבל
      ילד שמפענח צריך ניגודיות מלאה ולא הילה
   2. **הרקע מאחורי הלוח מוחשך ומטושטש.** תמונות האווירה עמוסות, והלוח
      חייב לנצח אותן
   ============================================================ */

:root {
  --teal: #19d3c5;
  --teal-deep: #0e9e93;
  --teal-dark: #0b6f68;
  --teal-glow: rgba(25, 211, 197, .55);
  --pink: #ff3ea5;
  --pink-deep: #d1197f;
  --pink-dark: #8f0f56;
  --pink-glow: rgba(255, 62, 165, .55);
  --graphite: #2b313c;
  --graphite-2: #1d222b;
  --graphite-3: #141820;
  --steel: #3c4452;
  --gray: #c9d1d9;
  --gray-light: #e9eef3;
  --white: #f7fafc;
  --ink: #141a24;          /* טקסט על משטח בהיר */
  --text: #eef4f8;         /* טקסט על משטח כהה */
  --text-soft: #a9b6c4;
  --gold: #ffd23f;
  --ok: #33e08f;
  --err: #ff5d6c;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --neon-teal: 0 0 0 2px var(--teal), 0 0 18px var(--teal-glow), inset 0 0 14px rgba(25, 211, 197, .18);
  --neon-pink: 0 0 0 2px var(--pink), 0 0 18px var(--pink-glow), inset 0 0 14px rgba(255, 62, 165, .18);
}

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

/* 🔴 כל כלל display גובר על התכונה hidden, וכפתור שהוסתר בקוד ממשיך
   להיראות. הכלל הזה מחזיר ל-hidden את המשמעות שלו */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: 'Heebo', system-ui, sans-serif;
  color: var(--text);
  background: var(--graphite-3);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { font-family: 'Rubik', sans-serif; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* --- מילה אנגלית: תמיד LTR, תמיד עם נקודת התחלה משמאל --- */
.en-word, .tile, .belt-tile, .word-btn, .bank-word, .letter-card-ch,
.station-en, .unit-en, .letters-strip, .wave-target, .slot, .sign-word,
.ctx-sentence, .rbt-name-tag {
  font-family: 'Andika', 'Trebuchet MS', sans-serif;
  direction: ltr;
  unicode-bidi: isolate;
}

.en-word {
  position: relative; display: inline-block;
  padding-left: .62em; font-weight: 700;
}
/* נקודת ההתחלה: נורה ורודה משמאל. מוטיב קבוע מעולמון 1 ועד הסוף */
.en-word::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: .26em; height: .26em; border-radius: 50%;
  background: var(--pink);
  transform: translateY(-50%);
  box-shadow: 0 0 10px var(--pink), 0 0 0 3px rgba(255, 62, 165, .25);
}
.en-word-xl {
  font-size: clamp(44px, 7vw, 76px); line-height: 1.05;
  color: var(--ink);
  background: linear-gradient(180deg, var(--white), var(--gray));
  border-radius: 18px; padding: 8px 26px 12px 44px;
  box-shadow: 0 6px 0 #8b96a3, 0 0 0 3px var(--teal), 0 0 24px var(--teal-glow);
}
.en-word-xl::before { left: 16px; }

/* ============================================================
   העולם: רקע קבוע מאחורי כל המסכים
   ============================================================ */
.world { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--graphite-3); }

/* איור הגיבוי: ערפל דמדומים, רשת ניאון בפרספקטיבה ושני כתמי אור.
   רץ כשאין תמונה, ונשאר מתחת לתמונה כשהיא נטענת */
.world-fallback {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 20% 25%, rgba(255, 62, 165, .28), transparent 70%),
    radial-gradient(55% 45% at 82% 30%, rgba(25, 211, 197, .26), transparent 70%),
    linear-gradient(180deg, #123341 0%, #2a2350 48%, #171b26 100%);
}
.world-fallback::after {
  content: ''; position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%;
  background:
    repeating-linear-gradient(90deg, rgba(25, 211, 197, .35) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(255, 62, 165, .3) 0 2px, transparent 2px 60px);
  transform: perspective(500px) rotateX(62deg);
  transform-origin: bottom;
  mask-image: linear-gradient(0deg, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(0deg, #000 30%, transparent);
  animation: grid-run 4s linear infinite;
}
@keyframes grid-run { to { background-position: 0 0, 0 60px; } }

.world-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .8s;
}
.world-media.is-on { opacity: 1; }
/* במסך העולמון הרקע נסוג: מטושטש ומוחשך, כדי שהלוח ינצח */
.world.is-unit .world-media { filter: blur(7px) brightness(.55) saturate(1.2); transform: scale(1.06); }
.world.is-unit::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(80% 70% at 50% 55%, transparent 30%, rgba(10, 12, 18, .55));
}

/* חלקיקי אבק ניאון שמרחפים מעל הכול */
.motes { position: absolute; inset: 0; pointer-events: none; }
.mote {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 8px var(--teal);
  animation: mote-rise linear infinite; opacity: 0;
}
.mote.pink { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
@keyframes mote-rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translateY(-60vh); opacity: 0; }
}

#app { position: fixed; inset: 0; z-index: 1; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* שכבת האפקטים: חלקיקים, הבזקים. מעל הכול ולא חוסמת לחיצות */
#fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.spark {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  margin: -5px 0 0 -5px; will-change: transform, opacity;
}
.flash { position: absolute; inset: 0; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, .55), transparent 55%); }
.float-score {
  position: absolute; font-family: 'Rubik', sans-serif; font-weight: 900;
  font-size: 1.6rem; color: var(--gold); text-shadow: 0 0 12px rgba(255, 210, 63, .8), 0 2px 0 #000;
  transform: translate(-50%, -50%);
}

/* סרטון במסך מלא: פתיחת המשחק ופתיחת עולם */
.film { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; place-items: center; }
.film video { width: 100%; height: 100%; object-fit: contain; }
.film-caption {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  max-width: min(90vw, 900px); text-align: center;
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: clamp(1.1rem, 2.6vw, 1.8rem);
  color: #fff; background: rgba(10, 12, 18, .72); padding: 10px 22px; border-radius: 16px;
  box-shadow: var(--neon-teal);
}
.film-caption:empty { display: none; }
.film-skip { position: absolute; top: 16px; left: 16px; }
.film.needs-tap::after {
  content: 'לחצו כדי להתחיל'; position: absolute; font-family: 'Rubik', sans-serif; font-weight: 900;
  font-size: 1.6rem; color: #fff; text-shadow: 0 0 16px var(--pink);
}

/* ============================================================
   רכיבים משותפים
   ============================================================ */

.btn-main {
  position: relative; display: inline-block;
  background: linear-gradient(180deg, #ff6fbd, var(--pink) 55%, var(--pink-deep));
  border-radius: 999px;
  padding: 14px 42px;
  font-family: 'Rubik', sans-serif; font-weight: 900;
  font-size: clamp(1.02rem, 2.2vw, 1.24rem);
  color: #fff; letter-spacing: .3px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: 0 6px 0 var(--pink-dark), 0 0 26px var(--pink-glow);
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.btn-main::after {
  content: ''; position: absolute; inset: 3px 10% auto; height: 40%;
  border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .45), transparent);
  pointer-events: none;
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--pink-dark), 0 0 36px var(--pink-glow); }
.btn-main:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--pink-dark), 0 0 18px var(--pink-glow); }
.btn-main:disabled {
  background: linear-gradient(180deg, #59616e, #444b57);
  color: #9aa4b1; text-shadow: none;
  box-shadow: 0 5px 0 #2a2f37; cursor: default; transform: none;
}
.btn-main:disabled::after { opacity: .3; }
.btn-main.is-ready { animation: ready-pulse 1.4s ease-in-out infinite; }
@keyframes ready-pulse {
  50% { box-shadow: 0 6px 0 var(--pink-dark), 0 0 44px rgba(255, 62, 165, .9); }
}

.btn-soft {
  background: linear-gradient(180deg, #2fe3d5, var(--teal) 55%, var(--teal-deep));
  border-radius: 999px; padding: 11px 26px;
  font-weight: 900; color: var(--ink); font-family: 'Rubik', sans-serif;
  box-shadow: 0 5px 0 var(--teal-dark), 0 0 20px var(--teal-glow);
}
.btn-soft:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--teal-dark); }
.btn-ghost {
  background: rgba(20, 24, 32, .6);
  border: 2px dashed var(--teal);
  border-radius: 999px; padding: 8px 18px;
  font-weight: 700; color: var(--teal); font-size: .92rem;
}

/* שבבי 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; gap: 8px;
}
.hud > * { pointer-events: auto; }
.hud-left { display: flex; gap: 8px; flex-wrap: wrap; }
.hud-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(20, 24, 32, .82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 999px; padding: 7px 15px;
  font-weight: 700; font-size: 1rem; color: var(--text);
  box-shadow: 0 0 0 2px rgba(25, 211, 197, .55), 0 4px 14px rgba(0, 0, 0, .4);
  transition: transform .12s, box-shadow .2s;
}
button.hud-chip:hover { transform: translateY(-2px); box-shadow: var(--neon-teal); }
.hud-chip svg { width: 20px; height: 20px; }
.screw-icon { fill: none; stroke: var(--gold); stroke-width: 2.2; }
.sound-icon { fill: var(--teal); stroke: var(--teal); }
.screws-count { font-family: 'Rubik', sans-serif; color: var(--gold); min-width: 1.6em; text-align: center; }

/* שלט ניאון */
.banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(16, 19, 26, .82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  color: #fff; font-family: 'Rubik', sans-serif; font-weight: 900;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  padding: 9px 28px; box-shadow: var(--neon-pink);
  text-shadow: 0 0 12px var(--pink-glow);
  z-index: 5; white-space: nowrap;
}

/* ============================================================
   מסך המפה
   ============================================================ */
.screen-map { overflow: hidden; }

/* 🔴 המסגרת היא 16:9 בדיוק, כמו התמונה, ו"מכסה" את המסך. כך מיקום
   באחוזים בתוך המסגרת הוא מיקום באחוזים בתוך התמונה, בכל גודל מסך */
.map-scroller {
  position: absolute; inset: 0; overflow: hidden;
}
.map-frame {
  position: absolute; left: 50%; top: 50%;
  width: max(100vw, 177.78vh); height: max(56.25vw, 100vh);
  transform: translate(-50%, -50%);
}
.map-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.map-fallback-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 12, 18, .55) 0%, transparent 18%, transparent 78%, rgba(10, 12, 18, .6) 100%);
}

/* בטלפון לאורך: המפה רחבה מהמסך, וגוללים אותה לצדדים */
@media (max-aspect-ratio: 5/4) {
  .map-scroller { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .map-scroller::-webkit-scrollbar { display: none; }
  .map-frame { left: 0; top: 0; transform: none; width: 177.78vh; height: 100vh; }
}

.station {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  z-index: 4;
}
.station-pin {
  position: relative;
  width: clamp(46px, 4.6vw, 64px); height: clamp(46px, 4.6vw, 64px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a4252, var(--graphite-2));
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--steel), 0 6px 14px rgba(0, 0, 0, .55);
  transition: transform .15s, box-shadow .2s;
}
.station-pin svg { width: 56%; height: 56%; }
.station-no {
  position: absolute; top: -9px; right: -9px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--graphite); color: var(--text);
  box-shadow: 0 0 0 2px var(--steel);
  font-family: 'Rubik', sans-serif; font-weight: 900; font-size: .82rem;
  display: grid; place-items: center;
}
.station-label {
  background: rgba(14, 17, 23, .86);
  color: #fff;
  font-size: clamp(.68rem, 1.25vw, .86rem); font-weight: 700;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 0 0 1.5px rgba(201, 209, 217, .35), 0 3px 8px rgba(0, 0, 0, .4);
}
.station-en {
  font-size: clamp(.58rem, 1vw, .72rem); font-weight: 700;
  color: var(--gray); text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
.station:not(:disabled):hover .station-pin { transform: scale(1.1); }

.station.st-open .station-pin { box-shadow: var(--neon-pink), 0 6px 14px rgba(0, 0, 0, .55); }
.station.st-open .station-pin::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid var(--pink);
  animation: ring-out 1.6s ease-out infinite;
}
@keyframes ring-out { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.station.st-open .station-label { box-shadow: var(--neon-pink); }
.station.st-open .station-no { background: var(--pink); color: #fff; box-shadow: none; }

.station.st-done .station-pin { box-shadow: var(--neon-teal), 0 6px 14px rgba(0, 0, 0, .55); }
.station.st-done .station-no { background: var(--teal); color: var(--ink); box-shadow: none; }

.station.st-locked .station-pin, .station.st-soon .station-pin { opacity: .78; }
.station.st-locked .station-label, .station.st-soon .station-label { color: var(--text-soft); }
.station:disabled { cursor: default; }

/* 🔴 13.10: כל מקום שאינו הבא הוא נקודה קטנה, בלי שם. המפה הייתה עמוסה.
   ה-padding מגדיל את אזור ההקשה, כי נקודה של 18px קטנה מדי לאצבע */
.station.is-dot { padding: 13px; }
.station.is-dot .station-pin {
  width: 18px; height: 18px; background: var(--gray-light);
  box-shadow: 0 0 0 3px #10141b, 0 0 0 5px rgba(233, 238, 243, .35), 0 3px 8px rgba(0, 0, 0, .6);
}
.station.is-dot .station-pin svg,
.station.is-dot .station-no,
.station.is-dot .station-label,
.station.is-dot .station-en,
.station.is-dot .station-soon { display: none; }
.station.is-dot.st-done .station-pin { background: var(--teal); box-shadow: 0 0 0 3px #10141b, 0 0 14px var(--teal-glow); }
.station.is-dot.st-locked .station-pin, .station.is-dot.st-soon .station-pin { opacity: 1; }
.station-soon {
  font-size: .62rem; font-weight: 700; color: var(--text-soft);
  background: rgba(14, 17, 23, .8); padding: 1px 8px; border-radius: 999px;
}

/* ⚠️ TIN עומד **ליד** הסיכה ולא עליה. כשהוא במרכז התחנה הוא מסתיר
   את המספר ואת מצב הפתיחה, והילד לא רואה לאן ללחוץ */
.map-tin {
  position: absolute; z-index: 6; width: clamp(70px, 7vw, 110px);
  transform: translate(-125%, -88%);
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(25, 211, 197, .55)) drop-shadow(0 8px 6px rgba(0, 0, 0, .5));
}
.map-tin > * { width: 100%; height: auto; display: block; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.map-toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 8; background: rgba(14, 17, 23, .88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 16px; padding: 10px 22px; font-weight: 700;
  box-shadow: var(--neon-teal);
  width: max-content; max-width: min(92vw, 760px); text-align: center; line-height: 1.4;
}

/* ============================================================
   מסך עולמון: כותרת, לוח, וסרגל הדמות
   ============================================================ */
.unit-progress {
  display: flex; gap: 6px; justify-content: center; align-items: center;
  flex-wrap: wrap; max-width: 48vw;
  background: rgba(14, 17, 23, .72); padding: 7px 12px; border-radius: 999px;
  box-shadow: 0 0 0 1.5px rgba(201, 209, 217, .25);
}
.unit-progress .seg {
  width: clamp(14px, 3.2vw, 34px); height: 10px; border-radius: 999px;
  background: var(--steel);
}
.unit-progress .seg.done { background: var(--teal); box-shadow: 0 0 10px var(--teal-glow); }
.unit-progress .seg.now { background: var(--pink); box-shadow: 0 0 12px var(--pink-glow); animation: seg-pulse 1.2s infinite; }
@keyframes seg-pulse { 50% { transform: scaleY(1.5); } }

/* אפס גלילה: הלוח מתכווץ להתאים למסך, כמו שקופית */
/* ⚠️ ריפוד עליון שמפנה מקום לשורת ה-HUD. בלי זה הלוח עולה מתחתיה */
.unit-stage {
  flex: 1; overflow: hidden; margin-top: 62px;
  display: flex; justify-content: center; align-items: center;
  padding: 4px 12px 12px;
}

.panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 2.5fr;
  width: min(1320px, 100%);
  background: linear-gradient(180deg, rgba(43, 49, 60, .94), rgba(24, 28, 36, .96));
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px rgba(25, 211, 197, .7), 0 0 34px rgba(25, 211, 197, .28), var(--shadow);
  overflow: hidden;
  transform-origin: top center;
}
/* קו ניאון ורוד בראש הלוח, כמו שפה של מכונה */
.panel::before {
  content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--pink), transparent);
  box-shadow: 0 0 14px var(--pink);
}

.panel-solo { grid-template-columns: 1fr; }

/* --- סרגל הדמות --- */
.side {
  background: linear-gradient(180deg, rgba(25, 211, 197, .07), rgba(255, 62, 165, .05));
  border-left: 1.5px solid rgba(201, 209, 217, .14);
  padding: 16px 14px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.side-kicker {
  background: rgba(14, 17, 23, .8); border-radius: 999px;
  padding: 5px 16px; font-family: 'Rubik', sans-serif; font-weight: 700;
  font-size: .82rem; color: var(--teal);
  box-shadow: 0 0 0 1.5px rgba(25, 211, 197, .55);
}
.side-title {
  font-family: 'Rubik', sans-serif; font-weight: 900;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem); color: #fff;
  text-shadow: 0 0 14px rgba(255, 62, 165, .55);
}
.side-tin { width: clamp(96px, 11vw, 150px); }
.side-tin > * { width: 100%; height: auto; display: block; animation: bob 3.2s ease-in-out infinite; }
.bubble {
  position: relative; width: 100%;
  background: var(--gray-light); color: var(--ink);
  border-radius: 16px; padding: 11px 14px;
  font-size: 1rem; font-weight: 500; line-height: 1.45;
  box-shadow: 0 0 0 3px var(--teal), 0 0 18px var(--teal-glow);
}
.bubble::before {
  content: ''; position: absolute; top: -17px; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent; border-bottom-color: var(--teal);
}
.side-help {
  width: 100%; background: rgba(255, 62, 165, .12);
  border-radius: 14px; padding: 9px 11px; font-size: .88rem; color: #ffd0e8;
  box-shadow: 0 0 0 1.5px rgba(255, 62, 165, .55);
}

/* --- אזור הפעילות --- */
.card { padding: 18px clamp(14px, 2.4vw, 34px) 18px; }
.card-head { text-align: center; margin-bottom: 10px; }
.card-title { font-size: clamp(1.2rem, 2.4vw, 1.7rem); color: #fff; text-shadow: 0 0 14px var(--pink-glow); }

.stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 230px;
}

.feedback {
  min-height: 30px; text-align: center; font-size: 1.08rem; padding: 6px 0 2px;
  opacity: 0; font-weight: 700; font-family: 'Rubik', sans-serif;
  transition: opacity .2s;
}
.feedback.is-shown { opacity: 1; }
.feedback.is-good { color: var(--ok); text-shadow: 0 0 12px rgba(51, 224, 143, .5); }
.feedback.is-try { color: #ffb3c1; }

.card-foot { text-align: center; padding-top: 8px; }
/* 🆕 22.10 · חזרה למשימה הקודמת. משני, כדי שלא יתחרה בכפתור ההמשך. ב-RTL הוא מימין */
.card-foot:has(.btn-back) { display: flex; justify-content: center; align-items: center; gap: 14px; }
.btn-back { display: inline-flex; align-items: center; gap: 4px; padding: 10px 18px 10px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .06); color: var(--text-soft); font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 1rem;
  box-shadow: inset 0 0 0 2px var(--steel); transition: color .2s, box-shadow .2s; }
.btn-back svg { width: 18px; height: 18px; stroke: currentColor; }
.btn-back:hover, .btn-back:focus-visible { color: var(--white); box-shadow: inset 0 0 0 2px var(--teal); }
.beat-note { color: var(--text-soft); font-size: .95rem; text-align: center; margin-top: 10px; }

/* ============================================================
   פעימות
   ============================================================ */

/* נקודות סיבוב */
.round-dots { display: flex; gap: 8px; margin-bottom: 12px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--steel); }
.dot.is-done { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.dot.is-now { background: var(--pink); box-shadow: 0 0 10px var(--pink); transform: scale(1.3); }

/* נורות הסדנה: כל הצלחה מדליקה אחת */
.bulbs { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.bulb {
  width: 26px; height: 34px; position: relative;
  border-radius: 50% 50% 40% 40%;
  background: #39404d; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3);
  transition: background .25s, box-shadow .25s;
}
.bulb::after {
  content: ''; position: absolute; bottom: -7px; left: 7px; right: 7px; height: 8px;
  border-radius: 0 0 4px 4px; background: #7d8796;
}
.bulb.is-on {
  background: radial-gradient(circle at 40% 35%, #fff, var(--gold) 55%, #f0a20a);
  box-shadow: 0 0 18px rgba(255, 210, 63, .9), 0 0 40px rgba(255, 210, 63, .45);
}

/* 1 · מגש האותיות */
/* כל האותיות של העולם בשורה אחת, כמה שלא יהיו (--n נקבע בקוד) */
.letters-tray { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 12px; width: 100%; }
.letter-card {
  aspect-ratio: 1 / 1; border-radius: 18px;
  background: linear-gradient(180deg, var(--white), var(--gray));
  box-shadow: 0 6px 0 #8b96a3, 0 0 0 3px var(--steel);
  display: grid; place-items: center;
  transition: transform .12s, box-shadow .2s;
}
.letter-card-ch { font-size: clamp(34px, 5vw, 54px); font-weight: 700; color: var(--ink); }
.letter-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #8b96a3, 0 0 0 3px var(--steel); }
.letter-card.is-tapped { box-shadow: 0 6px 0 var(--teal-dark), 0 0 0 3px var(--teal), 0 0 22px var(--teal-glow); }

/* 2 · וידאו וכרטיס כלל */
.beat-video { width: 100%; max-height: 46vh; border-radius: 16px; background: #000; box-shadow: var(--neon-teal); }
.rule-card {
  width: 100%; margin-top: 12px;
  background: rgba(14, 17, 23, .55);
  border-radius: 16px; padding: 12px 18px;
  box-shadow: 0 0 0 1.5px rgba(255, 62, 165, .5);
}
.rule-card h3 { margin-bottom: 7px; font-size: 1.08rem; color: var(--pink); }
.rule-card ul { padding-inline-start: 20px; }
.rule-card li { margin-bottom: 4px; }

/* קטע כניסה */
.cutscene {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 52vh;
  border-radius: 18px; overflow: hidden; background: #0c0f15;
  box-shadow: 0 0 0 2px var(--teal), 0 0 26px var(--teal-glow);
}
.cutscene video, .cutscene img.cut-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cut-tin { position: absolute; bottom: 4%; width: 30%; left: 50%; }
.cut-tin > * { width: 100%; height: auto; display: block; }
.cut-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 20px 14px; text-align: center;
  background: linear-gradient(0deg, rgba(10, 12, 18, .92), transparent);
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: clamp(1rem, 2vw, 1.3rem);
}

/* רמקולים */
.speaker {
  width: 52px; height: 52px; border-radius: 50%; padding: 0; flex: 0 0 auto;
  background: rgba(14, 17, 23, .85);
  display: grid; place-items: center;
  box-shadow: 0 0 0 2.5px var(--teal), 0 0 14px var(--teal-glow);
}
.speaker svg { width: 24px; height: 24px; fill: var(--teal); stroke: var(--teal); }
.speaker:active { transform: scale(.94); }

.big-speaker {
  display: flex; align-items: center; gap: 11px;
  border-radius: 999px; padding: 12px 28px;
  background: linear-gradient(180deg, #2fe3d5, var(--teal) 55%, var(--teal-deep));
  color: var(--ink); font-size: 1.08rem; font-weight: 900;
  font-family: 'Rubik', sans-serif;
  box-shadow: 0 5px 0 var(--teal-dark), 0 0 24px var(--teal-glow);
  margin-bottom: 16px;
}
.big-speaker:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--teal-dark); }
.big-speaker svg { width: 26px; height: 26px; fill: var(--ink); stroke: var(--ink); }

/* אריחי אותיות: בהירים, ואות כהה. ניגודיות מלאה */
.tiles-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tile {
  min-width: 66px; height: 74px; padding: 0 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--white), var(--gray));
  box-shadow: 0 6px 0 #8b96a3, 0 0 0 2.5px var(--steel);
  font-size: 38px; font-weight: 700; color: var(--ink);
  transition: transform .1s, box-shadow .2s;
}
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 #8b96a3; }
.tile-lg { min-width: 92px; height: 98px; font-size: 52px; }
.tile.is-picked { box-shadow: 0 6px 0 var(--teal-dark), 0 0 0 3px var(--teal), 0 0 20px var(--teal-glow); }
.tile.is-used { opacity: .22; box-shadow: none; transform: translateY(4px); }
.tile.is-right { box-shadow: 0 6px 0 #1f8a57, 0 0 0 3px var(--ok), 0 0 24px rgba(51, 224, 143, .6); }
.tile.is-wrong { box-shadow: 0 6px 0 #8b96a3, 0 0 0 3px var(--err); animation: shake .3s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* מסילה: משבצות על פס ניאון, ונקודת התחלה ורודה בצד שמאל */
.rail {
  position: relative; display: flex; gap: 12px; justify-content: center;
  margin: 16px 0; padding: 12px 18px 16px 40px;
  border-radius: 20px;
  background: rgba(14, 17, 23, .6);
  box-shadow: inset 0 -5px 0 rgba(25, 211, 197, .45), 0 0 0 1.5px rgba(201, 209, 217, .2);
}
.rail::before {
  content: ''; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--pink);
  box-shadow: 0 0 12px var(--pink), 0 0 0 4px rgba(255, 62, 165, .25);
}
.slots { display: flex; gap: 12px; justify-content: center; }
.slot {
  width: 74px; height: 82px; border-radius: 16px;
  border: 3px dashed rgba(201, 209, 217, .45);
  background: rgba(255, 255, 255, .05);
  display: grid; place-items: center;
  font-size: 40px; font-weight: 700; color: var(--ink);
  transition: background .15s, box-shadow .2s;
}
.slot.is-filled {
  border: none;
  background: linear-gradient(180deg, var(--white), var(--gray));
  box-shadow: 0 5px 0 #8b96a3, 0 0 0 3px var(--teal);
}
.slot.is-right { box-shadow: 0 5px 0 #1f8a57, 0 0 0 3px var(--ok), 0 0 22px rgba(51, 224, 143, .6); }
.slot.is-wrong { box-shadow: 0 5px 0 #8b96a3, 0 0 0 3px var(--err); animation: shake .3s; }
.slot.is-lit { box-shadow: 0 5px 0 #8b96a3, 0 0 0 3px var(--gold), 0 0 26px rgba(255, 210, 63, .8); }
.slot-model { font-size: 38px; color: rgba(201, 209, 217, .32); }

.build-head { display: flex; align-items: center; gap: 16px; margin-bottom: 2px; }
.art-frame {
  background: var(--gray-light);
  border-radius: 20px; padding: 8px;
  box-shadow: 0 0 0 3px var(--steel), 0 6px 0 #8b96a3;
}
.art { display: block; }
.art-img { object-fit: cover; border-radius: 14px; }
.art-missing { border: 2px dashed var(--steel); border-radius: 12px; }

/* תנועות: ורודות. הלב של המילה, כמו הניקוד בעברית */
.tile.is-vowel { background: linear-gradient(180deg, #ffe2f1, #ffb3d9); box-shadow: 0 6px 0 var(--pink-deep), 0 0 0 3px var(--pink), 0 0 18px var(--pink-glow); }
.slot.is-vowel-slot { border-color: var(--pink); background: rgba(255, 62, 165, .1); }
.slot.is-vowel-slot.is-filled { background: linear-gradient(180deg, #ffe2f1, #ffb3d9); box-shadow: 0 5px 0 var(--pink-deep), 0 0 0 3px var(--pink); }
.tiles-vowels { margin-top: 12px; }
.vowel-card {
  width: 100%; max-width: 640px; text-align: right; line-height: 1.6;
  background: rgba(255, 62, 165, .1); border-radius: 18px; padding: 12px 18px; margin-bottom: 6px;
  box-shadow: 0 0 0 1.5px rgba(255, 62, 165, .55);
}
.vowel-card p + p { margin-top: 4px; }
.vowel-list, .vowel-term { font-family: 'Andika', sans-serif; font-weight: 700; color: #ffd0e8; font-size: 1.15em; unicode-bidi: isolate; display: inline-block; white-space: nowrap; }
.name-actions { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 10px; }

/* שלט: מילה מוארת על לוח ניאון */
.signs { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.sign-btn {
  min-width: 170px; padding: 16px 28px; border-radius: 18px;
  background: #10141b;
  box-shadow: 0 0 0 3px var(--steel), 0 6px 0 #07090c;
  transition: transform .12s, box-shadow .2s;
}
.sign-btn:hover { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--teal), 0 0 22px var(--teal-glow), 0 9px 0 #07090c; }
.sign-word {
  font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: 4px;
  color: var(--white); text-shadow: 0 0 10px rgba(255, 255, 255, .5);
}
.sign-btn.is-right { box-shadow: 0 0 0 3px var(--pink), 0 0 34px var(--pink-glow), 0 6px 0 #07090c; }
.sign-btn.is-right .sign-word { color: #ffe2f1; text-shadow: 0 0 12px var(--pink), 0 0 26px var(--pink); }
.sign-btn.is-wrong { box-shadow: 0 0 0 3px var(--err), 0 6px 0 #07090c; animation: shake .3s; }

/* אור שעובר על האותיות משמאל לימין */
.sweep-word { display: flex; gap: 6px; justify-content: center; }
.sweep-ch {
  font-family: 'Andika', sans-serif; font-weight: 700;
  font-size: clamp(54px, 8vw, 86px); color: var(--text-soft);
  min-width: .8em; text-align: center; transition: color .2s, text-shadow .2s;
}
.sweep-ch.is-lit { color: #fff; text-shadow: 0 0 14px var(--gold), 0 0 32px rgba(255, 210, 63, .7); }

/* 5 · המסוע */
.wave-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wave-label { font-size: 1.05rem; color: var(--text-soft); font-weight: 700; }
.wave-target {
  font-size: clamp(34px, 4.8vw, 50px); font-weight: 700; min-width: 70px; text-align: center;
  background: linear-gradient(180deg, var(--white), var(--gray));
  border-radius: 16px; padding: 2px 16px; color: var(--ink);
  box-shadow: 0 5px 0 #8b96a3, 0 0 0 3px var(--pink), 0 0 22px var(--pink-glow);
}
.combo {
  font-family: 'Rubik', sans-serif; font-weight: 900; font-size: 1.1rem;
  color: var(--gold); text-shadow: 0 0 12px rgba(255, 210, 63, .7);
  min-width: 70px; text-align: center; opacity: 0; transition: opacity .2s;
}
.combo.is-on { opacity: 1; }
.belt {
  position: relative; width: 100%; height: clamp(170px, 30vh, 230px);
  border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(70% 90% at 50% 0%, rgba(25, 211, 197, .18), transparent 70%),
    linear-gradient(180deg, #1b2029 0%, #12161d 100%);
  box-shadow: inset 0 0 0 2px rgba(201, 209, 217, .18), 0 0 0 2px rgba(25, 211, 197, .5);
}
.belt::before, .belt::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--teal); box-shadow: 0 0 12px var(--teal);
}
.belt::before { top: 14%; }
.belt::after { bottom: 26px; background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.belt-lane { position: absolute; inset: 0; }
.belt-teeth {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: repeating-linear-gradient(90deg, #3c4452 0 18px, #262c36 18px 36px);
  animation: teeth-run .6s linear infinite;
}
@keyframes teeth-run { to { background-position: 36px 0; } }
.belt-tile {
  position: absolute; width: 66px; height: 66px; margin-top: -33px; padding: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--white), var(--gray));
  box-shadow: 0 5px 0 #8b96a3, 0 0 0 2.5px var(--steel);
  font-size: 34px; font-weight: 700; color: var(--ink);
  will-change: transform;
}
.belt-tile.is-gone { animation: pop-out .3s forwards; pointer-events: none; }
.belt-tile.is-miss { box-shadow: 0 5px 0 #8b96a3, 0 0 0 3px var(--err); }
@keyframes pop-out { to { transform: scale(1.8); opacity: 0; } }

.wave-progress {
  width: 100%; height: 14px; border-radius: 999px;
  background: var(--graphite-2);
  box-shadow: inset 0 0 0 1.5px rgba(201, 209, 217, .2);
  margin-top: 12px; overflow: hidden;
}
.wave-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--pink));
  box-shadow: 0 0 12px var(--pink-glow);
  transition: width .25s;
}

/* 6 · שבב הזיכרון */
.chip {
  position: relative; width: 100%; border-radius: 18px;
  background: linear-gradient(135deg, #1c2a2f, #26203a);
  padding: 12px 16px; margin-bottom: 14px;
  box-shadow: 0 0 0 2px #9b86e0, 0 0 22px rgba(155, 134, 224, .35);
}
.chip-title { font-size: .86rem; color: #c9b9ff; font-weight: 700; margin-bottom: 8px; font-family: 'Rubik', sans-serif; }
.chip-words { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.chip-word {
  display: flex; align-items: center; gap: 9px;
  background: var(--gray-light); color: var(--ink); border-radius: 14px;
  padding: 6px 12px; font-size: 26px;
}
.chip-he { font-family: 'Heebo', sans-serif; font-size: .8rem; color: #4a5566; }

/* משפט בהקשר: מילים לחיצות, ומילות השבב מסומנות */
.ctx-card {
  width: 100%; display: flex; align-items: center; gap: 18px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 12px;
}
.ctx-sentence {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start;
  background: var(--gray-light); border-radius: 18px; padding: 12px 18px 12px 34px;
  position: relative; box-shadow: 0 0 0 3px var(--steel), 0 6px 0 #8b96a3;
}
.ctx-sentence::before {
  content: ''; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px var(--pink);
}
.ctx-w {
  font-size: clamp(30px, 4.4vw, 44px); font-weight: 700; color: var(--ink);
  padding: 0 6px; border-radius: 10px; transition: background .15s, box-shadow .2s;
}
.ctx-w.is-chip { background: rgba(155, 134, 224, .22); box-shadow: inset 0 -4px 0 #9b86e0; }
.ctx-w.is-lit { background: rgba(255, 210, 63, .45); }
.ctx-w.is-right { background: rgba(51, 224, 143, .4); }
.ctx-w.is-wrong { background: rgba(255, 93, 108, .35); animation: shake .3s; }
.ctx-sentence.is-tappable .ctx-w { cursor: pointer; }

.word-btn {
  min-width: 128px; height: 78px; border-radius: 16px;
  background: linear-gradient(180deg, var(--white), var(--gray));
  box-shadow: 0 6px 0 #8b96a3, 0 0 0 2.5px var(--steel);
  font-size: 34px; font-weight: 700; color: var(--ink);
}
.word-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #8b96a3; }
.word-btn.is-right { box-shadow: 0 6px 0 #1f8a57, 0 0 0 3px var(--ok); }
.word-btn.is-wrong { box-shadow: 0 6px 0 #8b96a3, 0 0 0 3px var(--err); animation: shake .3s; }

/* 7 · קוראים לבד */
.read-word { margin: 4px 0 22px; text-align: center; }
.pic-options { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.pic-btn {
  border-radius: 22px; background: var(--gray-light);
  box-shadow: 0 0 0 3px var(--steel), 0 7px 0 #8b96a3;
  padding: 12px; display: grid; place-items: center;
  transition: transform .12s, box-shadow .2s;
}
.pic-btn:hover { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--teal), 0 0 22px var(--teal-glow), 0 10px 0 #8b96a3; }
.pic-btn:active { transform: translateY(4px); }
.pic-btn.is-right { box-shadow: 0 0 0 4px var(--ok), 0 0 30px rgba(51, 224, 143, .6), 0 7px 0 #1f8a57; }
.pic-btn.is-wrong { box-shadow: 0 0 0 4px var(--err), 0 7px 0 #8b96a3; animation: shake .3s; }

/* סיום פעימה */
.beat-done { text-align: center; }
.beat-done-mark {
  width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 12px;
  background: radial-gradient(circle at 35% 30%, #5ff0b0, #17a866);
  position: relative;
  box-shadow: 0 0 0 4px rgba(51, 224, 143, .35), 0 0 30px rgba(51, 224, 143, .6);
}
.beat-done-mark::after {
  content: ''; position: absolute; left: 23px; top: 14px;
  width: 16px; height: 30px; border: solid #fff;
  border-width: 0 6px 6px 0; transform: rotate(45deg);
}
.beat-done p { margin: 4px 0; font-weight: 700; font-size: 1.1rem; }
.beat-done-sub { font-weight: 400 !important; color: var(--text-soft); font-size: .95rem; }

/* 8 · התקנה */
.install-lead { text-align: center; margin-bottom: 12px; font-size: 1.05rem; }
.install-stage { display: flex; align-items: center; gap: 24px; justify-content: center; flex-wrap: wrap; }
.install-tin { width: clamp(150px, 20vw, 230px); position: relative; }
.install-tin > * { width: 100%; height: auto; display: block; }
.install-card { text-align: center; }
.install-part {
  font-family: 'Rubik', sans-serif; font-weight: 900; font-size: 1.5rem; color: #fff;
  text-shadow: 0 0 16px var(--pink);
}
.install-unlock { color: var(--teal); font-weight: 700; font-size: 1.05rem; }

/* תליית השלט: לוח שגוררים אל החזה של TIN */
.hang-row { display: flex; align-items: center; justify-content: center; gap: 30px; flex-wrap: wrap; }
.hang-plate {
  padding: 10px 26px; border-radius: 14px; background: #10141b;
  box-shadow: 0 0 0 3px var(--pink), 0 0 26px var(--pink-glow), 0 6px 0 #07090c;
  cursor: grab; touch-action: none;
}
.hang-plate .sign-word { font-size: 40px; color: #ffe2f1; text-shadow: 0 0 12px var(--pink); }
.hang-target { position: relative; }
.hang-target .drop-zone {
  position: absolute; left: 36%; width: 28%; top: 49%; height: 13%;
  border-radius: 10px; border: 3px dashed var(--pink);
  animation: zone-blink 1.1s ease-in-out infinite;
}
@keyframes zone-blink { 50% { border-color: rgba(255, 62, 165, .25); } }

.bank { width: 100%; margin-top: 14px; border-top: 1.5px solid rgba(201, 209, 217, .15); padding-top: 12px; }
.bank-title { font-size: .9rem; color: var(--text-soft); margin-bottom: 8px; font-weight: 700; }
.bank-words { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.bank-word {
  border-radius: 12px;
  background: linear-gradient(180deg, var(--white), var(--gray));
  padding: 5px 15px; font-size: 23px; font-weight: 700; color: var(--ink);
  box-shadow: 0 4px 0 #8b96a3, 0 0 0 2px var(--teal);
}

/* ============================================================
   מסך פתיחת עולמון וסיום
   ============================================================ */
.intro-badge {
  display: inline-block;
  background: rgba(14, 17, 23, .8); color: var(--pink);
  border-radius: 999px; padding: 5px 18px;
  font-size: .9rem; font-weight: 700;
  box-shadow: 0 0 0 1.5px var(--pink);
}
.unit-place { font-family: 'Rubik', sans-serif; font-weight: 900; font-size: clamp(1.7rem, 4vw, 2.5rem); color: #fff; margin: 8px 0 0; text-shadow: 0 0 18px var(--pink-glow); }
.unit-en { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--teal); margin: 2px 0 2px; }
.unit-he { color: var(--text-soft); margin-bottom: 12px; }
/* 🔴 14.10, שני: האותיות של העולם תמיד בשורה אחת. בחלון צר האריחים מתכווצים במקום לרדת שורה */
.letters-strip { display: flex; justify-content: center; gap: clamp(4px, 1.2vw, 10px); flex-wrap: nowrap; margin-bottom: 16px; }
.letters-strip span {
  flex: 0 1 56px; min-width: 0; aspect-ratio: 56 / 66; border-radius: clamp(8px, 1.6vw, 14px);
  display: grid; place-items: center; font-size: clamp(24px, 3.6vw, 34px); font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, var(--white), var(--gray));
  box-shadow: 0 5px 0 #8b96a3, 0 0 0 2.5px var(--teal);
}
/* רוחב קריא. שורה שנמתחת על כל רוחב הלוח קשה למעקב בגיל הזה */
.objectives {
  max-width: 660px; margin-inline: auto;
  text-align: right; background: rgba(14, 17, 23, .5);
  border-radius: 18px; padding: 14px 22px; margin-bottom: 18px;
  box-shadow: 0 0 0 1.5px rgba(25, 211, 197, .45);
}
.objectives h3 { margin-bottom: 8px; font-size: 1.08rem; color: var(--teal); }
.objectives ul { list-style: none; }
.objectives li { margin-bottom: 6px; padding-inline-start: 22px; position: relative; }
.objectives li::before {
  content: ''; position: absolute; right: 0; top: .5em;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 8px var(--pink);
}

.reward-part { font-family: 'Rubik', sans-serif; font-weight: 900; font-size: 1.6rem; color: #fff; text-shadow: 0 0 16px var(--pink); }
.reward-unlock { color: var(--teal); font-weight: 700; margin-bottom: 14px; }
.reward-stats { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.reward-stats div {
  min-width: 122px;
  background: rgba(14, 17, 23, .6); border-radius: 16px;
  padding: 10px 12px; font-size: .84rem; color: var(--text-soft);
  box-shadow: 0 0 0 1.5px rgba(25, 211, 197, .5);
}
.reward-stats span {
  display: block; font-size: 1.8rem; font-weight: 900; color: var(--gold);
  font-family: 'Rubik', sans-serif; text-shadow: 0 0 12px rgba(255, 210, 63, .5);
}

/* ============================================================
   הרובוט
   ============================================================ */
.robot { display: block; overflow: visible; }
.tin-img-wrap { position: relative; }
.tin-img-wrap img { width: 100%; height: auto; display: block; }
/* השם על שלט החזה כשהרובוט הוא תמונה. המיקום נמדד על תמונת העוגן */
.rbt-name-tag {
  position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%);
  font-weight: 700; font-size: clamp(10px, 1.1em, 40px); letter-spacing: .12em;
  color: #ffe2f1; text-shadow: 0 0 8px var(--pink), 0 0 16px var(--pink);
}
.rbt-name { font-family: 'Andika', sans-serif; font-size: 19px; font-weight: 700; fill: #ffe2f1; letter-spacing: 3px; }

.robot .rbt-part.is-on.just-in { animation: snap-in .8s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes snap-in {
  0% { opacity: 0; transform: scale(.3); }
  60% { opacity: 1; transform: scale(1.18); }
  100% { transform: scale(1); }
}
.robot .rbt-eye { animation: blink 4.6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.robot .rbt-neon { animation: neon-hum 2.4s ease-in-out infinite; }

/* TIN מדבר דרך המסכה. --talk בין 0 ל-1, נכתב מ-talk.js בכל פריים */
.robot .rbt-visor-glow, .robot .rbt-visor-rim { opacity: calc(var(--talk, 0) * 1.1); }
.robot .rbt-eye { transition: filter .05s; }
.is-talking .robot .rbt-eye { animation: none; filter: brightness(calc(1 + var(--talk, 0) * 1.4)) drop-shadow(0 0 calc(var(--talk, 0) * 10px) #8ff3ea); }
.tin-visor-glow {
  position: absolute; left: 30%; right: 30%; top: 12%; height: 18%; border-radius: 40%;
  background: radial-gradient(closest-side, rgba(25, 211, 197, .75), transparent);
  opacity: calc(var(--talk, 0) * 1.2); mix-blend-mode: screen; pointer-events: none;
}
@keyframes neon-hum { 50% { opacity: .6; } }

/* ============================================================
   מסכים צרים
   ============================================================ */
@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .side {
    flex-direction: row; flex-wrap: wrap; text-align: right;
    padding: 10px 12px; gap: 10px; align-items: center; justify-content: flex-start;
    border-left: none; border-bottom: 1.5px solid rgba(201, 209, 217, .14);
  }
  .side-tin { width: 62px; }
  .bubble { width: auto; flex: 1; min-width: 190px; font-size: .94rem; }
  .bubble::before { display: none; }
  .side-help { font-size: .82rem; }
}

@media (max-width: 600px) {
  .letters-tray { gap: 6px; }
  .letter-card { border-radius: 12px; }
  .letter-card-ch { font-size: clamp(24px, 7vw, 34px); }
  .hud-chip { padding: 6px 11px; font-size: .9rem; }
  /* בטלפון: בלי שבבי הסטטיסטיקה במפה, והשלט יורד מתחת ל-HUD */
  .screen-map .hud-chip.is-stat { display: none; }
  .banner { top: 62px; font-size: 1rem; padding: 7px 18px; }
  .unit-progress { max-width: 54vw; gap: 4px; padding: 6px 9px; }
  .unit-progress .seg { width: 13px; height: 8px; }
  .tile { min-width: 56px; height: 64px; font-size: 32px; }
  .tile-lg { min-width: 74px; height: 80px; font-size: 42px; }
  .slot { width: 60px; height: 68px; font-size: 32px; }
  .signs { gap: 12px; }
  .sign-btn { min-width: 130px; padding: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 🔴 13.10: מעולם 3 גוררים חלק אל השקע שלו, ולא שלט. השקע של יד ימין
   יושב ב-(166, 152) מתוך 220×296 של הרובוט. ⚠️ רוחב מפורש: בתוך install-tin
   יש כלל שנותן לילדים רוחב מלא, ובכיוון RTL הוא גובר על left */
.hang-plate.is-part {
  display: grid; justify-items: center; gap: 4px; padding: 12px 22px;
  background: #1a1f28;
}
.hang-plate .part-label { font-size: 15px; color: #ffe2f1; }
.hang-target .drop-zone.dz-armR { left: 66%; width: 19%; top: 44%; height: 15%; border-radius: 50%; }
.hang-target .drop-zone.dz-armL { left: 15%; width: 19%; top: 44%; height: 15%; border-radius: 50%; }
/* כשהרובוט הוא תמונה (tin-N.png, ריבוע) ולא הציור (220×296), השקע במקום אחר.
   נמדד על tin-2: הכתף בערך ב-(67%, 44%) */
.hang-target:has(img) .drop-zone.dz-armR { left: 59.5%; width: 15%; top: 36.5%; height: 15%; }
.hang-target:has(img) .drop-zone.dz-armL { left: 25.5%; width: 15%; top: 36.5%; height: 15%; }
/* 🆕 15.10 · רגליים, עולם 5. בציור: שני השקעים ב-(88, 216) ו-(132, 216).
   בתמונה tin-4: הירכיים יושבות על העגלה, בערך בגובה 62% */
.hang-target .drop-zone.dz-legs { left: 33%; width: 34%; top: 68%; height: 10%; border-radius: 30px; }
.hang-target:has(img) .drop-zone.dz-legs { left: 30%; width: 40%; top: 58%; height: 13%; }
/* 19.10 · ליבת האנרגיה: באמצע הגוף, מתחת לשלט החזה. ב-tin-6 היא כבר שם, ובתמונה tin-5 המקום ריק */
.hang-target .drop-zone.dz-core { left: 42%; width: 16%; top: 59%; height: 11%; border-radius: 50%; }
.hang-target:has(img) .drop-zone.dz-core { left: 43%; width: 14%; top: 43%; height: 11%; }
/* 19.10 · אנטנה: מעל הראש */
.hang-target .drop-zone.dz-antenna { left: 44%; width: 12%; top: 0; height: 9%; border-radius: 50%; }
.hang-target:has(img) .drop-zone.dz-antenna { left: 44%; width: 12%; top: 1%; height: 8%; }
/* 19.10 · זרקור: בצד הראש */
.hang-target .drop-zone.dz-light { left: 64%; width: 14%; top: 3%; height: 8%; border-radius: 40%; }
.hang-target:has(img) .drop-zone.dz-light { left: 64%; width: 14%; top: 8%; height: 9%; }
/* 20.10 · המתג הכפול: על החזה. בציור בצד ימין של הצופה (x 140), ובתמונה tin-9 בצד שמאל, ליד שלט החזה */
.hang-target .drop-zone.dz-switch { left: 61%; width: 10%; top: 59%; height: 10%; border-radius: 30%; }
.hang-target:has(img) .drop-zone.dz-switch { left: 35%; width: 9%; top: 46%; height: 12%; }
/* 21.10 · מנועי סילון: מתחת לכפות הרגליים. בתמונה tin-10 בערך x 29%–69%, y 80%–92% */
.hang-target .drop-zone.dz-jets { left: 30%; width: 40%; top: 84%; height: 10%; border-radius: 30px; }
.hang-target:has(img) .drop-zone.dz-jets { left: 28%; width: 42%; top: 80%; height: 12%; }
/* 22.10 · כנפיים: משני צידי הגוף, בגובה הכתפיים */
.hang-target .drop-zone.dz-wings { left: 4%; width: 92%; top: 38%; height: 24%; border-radius: 30px; }
.hang-target:has(img) .drop-zone.dz-wings { left: 6%; width: 88%; top: 34%; height: 24%; }

/* ============================================================
   🆕 13.10 · משחק זיכרון, קוראים לרובוט, הכה את הרובוט
   ============================================================ */

/* --- משחק זיכרון --- */
.mem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  width: min(100%, 520px);
}
.mem-card {
  position: relative; aspect-ratio: 1 / 1; padding: 0; border-radius: 18px;
  background: var(--gray-light);
  box-shadow: 0 0 0 2.5px var(--steel), 0 6px 0 #8b96a3;
  display: grid; place-items: center; overflow: hidden;
  transition: transform .12s, box-shadow .2s;
}
.mem-card:active { transform: translateY(3px); }
/* גב הקלף: גרפיט עם ברג ניאון. אין עליו כלום שאפשר לקרוא */
.mem-back {
  position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, var(--teal) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, transparent 0 20%, rgba(25, 211, 197, .35) 21% 24%, transparent 25%),
    linear-gradient(135deg, var(--graphite), var(--graphite-3));
  transition: opacity .18s;
}
.mem-face { opacity: 0; transition: opacity .18s; display: grid; place-items: center; }
.mem-card.is-open .mem-back { opacity: 0; }
.mem-card.is-open .mem-face { opacity: 1; }
.mem-card.is-open { animation: mem-flip .22s ease-out; }
@keyframes mem-flip { 0% { transform: scaleX(.2); } 100% { transform: scaleX(1); } }
.mem-card.is-matched { box-shadow: 0 0 0 3px var(--ok), 0 0 20px rgba(51, 224, 143, .55), 0 6px 0 #1f8a57; }
.mem-word { font-size: clamp(26px, 4vw, 36px); font-weight: 700; color: var(--ink); }

/* --- קוראים לרובוט --- */
.mic-btn {
  display: flex; align-items: center; gap: 12px;
  border-radius: 999px; padding: 14px 30px; margin-top: 8px;
  background: linear-gradient(180deg, #ff6dbb, var(--pink) 55%, var(--pink-deep));
  color: #fff; font-size: 1.1rem; font-weight: 900; font-family: 'Rubik', sans-serif;
  box-shadow: 0 5px 0 var(--pink-dark), 0 0 24px var(--pink-glow);
}
.mic-btn svg { width: 28px; height: 28px; fill: #fff; stroke: #fff; }
.mic-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pink-dark); }
.mic-btn.is-rec { animation: rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 5px 0 var(--pink-dark), 0 0 0 10px rgba(255, 62, 165, .25), 0 0 40px var(--pink-glow); } }
.compare-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.compare-row .btn-soft { display: flex; align-items: center; gap: 8px; }
.compare-row .btn-soft svg { width: 22px; height: 22px; fill: var(--ink); stroke: var(--ink); }
.btn-ok {
  background: linear-gradient(180deg, #6ff0b4, var(--ok) 55%, #1fa868);
  border-radius: 999px; padding: 11px 26px;
  font-weight: 900; color: var(--ink); font-family: 'Rubik', sans-serif;
  box-shadow: 0 5px 0 #157a4a, 0 0 20px rgba(51, 224, 143, .45);
}
.btn-ok:active { transform: translateY(4px); box-shadow: 0 1px 0 #157a4a; }

/* --- הכה את הרובוט --- */
/* 🔴 14.10, שני: "נראה בסיסי מדי". עכשיו לוח מכונה מפלדה עם צוהרים עגולים.
   הצוהר נדלק כשרובוט עולה ממנו, ירוק בפגיעה ואדום בטעות */
.whack-field {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px;
  width: min(100%, 540px); margin: 4px 0; padding: 14px 18px 16px;
  border-radius: 26px; position: relative;
  background:
    radial-gradient(circle at 14px 14px, #59626f 0 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) 14px, #59626f 0 3px, transparent 4px),
    radial-gradient(circle at 14px calc(100% - 14px), #59626f 0 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #59626f 0 3px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #343b47, var(--graphite-2));
  box-shadow: 0 0 0 2px var(--steel), 0 0 0 4px rgba(25, 211, 197, .35), 0 0 26px rgba(25, 211, 197, .18),
    inset 0 2px 0 rgba(255, 255, 255, .08), inset 0 -6px 14px rgba(0, 0, 0, .35);
}
/* החור: הבור מאחורי הרובוט (before), ושפת המתכת לפניו (after). overflow מסתיר אותו כשהוא למטה */
.hole {
  position: relative; height: 158px; overflow: hidden;
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
}
.hole::before {
  content: ''; position: absolute; left: 5%; right: 5%; bottom: 2px; height: 34px;
  border-radius: 50%; z-index: 0;
  background: radial-gradient(ellipse at 50% 35%, #000 0 45%, #0b1016 70%, #1a2029);
  box-shadow: 0 0 0 4px #4a5361, 0 0 0 6px #262c36, 0 0 12px 4px rgba(25, 211, 197, .12);
  transition: box-shadow .2s;
}
.hole::after {
  content: ''; position: absolute; left: 5%; right: 5%; bottom: 2px; height: 34px;
  border-radius: 50%; z-index: 2; pointer-events: none;
  /* רק החצי הקדמי של השפה. החצי האחורי שקוף, והרובוט נראה מעליו */
  clip-path: inset(50% -10px -10px -10px);
  box-shadow: inset 0 -5px 0 #59626f, inset 0 -9px 0 #2c333e;
  background: linear-gradient(180deg, transparent 50%, #10151c 50%);
}
.hole:has(.mole.is-up)::before {
  box-shadow: 0 0 0 4px var(--teal), 0 0 0 6px #262c36, 0 0 18px 6px var(--teal-glow);
}
.hole:has(.mole.is-hit)::before {
  box-shadow: 0 0 0 4px var(--ok), 0 0 0 6px #262c36, 0 0 22px 8px rgba(51, 224, 143, .6);
}
.hole:has(.mole.is-miss)::before {
  box-shadow: 0 0 0 4px var(--err), 0 0 0 6px #262c36, 0 0 18px 6px rgba(255, 93, 108, .5);
}

/* הרובוט הקטן: שלט מעל הראש, ראש, וגוף שנבלע בבור.
   🔴 השלט למעלה, ולכן תמיד מעל שפת הבור. כשהיה למטה, השפה כיסתה חצי מהמילה */
.mole {
  --tone: var(--teal); --tone-glow: var(--teal-glow);
  position: absolute; left: 50%; bottom: 14px; width: 112px; padding: 0;
  transform: translate(-50%, 125%); transition: transform .15s ease-in;
  display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; z-index: 1; touch-action: manipulation; cursor: pointer;
}
.mole[data-tone="pink"] { --tone: var(--pink); --tone-glow: var(--pink-glow); }
.mole[data-tone="gold"] { --tone: var(--gold); --tone-glow: rgba(255, 210, 63, .5); }
.mole.is-up { transform: translate(-50%, 0); transition: transform .32s cubic-bezier(.34, 1.6, .64, 1); }
.mole:focus-visible { outline: none; }
.mole:focus-visible .mole-plate { box-shadow: 0 0 0 3px var(--white), 0 4px 0 #8b96a3; }

/* השלט: בהיר עם אותיות כהות, כמו כל מילה שמפענחים. שני מוטות מחזיקים אותו */
.mole-plate {
  position: relative; min-width: 100px; padding: 3px 12px; border-radius: 13px;
  background: linear-gradient(180deg, var(--white), var(--gray-light) 70%, #d3dbe3); color: var(--ink);
  font-size: 30px; font-weight: 700; line-height: 1.2;
  box-shadow: 0 0 0 2.5px var(--steel), 0 4px 0 #8b96a3, 0 6px 14px rgba(0, 0, 0, .35);
}
.mole-plate::before, .mole-plate::after {
  content: ''; position: absolute; top: 100%; width: 5px; height: 12px;
  background: linear-gradient(90deg, #6b7583, #3c4452); border-radius: 0 0 2px 2px;
}
.mole-plate::before { left: 32%; }
.mole-plate::after { right: 32%; }

.mole-head {
  margin-top: 10px; width: 66px; height: 48px; border-radius: 20px 20px 16px 16px;
  background: linear-gradient(180deg, var(--tone) 0 26%, #f2f5f8 26%, #c3ccd6);
  display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 6px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .14), 0 0 0 1.5px rgba(0, 0, 0, .25), 0 0 14px var(--tone-glow);
  position: relative;
}
/* אוזניים ורודות, כמו של TIN */
.mole-head::before, .mole-head::after {
  content: ''; position: absolute; top: 17px; width: 11px; height: 18px; border-radius: 6px;
  background: radial-gradient(circle, #ffd5ea 0 25%, var(--pink) 30% 60%, var(--pink-deep) 65%);
  box-shadow: 0 0 8px var(--pink-glow);
}
.mole-head::before { left: -8px; }
.mole-head::after { right: -8px; }
.mole-eye {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 9px var(--teal-glow), 0 0 0 3.5px #10141b;
  transition: height .12s, border-radius .12s;
}
.mole-body {
  width: 50px; height: 26px; margin-top: 3px; border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, #d9e0e7, #8f9aa7);
  box-shadow: inset 0 0 0 9px transparent, inset 0 -3px 0 rgba(0, 0, 0, .15);
  position: relative;
}
.mole-body::after {
  content: ''; position: absolute; left: 50%; top: 7px; width: 20px; height: 6px; margin-left: -10px;
  border-radius: 3px; background: var(--tone); box-shadow: 0 0 8px var(--tone-glow);
}

/* פגיעה: העיניים הופכות לחיוך, והשלט נדלק בירוק */
.mole.is-hit .mole-plate { background: linear-gradient(180deg, #eafff4, #b8f5d6); box-shadow: 0 0 0 3px var(--ok), 0 0 20px rgba(51, 224, 143, .7); }
.mole.is-hit .mole-eye {
  height: 8px; margin-top: -4px; border-radius: 10px 10px 0 0; background: transparent;
  border: 3.5px solid var(--gold); border-bottom: 0; box-shadow: 0 -2px 8px rgba(255, 210, 63, .7);
}
.mole.is-hit .mole-head { animation: mole-boing .36s ease-out; }
.mole.is-miss .mole-plate { box-shadow: 0 0 0 3px var(--err); animation: shake .3s; }
@keyframes mole-boing {
  0% { transform: scale(1, 1); }
  35% { transform: scale(1.18, .82); }
  70% { transform: scale(.94, 1.08); }
  100% { transform: scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .mole, .mole.is-up { transition-duration: .01s; }
  .mole.is-hit .mole-head { animation: none; }
}

/* --- השלט של הרובוט · בונים משפט --- */
/* הגדר: המסילה הרגילה, עם משבצות ברוחב מילה. בטלפון היא נשברת לשתי שורות */
.sent-rail { max-width: 100%; }
.sent-slots { flex-wrap: wrap; gap: 10px; }
.slot.sent-slot { width: auto; min-width: 70px; height: 64px; padding: 0 12px; font-size: 32px; }
.word-tile { min-width: 70px; height: 62px; font-size: 30px; }
.sent-tiles { transition: opacity .3s, transform .3s; }
.sent-tiles + .beat-note { margin-top: 16px; }
.sent-tiles.is-cleared { opacity: 0; transform: translateY(10px); pointer-events: none; }
/* נעיצה: השלט מתרומם, מקבל עמוד מתחתיו ונדלק בירוק */
.sent-rail.is-planted { animation: sent-plant .7s cubic-bezier(.34, 1.5, .64, 1) both;
  box-shadow: inset 0 -5px 0 var(--ok), 0 0 0 2px var(--ok), 0 0 26px rgba(51, 224, 143, .45); }
.sent-rail.is-planted::after {
  content: ''; position: absolute; left: 50%; top: 100%; width: 12px; height: 34px; margin-left: -6px;
  border-radius: 0 0 4px 4px; background: linear-gradient(90deg, #6b7583, #3c4452);
}
@keyframes sent-plant { 0% { transform: translateY(0); } 55% { transform: translateY(-22px); } 100% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .sent-rail.is-planted { animation: none; } }

@media (max-width: 600px) {
  /* 🔴 ארבע עמודות גם בטלפון. בשלוש היו ארבע שורות, וכפתור ההמשך ירד מתחת למסך */
  .mem-grid { gap: 8px; width: min(100%, 310px); }
  .mem-face svg, .mem-face img { width: 52px; height: 52px; }
  .mem-word { font-size: 24px; }
  .whack-field { gap: 8px 10px; padding: 10px 10px 12px; }
  .hole { height: 138px; }
  .mole { width: 94px; bottom: 12px; }
  .mole-plate { min-width: 82px; font-size: 25px; padding: 2px 8px; }
  .mole-head { width: 56px; height: 42px; margin-top: 9px; }
  .mole-eye { width: 12px; height: 12px; }
}

@media (max-width: 600px) {
  .slot.sent-slot { min-width: 52px; height: 54px; padding: 0 9px; font-size: 26px; }
  .word-tile { min-width: 56px; height: 54px; font-size: 26px; padding: 0 10px; }
  .sent-tiles { gap: 9px; }
}
