:root {
  --bg: #0c0c0f; --bg2: #16161b; --bg3: #1e1e24; --bg4: #26262e;
  --border: #34343d; --border-soft: #26262e;
  --text: #e8e8ec; --muted: #9a9aa5; --dim: #6f6f79;
  --accent: #2ecc71; --accent2: #3ddc84;
  --gold: #f0a030; --blue: #4da3ff; --red: #ff6b6b; --purple: #a371f7;
  --radius: 14px;
  --grad: linear-gradient(135deg, #2ecc71, #26c6da);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1100px 650px at 50% -8%, rgba(46,204,113,.10), transparent 60%),
              radial-gradient(900px 500px at 90% 110%, rgba(77,163,255,.07), transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  animation: fadein .35s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }

/* ── Верхняя панель ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 22px; height: 72px;
  background: rgba(13,13,16,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; color: var(--text) !important; }
.brand .logo {
  width: 64px; height: 64px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; overflow: hidden; flex-shrink: 0;
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.who .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.id-pill { background: rgba(240,160,48,.15); border: 1px solid rgba(240,160,48,.4); color: var(--gold); font-weight: 800; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; }
.btn-link { color: var(--text); background: var(--bg3); border: 1px solid var(--border); padding: 7px 13px; border-radius: 9px; font-size: 13px; transition: border-color .15s, transform .15s; }
.btn-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.lang-switch { color: var(--gold); background: rgba(240,160,48,.1); border: 1px solid rgba(240,160,48,.35); border-radius: 999px; padding: 5px 12px; font-size: 11.5px; font-weight: 800; letter-spacing: .5px; }
.lang-switch:hover { background: rgba(240,160,48,.2); }

.page { max-width: 1080px; margin: 0 auto; padding: 26px 18px 70px; }

/* ── Лендинг ── */
.hero { text-align: center; padding: 56px 16px 28px; }
.hero .tag { display: inline-flex; align-items: center; gap: 7px; background: rgba(46,204,113,.09); border: 1px solid rgba(46,204,113,.3); color: var(--accent); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 6px 14px; margin-bottom: 18px; letter-spacing: .4px; text-transform: uppercase; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 12px; line-height: 1.2; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero .sub { color: var(--muted); font-size: 16.5px; max-width: 560px; margin: 0 auto; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 11px; padding: 11px 20px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s; text-decoration: none;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.btn.primary { background: linear-gradient(135deg, #2ecc71, #25b465); border: none; color: #06130b; font-weight: 800; box-shadow: 0 8px 24px rgba(46,204,113,.3); }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(46,204,113,.45); }
.btn.block { width: 100%; justify-content: center; margin-top: 16px; }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: 8px; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 44px; }
.how-step {
  background: linear-gradient(160deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.55;
  transition: transform .18s, border-color .18s;
}
.how-step:hover { transform: translateY(-3px); border-color: rgba(46,204,113,.4); }
.how-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  color: #06130b; font-size: 15px; margin-bottom: 12px; box-shadow: 0 4px 12px rgba(46,204,113,.3);
}

/* ── Карточки ── */
.card {
  background: linear-gradient(160deg, var(--bg2), #141418);
  border: 1px solid var(--border-soft); border-radius: 16px;
  padding: 22px; margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.card h2 { margin: 0 0 14px; font-size: 16.5px; display: flex; align-items: center; gap: 9px; }
.card.narrow { max-width: 430px; }
.card.center { margin: 48px auto; text-align: center; position: relative; overflow: hidden; }
.card.center > * { position: relative; z-index: 1; }
/* Еле видимый размытый логотип по центру карточки входа */
.login-bg-logo {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.login-bg-logo img {
  width: 38%; max-width: 160px; height: auto;
  opacity: .07; filter: blur(7px);
}
/* Логотип (64x64) над заголовком входа */
.logo-small {
  width: 64px; height: 64px; margin: 0 auto 12px;
}
.logo-small img { width: 100%; height: 100%; object-fit: contain; display: block; }
.muted { color: var(--muted); font-size: 13.5px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
input, select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 11px 14px; font-size: 14.5px; outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,204,113,.12); }
.row { display: flex; gap: 10px; }
.row input { flex: 1; }

.alert { border-radius: 11px; padding: 11px 15px; margin: 12px 0; font-size: 14px; }
.alert.error { background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.4); color: #ff9a9a; }

/* ── Вкладки ── */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  background: var(--bg2); border: 1px solid var(--border-soft); color: var(--muted);
  border-radius: 11px; padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.tab:hover { color: var(--text); border-color: var(--border); }
.tab.active { border-color: rgba(46,204,113,.55); color: var(--accent); background: rgba(46,204,113,.07); }
.tabpane { display: none; }
.tabpane.active { display: block; animation: fadein .25s ease; }

/* ── Загрузка курса ── */
.drop {
  border: 2px dashed var(--border); border-radius: 14px; padding: 42px 16px;
  text-align: center; color: var(--muted); cursor: pointer; transition: all .18s;
  background: rgba(255,255,255,.015);
}
.drop:hover { border-color: rgba(46,204,113,.5); }
.drop.over { border-color: var(--accent); background: rgba(46,204,113,.07); transform: scale(1.01); }
.drop .big { font-size: 34px; display: block; margin-bottom: 10px; }

/* ── Мониторинг ── */
.monitor { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.mon-card {
  background: linear-gradient(160deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; text-align: center;
  transition: transform .15s;
}
.mon-card:hover { transform: translateY(-2px); }
.mon-card .ico { font-size: 20px; }
.mon-card b { display: block; font-size: 28px; margin-top: 6px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mon-card span { font-size: 12px; color: var(--muted); }

/* ── Таблица учеников ── */
table.st { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.st th { text-align: left; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); }
table.st td { padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.st tbody tr { transition: background .12s; }
table.st tbody tr:hover { background: rgba(255,255,255,.025); }
.st-id { font-family: Consolas, monospace; font-weight: 800; color: var(--gold); font-size: 14px; letter-spacing: .5px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #06130b; margin-right: 10px; flex-shrink: 0;
}
.badge { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 11.5px; font-weight: 800; cursor: pointer; border: 1px solid; transition: all .15s; }
.badge.on { background: rgba(46,204,113,.13); color: var(--accent); border-color: rgba(46,204,113,.4); }
.badge.off { background: rgba(255,107,107,.1); color: var(--red); border-color: rgba(255,107,107,.4); }
.badge:hover { filter: brightness(1.2); }
.prog-bar { background: var(--bg3); height: 8px; border-radius: 5px; overflow: hidden; min-width: 84px; }
.prog-bar > div { height: 100%; background: var(--grad); border-radius: 5px; transition: width .4s; }

.medal {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg3); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; color: var(--muted);
  opacity: .55; transition: all .15s;
}
.medal span { font-size: 17px; }
.medal.on {
  background: rgba(240,160,48,.1); border-color: rgba(240,160,48,.45);
  color: var(--gold); opacity: 1;
}

/* Таймер 30 дней */
.timer-card {
  background: linear-gradient(160deg, rgba(46,204,113,.08), rgba(46,204,113,.02));
  border: 1px solid rgba(46,204,113,.35); border-radius: 14px;
  padding: 14px 20px; text-align: center; min-width: 150px;
}
.timer-title { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.timer-num { font-size: 34px; font-weight: 800; font-family: Consolas, monospace; margin: 4px 0 2px; }
.timer-bar { height: 7px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.timer-bar > div { height: 100%; background: var(--grad); border-radius: 4px; transition: width .4s; }

/* ── Модалка ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; animation: fadein .2s ease; }
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; padding: 28px;
  max-width: 430px; width: 92%; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.center-big { font-size: 20px; font-weight: 800; margin: 18px 0; word-break: break-all; line-height: 1.7; }
.center-big .num { color: var(--gold); font-size: 30px; font-family: Consolas, monospace; letter-spacing: 1px; }
.id-big { font-size: 15px; color: var(--muted); margin: 12px 0; }
.id-big .id-num { color: var(--gold); font-size: 28px; font-family: Consolas, monospace; letter-spacing: 1px; }

.logo-big {
  width: 64px; height: 64px; border-radius: 18px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  margin: 0 auto 14px; box-shadow: 0 8px 26px rgba(46,204,113,.35);
}
.logo-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-logo { width: 64px; height: 64px; margin: 0 auto 16px; }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 26px rgba(46,204,113,.35)); }
.id-card {
  background: linear-gradient(150deg, rgba(240,160,48,.16), rgba(240,160,48,.04));
  border: 1px solid rgba(240,160,48,.4); border-radius: 14px; padding: 18px; margin: 14px 0;
}
.id-card .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.id-card .val { font-family: Consolas, monospace; font-size: 30px; font-weight: 800; color: var(--gold); letter-spacing: 2.5px; margin-top: 5px; }

/* ── Roadmap вьюер (полноэкранный, как в программе) ── */
.rm-body { overflow: hidden; }
.rm-topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: rgba(0,0,0,.97);
  border-bottom: 1px solid #1a3d24; color: var(--accent);
}
.rm-top-left, .rm-top-right { display: flex; align-items: center; gap: 12px; }
.rm-sep { width: 1px; height: 26px; background: #1a3d24; }
.rm-icon-btn {
  width: 36px; height: 36px; border-radius: 9px; background: transparent;
  border: 1px solid #1a3d24; color: var(--accent); font-size: 16px; cursor: pointer;
}
.rm-icon-btn:hover { border-color: var(--accent); background: rgba(46,204,113,.1); }
.rm-select { width: 190px; margin: 0; padding: 8px 10px; font-size: 13px; }
.roadmap-wrap { position: relative; display: flex; height: calc(100vh - 72px); width: 100%; margin: 0; padding: 0; max-width: none; }
.roadmap-sidebar {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 30;
  width: 292px; flex-shrink: 0;
  background: rgba(10,10,13,.94); backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-soft);
  padding: 20px 18px; overflow-y: auto;
  transform: translateX(0); transition: transform .25s ease;
}
.roadmap-wrap.sb-hidden .roadmap-sidebar { transform: translateX(-105%); }
.roadmap-sidebar h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.roadmap-sidebar h3 { font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .8px; margin: 20px 0 10px; }
#legend .lg { font-size: 12.5px; color: var(--muted); margin: 7px 0; display: flex; align-items: center; gap: 9px; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.lg-dot.me { background: var(--gold); box-shadow: 0 0 9px var(--gold); }
.lg-dot.unlocked { background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.lg-dot.other { background: var(--blue); box-shadow: 0 0 9px var(--blue); }
.roadmap-canvas-wrap {
  flex: 1; overflow: hidden; position: relative;
  background: #000;
  background-image: linear-gradient(rgba(46,204,113,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(46,204,113,.04) 1px, transparent 1px);
  background-size: 44px 44px;
}
#roadmap-canvas { width: 100%; height: 100%; cursor: grab; }
#roadmap-canvas:active { cursor: grabbing; }
#roadmap-canvas svg { display: block; }
.rm-zoom { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.rm-zoom button {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(0,0,0,.92); border: 1px solid #1a3d24;
  color: var(--accent); font-size: 18px; font-weight: 800; cursor: pointer;
  backdrop-filter: blur(6px); transition: all .15s;
}
.rm-zoom button:hover { border-color: var(--accent); background: rgba(46,204,113,.12); transform: translateY(-1px); }

/* Выпадающий список учеников блока на карте */
.rm-pop {
  background: #141419; border: 1px solid var(--border); border-radius: 10px;
  color: #e7e7e9; font: 12.5px system-ui, 'Segoe UI', sans-serif;
  padding: 6px 8px; max-height: 280px; overflow-y: auto;
  box-shadow: 0 12px 34px rgba(0,0,0,.55); pointer-events: auto;
  scrollbar-width: thin; scrollbar-color: #3f3f46 transparent;
}
.rm-pop-item { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.rm-pop-item:hover { background: rgba(255,255,255,.06); }
.rm-pop-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }

/* Ученики выбранного блока в левой панели */
#block-students h3 { margin-top: 18px; }
.rm-stud-item {
  display: flex; gap: 9px; align-items: center;
  background: var(--bg3); border: 1px solid var(--border-soft); border-radius: 9px;
  padding: 8px 11px; margin: 6px 0; font-size: 13px; cursor: pointer;
  transition: border-color .15s;
}
.rm-stud-item:hover { border-color: var(--blue); }
.rm-stud-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.rm-stud-detail {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 13px; margin-top: 8px; font-size: 13px; line-height: 1.6;
}
.rm-stud-detail .badge { margin-left: 4px; }
.rm-d-row { display: flex; justify-content: space-between; gap: 8px; margin: 5px 0; color: var(--muted); }
.rm-d-row b { color: var(--text); }

@media (max-width: 760px) {
  .roadmap-wrap { flex-direction: column; height: auto; }
  .roadmap-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .roadmap-canvas-wrap { height: 65vh; }
  table.st { display: block; overflow-x: auto; }
}
