/* ============================================================
   styles.css — עיצוב נגיש, רספונסיבי, RTL, עם 4 ערכות נושא
   ============================================================ */

/* ---------- איפוס בסיסי ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: 'Heebo', 'Rubik', 'Assistant', system-ui, -apple-system, Arial, sans-serif;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 8px 26px rgba(0,0,0,0.10);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.16);
  --tap: 60px; /* גובה מינימלי ליעדי מגע */
  --transition: 0.22s ease;
}

/* ============================================================
   ערכות נושא — מתבהרות->מתכהות לפי רמת הקושי
   ============================================================ */

/* רמה 1 — בהיר וחמים */
body[data-level="1"] {
  --bg-1: #fff8ef;
  --bg-2: #ffeede;
  --surface: #ffffff;
  --surface-2: #fff3e6;
  --text: #3a2f26;
  --text-soft: #6f6156;
  --primary: #f4914e;
  --primary-strong: #e2743a;
  --accent: #5aa9e6;
  --border: #f0dcc7;
  --ok: #4caf50;
  --ok-bg: #e6f5e7;
  --no: #e05252;
  --no-bg: #fbe6e6;
}

/* רמה 2 — קלאסי בינוני */
body[data-level="2"] {
  --bg-1: #eaf4fb;
  --bg-2: #d9ecf7;
  --surface: #ffffff;
  --surface-2: #eef6fc;
  --text: #223b4d;
  --text-soft: #4e6b7d;
  --primary: #2e9dc4;
  --primary-strong: #1f7fa3;
  --accent: #23a699;
  --border: #cfe4f0;
  --ok: #2e9e57;
  --ok-bg: #e2f4e9;
  --no: #d84a4a;
  --no-bg: #fbe4e4;
}

/* רמה 3 — כהה אלגנטי */
body[data-level="3"] {
  --bg-1: #2b2c47;
  --bg-2: #23243c;
  --surface: #34365a;
  --surface-2: #3d3f68;
  --text: #f2f1fb;
  --text-soft: #c3c1e0;
  --primary: #8b7ce8;
  --primary-strong: #6f5fd6;
  --accent: #3fbf9f;
  --border: #4a4c78;
  --ok: #4fc27a;
  --ok-bg: #2f4a3c;
  --no: #f36b6b;
  --no-bg: #4c3238;
}

/* רמה 4 — הכי כהה וממוקד */
body[data-level="4"] {
  --bg-1: #0f1b2d;
  --bg-2: #0a1420;
  --surface: #16263c;
  --surface-2: #1c3149;
  --text: #f4f8ff;
  --text-soft: #b7c6da;
  --primary: #2fb0a3;
  --primary-strong: #1f8f84;
  --accent: #4d8ce0;
  --border: #274259;
  --ok: #35c47f;
  --ok-bg: #123a2b;
  --no: #ff6b6b;
  --no-bg: #3f2029;
}

/* ---------- בסיס ----------
   גודל בסיס קומפקטי. מי שצריך גדול יותר — כפתור הנגישות בהגדרות
   (html.large-text) מגדיל את הכול. */
