/* SATURN School — космическая тема в фирменных цветах: лаванда и бирюза на глубоком тёмном небе */
:root {
  --space: #0b0918;
  --space-2: #141029;
  --lilac: #b39bd6;
  --lilac-soft: #d9cdee;
  --teal: #6ba39c;
  --teal-bright: #8fd1c6;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f3effa;
  --muted: rgba(243, 239, 250, 0.58);
  --faint: rgba(243, 239, 250, 0.34);
  --grad: linear-gradient(100deg, var(--lilac) 0%, var(--teal-bright) 100%);
  --danger: #f09aa8;
  --r: 22px;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 70% at 85% -10%, #2a1f4d 0%, transparent 60%),
              radial-gradient(90% 60% at -10% 110%, #133a3a 0%, transparent 60%),
              var(--space);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 var(--body);
  overflow-x: hidden;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nebula {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(35% 25% at 70% 30%, rgba(179, 155, 214, .18), transparent 70%),
              radial-gradient(30% 25% at 25% 75%, rgba(107, 163, 156, .16), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .nebula, .sat, .boot-orbit { animation: none !important; } }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }

/* ---------- Загрузка ---------- */
.boot { min-height: 80vh; display: grid; place-items: center; }
.boot-orbit { width: 90px; height: 34px; border: 1.5px solid var(--lilac-soft); border-radius: 50%; position: relative; transform: rotate(-12deg); animation: spin 2.4s linear infinite; }
.boot-orbit span { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; }
@keyframes spin { to { transform: rotate(348deg); } }

/* ---------- Шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.logo { display: block; width: 118px; height: auto; }
.who { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.3; }
.who b { display: block; color: var(--text); font-weight: 600; font-size: 14px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: .01em; }
h1 { font-size: 26px; line-height: 1.1; text-transform: uppercase; }
h1 .thin { font-weight: 300; color: var(--muted); display: block; }
h2 { font-size: 17px; text-transform: uppercase; margin: 26px 0 12px; }
.sub { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

/* ---------- Карточки ---------- */
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card + .card, .list > * + * { margin-top: 10px; }
.tap { transition: transform .15s ease, background .2s ease; }
.tap:active { transform: scale(.985); background: var(--glass-2); }

/* ---------- Главный прогресс (орбита) ---------- */
.hero { position: relative; display: grid; place-items: center; padding: 8px 0 4px; }
.hero svg { width: min(78vw, 300px); height: auto; overflow: visible; }
.hero .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.pct { font-family: var(--display); font-size: 54px; font-weight: 300; line-height: 1; }
.pct small { font-size: 22px; color: var(--muted); }
.pct-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.rank {
  display: inline-flex; align-items: center; gap: 8px; margin: 6px auto 0; padding: 7px 14px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--line); font-size: 13px;
}
.rank i { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px var(--teal-bright); }
.sat { transform-origin: 150px 150px; }

.chips3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; }
.stat span { font-size: 11.5px; color: var(--muted); }

/* ---------- Следующий урок ---------- */
.next { position: relative; overflow: hidden; margin-top: 18px; }
.next::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(143, 209, 198, .25), transparent 70%); }
.next h3 { font-size: 15px; margin: 6px 0 4px; text-transform: none; font-weight: 500; }
.next p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

