/* ============ מיושם · אולפן לילה — מערכת עיצוב ============ */
:root {
  --bg: #07080f;
  --text: #f2f2fa;
  --muted: #8b8b99;
  --muted-2: #6f7189;
  --card: rgba(255, 255, 255, .04);
  --card-hover: rgba(139, 124, 248, .07);
  --border: #232742;
  --border-2: #2c3052;
  --purple: #8b7cf8;
  --cyan: #67e8f9;
  --good: #3fdd9b;
  --bad: #ff7b72;
  --grad: linear-gradient(90deg, #8b7cf8, #67e8f9);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: 'Heebo', sans-serif;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
a { color: var(--purple); text-decoration: none; }
a:hover { color: #a99dfb; }
button { font-family: inherit; }

/* --- רקע אורורה חי --- */
.aurora {
  position: fixed; inset: -30%;
  background: conic-gradient(from 0deg, rgba(139,124,248,.13), rgba(103,232,249,.08), transparent 60%, rgba(139,124,248,.13));
  filter: blur(70px);
  animation: aurora 16s linear infinite;
  pointer-events: none; z-index: 0;
}
main, .page { position: relative; z-index: 1; }

/* --- אנימציות --- */
@keyframes aurora { 0% { transform: translate(-20%,-10%) rotate(0deg) scale(1); } 50% { transform: translate(20%,10%) rotate(180deg) scale(1.25); } 100% { transform: translate(-20%,-10%) rotate(360deg) scale(1); } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 40px 8px rgba(139,124,248,.35); } 50% { box-shadow: 0 0 90px 24px rgba(103,232,249,.45); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes confettiFall { 0% { transform: translateY(-10px) rotate(0deg); opacity: 1; } 100% { transform: translateY(220px) rotate(540deg); opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- מבנה עמוד --- */
.page { max-width: 1060px; margin: 0 auto; padding: 40px 32px 80px; animation: fadeUp .4s ease; }
.page.narrow { max-width: 820px; }
.fade { animation: fadeUp .3s ease; }

/* --- כותרת עליונה --- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 52px; flex-wrap: wrap; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.logo { font-size: 26px; font-weight: 900; }
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-row { display: flex; align-items: baseline; gap: 12px; }
.brand-tag { color: var(--muted-2); font-size: 13px; }
.stats-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 16px;
}
.stats-pill .streak { font-size: 13px; color: #c9c9dd; font-weight: 700; }
.stats-pill .done { font-size: 13px; color: var(--cyan); font-weight: 700; }
.stats-pill .divider { width: 1px; height: 14px; background: var(--border); }

/* --- Hero (ספרייה) --- */
.hero { text-align: center; margin-bottom: 56px; }
.hero h1 { font-size: 38px; font-weight: 900; margin: 0 0 8px; }
.hero .sub { color: var(--muted); font-size: 15px; margin: 0 0 26px; }
.hero-box { max-width: 660px; margin: 0 auto; }
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.tab {
  font-size: 13px; font-weight: 700; cursor: pointer;
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); padding: 6px 18px; transition: .15s;
}
.tab.on { background: rgba(139,124,248,.14); border-color: var(--purple); color: var(--text); }
.tab:hover:not(.on) { border-color: var(--border-2); color: #c9c9dd; }

.input-row {
  display: flex; gap: 10px; background: rgba(255,255,255,.05);
  border: 1px solid var(--border-2); border-radius: 18px; padding: 8px;
  backdrop-filter: blur(12px); box-shadow: 0 0 60px rgba(139,124,248,.12);
}
.input-row input {
  flex: 1; font-family: inherit; font-size: 15px; background: transparent;
  color: var(--text); border: none; outline: none; padding: 10px 14px; text-align: left;
}
.btn-primary {
  font-size: 15px; font-weight: 800; cursor: pointer; background: var(--grad);
  color: var(--bg); border: none; border-radius: 12px; padding: 12px 28px; transition: .15s;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:disabled { opacity: .55; cursor: default; filter: none; }

.drop {
  border: 2px dashed var(--border-2); border-radius: 18px; padding: 34px;
  text-align: center; color: var(--muted); cursor: pointer; transition: .15s;
  background: rgba(255,255,255,.02);
}
.drop:hover, .drop.over { border-color: var(--purple); color: var(--text); }
.drop .ic { font-size: 26px; margin-bottom: 8px; }
.drop .t { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.drop .s { font-size: 12.5px; color: var(--muted-2); }
.msg { margin-top: 12px; font-size: 13.5px; font-weight: 600; }
.msg.ok { color: var(--good); }
.msg.err { color: var(--bad); }

/* --- כותרת מדור + רשת שיעורים --- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.sec-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.sec-head .count { color: var(--muted-2); font-size: 13px; }
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.card {
  display: flex; flex-direction: column; gap: 13px; background: var(--card);
  border: 1px solid var(--border); border-radius: 18px; padding: 20px;
  cursor: pointer; transition: .15s; position: relative; overflow: hidden;
}
.card:hover { border-color: var(--purple); background: var(--card-hover); }
.card.failed { border-style: dashed; border-color: #3a2530; cursor: default; }
.card.failed:hover { background: var(--card); }
.card .shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(139,124,248,.09), transparent);
  background-size: 200% 100%; animation: shimmer 1.8s linear infinite;
}
.card > * { position: relative; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.ready { color: var(--good); background: rgba(63,221,155,.12); }
.badge.proc { color: var(--purple); background: rgba(139,124,248,.14); }
.badge.failed { color: var(--bad); background: rgba(255,123,114,.12); }
.card .dur { color: var(--muted-2); font-size: 12px; }
.card .title { font-weight: 700; font-size: 15px; line-height: 1.5; }
.bar { height: 5px; background: #1c1f33; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; transition: width .4s; }
.card .meta { font-size: 12px; }
.card .meta.err { color: var(--bad); }
.card .meta.def { color: var(--muted); }
.retry-btn {
  font-size: 13px; font-weight: 700; cursor: pointer; background: none;
  border: 1px solid var(--border-2); color: #c9c9dd; border-radius: 10px; padding: 8px;
}
.retry-btn:hover { border-color: var(--purple); }
.empty { grid-column: 1 / -1; color: var(--muted-2); text-align: center; padding: 40px; }

/* --- מסך עיבוד --- */
.back { color: var(--muted-2); font-size: 13px; cursor: pointer; }
.back:hover { color: var(--purple); }
.proc-wrap { text-align: center; padding-top: 56px; }
.orb { position: relative; width: 110px; height: 110px; margin: 0 auto; }
.orb .core { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #67e8f9, #8b7cf8 60%, #3b2f7a); animation: pulseGlow 2.4s ease-in-out infinite; }
.orb .ring { position: absolute; inset: -14px; border-radius: 50%; border: 1px dashed rgba(139,124,248,.5); animation: spinSlow 9s linear infinite; }
.orb .face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; }
.proc-wrap h2 { font-size: 28px; font-weight: 900; margin: 30px 0 6px; }
.proc-wrap .psub { color: var(--muted); font-size: 14px; margin: 0 0 44px; }
.stages { display: flex; justify-content: center; max-width: 620px; margin: 0 auto 40px; }
.stage { display: flex; align-items: flex-start; }
.stage-col { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 110px; }
.stage-dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.stage-label { font-size: 12px; font-weight: 700; }
.stage-line { width: 60px; height: 1px; margin-top: 20px; }
.proc-note {
  max-width: 560px; margin: 0 auto; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 22px; text-align: right;
}
.proc-note .lbl { color: var(--muted-2); font-size: 11px; font-weight: 700; letter-spacing: .1em; margin-bottom: 6px; }
.proc-note .val { color: #c9c9dd; font-size: 14px; line-height: 1.7; }
.proc-active { color: var(--muted-2); font-size: 13px; margin: 36px 0 0; }

/* --- דף שיעור --- */
.lesson-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.chips { display: flex; gap: 8px; }
.chip-i { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.chip-i.cyan { color: var(--cyan); background: rgba(103,232,249,.1); border: 1px solid rgba(103,232,249,.3); }
.chip-i.purple { color: var(--purple); background: rgba(139,124,248,.1); border: 1px solid rgba(139,124,248,.3); }
.lesson-title { font-size: 29px; font-weight: 900; margin: 0 0 30px; }
.lesson-grid { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: start; }
@media (max-width: 820px) { .lesson-grid { grid-template-columns: 1fr; } }

.nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px; }
.nav-row {
  display: flex; gap: 12px; align-items: center; padding: 9px 10px; background: transparent;
  border: none; border-radius: 12px; cursor: pointer; text-align: start; transition: .15s; width: 100%;
}
.nav-row:hover { background: rgba(139,124,248,.08); }
.nav-row.on { background: rgba(139,124,248,.08); }
.nav-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; flex-shrink: 0; }
.nav-label { font-size: 13px; }
@media (max-width: 820px) {
  .nav {
    flex-direction: row; flex-wrap: nowrap; position: static; overflow-x: auto;
    gap: 6px; padding-bottom: 8px; -webkit-overflow-scrolling: touch;
  }
  .nav-row { width: auto; flex-shrink: 0; padding: 7px 8px; }
  .nav-label { display: none; }
}

.panel {
  background: var(--card); border: 1px solid var(--border-2); border-radius: 20px;
  padding: 30px 34px; box-shadow: 0 0 40px rgba(139,124,248,.08);
}
.ch-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ch-chip { background: var(--grad); color: var(--bg); font-size: 12px; font-weight: 900; padding: 3px 12px; border-radius: 999px; }
.ts-link { color: var(--cyan); font-size: 12px; }
.panel h3 { font-size: 20px; font-weight: 800; margin: 0 0 14px; }
.panel .para { color: #c9c9dd; font-size: 15px; line-height: 1.95; margin: 0 0 14px; }
.panel .para ul { padding-inline-start: 20px; }
.key-box {
  background: rgba(103,232,249,.05); border: 1px solid rgba(103,232,249,.2); border-radius: 12px;
  padding: 13px 18px; color: #c9c9dd; font-size: 13.5px; margin-bottom: 16px;
}
.key-box strong { color: var(--cyan); }
.ch-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.concepts { display: flex; gap: 8px; flex-wrap: wrap; }
.concept { font-size: 12px; color: var(--muted); background: #11131f; border: 1px solid var(--border); padding: 4px 12px; border-radius: 8px; }

/* --- חידון --- */
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.quiz-top .qn { font-weight: 800; font-size: 15px; }
.quiz-bar { width: 140px; height: 5px; background: #1c1f33; border-radius: 99px; overflow: hidden; }
.quiz-bar > div { height: 100%; background: var(--grad); transition: width .4s; }
.q-text { font-size: 18px; font-weight: 800; margin: 0 0 18px; line-height: 1.6; }
.opts { display: grid; gap: 10px; }
.opt {
  font-size: 14.5px; font-weight: 500; text-align: start; background: #0d1020; color: #c9c9dd;
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; cursor: pointer;
  transition: .15s; display: flex; justify-content: space-between; align-items: center;
}
.opt:hover:not(.correct):not(.wrong):not(.dim) { border-color: var(--purple); }
.opt.correct { border-color: var(--good); background: rgba(63,221,155,.1); color: var(--good); }
.opt.wrong { border-color: var(--bad); background: rgba(255,123,114,.1); color: var(--bad); }
.opt.dim { color: var(--muted-2); }
.q-feedback {
  margin-top: 14px; background: rgba(103,232,249,.06); border: 1px solid rgba(103,232,249,.25);
  border-radius: 12px; padding: 14px 18px; color: #c9c9dd; font-size: 13.5px; line-height: 1.7;
}
.btn-block {
  margin-top: 14px; width: 100%; font-size: 15px; font-weight: 800; cursor: pointer;
  background: var(--grad); color: var(--bg); border: none; border-radius: 12px; padding: 13px;
}
.btn-block:hover { filter: brightness(1.15); }
.btn-inline {
  font-size: 14px; font-weight: 800; cursor: pointer; background: var(--grad); color: var(--bg);
  border: none; border-radius: 12px; padding: 11px 26px;
}
.btn-inline:hover { filter: brightness(1.15); }

/* מסך תוצאות חידון */
.score-panel { text-align: center; padding: 52px 34px; box-shadow: 0 0 60px rgba(139,124,248,.15); }
.score-emoji { font-size: 52px; margin-bottom: 10px; }
.score-panel h3 { font-size: 24px; font-weight: 900; margin: 0 0 8px; }
.score-panel .ssub { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.score-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; }
.score-dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 900; }

/* --- צ'קליסט --- */
.check-head { background: var(--card); border: 1px solid var(--border-2); border-radius: 20px; padding: 26px 30px; margin-bottom: 14px; }
.check-head .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.check-head h3 { font-size: 18px; font-weight: 800; margin: 0; }
.check-head .cnt { color: var(--cyan); font-size: 13px; font-weight: 700; }
.check-head p { color: var(--muted); font-size: 13px; margin: 0; }
.check-item {
  display: flex; gap: 14px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px 22px; cursor: pointer;
  margin-bottom: 10px; transition: .15s;
}
.check-item:hover { border-color: var(--purple); }
.check-item.done { border-color: rgba(63,221,155,.35); }
.check-item input { margin-top: 5px; accent-color: var(--purple); width: 18px; height: 18px; flex-shrink: 0; }
.check-item .task { font-size: 14.5px; color: var(--text); }
.check-item.done .task { color: var(--muted); text-decoration: line-through; }
.check-item .why { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.check-item .ci-body { flex: 1; min-width: 0; }
.check-item .ci-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.check-item .ci-meta { color: var(--muted-2); font-size: 12px; white-space: nowrap; }
/* הצעד הראשון הוא הפריט שמוריד את מחסום ההתחלה — הוא מודגש, לא הערת שוליים */
.check-item .ci-step, .check-item .ci-when {
  font-size: 13px; margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  background: #10121e; border: 1px solid var(--border); color: var(--text);
}
.check-item .ci-step { border-right: 2px solid var(--purple); }
.check-item .ci-when { border-right: 2px solid var(--good); color: var(--muted); }
.check-item .lbl {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
  margin-bottom: 3px; color: var(--muted-2);
}
.check-item .ci-step .lbl { color: var(--purple); }
.check-item .ci-when .lbl { color: var(--good); }
.check-item.done .ci-step, .check-item.done .ci-when { opacity: .45; }
.check-done {
  text-align: center; background: rgba(63,221,155,.06); border: 1px solid rgba(63,221,155,.3);
  border-radius: 16px; padding: 22px; color: var(--good); font-weight: 800; font-size: 15px;
}

/* --- מושגים: תגית, מפת שליטה, שעון --- */
.cchip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted);
  background: #10121e;
}
.cchip b { font-weight: 800; opacity: .75; font-size: 11.5px; }
.cchip.ok { border-color: rgba(63,221,155,.45); color: var(--good); background: rgba(63,221,155,.07); }
.cchip.gap { border-color: rgba(255,123,114,.45); color: var(--bad); background: rgba(255,123,114,.07); }
.q-concept { margin-bottom: 12px; border-color: rgba(139,124,248,.4); color: var(--purple); background: rgba(139,124,248,.08); }
.q-clock { font-size: 13px; color: var(--muted-2); font-variant-numeric: tabular-nums; margin-inline-start: auto; }
.score-time { font-size: 14px; color: var(--muted-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cmap { margin: 22px 0 6px; text-align: right; }
.cmap-head { font-size: 12px; font-weight: 800; color: var(--muted-2); margin-bottom: 10px; }
.cmap-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.score-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn-inline.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); box-shadow: none; }
.btn-inline.ghost:hover { border-color: var(--purple); color: var(--text); }

/* --- כרטיסיות זיכרון --- */
.flash {
  min-height: 240px; display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 34px 28px;
  cursor: pointer; transition: .18s; position: relative;
}
.flash:hover { border-color: var(--purple); }
.flash.flipped { background: #10121e; border-color: rgba(139,124,248,.4); }
.flash.known { border-color: rgba(63,221,155,.4); }
.flash.known::after {
  content: "✓ ידוע"; position: absolute; top: 14px; left: 18px;
  font-size: 11px; font-weight: 800; color: var(--good);
}
.ff-label { font-size: 12px; color: var(--muted-2); margin-bottom: 12px; }
.ff-concept {
  font-size: 30px; font-weight: 900; color: var(--text); line-height: 1.3;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ff-hint { font-size: 12px; color: var(--muted-2); margin-top: 18px; }
.fb-idea { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.6; }
.fb-exp { font-size: 14px; color: var(--muted); line-height: 1.65; margin-top: 12px; }
.flash-back .ts-link { margin-top: 16px; display: inline-block; }
.flash-nav { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.flash-nav .btn-inline[disabled] { opacity: .35; cursor: default; }

/* --- שיתוף עם מחזור --- */
.join-box { display: flex; gap: 10px; margin: 4px 0 20px; }
.join-box input {
  flex: 1; background: #10121e; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 13px;
}
.join-box .btn-inline { white-space: nowrap; }
.mem-list { display: flex; flex-direction: column; gap: 8px; }
.mem {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px;
}
.mem-email { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.mem-score { font-size: 13px; font-weight: 700; color: var(--good); white-space: nowrap; }
.badge.shared { background: rgba(103,232,249,.12); color: var(--cyan); border: 1px solid rgba(103,232,249,.35); }

/* מפת פערי המחזור — הדוח של המנחה */
.gaps-panel { margin-top: 22px; background: #10121e; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.gaps-head { font-size: 12px; font-weight: 800; color: var(--muted-2); margin-bottom: 12px; }
.gap-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; font-size: 13px; }
.gap-row:last-child { margin-bottom: 0; }
.gap-name { min-width: 130px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.gap-bar { flex: 1; height: 7px; background: #1a1e30; border-radius: 20px; overflow: hidden; min-width: 60px; }
.gap-bar div { height: 100%; background: linear-gradient(90deg, var(--purple), var(--bad)); border-radius: 20px; }
.gap-pct { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); white-space: nowrap; }
.gap-pct.hot { color: var(--bad); }
.gap-n { font-size: 11px; white-space: nowrap; }

/* ============ מרכז המרצה ============ */
.teacher-hero { margin: 4px 0 30px; }

/* רצועת מדדים */
.tkpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 38px; }
.tkpi { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px 18px;
  text-align: center; transition: transform .18s ease, border-color .18s ease; }
.tkpi:hover { transform: translateY(-2px); border-color: var(--border-2); }
.tkpi-icon { font-size: 21px; opacity: .9; margin-bottom: 8px; }
.tkpi-val { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.tkpi-label { font-size: 12.5px; color: var(--muted); margin-top: 9px; font-weight: 600; }
.tkpi.hero { border-color: rgba(139,124,248,.4); box-shadow: 0 0 34px rgba(139,124,248,.13); }
.tkpi.hero .tkpi-val { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* כרטיסי כיתות */
.class-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.class-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .18s ease, border-color .18s ease; }
.class-card::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 3px; background: var(--grad); opacity: .65; }
.class-card:hover { transform: translateY(-3px); border-color: var(--border-2); }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-head h3 { font-size: 17px; font-weight: 800; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-status { font-size: 11px; color: var(--purple); background: rgba(139,124,248,.12);
  padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.cc-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cc-meta .dot-sep { color: var(--muted-2); }
.cc-score { display: flex; flex-direction: column; gap: 6px; }
.cc-score-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.cc-score-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-score-val.good { color: var(--good); } .cc-score-val.mid { color: #e6c15a; } .cc-score-val.bad { color: var(--bad); }
.cc-bar { height: 8px; background: #1a1e30; border-radius: 20px; overflow: hidden; }
.cc-bar div { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width .5s ease; }
.cc-bar div.good { background: linear-gradient(90deg, #3fdd9b, #67e8f9); }
.cc-bar div.mid  { background: linear-gradient(90deg, #e6c15a, #8b7cf8); }
.cc-bar div.bad  { background: linear-gradient(90deg, var(--bad), #ffa07a); }
.cc-gap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #ffb3ad;
  background: rgba(255,123,114,.08); border: 1px solid rgba(255,123,114,.22); border-radius: 12px; padding: 9px 12px; }
.cc-gap b { color: var(--bad); font-weight: 800; }
.cc-gap-pct { margin-inline-start: auto; font-weight: 800; color: var(--bad); font-variant-numeric: tabular-nums; }
.cc-gap.empty { background: transparent; border-color: var(--border); color: var(--muted-2); justify-content: center; font-size: 12px; }
.cc-actions { display: flex; align-items: center; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.btn-ghost { background: transparent; border: 1px solid var(--border-2); color: var(--muted);
  border-radius: 12px; padding: 9px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, color .15s; }
.btn-ghost:hover:not([disabled]) { border-color: var(--purple); color: var(--text); }
.btn-ghost[disabled] { color: var(--good); border-color: rgba(63,221,155,.4); cursor: default; }

/* מפת הנפילות — ההירו */
.gapmap-hero { background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px 26px; margin-bottom: 34px; box-shadow: 0 0 40px rgba(139,124,248,.08); }
.gmh-head { margin-bottom: 18px; }
.gmh-head h2 { font-size: 21px; font-weight: 800; margin: 0; }
.gmh-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.gapmap-hero.empty-hero { text-align: center; padding: 40px 26px; }
.gapmap-hero.empty-hero .gmh-head { margin-bottom: 0; }

.spotlight { position: relative; display: flex; align-items: center; gap: 18px;
  padding: 6px 4px 20px; margin-bottom: 14px; border-bottom: 1px solid var(--border); overflow: hidden; }
.spot-glow { position: absolute; inset-inline-start: -8%; top: 50%; width: 240px; height: 190px;
  transform: translateY(-50%); filter: blur(24px); pointer-events: none;
  background: radial-gradient(circle, rgba(255,123,114,.22), transparent 70%); animation: breathe 4s ease-in-out infinite; }
.spotlight:not(.hot) .spot-glow { background: radial-gradient(circle, rgba(139,124,248,.20), transparent 70%); }
.spot-main { flex: 1; position: relative; z-index: 1; min-width: 0; }
.spot-concept { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.spot-bar { height: 12px; background: #1a1e30; border-radius: 20px; overflow: hidden; }
.spot-bar div { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--purple), var(--bad)); }
.spot-line { font-size: 13px; color: var(--muted); margin-top: 10px; }
.spot-line b { color: var(--text); font-weight: 800; }
.spot-pct { position: relative; z-index: 1; font-weight: 900; font-size: clamp(40px, 7vw, 60px);
  line-height: 1; letter-spacing: -2px; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: linear-gradient(90deg, var(--purple), var(--bad)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spotlight:not(.hot) .spot-pct { background: var(--grad); -webkit-background-clip: text; background-clip: text; }
.gm-rows { display: flex; flex-direction: column; gap: 9px; }
/* "המפה מציירת את עצמה" — הרוחב נקבע ב-inline (תמיד נכון); הגדילה היא scaleX מימין (RTL),
   fill-mode ברירת-מחדל: אם ההנפשה לא רצה (טאב מוסתר) הבר פשוט מוצג ברוחב-היעד המלא. */
.gapmap-hero .gap-bar div, .spot-bar div { transform-origin: right center; animation: growBar .8s cubic-bezier(.2,.7,.2,1); }
@keyframes growBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .gapmap-hero .gap-bar div, .spot-bar div { animation: none; } }

/* מצב ריק — עם תצוגת-רפאים של המפה מאחור */
.teacher-empty-wrap { position: relative; margin: 30px auto; max-width: 560px; }
.ghost-map { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  gap: 14px; padding: 44px; opacity: .16; filter: blur(1px); pointer-events: none; }
.ghost-map .gap-name { color: var(--muted-2); letter-spacing: 2px; min-width: 90px; }
.teacher-empty { position: relative; z-index: 1; text-align: center; margin: 0 auto; background: rgba(10,11,20,.72);
  border: 1px solid var(--border); border-radius: 20px; padding: 46px 32px; backdrop-filter: blur(2px); }
.teacher-empty h3 { font-size: 22px; font-weight: 900; margin: 12px 0 8px; }
.teacher-empty p { color: var(--muted); line-height: 1.75; font-size: 14px; margin: 0; }
.empty-steps { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.empty-steps span { white-space: nowrap; }

@media (max-width: 760px) {
  .tkpi-strip { grid-template-columns: repeat(2, 1fr); }
  .class-grid { grid-template-columns: 1fr; }
  .spotlight { flex-direction: column; align-items: flex-start; gap: 10px; }
  .spot-pct { align-self: flex-end; }
}

/* --- קונפטי --- */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.confetti span { position: absolute; top: 20%; }

/* --- תמלול מלא (נשמר מהגרסה הקודמת) --- */
.transcript-block { margin-top: 30px; }
.transcript-toggle {
  width: 100%; text-align: start; cursor: pointer; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; font-size: 1rem;
  font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; transition: .15s;
}
.transcript-toggle:hover { border-color: var(--purple); }
.tt-hint { color: var(--muted-2); font-size: .8rem; font-weight: 400; }
.transcript-panel {
  background: var(--card); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 12px 12px; margin-top: -12px; padding: 20px 16px 12px;
  max-height: 60vh; overflow-y: auto;
}
.tt-loading { color: var(--muted-2); text-align: center; padding: 16px; }
.tt-legend { color: var(--muted-2); font-size: .82rem; margin-bottom: 12px; }
.seg { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 7px; font-size: .92rem; }
.seg:hover { background: var(--bg); }
.seg.cited { background: rgba(103,232,249,.09); border-inline-start: 3px solid var(--cyan); }
.seg-ts { color: var(--purple); font-size: .78rem; font-weight: 700; text-decoration: none; min-width: 44px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
a.seg-ts:hover { text-decoration: underline; }
.seg-text { flex: 1; color: #c9c9dd; }
.seg-bi { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.seg-he { color: var(--text); }
.seg-src { color: var(--muted-2); font-size: .82rem; text-align: left; }
.seg-badge { color: var(--cyan); font-size: .7rem; font-weight: 700; white-space: nowrap; border: 1px solid var(--cyan); border-radius: 999px; padding: 1px 8px; align-self: center; }

/* --- שקפים (מה שהוצג) --- */
.slides-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: rgba(103,232,249,.05); border: 1px dashed rgba(103,232,249,.3);
  border-radius: 14px; padding: 14px 18px; margin: 4px 0 16px; color: #c9c9dd; font-size: 13.5px;
}
.slides-banner.err { background: rgba(255,123,114,.06); border-color: rgba(255,123,114,.3); color: var(--bad); }
.slides-note { color: var(--muted-2); font-size: 13px; margin: 4px 0 16px; }
.shots { margin: 6px 0 18px; }
.shots-label { color: var(--cyan); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.shots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.shot { margin: 0; cursor: zoom-in; }
.shot img {
  width: 100%; border-radius: 10px; border: 1px solid var(--border-2); display: block;
  aspect-ratio: 16 / 9; object-fit: cover; transition: .15s;
}
.shot:hover img { border-color: var(--cyan); }
.shot figcaption { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 6px; }
.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(3,4,10,.92);
  display: flex; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 12px; border: 1px solid var(--border-2); }

/* --- מצגת (deck) --- */
.deck-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.deck-counter { color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.deck-btn {
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--card); color: #c9c9dd; border: 1px solid var(--border-2);
  border-radius: 10px; padding: 8px 14px; transition: .15s; text-decoration: none; display: inline-block;
}
.deck-btn:hover { border-color: var(--purple); color: var(--text); }
.deck-btn:disabled { opacity: .35; cursor: default; }
.deck-btn:disabled:hover { border-color: var(--border-2); color: #c9c9dd; }

.slide {
  aspect-ratio: 16 / 9; width: 100%;
  background: linear-gradient(160deg, #12142a, #0a0b16);
  border: 1px solid var(--border-2); border-radius: 20px;
  box-shadow: 0 0 60px rgba(139,124,248,.12);
  padding: 44px 52px; display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.slide.title { align-items: center; justify-content: center; text-align: center; }
.slide-title-layout { display: flex; flex-direction: column; gap: 18px; }
.slide-big {
  font-size: clamp(26px, 4vw, 46px); font-weight: 900; margin: 0; line-height: 1.25;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.slide-sub { color: var(--cyan); font-size: clamp(14px, 1.8vw, 20px); font-weight: 700; margin: 0; }
.slide-content-layout { display: flex; flex-direction: column; height: 100%; }
.slide-h { font-size: clamp(20px, 2.6vw, 30px); font-weight: 800; margin: 0 0 22px; color: var(--cyan); }
.slide-content-layout.purple .slide-h { color: var(--purple); }
.slide-bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.slide-bullets li { position: relative; padding-inline-start: 26px; font-size: clamp(15px, 2vw, 21px); line-height: 1.5; color: var(--text); }
.slide-bullets li::before { content: "●"; position: absolute; inset-inline-start: 0; color: var(--purple); font-size: .8em; top: .15em; }
.slide-content-layout.cyan .slide-bullets li::before { color: var(--cyan); }
.slide-note { margin-top: auto; padding-top: 16px; color: var(--muted); font-size: clamp(12px, 1.5vw, 15px); border-top: 1px solid var(--border); }

.deck-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.deck-dots { display: flex; gap: 7px; }
.deck-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); cursor: pointer; transition: .15s; }
.deck-dot.on { background: var(--purple); width: 22px; border-radius: 99px; }

.deck-fs { position: fixed; inset: 0; z-index: 100; background: #05060c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px; }
.deck-fs .slide.fs { max-width: min(1200px, 92vw); max-height: 80vh; }
.fs-close { position: absolute; top: 20px; inset-inline-start: 24px; background: var(--card); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
.fs-close:hover { border-color: var(--purple); }
.fs-controls { display: flex; align-items: center; gap: 18px; }
.fs-controls .deck-btn { font-size: 20px; padding: 8px 20px; }

/* --- מסך כניסה --- */
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border-2);
  border-radius: 20px; padding: 34px 30px; text-align: center; box-shadow: 0 0 70px rgba(139,124,248,.14);
}
.auth-card .logo { font-size: 30px; font-weight: 900; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 4px 0 26px; }
.auth-tabs { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  background: transparent; border: none; border-radius: 9px; color: var(--muted); padding: 9px; transition: .15s;
}
.auth-tabs button.on { background: rgba(139,124,248,.16); color: var(--text); }
#auth-form { display: flex; flex-direction: column; gap: 10px; }
#auth-form input {
  font-family: inherit; font-size: 15px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 12px; padding: 13px 15px; outline: none; transition: .15s;
}
#auth-form input:focus { border-color: var(--purple); }
#auth-form input[type=email] { text-align: left; }
.auth-submit { width: 100%; padding: 13px; margin-top: 4px; }
.auth-alt { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.link-btn { background: none; border: none; color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer; padding: 4px; }
.link-btn:hover { color: var(--purple); }
.auth-msg { margin-top: 16px; font-size: 13.5px; font-weight: 600; line-height: 1.6; }
.auth-msg.ok { color: var(--good); }
.auth-msg.err { color: var(--bad); }

/* --- תפריט משתמש (בכותרת) --- */
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-email { color: var(--muted); font-size: 12.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: var(--card); border: 1px solid var(--border); color: #c9c9dd; font-family: inherit;
  font-size: 12.5px; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 6px 14px; transition: .15s;
}
.logout-btn:hover { border-color: var(--bad); color: var(--bad); }

/* --- טעינה / מצב ריק --- */
.loading-box { text-align: center; padding: 60px 20px; }
.loading-box .big { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.spinner { width: 36px; height: 36px; margin: 0 auto 18px; border: 3px solid var(--border); border-top-color: var(--purple); border-radius: 50%; animation: spin .9s linear infinite; }

@media (max-width: 640px) {
  .page { padding: 24px 16px 60px; }
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .tabs { flex-wrap: wrap; }
  .panel { padding: 22px 18px; }
  .lesson-title { font-size: 23px; }
  .check-head { padding: 20px 18px; }
  .check-item { padding: 15px 16px; }
  .top { margin-bottom: 32px; }
}