html { font-size: 16px; }
body {
  font-family: var(--font);
  direction: rtl;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

#app { min-height: 100vh; }

/* ============================================================
   מסך התחברות
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border);
}
.login-logo { font-size: 84px; line-height: 1; margin-bottom: 8px; }
.login-title { font-size: 2.6rem; font-weight: 800; color: var(--text); }
.login-subtitle { font-size: 1.2rem; color: var(--text-soft); margin: 12px 0 32px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: var(--tap);
  background: #fff; color: #3c4043;
  border: 2px solid #dadce0; border-radius: var(--radius);
  font-size: 1.25rem; font-weight: 700;
  padding: 14px 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.google-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }
.google-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }
.login-foot { margin-top: 20px; color: var(--text-soft); font-size: 1rem; }

/* תיבת הנחיות התקנה (מוצגת כשאין הגדרת Firebase) */
.setup-box {
  margin-top: 24px; padding: 20px;
  background: var(--surface-2);
  border: 2px solid var(--primary);
  border-radius: 16px;
  text-align: right;
}
.setup-title { font-size: 1.2rem; font-weight: 800; color: var(--primary-strong); margin-bottom: 8px; }
.setup-lead { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.setup-file {
  display: inline-block; margin-bottom: 12px;
  padding: 4px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: 'Courier New', monospace; font-size: 1rem; font-weight: 700;
  direction: ltr; color: var(--primary-strong);
}
.setup-steps { margin: 6px 22px 0; padding: 0; font-size: 0.98rem; line-height: 1.7; color: var(--text-soft); }
.setup-steps li { margin-bottom: 4px; }

/* ============================================================
   דף נחיתה (Landing)
   ============================================================ */
.landing {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* אנימציית כניסה עדינה */
.landing .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.landing.landing-in .reveal { opacity: 1; transform: none; }
.landing.landing-in .landing-hero.reveal { transition-delay: 0.05s; }
.landing.landing-in .landing-story.reveal { transition-delay: 0.2s; }

/* Hero */
.landing-hero {
  text-align: center;
  padding: 20px 16px 8px;
}
.landing-logo {
  font-size: 82px; line-height: 1;
  animation: floaty 4s ease-in-out infinite;
}
.landing-title {
  font-family: 'Gveret Levin', 'Heebo', cursive;
  font-size: clamp(3rem, 9vw, 4.6rem);
  font-weight: 400;
  color: var(--primary-strong);
  margin: 6px 0 4px;
  line-height: 1.1;
}
.landing-tagline {
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  color: var(--text-soft);
  max-width: 620px; margin: 0 auto;
}
.landing-auth { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.landing-auth .google-btn { max-width: 420px; box-shadow: var(--shadow); }
.landing-auth-note { font-size: 1.02rem; color: var(--text-soft); }

/* טבעת אור מסתובבת סביב כפתור ההתחברות + זוהר עדין */
@property --btn-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.google-orbit {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
}
.google-orbit .google-btn { max-width: none; }
/* הטבעת הצבעונית שנעה סביב הכפתור (טכניקת mask ליצירת מסגרת בלבד) */
.google-orbit::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--radius) + 6px);
  padding: 4px;
  background: conic-gradient(from var(--btn-angle),
    transparent 0deg, var(--primary) 45deg, var(--accent) 92deg, transparent 145deg,
    transparent 215deg, var(--primary-strong) 262deg, var(--primary) 305deg, transparent 350deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: btn-orbit 5.5s linear infinite;
  pointer-events: none;
  z-index: 2;
}
/* זוהר חם ורך מאחורי הכפתור, פועם לאט */
.google-orbit::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: calc(var(--radius) + 8px);
  background: radial-gradient(closest-side, rgba(244, 145, 78, 0.5), rgba(244, 145, 78, 0) 72%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
  animation: btn-glow 3.6s ease-in-out infinite;
}
@keyframes btn-orbit { to { --btn-angle: 360deg; } }
@keyframes btn-glow { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.75; } }

/* סיפור — רוחב מלא על רקע הדף, ללא תיבה */
.landing-story {
  margin-top: 56px;
  text-align: center;
}
.story-heading {
  font-family: 'Gveret Levin', 'Heebo', cursive;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 400;
  color: var(--primary-strong);
  margin-bottom: 14px;
}
.story-divider {
  width: 90px; height: 4px; margin: 0 auto 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.story-lead {
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 800; color: var(--text);
  margin-bottom: 30px;
}
/* גוף הסיפור — נפרש על רוחב המסך, בטורים מאוזנים במסכים רחבים */
.story-body {
  text-align: right;
  font-size: clamp(1.12rem, 1.4vw, 1.28rem);
  line-height: 2;
  color: var(--text);
  column-gap: 56px;
}
.story-p { margin: 0 0 20px; break-inside: avoid; }
.story-signature {
  font-family: 'Gveret Levin', 'Heebo', cursive;
  font-size: 2.1rem; color: var(--primary-strong);
  margin-top: 20px;
}

/* בשתי טורים רק במסכים רחבים, כדי לשמור על שורות קריאות */
@media (min-width: 1000px) {
  .story-body { column-count: 2; }
}

@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============================================================
   פופ-אפ אישור עוגיות (Cookies)
   ============================================================ */
.cookie-pop {
  position: fixed; z-index: 9000;
  bottom: 20px; left: 50%;
  transform: translate(-50%, 160%);
  width: min(560px, calc(100% - 32px));
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}
.cookie-pop.cookie-in { transform: translate(-50%, 0); opacity: 1; }
.cookie-pop.cookie-out { transform: translate(-50%, 160%); opacity: 0; }
.cookie-emoji { font-size: 2.4rem; line-height: 1.2; flex: 0 0 auto; }
.cookie-body { flex: 1; }
.cookie-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.cookie-text { font-size: 1.02rem; color: var(--text-soft); line-height: 1.6; margin-bottom: 14px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-accept {
  min-height: 50px; padding: 10px 26px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  color: #fff; border: none; border-radius: 14px;
  font-size: 1.1rem; font-weight: 800; transition: var(--transition);
}
.cookie-accept:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cookie-decline {
  min-height: 50px; padding: 10px 22px;
  background: transparent; color: var(--text);
  border: 2px solid var(--border); border-radius: 14px;
  font-size: 1.05rem; font-weight: 700; transition: var(--transition);
}
.cookie-decline:hover { background: var(--surface-2); }

@media (max-width: 760px) {
  .landing { padding: 32px 20px 70px; }
  .landing-story { margin-top: 40px; }
}

/* ============================================================
   כותרת עליונה
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.topbar-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 1.3rem;
}
.topbar-name { font-size: 1.15rem; font-weight: 700; }
.logout-btn {
  min-height: 48px; padding: 8px 22px;
  background: transparent; color: var(--text);
  border: 2px solid var(--border); border-radius: 14px;
  font-size: 1.05rem; font-weight: 700;
  transition: var(--transition);
}
.logout-btn:hover { background: var(--surface-2); }

/* סרגל כלים אמצעי בכותרת + כפתור הגדרות */
.topbar-center { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.topbar-tool {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px; padding: 8px 12px;
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border); border-radius: 14px;
  transition: var(--transition);
}
.topbar-tool:hover { border-color: var(--primary); transform: translateY(-1px); }
.topbar-tool .tool-icon { font-size: 1.4rem; line-height: 1; }

/* ============================================================
   חלון הגדרות (Settings)
   ============================================================ */
.settings-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(20, 16, 12, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.settings-overlay.settings-in { opacity: 1; }
.settings-overlay.settings-out { opacity: 0; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: min(440px, 100%);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.settings-overlay.settings-in .settings-card { transform: none; }
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.settings-title { font-size: 1.5rem; font-weight: 800; }
.settings-close, .settings-back {
  min-height: 42px; padding: 6px 14px;
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border); border-radius: 12px;
  font-size: 1.1rem; font-weight: 800; line-height: 1;
  transition: var(--transition);
}
.settings-close:hover, .settings-back:hover { background: var(--surface); border-color: var(--primary); }

.settings-list { display: grid; gap: 12px; }
.settings-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 14px 18px;
  background: var(--surface-2);
  border: 2px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 1.25rem; font-weight: 700;
  text-align: right;
  transition: var(--transition);
}
.settings-row:hover { transform: translateX(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.settings-row-icon { font-size: 1.6rem; flex: 0 0 auto; }
.settings-row-label { flex: 1; }
.settings-row-arrow { font-size: 1.6rem; color: var(--text-soft); }
.settings-row-danger { color: var(--no); border-color: color-mix(in srgb, var(--no) 45%, var(--border)); }
.settings-row-danger:hover { border-color: var(--no); background: var(--no-bg); }

/* פאנל חשבון */
.account-info { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 20px; }
.account-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.account-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 2.2rem; font-weight: 800;
}
.account-name { font-size: 1.4rem; font-weight: 800; }
.account-email { font-size: 1.05rem; color: var(--text-soft); direction: ltr; }
.account-signout { width: 100%; }

/* ============================================================
   מבנה מסך כללי
   ============================================================ */
.screen { max-width: 1100px; margin: 0 auto; padding: 28px 24px 64px; }
.screen-title { font-size: 2.2rem; font-weight: 800; }
.screen-sub { font-size: 1.2rem; color: var(--text-soft); margin-top: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 22px;
}
.card-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 18px; }

/* ---------- פס התקדמות ---------- */
.progress {
  position: relative;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.6s ease;
  min-width: 0;
}
.progress-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: var(--text);
  text-shadow: 0 1px 2px rgba(255,255,255,0.4);
}

/* ============================================================
   מסך ראשי — רמות ובתים
   ============================================================ */
.levels-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.level-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 96px; padding: 14px 8px;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: var(--transition);
}
.level-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.level-btn.active {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 30%, transparent);
}
.level-num {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 1.4rem;
}
.level-name { font-size: 1rem; font-weight: 700; text-align: center; }