/* ---------- Планеты (курсы) ---------- */
.planet { --c1: #d9cdee; --c2: #7a64a6; width: 44px; height: 44px; flex: none; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 32% 30%, var(--c1), var(--c2) 70%, #1a1430 100%); box-shadow: inset -6px -8px 14px rgba(0,0,0,.35), 0 0 18px -4px var(--c2); }
.planet.ring::after { content: ''; position: absolute; left: -9px; right: -9px; top: 50%; height: 12px; margin-top: -6px; border: 1.5px solid rgba(255,255,255,.55); border-radius: 50%; transform: rotate(-18deg); }
.planet.sm { width: 30px; height: 30px; }
.planet.sm.ring::after { left: -6px; right: -6px; height: 9px; margin-top: -4.5px; }
.planet.lg { width: 74px; height: 74px; }
.planet.lg.ring::after { left: -16px; right: -16px; height: 20px; margin-top: -10px; }
.p-saturn  { --c1: #efe6ff; --c2: #9b83c8; }
.p-mars    { --c1: #ffd9c9; --c2: #c9806e; }
.p-venus   { --c1: #fff1d6; --c2: #c9a46e; }
.p-comet   { --c1: #ffffff; --c2: #8fa6d6; }
.p-neptune { --c1: #d4f3ef; --c2: #4f9b92; }
.p-jupiter { --c1: #f6e7dc; --c2: #a6857a; }
.p-moon    { --c1: #f4f4f7; --c2: #8b8a9c; }

.course { display: flex; align-items: center; gap: 14px; }
.course .body { flex: 1; min-width: 0; }
.course .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.course .n { font-family: var(--display); font-size: 13px; color: var(--muted); flex: none; }
.bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 9px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 10px rgba(143,209,198,.5); transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* ---------- Экран курса и уроки ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding: 6px 0; margin-bottom: 8px; }
.course-head { display: flex; gap: 22px; align-items: center; margin: 6px 0 8px; }
.course-head h1 { font-size: 20px; }
.lessons { position: relative; margin-top: 18px; padding-left: 26px; }
.lessons::before { content: ''; position: absolute; left: 9px; top: 18px; bottom: 18px; width: 1px; background: linear-gradient(var(--line), rgba(255,255,255,.04)); }
.lesson { position: relative; }
.lesson::before { content: ''; position: absolute; left: -22px; top: 22px; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--faint); background: var(--space); }
.lesson.done::before { border-color: transparent; background: var(--teal-bright); box-shadow: 0 0 12px var(--teal-bright); }
.lesson.ok::before { background: var(--lilac); box-shadow: 0 0 12px var(--lilac); }
.lesson .row { display: flex; gap: 12px; align-items: flex-start; }
.lesson .num { font-family: var(--display); font-size: 12px; color: var(--faint); padding-top: 2px; min-width: 22px; }
.lesson .t { font-weight: 600; }
.lesson .a { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.lesson .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.check { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; transition: all .2s ease; margin-left: auto; }
.check svg { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: all .2s ease; }
.done .check { border-color: transparent; background: var(--grad); }
.done .check svg { opacity: 1; transform: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 4px 9px; border-radius: 99px; background: rgba(179,155,214,.16); color: var(--lilac-soft); }
.badge.teal { background: rgba(143,209,198,.14); color: var(--teal-bright); }
.badge.dim { background: rgba(255,255,255,.06); color: var(--muted); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 600; font-size: 14px; background: var(--glass-2); border: 1px solid var(--line); }
.btn.primary { background: var(--grad); color: #17122b; border: 0; box-shadow: 0 8px 26px -10px rgba(143,209,198,.7); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; }
.btn:active { transform: scale(.98); }

/* ---------- Ученики (для преподавателей) ---------- */
.search { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ffffff88' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") no-repeat 14px center; outline: none; }
.search:focus { border-color: var(--lilac); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px -16px 4px; padding: 0 16px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 8px 14px; border-radius: 99px; font-size: 13px; background: var(--glass); border: 1px solid var(--line); color: var(--muted); }
.tab.on { background: var(--grad); color: #17122b; border-color: transparent; font-weight: 600; }

.person { display: flex; align-items: center; gap: 14px; }
.ava { position: relative; width: 50px; height: 50px; flex: none; }
.ava svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ava span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 12px; }
.person .body { flex: 1; min-width: 0; }
.person .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .m { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dots { display: flex; gap: 4px; margin-top: 7px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.12); }
.dots i.on { background: var(--teal-bright); }
.dots i.half { background: var(--lilac); }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .planet { margin: 0 auto 18px; }

/* ---------- Формы ---------- */
label.f { display: block; margin-top: 14px; }
label.f span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.inp { width: 100%; min-height: 46px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.2); outline: none; resize: vertical; }
.inp:focus { border-color: var(--lilac); }
.pick { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick .body { flex: 1; }
.pick .m { font-size: 12px; color: var(--muted); }
.toggle { width: 46px; height: 28px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on { background: var(--teal); }
.toggle.on::after { transform: translateX(18px); }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px dashed var(--line); font-size: 12px; word-break: break-all; color: var(--lilac-soft); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row-btns .btn { flex: 1; }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

/* ---------- Нижнее меню ---------- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; gap: 4px; padding: 6px; border-radius: 22px; background: rgba(20, 16, 41, .78); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); }
.nav button { white-space: nowrap; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 16px; border-radius: 16px; font-size: 11px; color: var(--muted); }
.nav button svg { width: 21px; height: 21px; }
.nav button.on { background: var(--glass-2); color: var(--text); }
.nav button.on svg { color: var(--teal-bright); }

/* ---------- Тост и вспышка ---------- */
#toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -30px); opacity: 0; z-index: 20;
  padding: 11px 18px; border-radius: 16px; background: rgba(20,16,41,.92); border: 1px solid var(--line); font-size: 13.5px;
  transition: all .3s ease; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.spark { position: fixed; width: 5px; height: 5px; border-radius: 50%; pointer-events: none; z-index: 30; background: #fff; box-shadow: 0 0 8px #fff; }

.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.list > .fade:nth-child(2) { animation-delay: .04s } .list > .fade:nth-child(3) { animation-delay: .08s }
.list > .fade:nth-child(4) { animation-delay: .12s } .list > .fade:nth-child(5) { animation-delay: .16s }
.list > .fade:nth-child(6) { animation-delay: .2s } .list > .fade:nth-child(n+7) { animation-delay: .24s }

/* Мини-полоски по каждому курсу в списке учеников */
.mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mini-c { position: relative; overflow: hidden; font-size: 10.5px; line-height: 1; padding: 4px 7px; border-radius: 7px; background: rgba(255,255,255,.05); color: var(--faint); }
.mini-c i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(143,209,198,.22); }
.mini-c.part { color: var(--muted); }
.mini-c.full { color: #17122b; background: var(--teal-bright); }
.mini-c.full i { display: none; }
.mini-c { isolation: isolate; } .mini-c i { z-index: -1; }
.mini-c.own { box-shadow: inset 0 0 0 1px var(--lilac); color: var(--lilac-soft); }
