:root {
  --bg: #0d1226;
  --panel: #161d3a;
  --panel-2: #1e2750;
  --line: #2c3768;
  --text: #eef0fa;
  --muted: #8e98c4;
  --ok: #22c55e;
  --gold: #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, #1b2155 0, transparent 40%),
    radial-gradient(circle at 85% 60%, #10304a 0, transparent 40%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
}
body.sheet-open { overflow: hidden; }

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 18, 38, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hud-inner {
  max-width: 980px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.hud-title { font-weight: 800; white-space: nowrap; }
.hud-progress { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 160px; }
.hud-bar { flex: 1; height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hud-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  border-radius: 99px; transition: width 0.6s ease;
}
#hudPct { font-weight: 800; min-width: 40px; }
.hud-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 99px; font-size: 0.85rem; white-space: nowrap;
}
.chip.xp b { color: var(--gold); }
.chip.user-chip b { color: #a5b4fc; }
.chip-btn {
  cursor: pointer; font-family: inherit; color: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip-btn:hover { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); }
.chip-btn.danger:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fecaca; }

/* ---------- Boshlanish ---------- */
.map-wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.start-banner { text-align: center; padding: 36px 0 10px; }
.start-banner h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.2; }
.start-banner p { color: var(--muted); margin-top: 10px; }

/* ---------- Xarita ---------- */
.map { position: relative; width: 100%; }

.zone {
  position: absolute; left: -16px; right: -16px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--c) 14%, transparent),
    color-mix(in srgb, var(--c) 4%, transparent));
  border-radius: 32px;
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
}

.path { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.road-bg   { fill: none; stroke: #0a0f22; stroke-width: 22; stroke-linecap: round; opacity: 0.7; }
.road-dash { fill: none; stroke: var(--line); stroke-width: 6; stroke-dasharray: 2 14; stroke-linecap: round; }
.road-done {
  fill: none; stroke: var(--ok); stroke-width: 8; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6));
}

/* Dunyo (bo'lim) kartasi */
.world {
  position: absolute; transform: translate(-50%, -50%);
  width: min(92%, 440px);
  display: flex; gap: 14px; align-items: center;
  background: var(--panel);
  border: 2px solid var(--c);
  border-radius: 22px; padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 6px color-mix(in srgb, var(--c) 15%, transparent);
  z-index: 3;
}
.world-icon {
  font-size: 2.2rem; width: 64px; height: 64px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 18px;
  background: color-mix(in srgb, var(--c) 25%, transparent);
}
.world > div:last-child { flex: 1; min-width: 0; }
.world-num { font-size: 0.72rem; letter-spacing: 0.15em; font-weight: 800; color: var(--c); }
.world h2 { font-size: 1.4rem; }
.world-desc { font-size: 0.8rem; color: var(--muted); }
.world .mini-bar { margin: 8px 0 4px; }

.mini-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--c, var(--ok)); border-radius: 99px; transition: width .4s; }