/* מדורים בדשבורד */
.section-block { border-top: 5px solid var(--primary); }
.section-head { margin-bottom: 18px; }
.section-title { margin-bottom: 2px; }
.section-sub { font-size: 1.05rem; color: var(--text-soft); }

.houses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.house-tile {
  display: flex; flex-direction: column; gap: 10px;
  text-align: right;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--text);
  transition: var(--transition);
}
.house-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.house-icon { font-size: 3rem; }
.house-title { font-size: 1.5rem; font-weight: 800; }
.house-sub { font-size: 1.05rem; color: var(--text-soft); margin-bottom: 6px; }
.house-tile .progress { height: 26px; }

/* ============================================================
   ניווט חזרה
   ============================================================ */
.nav-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.btn-back {
  min-height: 54px; padding: 10px 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text); font-size: 1.1rem; font-weight: 700;
  transition: var(--transition);
}
.btn-back:hover { background: var(--surface-2); transform: translateX(4px); }
.btn-back-secondary { opacity: 0.92; }

/* ============================================================
   מסך בית
   ============================================================ */
.house-head { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.house-head-icon { font-size: 3.6rem; }

.missions-list { display: grid; gap: 14px; }
.mission-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-align: right;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.35rem;
  color: var(--text);
  transition: var(--transition);
}
.mission-item:hover { transform: translateX(-4px); box-shadow: var(--shadow); border-color: var(--primary); }
.mission-item.completed { border-color: var(--ok); }
.mission-name { font-size: 1.3rem; font-weight: 800; }
.mission-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; color: var(--text-soft); font-size: 1rem; }
.mission-score { color: var(--primary-strong); font-weight: 700; }
.mission-badge {
  flex: 0 0 auto;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 1.5rem; font-weight: 800;
}
.mission-item.completed .mission-badge { background: var(--ok); }

/* ============================================================
   מסך משימה (Gameplay)
   ============================================================ */
.nav-row-mission { position: sticky; top: 74px; z-index: 40; }
.mission-head { margin-bottom: 8px; }
.mission-title { font-size: 1.9rem; font-weight: 800; }
.question-progress {
  display: inline-block;
  margin: 10px 0 12px;
  padding: 6px 18px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 999px;
  font-size: 1.2rem; font-weight: 800; color: var(--primary-strong);
}

.question-card { min-height: 300px; }
.game-stage { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.game-instruction { font-size: 1.35rem; font-weight: 700; text-align: center; }

/* ---------- אפשרויות בחירה (משותף) ---------- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 640px;
}
.option-btn {
  min-height: 74px; padding: 16px 20px;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.5rem; font-weight: 700;
  transition: var(--transition);
}
.option-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.option-btn:disabled { cursor: default; }
.option-btn.correct {
  background: var(--ok-bg); border-color: var(--ok); color: var(--ok);
  animation: pop 0.3s ease;
}
.option-btn.wrong {
  background: var(--no-bg); border-color: var(--no); color: var(--no);
  animation: shake 0.35s ease;
}

/* ---------- בית זיכרון ---------- */
.memory-words { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.memory-word {
  padding: 16px 26px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.8rem; font-weight: 700;
}
.memory-word-main { border-color: var(--primary); }
.target-bold { font-weight: 900; font-size: 2.2rem; color: var(--primary-strong); }
.memory-countdown {
  font-size: 3.4rem; font-weight: 900; color: var(--primary);
  min-height: 60px;
}

/* ---------- בית קשב וריכוז ---------- */
.attention-target {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 26px;
  background: var(--surface-2);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
}
.attention-target-symbol { font-size: 2.6rem; line-height: 1; }
.attention-count { font-size: 1.2rem; font-weight: 700; color: var(--text-soft); }
.attention-grid {
  display: grid; gap: 12px;
  width: 100%; max-width: 30rem;
}
.attention-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: 16px;
  font-size: clamp(1.4rem, 5.5vw, 2.3rem);
  color: var(--text);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.attention-cell:hover:not(:disabled) { transform: scale(1.05); border-color: var(--primary); }
.attention-cell.cell-hit { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.attention-cell.cell-miss { background: var(--no-bg); border-color: var(--no); color: var(--no); }
.attention-cell.cell-reveal { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok) inset; }

/* ---------- בית שפה ומילים ---------- */
.lang-hint {
  padding: 12px 20px;
  background: var(--surface-2);
  border: 2px dashed var(--primary);
  border-radius: 14px;
  font-size: 1.15rem; font-weight: 600;
}
.lang-slots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; direction: rtl; }
.lang-slot {
  width: 3.6rem; height: 4.4rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 3px dashed var(--border);
  border-radius: 14px;
  font-size: 2rem; font-weight: 800;
}
.lang-slot.filled { border-style: solid; border-color: var(--primary); background: var(--surface-2); }
.lang-slot.slot-correct { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.lang-slot.slot-wrong { border-color: var(--no); background: var(--no-bg); color: var(--no); }
.lang-pool { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lang-letter {
  width: 64px; height: 74px;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: 14px;
  font-size: 2rem; font-weight: 800; color: var(--text);
  transition: var(--transition);
}
.lang-letter:hover:not(:disabled):not(.used) { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.lang-letter.used { opacity: 0.25; cursor: default; }
.lang-undo {
  min-height: 50px; padding: 8px 22px;
  background: transparent; color: var(--text);
  border: 2px solid var(--border); border-radius: 14px;
  font-size: 1.05rem; font-weight: 700;
}
.lang-answer { font-size: 1.3rem; font-weight: 800; color: var(--ok); }

/* ---------- בית חשיבה לוגית ---------- */
.logic-sequence { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; direction: ltr; }
.logic-num {
  min-width: 68px; height: 68px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: 16px;
  font-size: 1.8rem; font-weight: 800;
}
.logic-missing { border-color: var(--primary); color: var(--primary); border-style: dashed; }

/* ---------- בית פתרון בעיות + ידע כללי ---------- */
.problem-text {
  font-size: 1.5rem; font-weight: 600; line-height: 1.8;
  text-align: center;
  padding: 22px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  max-width: 700px;
}
.knowledge-text { font-weight: 700; }

/* ---------- בית זיכרון קלפים ---------- */
.cards-stage { gap: 16px; }
.cards-target {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 28px;
  background: var(--surface-2);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
}
.cards-target-label { font-size: 1.25rem; font-weight: 700; }
.cards-target-symbol { font-size: 2.8rem; line-height: 1; }
.cards-grid {
  display: grid; gap: 14px;
  width: 100%; max-width: 34rem;
}
.card-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff;
  border: 3px solid var(--border);
  border-radius: 18px;
  font-size: clamp(2rem, 9vw, 3.3rem);
  transition: transform 0.12s ease, background 0.2s ease, opacity 0.3s ease;
}
.card-cell:hover:not(:disabled):not(.revealed) { transform: scale(1.04); }
.card-cell.revealed { background: var(--surface); color: var(--text); }
.card-cell.card-correct { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.card-cell.card-wrong { background: var(--no-bg); border-color: var(--no); color: var(--no); }
.card-cell.card-gone { visibility: hidden; }
.cards-hint {
  text-align: center; max-width: 640px; margin: 0 auto;
  font-size: 1.05rem; color: var(--text-soft);
}

/* ---------- בית משחק ההקלדה ---------- */
.typing-word {
  font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 900;
  letter-spacing: 2px;
  padding: 16px 34px;
  background: var(--surface-2);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary-strong);
}
.typing-input {
  width: 100%; max-width: 460px;
  text-align: center;
  font-family: inherit; font-size: 2rem; font-weight: 800;
  padding: 14px 18px;
  border: 3px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  transition: var(--transition);
}
.typing-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.typing-input.typing-bad { border-color: var(--no); color: var(--no); }
.typing-input.typing-correct { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.typing-input.typing-wrong { border-color: var(--no); background: var(--no-bg); color: var(--no); }

/* ---------- בית הפרפרים הצבעוניים ---------- */
.bf-stage { gap: 14px; }
.bf-svg-wrap { display: inline-block; width: 100%; height: 100%; }
.bf-svg { width: 100%; height: 100%; display: block; }

/* מקרא (7 הצבעים בעיגול) */
.bf-legend {
  position: relative;
  width: min(74vw, 13.5rem);
  aspect-ratio: 1;
  margin: 4px auto 2px;
}
.bf-legend-item {
  position: absolute;
  width: 2.7rem; height: 2.7rem;
  transform: translate(-50%, -50%);
}

/* אזור המשחק */
.bf-status {
  font-size: 1.2rem; font-weight: 800; text-align: center;
  min-height: 1.7em; color: var(--text);
}
.bf-area {
  position: relative;
  width: min(92vw, 21rem);
  aspect-ratio: 1;
  margin: 2px auto;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bf-fly {
  position: absolute;
  width: clamp(2rem, 11vw, 2.8rem);
  height: clamp(2rem, 11vw, 2.8rem);
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease;
}
.bf-fly.bf-color { animation: bf-pop 0.28s ease; }
.bf-clickable { cursor: pointer; }
.bf-clickable:hover { transform: translate(-50%, -50%) scale(1.14); }
.bf-fly.bf-correct { filter: drop-shadow(0 0 6px rgba(255, 207, 51, 0.9)); }
.bf-fly.bf-wrong { filter: drop-shadow(0 0 6px rgba(229, 57, 53, 0.9)); }
.bf-start { margin-top: 4px; }
@keyframes bf-pop {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ---------- בית המהג'ונג ---------- */
.mj-stage { gap: 12px; width: 100%; }
.mj-controls { display: flex; gap: 10px; justify-content: center; }
.mj-btn {
  min-height: 48px; padding: 8px 20px;
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border); border-radius: 14px;
  font-size: 1.05rem; font-weight: 700; transition: var(--transition);
}
.mj-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.mj-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; padding: 6px 0; }
.mj-board {
  --tw: clamp(2.3rem, 11vw, 3.6rem);
  --th: calc(var(--tw) * 1.32);
  --dx: calc(var(--tw) * 0.14);
  --dy: calc(var(--tw) * 0.18);
  position: relative;
  margin: 0 auto;
  width: calc(var(--cols) * var(--tw) + var(--layers) * var(--dx) + 10px);
  height: calc(var(--rows) * var(--th) + var(--layers) * var(--dy) + 10px);
}
.mj-tile {
  position: absolute;
  width: var(--tw); height: var(--th);
  left: calc(var(--x) * var(--tw) - var(--l) * var(--dx) + 5px);
  top: calc(var(--y) * var(--th) - var(--l) * var(--dy) + 5px);
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, #fffdf8, #efe6d6);
  border: 1px solid #d9cab0;
  border-bottom-width: 4px; border-left-width: 3px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(60, 40, 10, 0.28);
  font-size: calc(var(--tw) * 0.62);
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.25s ease;
  overflow: hidden;
}
.mj-face { position: relative; z-index: 1; }
.mj-tile-shine {
  position: absolute; inset: 0;
  background: linear-gradient(150deg, rgba(255,255,255,0.6), rgba(255,255,255,0) 45%);
  pointer-events: none;
}
.mj-tile.mj-blocked { filter: brightness(0.9) saturate(0.85); cursor: default; }
.mj-tile.mj-blocked .mj-face { opacity: 0.72; }
.mj-tile.mj-free { cursor: pointer; }
.mj-tile.mj-free:hover { transform: translateY(-2px); box-shadow: 0 5px 9px rgba(60,40,10,0.34); }
.mj-tile.mj-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary), 0 5px 9px rgba(60,40,10,0.34);
  transform: translateY(-2px);
}
.mj-tile.mj-hint { animation: mj-hint 0.7s ease 2; }
.mj-tile.mj-shake { animation: mj-shake 0.35s ease; }
.mj-tile.mj-remove { transform: scale(0.4); opacity: 0; }
.mj-tile.mj-gone { display: none; }
.mj-toast {
  text-align: center; margin-top: 4px;
  font-size: 1.05rem; font-weight: 800; color: var(--primary-strong);
}
@keyframes mj-hint {
  0%, 100% { box-shadow: 0 2px 4px rgba(60,40,10,0.28); }
  50% { box-shadow: 0 0 0 4px var(--accent), 0 5px 9px rgba(60,40,10,0.34); transform: translateY(-2px); }
}
@keyframes mj-shake {
  0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); }
}