/* Etap banneri */
.unit {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--c) 60%, var(--line));
  border-radius: 99px; padding: 8px 8px 8px 14px;
  white-space: nowrap; z-index: 3; font-size: 0.92rem;
  max-width: 94%;
}
.unit b { overflow: hidden; text-overflow: ellipsis; }
.unit-num {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c);
}
.unit-count {
  background: var(--line); border-radius: 99px; padding: 2px 9px; font-size: 0.78rem; font-weight: 700;
}
.unit-done .unit-count { background: var(--ok); color: #fff; }

/* ---------- Level tugunlari ---------- */
.lvl {
  position: absolute; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%;
  border: 0; cursor: pointer; z-index: 4;
  display: grid; place-items: center;
  font: inherit;
  background: #2a3360;
  box-shadow: 0 8px 0 #1a2045, 0 12px 20px rgba(0,0,0,0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.lvl:hover { transform: translate(-50%, -50%) scale(1.06); }
.lvl:active { transform: translate(-50%, calc(-50% + 6px)); box-shadow: 0 2px 0 #1a2045; }
.lvl-face { font-size: 2.1rem; line-height: 1; }

.lvl.locked { cursor: not-allowed; }
.lvl.locked .lvl-face { font-size: 1.6rem; opacity: 0.6; }

.lvl.done {
  background: var(--ok);
  box-shadow: 0 8px 0 #15803d, 0 12px 20px rgba(0,0,0,0.4);
}
.lvl-check {
  position: absolute; top: -4px; right: -4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: #3b2a00; font-weight: 900;
  display: grid; place-items: center; font-size: 0.9rem;
  border: 3px solid var(--bg);
}

.lvl.current {
  width: 100px; height: 100px;
  background:
    radial-gradient(circle, var(--c) 0 60%, transparent 61%),
    conic-gradient(var(--gold) calc(var(--p) * 1%), #2a3360 0);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 60%, #000), 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent);
  animation: pulse 1.8s infinite;
}
.lvl.current .lvl-face { font-size: 2.5rem; }
@keyframes pulse {
  0%   { box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 60%, #000), 0 0 28px 4px color-mix(in srgb, var(--c) 70%, transparent), 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); }
  70%  { box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 60%, #000), 0 0 40px 10px color-mix(in srgb, var(--c) 55%, transparent), 0 0 0 24px transparent; }
  100% { box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 60%, #000), 0 0 28px 4px color-mix(in srgb, var(--c) 70%, transparent), 0 0 0 0 transparent; }
}

.marker {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center;
  font-size: 1.9rem; animation: bounce 1.2s ease-in-out infinite;
  pointer-events: none;
}
.marker.m-left { left: auto; right: calc(100% + 12px); }
.marker i {
  font-style: normal; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em;
  background: var(--gold); color: #3b2a00;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; margin-top: 2px;
}
@keyframes bounce { 50% { transform: translateY(calc(-50% - 8px)); } }

.shake { animation: shake 0.4s; }
@keyframes shake {
  20%, 60% { transform: translate(calc(-50% - 7px), -50%); }
  40%, 80% { transform: translate(calc(-50% + 7px), -50%); }
}

/* Darajalar yoniga chiqadigan sarlavha — default yashirin, faqat ustiga kelganda ko'rinadi */
.lvl-label {
  position: absolute; transform: translateX(-50%) translateY(6px);
  text-align: center; font-weight: 600; font-size: 0.82rem;
  width: max-content; max-width: 180px; z-index: 5;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  margin-top: 10px;
  color: #e5e7eb;
  box-shadow: 0 10px 25px -8px rgba(0,0,0,0.6);
  opacity: 0; visibility: hidden;
  transition: opacity .15s ease, transform .15s ease;
}
.lvl:hover + .lvl-label,
.lvl:focus-visible + .lvl-label,
.lvl-label:hover {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.lvl-label.locked { color: var(--muted); }
.lvl-step { display: block; font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.lvl-label small {
  display: block; font-size: 0.68rem; color: #9ca3af;
  margin-bottom: 2px; font-weight: 500; letter-spacing: 0.2px;
}
.lvl-label span { display: block; line-height: 1.3; }
.lvl-label::before {
  content: ""; position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: rgba(17, 24, 39, 0.95);
  border-left: 1px solid rgba(99, 102, 241, 0.3);
  border-top: 1px solid rgba(99, 102, 241, 0.3);
}

/* Marra */
.trophy {
  position: absolute; transform: translate(-50%, -50%);
  text-align: center; z-index: 4; width: 240px;
}
.trophy-icon {
  font-size: 3.4rem; width: 120px; height: 120px; margin: 0 auto 10px;
  display: grid; place-items: center; border-radius: 50%;
  background: #2a3360; filter: grayscale(0.9);
  box-shadow: 0 10px 0 #1a2045;
}
.trophy.won .trophy-icon {
  filter: none; background: var(--gold); box-shadow: 0 10px 0 #b45309, 0 0 40px var(--gold);
}
.trophy p { font-weight: 800; }
.trophy small { color: var(--muted); }

.reset {
  position: absolute; left: 50%; transform: translateX(-50%);
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.82rem;
  cursor: pointer; text-decoration: underline;
}

/* Hozirgi joyga tugma */
.fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  cursor: pointer; display: grid; place-items: center; color: #3b2a00;
  background: var(--gold);
  box-shadow: 0 6px 0 #b45309, 0 10px 24px rgba(0,0,0,0.4);
}
.fab:active { transform: translateY(4px); box-shadow: 0 2px 0 #b45309; }

/* ---------- Level oynasi (bottom sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 60;
}
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 61;
  width: min(100%, 560px); max-height: 85vh; overflow-y: auto;
  transform: translate(-50%, 105%);
  transition: transform 0.3s cubic-bezier(.2,.9,.3,1.1);
  background: var(--panel);
  border: 1px solid var(--line); border-bottom: 0;
  border-top: 4px solid var(--c);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px 28px;
}
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
body.sheet-open .sheet { transform: translate(-50%, 0); }

.sheet-handle { width: 44px; height: 5px; background: var(--line); border-radius: 9px; margin: 0 auto 14px; }
.sheet-head { display: flex; gap: 14px; align-items: flex-start; }
.sheet-head > div:nth-child(2) { flex: 1; min-width: 0; }
.sheet-icon {
  font-size: 2rem; width: 60px; height: 60px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 25%, transparent);
}
.sheet-path { font-size: 0.78rem; color: var(--muted); }
.sheet h3 { font-size: 1.35rem; margin: 2px 0; }
.sheet-meta { font-size: 0.85rem; color: var(--muted); }
.close {
  background: var(--panel-2); border: 0; color: var(--text);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 0.95rem;
}

.sheet-prog { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; }
.sheet-prog .mini-bar { flex: 1; height: 12px; }
.sheet-prog .mini-bar span { background: var(--ok); }

.topics { display: grid; gap: 6px; }
.topic {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; cursor: pointer;
  background: var(--panel-2); border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.topic:hover { border-color: var(--line); }
.topic input { display: none; }
.topic .box {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 2px solid var(--muted); border-radius: 7px;
  display: grid; place-items: center; transition: all 0.15s;
}
.topic .t { flex: 1; }
.topic .xp { font-size: 0.72rem; color: var(--gold); font-weight: 700; opacity: 0.8; }
.topic.checked { background: color-mix(in srgb, var(--ok) 12%, var(--panel-2)); }
.topic.checked .box { background: var(--ok); border-color: var(--ok); }
.topic.checked .t { color: var(--muted); text-decoration: line-through; }
.topic.checked .xp { opacity: 0.35; }

.project {
  margin-top: 14px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 12px; padding: 12px 14px; font-size: 0.92rem;
}
.sheet-actions { margin-top: 16px; }
.btn {
  width: 100%; padding: 14px; border-radius: 14px; border: 0;
  font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; color: #fff;
}
.btn.primary { background: var(--ok); box-shadow: 0 5px 0 #15803d; }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #15803d; }
.btn.ghost { background: var(--panel-2); color: var(--muted); }
.sheet-next { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 14px; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 80px; z-index: 80;
  transform: translate(-50%, -20px); opacity: 0;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transition: all 0.25s; pointer-events: none;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Konfetti */
.confetti {
  position: fixed; top: -40px; z-index: 90; pointer-events: none;
  animation: fall 1.8s ease-in forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.6; }
}

/* Mobil */
@media (max-width: 600px) {
  .hud-inner { gap: 8px; }
  .hud-title span { display: none; }
  .hud-stats { width: 100%; justify-content: space-between; }
  .lvl { width: 72px; height: 72px; }
  .lvl.current { width: 86px; height: 86px; }
  .lvl-face { font-size: 1.8rem; }
  .lvl-label { width: 120px; font-size: 0.82rem; }
  .world h2 { font-size: 1.2rem; }
  .world-icon { width: 52px; height: 52px; font-size: 1.8rem; }
}

/* ---------- Heroicons ---------- */
.hi { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }

.hud-title { display: flex; align-items: center; gap: 8px; }
.hud-title .hi { width: 24px; height: 24px; color: #818cf8; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip .hi { width: 16px; height: 16px; color: var(--muted); }
.chip.xp .hi { color: var(--gold); }
.fab .hi { width: 28px; height: 28px; stroke-width: 2; }

.world-icon .hi { width: 36px; height: 36px; color: var(--c); }
.unit-count .hi { width: 14px; height: 14px; stroke-width: 3; vertical-align: -2px; }

.lvl-face { display: grid; place-items: center; }
.lvl-face .hi { width: 38px; height: 38px; color: #c7cdf0; stroke-width: 1.7; }
.lvl.done .lvl-face .hi, .lvl.current .lvl-face .hi { color: #fff; }
.lvl.current .lvl-face .hi { width: 44px; height: 44px; }
.lvl.locked .lvl-face .hi { width: 30px; height: 30px; color: #6b75a3; }
.lvl-check .hi { width: 15px; height: 15px; stroke-width: 3.2; }

.marker .pin .hi {
  width: 38px; height: 38px; color: var(--gold); stroke-width: 2;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.trophy-icon .hi { width: 62px; height: 62px; color: #c7cdf0; }
.trophy.won .trophy-icon .hi { color: #3b2a00; }
.reset { display: inline-flex; align-items: center; gap: 6px; }

.sheet-icon .hi { width: 32px; height: 32px; color: var(--c); }
.sheet-path .hi, .sheet-meta .hi { width: 14px; height: 14px; vertical-align: -2px; }
.close { display: grid; place-items: center; }
.close .hi { width: 18px; height: 18px; stroke-width: 2; }

.topic .box .hi { width: 14px; height: 14px; color: #fff; stroke-width: 3.5; opacity: 0; transition: opacity .15s; }
.topic.checked .box .hi { opacity: 1; }
.topic .xp { display: inline-flex; align-items: center; gap: 2px; }
.topic .xp .hi { width: 13px; height: 13px; }

.project { display: flex; gap: 10px; align-items: flex-start; }
.project .hi { width: 22px; height: 22px; color: var(--gold); margin-top: 1px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn .hi { width: 22px; height: 22px; stroke-width: 2; }
.sheet-next .hi { width: 16px; height: 16px; vertical-align: -3px; }

.toast { display: flex; align-items: center; gap: 10px; }
.toast .hi { width: 22px; height: 22px; color: var(--gold); }

.confetti .hi { width: 100%; height: 100%; }

/* =========================================================
   Har bir mavzu = alohida level
   ========================================================= */
.lvl { width: 76px; height: 76px; }
.lvl.current {
  width: 96px; height: 96px;
  background: var(--c);
}
.lvl-face .hi { width: 32px; height: 32px; }
.lvl.current .lvl-face .hi { width: 42px; height: 42px; }
.lvl.done .lvl-face .hi { width: 34px; height: 34px; stroke-width: 3; }
.lvl.locked .lvl-face .hi { width: 26px; height: 26px; }

/* Amaliy loyiha leveli — oltin "boss" level */
.lvl.project-lvl { border-radius: 26px; }
.lvl.project-lvl.locked { background: #3a3420; box-shadow: 0 8px 0 #241f10, 0 12px 20px rgba(0,0,0,.4); }
.lvl.project-lvl.locked .lvl-face .hi { color: #a8915a; }
.lvl.project-lvl.current { background: var(--gold); }
.lvl.project-lvl.current .lvl-face .hi { color: #3b2a00; }

/* Level yozuvi uchun eski stillar — endi .lvl-label yuqoridagi tooltip stilini ishlatadi */

/* Bosqich sarlavhasi (masalan "Web qanday ishlaydi") */
.stage-chip {
  position: absolute; transform: translate(-50%, -50%); z-index: 3;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px dashed color-mix(in srgb, var(--c) 70%, var(--line));
  border-radius: 14px; padding: 7px 10px 7px 8px;
  max-width: 92%; white-space: nowrap;
}
.stage-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 25%, transparent);
}
.stage-ic .hi { width: 20px; height: 20px; color: var(--c); }
.stage-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.stage-txt small { font-size: 0.68rem; color: var(--muted); }
.stage-txt b { overflow: hidden; text-overflow: ellipsis; }
.stage-count {
  background: var(--line); border-radius: 99px; padding: 2px 9px;
  font-size: 0.76rem; font-weight: 700;
}
.stage-count .hi { width: 14px; height: 14px; stroke-width: 3; vertical-align: -2px; }
.stage-chip.done { border-style: solid; border-color: var(--ok); }
.stage-chip.done .stage-count { background: var(--ok); color: #fff; }

/* Oyna: bosqich nuqtalari */
.stage-dots {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 6px; font-size: 0.82rem;
}
.dots { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--line);
}
.dot.pr { border-radius: 3px; }
.dot.done { background: var(--ok); }
.dot.current { background: var(--c); }
.dot.me { outline: 2px solid #fff; outline-offset: 2px; }

.sheet-text { color: var(--muted); margin: 12px 0; font-size: 0.93rem; }
.learn { display: grid; gap: 8px; }
.learn a {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: 11px 14px; border-radius: 12px;
  transition: border-color .15s, transform .15s;
}
.learn a:hover { border-color: var(--c); transform: translateX(3px); }
.learn .hi { width: 20px; height: 20px; color: var(--c); }

@media (max-width: 600px) {
  .lvl { width: 64px; height: 64px; }
  .lvl.current { width: 80px; height: 80px; }
  .lvl-label { font-size: 0.78rem; padding: 5px 8px; }
}

/* =========================================================
   Level oynasi: Dars → Video → Topshiriqlar
   ========================================================= */
.sheet { width: min(100%, 680px); max-height: 92vh; }

.stepper {
  display: flex; align-items: center; gap: 6px;
  margin: 16px 0 6px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  scroll-margin-top: 10px;
}
.step {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; color: var(--muted);
  font: inherit; font-size: 0.86rem; font-weight: 700;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.step:hover { color: var(--text); }
.step.active { background: var(--panel-2); color: var(--text); }
.step-n {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.78rem;
  background: var(--line); color: var(--text);
}
.step.active .step-n { background: var(--c); color: #fff; }
.step.passed .step-n { background: var(--ok); color: #fff; }
.step-n .hi { width: 14px; height: 14px; stroke-width: 3; }
.step-line { flex: 1; height: 2px; background: var(--line); min-width: 8px; }

.lesson { padding-top: 8px; }
.lesson h4 {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; margin: 20px 0 10px;
}
.lesson h4 .hi { width: 20px; height: 20px; color: var(--c); }
.lesson-intro { font-size: 1rem; line-height: 1.65; margin: 10px 0; }

.concepts { display: grid; gap: 8px; }
.concept {
  background: var(--panel-2); border-left: 3px solid var(--c);
  border-radius: 10px; padding: 10px 14px;
}
.concept b { display: block; margin-bottom: 2px; }
.concept p { color: #c3c9e6; font-size: 0.93rem; line-height: 1.55; }

.code { position: relative; }
.code pre {
  background: #070b18; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; overflow-x: auto;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.86rem; line-height: 1.55; color: #d6dcff;
}
.code-lang {
  position: absolute; top: 8px; right: 10px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: 0.08em;
}

.lesson > .btn { margin-top: 20px; }

.yt-buttons { display: grid; gap: 10px; margin: 16px 0; }
.yt-btn {
  display: flex; align-items: center; gap: 14px;
  background: #dc2626; color: #fff; text-decoration: none;
  padding: 14px 16px; border-radius: 14px;
  box-shadow: 0 5px 0 #991b1b;
  transition: transform .12s, box-shadow .12s;
}
.yt-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #991b1b; }
.yt-btn .hi { width: 34px; height: 34px; }
.yt-btn span { display: flex; flex-direction: column; min-width: 0; }
.yt-btn small { opacity: 0.85; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-btn.en { background: var(--panel-2); box-shadow: 0 5px 0 #0d1226; border: 1px solid var(--line); }
.yt-btn.en .hi { color: #ef4444; }

.topic .t small { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 700; text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.hint { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 8px; }

@media (max-width: 600px) {
  .step span:last-child { display: none; }
  .step.active span:last-child { display: inline; }
  .sheet { max-height: 95vh; padding: 10px 14px 24px; }
}

.lesson code, .topic code {
  font-family: "Cascadia Code", Consolas, monospace; font-size: 0.85em;
  background: #070b18; border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px; color: #fcd34d;
}