/* ---------- טיימר ---------- */
.timer-wrap { width: 100%; max-width: 30rem; }
.timer-label { text-align: center; font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.timer-bar {
  height: 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--no), var(--primary)); }

/* ---------- משוב + כפתור הבא ---------- */
.controls-row {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  margin-top: 24px;
}
.feedback {
  font-size: 1.4rem; font-weight: 800;
  padding: 12px 28px; border-radius: 14px;
  animation: pop 0.3s ease;
}
.feedback-ok { color: var(--ok); background: var(--ok-bg); }
.feedback-no { color: var(--no); background: var(--no-bg); }
.btn-next {
  min-height: var(--tap); padding: 16px 48px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  color: #fff; border: none; border-radius: var(--radius);
  font-size: 1.4rem; font-weight: 800;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.btn-next:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ============================================================
   מסך חגיגה
   ============================================================ */
.celebrate-screen { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.celebrate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  text-align: center;
  max-width: 520px; width: 100%;
  animation: pop 0.4s ease;
}
.celebrate-emoji { font-size: 5rem; animation: bounce 1s ease infinite; }
.celebrate-title { font-size: 3rem; font-weight: 900; color: var(--primary-strong); }
.celebrate-sub { font-size: 1.3rem; color: var(--text-soft); margin: 10px 0 24px; }
.celebrate-score {
  display: inline-flex; flex-direction: column; gap: 4px;
  padding: 18px 40px; margin-bottom: 16px;
  background: var(--surface-2); border-radius: var(--radius); border: 2px solid var(--primary);
}
.celebrate-score-num { font-size: 2.6rem; font-weight: 900; color: var(--primary); }
.celebrate-score-label { font-size: 1.1rem; color: var(--text-soft); }
.celebrate-stars { font-size: 2.6rem; margin-bottom: 24px; letter-spacing: 8px; }
.cel-star { color: var(--border); }
.cel-star.filled { color: #ffca3a; animation: pop 0.5s ease; }
.celebrate-actions { display: flex; flex-direction: column; gap: 12px; }
.btn-primary {
  min-height: var(--tap); padding: 16px 30px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  color: #fff; border: none; border-radius: var(--radius);
  font-size: 1.3rem; font-weight: 800; box-shadow: var(--shadow);
  transition: var(--transition);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-big { font-size: 1.4rem; }
.btn-secondary {
  min-height: 54px; padding: 12px 26px;
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 1.15rem; font-weight: 700;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--primary); }

/* ============================================================
   מסך טעינה
   ============================================================ */
.loading-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  font-size: 1.3rem; color: var(--text-soft);
}
.spinner {
  width: 60px; height: 60px;
  border: 6px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ============================================================
   אנימציות
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-8px);} 75%{transform:translateX(8px);} }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.05ms !important; }
}

/* ============================================================
   רספונסיביות
   ============================================================ */
@media (max-width: 720px) {
  html { font-size: 15px; }
  .screen { padding: 20px 16px 56px; }
  .card { padding: 20px 16px; }
  .levels-row { grid-template-columns: repeat(2, 1fr); }
  .options-grid { grid-template-columns: 1fr; }
  .houses-grid { grid-template-columns: 1fr; }
  .nav-row-mission { position: static; }
  .screen-title { font-size: 1.8rem; }
  .login-card { padding: 34px 22px; }
  .login-title { font-size: 2.1rem; }
  .lang-slot, .lang-letter { width: 52px; height: 62px; font-size: 1.6rem; }
  .mission-badge { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }
  .topbar { gap: 8px; padding: 12px 14px; }
  .topbar-name { font-size: 1rem; }
}

@media (max-width: 400px) {
  .levels-row { grid-template-columns: 1fr; }
  .lang-slot, .lang-letter { width: 46px; height: 56px; font-size: 1.4rem; }
}

/* מיקוד נגיש */
:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }

/* ============================================================
   ✦ רענון עיצוב (Style refresh) — מראה עריכתי/מותגי, פחות "גנרי"
   כל השינויים מרוכזים בבלוק הזה בלבד — הסרת הבלוק מחזירה במדויק
   לגרסה הקודמת. (שינויי סגנון בלבד, ללא שינוי בהתנהגות.)
   ============================================================ */
:root {
  --font-display: 'Frank Ruhl Libre', 'Heebo', Georgia, serif;
  --radius: 13px;
  --radius-lg: 18px;
  --shadow: 0 4px 14px rgba(45, 32, 16, 0.07);
  --shadow-lg: 0 14px 32px rgba(45, 32, 16, 0.13);
}

/* רקע עם זוהר-פינה עדין במקום מדרג שטוח */
body {
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(255,255,255,0.35), transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
}

/* כותרות בגופן עריכתי (serif) — היכר עיצובי בולט */
.screen-title, .card-title, .section-title, .mission-title,
.celebrate-title, .house-title, .paywall-title, .settings-title,
.account-name, .celebrate-sub {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.screen-title { font-weight: 900; }
.card-title, .mission-title, .house-title { font-weight: 800; }
.celebrate-sub { font-family: var(--font); } /* תת-כותרת נשארת סאנס */

/* פס-הדגשה מוביל לכותרות כרטיס */
.card-title { position: relative; padding-right: 15px; }
.card-title::before {
  content: ''; position: absolute; right: 0; top: 0.16em; bottom: 0.16em;
  width: 5px; border-radius: 3px;
  background: linear-gradient(var(--primary), var(--accent));
}

/* כרטיסים שטוחים ומעודנים יותר */
.card { box-shadow: var(--shadow); }

/* כפתורים ראשיים — מוצקים ומוחשיים במקום מדרג/פילים */
.btn-primary, .btn-next, .paywall-subscribe, .cookie-accept {
  background: var(--primary-strong);
  background: var(--primary);
  border: none;
  border-bottom: 4px solid var(--primary-strong);
  border-radius: 12px;
}
.btn-primary:hover, .btn-next:hover, .paywall-subscribe:hover, .cookie-accept:hover {
  background: var(--primary-strong);
  transform: translateY(-2px);
}
.btn-primary:active, .btn-next:active, .cookie-accept:active {
  transform: translateY(1px); border-bottom-width: 2px;
}

/* בתי האימון — פריט-רשימה מעוצב עם תג-אייקון, במקום כרטיס ממורכז */
.house-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon title" "icon sub" "prog prog";
  align-items: center;
  column-gap: 15px; row-gap: 0;
  text-align: right;
  padding: 1rem 1rem 1.15rem;
  border-radius: var(--radius);
}
.house-tile .house-icon {
  grid-area: icon; margin: 0;
  width: 3.4rem; height: 3.4rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  background: var(--surface-2);
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 15px;
}
.house-tile .house-title { grid-area: title; align-self: end; }
.house-tile .house-sub { grid-area: sub; align-self: start; margin: 2px 0 8px; }
.house-tile .progress { grid-area: prog; }
.house-tile:hover .house-icon { background: color-mix(in srgb, var(--primary) 26%, var(--surface)); }

/* מדורים — קו עליון עדין */
.section-block { border-top-width: 4px; }

/* פס התקדמות מעט דק ומעודן */
.progress { height: 28px; }

/* פינות מעט חדות יותר לפקדים נפוצים (פחות "בועתי") */
.option-btn, .level-btn, .mission-item { border-radius: var(--radius); }

/* ============================================================
   שיפורים לפי המלצות מקצועיות: אימון יומי, הסברים, נגישות
   ============================================================ */
/* טקסט גדול יותר (הגדרה) */
html.large-text { font-size: 20px; }

/* חגיגה מאופקת יותר */
.celebrate-emoji { animation: pop 0.5s ease; }

/* כרטיס "האימון היומי" */
.daily-row { display: flex; gap: 16px; }
.daily-goal, .daily-streak {
  flex: 1; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 10px;
}
.daily-goal-num, .daily-streak-num { font-size: 2rem; font-weight: 900; color: var(--primary-strong); }
.daily-goal-label, .daily-streak-label { font-size: 1rem; color: var(--text-soft); margin-top: 2px; }
.daily-card .progress { margin-top: 14px; }
.week-strip { display: flex; gap: 6px; justify-content: space-between; margin-top: 16px; }
.week-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.week-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--border);
  color: var(--ok); font-weight: 900; font-size: 1.1rem;
}
.week-day.active .week-dot { background: var(--ok-bg); border-color: var(--ok); }
.week-day.today .week-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 55%, transparent); }
.week-name { font-size: 0.92rem; color: var(--text-soft); font-weight: 700; }
.daily-tip { margin-top: 14px; font-size: 1rem; color: var(--text-soft); }

/* רמז רמת קושי */
.level-hint { margin-top: 14px; font-size: 1.02rem; color: var(--text-soft); }

/* הערה כנה */
.science-note-body { font-size: 1.12rem; line-height: 1.85; color: var(--text); }

/* כרטיס "על התרגול" */
.about-purpose, .about-howto { font-size: 1.12rem; line-height: 1.7; margin-bottom: 8px; }
.about-howto { margin-bottom: 0; }
.about-tag { font-weight: 900; color: var(--primary-strong); }

/* מתגי הגדרות (switch) */
.settings-toggle { cursor: pointer; }
.settings-toggle .settings-row-label,
.settings-row-info .settings-row-label {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1;
}
.settings-row-title { font-size: 1.18rem; font-weight: 800; }
.settings-row-sub { font-size: 0.92rem; color: var(--text-soft); font-weight: 600; }
.switch {
  flex: 0 0 auto; position: relative;
  width: 58px; height: 32px; border-radius: 999px;
  background: var(--border); transition: background 0.2s ease;
}
.switch.on { background: var(--ok); }
.switch-knob {
  position: absolute; top: 3px; right: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: right 0.2s ease;
}
.switch.on .switch-knob { right: 29px; }

/* מקלדת עברית שעל המסך (משחק ההקלדה) */
.kb { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 580px; margin-top: 4px; }
.kb-row { display: flex; gap: 6px; justify-content: center; }
.kb-key {
  flex: 1 1 0; min-width: 30px; max-width: 54px; height: 50px; padding: 0 4px;
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border); border-radius: 11px;
  font-size: 1.35rem; font-weight: 800;
  transition: var(--transition);
}
.kb-key:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); }
.kb-key:disabled { opacity: 0.5; }
.kb-space { max-width: 150px; flex: 2; font-size: 1.05rem; }
.kb-back { max-width: 130px; flex: 2; font-size: 1.05rem; }

/* ---------- פאנל ניהול משתמשים (מנהל בלבד) ---------- */
.admin-status, .admin-empty { color: var(--text-soft); font-size: 1.05rem; padding: 8px 0; }
.admin-count {
  font-size: 1.25rem; font-weight: 800; color: var(--primary-strong);
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  text-align: center;
}
.admin-list { max-height: 46vh; overflow-y: auto; display: grid; gap: 8px; }
.admin-user {
  padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.admin-email { font-size: 1.05rem; font-weight: 800; direction: ltr; text-align: right; word-break: break-all; }
.admin-meta { font-size: 0.92rem; color: var(--text-soft); margin-top: 3px; }
.admin-download { width: 100%; margin-top: 14px; }

/* ---------- פופ-אפ קליטה (שם + גיל, חד-פעמי) ---------- */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 9600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(20, 16, 12, 0.55);
  opacity: 0; transition: opacity 0.25s ease;
}
.onboard-overlay.onboard-in { opacity: 1; }
.onboard-overlay.onboard-out { opacity: 0; }
.onboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
  width: min(440px, 100%);
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.onboard-overlay.onboard-in .onboard-card { transform: none; }
.onboard-emoji { font-size: 3rem; }
.onboard-title { font-size: 1.9rem; font-weight: 800; margin: 4px 0 8px; }
.onboard-note {
  font-size: 1.05rem; color: var(--text-soft); line-height: 1.6;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 20px;
}
.onboard-form { display: grid; gap: 14px; text-align: right; margin-bottom: 22px; }
.onboard-field { display: grid; gap: 6px; }
.onboard-label { font-size: 1.1rem; font-weight: 800; }
.onboard-input {
  width: 100%; min-height: 54px; padding: 10px 16px;
  font-family: inherit; font-size: 1.25rem; font-weight: 700;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: 12px;
  transition: var(--transition);
}
.onboard-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.onboard-actions { display: flex; flex-direction: column; gap: 10px; }
.onboard-next { width: 100%; }
.onboard-next:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.onboard-skip { width: 100%; }

/* ============================================================
   קרוסלת המלצות (דף הנחיתה)
   ============================================================ */
.reco { margin-top: 60px; text-align: center; }
.landing.landing-in .reco.reveal { transition-delay: 0.32s; }
.reco-heading {
  font-family: 'Gveret Levin', 'Heebo', cursive;
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 400;
  color: var(--primary-strong);
  margin-bottom: 14px;
}
.reco-note {
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 8px;
}

.reco-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.reco-viewport {
  flex: 1 1 auto;
  max-width: 500px;
  overflow: hidden;
  padding: 20px 10px;
  min-height: 380px;
  display: flex;
  align-items: center;
}
.reco-track {
  display: flex;
  direction: ltr;               /* חישוב הזזה עקבי; תוכן הכרטיס נשאר RTL */
  width: 100%;
  transition: transform 0.55s cubic-bezier(0.45, 0, 0.2, 1);
}
.reco-card {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: rtl;
}
.reco-inner {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 24px 22px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.reco-card:hover .reco-inner,
.reco-card--open .reco-inner {
  transform: scale(1.035);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.reco-badge {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--text-soft) 14%, var(--surface));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  letter-spacing: 0.02em;
}
.reco-quote-mark {
  position: absolute;
  top: 2px; right: 20px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 4.4rem;
  line-height: 1;
  color: color-mix(in srgb, var(--primary) 30%, transparent);
  pointer-events: none;
  user-select: none;
}
.reco-avatar {
  width: 72px; height: 72px;
  margin: 4px auto 12px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  background: radial-gradient(circle at 30% 28%, color-mix(in srgb, var(--primary) 26%, var(--surface)), color-mix(in srgb, var(--accent) 24%, var(--surface)));
  box-shadow: inset 0 0 0 3px var(--surface), 0 4px 12px rgba(0,0,0,0.12);
}
.reco-avatar.has-photo { background: none; }
.reco-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.reco-text {
  font-size: clamp(1.12rem, 2.6vw, 1.28rem);
  line-height: 1.85;
  color: var(--text);
  margin: 0 auto 16px;
  max-width: 32ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;        /* ברירת מחדל: מציג רק את ההתחלה */
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reco-card:hover .reco-text,
.reco-card--open .reco-text {
  -webkit-line-clamp: 99;       /* ריחוף/נגיעה: חושף את כל הטקסט */
  line-clamp: 99;
}
.reco-who { margin-top: 4px; }
.reco-name { font-size: 1.16rem; font-weight: 800; color: var(--primary-strong); }
.reco-role { font-size: 0.98rem; color: var(--text-soft); margin-top: 2px; }

.reco-arrow {
  flex: 0 0 auto;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary-strong);
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition), background var(--transition), color var(--transition);
}
.reco-arrow:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
}
.reco-arrow:active { transform: scale(0.96); }

.reco-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
}
.reco-dot {
  width: 11px; height: 11px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-soft) 35%, transparent);
  cursor: pointer;
  transition: background var(--transition), width var(--transition);
}
.reco-dot:hover { background: color-mix(in srgb, var(--primary) 60%, transparent); }
.reco-dot.is-active { width: 30px; background: var(--primary); }

@media (max-width: 600px) {
  .reco-viewport { min-height: 450px; padding: 14px 4px; }
  .reco-inner { padding: 22px 18px 20px; max-width: 340px; }
  .reco-arrow { width: 42px; height: 42px; font-size: 1.6rem; }
  .reco-stage { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .reco-track { transition: none; }
  .reco-inner, .reco-arrow { transition: none; }
}

/* ============================================================
   תקופת ניסיון (14 ימים)
   ============================================================ */
.settings-row-info { cursor: default; }
.trial-badge {
  flex: 0 0 auto;
  min-width: 2.4rem; height: 2.4rem; padding: 0 0.55rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--primary-strong);
  border: 1.5px solid color-mix(in srgb, var(--primary) 42%, transparent);
  font-weight: 800; font-size: 1.1rem; line-height: 1;
}
.trial-badge-ended {
  background: var(--no-bg); color: var(--no);
  border-color: color-mix(in srgb, var(--no) 55%, transparent);
}
.admin-trial {
  margin-top: 4px; font-weight: 800; font-size: 0.98rem;
  color: var(--primary-strong);
}
.admin-trial-ended { color: var(--no); }

/* מסך נעילה בתום הניסיון */
.trial-lock {
  min-height: 82vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.trial-lock-card {
  width: 100%; max-width: 30rem;
  text-align: center;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 28px 30px;
}
.trial-lock-icon { font-size: 3.6rem; line-height: 1; margin-bottom: 12px; }
.trial-lock-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800; color: var(--primary-strong);
  margin-bottom: 14px;
}
.trial-lock-text {
  font-size: 1.1rem; line-height: 1.8;
  color: var(--text); margin-bottom: 26px;
}
.trial-lock-pay { width: 100%; margin-bottom: 8px; }
.trial-lock-note { font-size: 0.92rem; color: var(--text-soft); margin-bottom: 22px; }
.trial-lock-out { width: 100%; }
