/* GEOKZ */

:root {
  --bg: #bfe4ff;
  --bg-glow-a: rgba(255, 255, 255, 0.7);
  --bg-glow-b: rgba(255, 220, 150, 0.55);
  --card: #fff;
  --card-2: #f5f1ff;
  --ink: #1b1545;
  --muted: #625d8f;
  --line: #e0d8ff;
  --brand: #6a4cff;
  --brand-d: #4a30d6;
  --brand-l: #e6e0ff;
  --ok: #17c58a;
  --ok-d: #0e9667;
  --ok-bg: #d3f7e8;
  --sun: #ffd23f;
  --sun-d: #d9a400;
  --rose: #ff4f78;
  --rose-d: #c92d56;
  --bad-bg: #ffdce5;
  --sky: #2fb8ff;
  --t1: #ffe0e8;
  --t2: #dbeeff;
  --t3: #fff1bf;
  --t4: #d4f6e8;
  --t5: #e8e0ff;
  --halo: rgba(106, 76, 255, 0.25);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 14px 30px -16px rgba(60, 30, 160, 0.4);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 22px 36px -16px rgba(60, 30, 160, 0.5);
  --radius: 22px;
  --font:
    ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, 'Noto Sans', Arial,
    sans-serif;
}

:root[data-theme='dark'] {
  --bg: #0c0924;
  --bg-glow-a: #1f1560;
  --bg-glow-b: #3a1a5c;
  --card: #1a1442;
  --card-2: #251c58;
  --ink: #f5f2ff;
  --muted: #aaa3d6;
  --line: #352b75;
  --brand: #8b73ff;
  --brand-d: #5a42d8;
  --brand-l: #2f2570;
  --ok: #2ee6a0;
  --ok-d: #14a572;
  --ok-bg: #145846;
  --sun: #ffd23f;
  --sun-d: #b88c00;
  --rose: #ff6a8d;
  --rose-d: #c23a60;
  --bad-bg: #5e2440;
  --sky: #4cc3ff;
  --t1: #4a2447;
  --t2: #1d3b70;
  --t3: #4f4120;
  --t4: #17503f;
  --t5: #382d7d;
  --halo: rgba(70, 120, 255, 0.38);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 14px 30px -14px rgba(0, 0, 0, 0.75);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.09) inset, 0 22px 38px -14px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--font);
  color: var(--ink);
  overflow-x: hidden;
}

/* фоновое свечение */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
body::before {
  top: -35vmax;
  left: -25vmax;
  background: radial-gradient(closest-side, var(--bg-glow-a), transparent);
  animation: drift-a 26s ease-in-out infinite alternate;
}
body::after {
  right: -30vmax;
  bottom: -35vmax;
  background: radial-gradient(closest-side, var(--bg-glow-b), transparent);
  opacity: 0.7;
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a {
  to {
    transform: translate3d(12vmax, 8vmax, 0);
  }
}
@keyframes drift-b {
  to {
    transform: translate3d(-10vmax, -9vmax, 0);
  }
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
:root[data-theme='dark'] {
  background: linear-gradient(#050316, #0f0833 65%, #1a0e45);
}
:root {
  background: linear-gradient(#6fc0ff 0%, #a9dbff 40%, #dff0ff 75%, #fff1d6 100%);
}
:root[data-theme='dark'] .sky::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(112deg, transparent 38%, rgba(140, 120, 255, 0.13) 50%, transparent 62%);
}
.sky i {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
}
.sky .s1 {
  width: 1px;
  height: 1px;
  box-shadow:
    41vw 19vh #ffeedd,
    83vw 6vh #fff,
    68vw 12vh #dfe6ff,
    74vw 7vh #fff,
    4vw 11vh #ffeedd,
    53vw 8vh #fff,
    11vw 70vh #ffeedd,
    7vw 72vh #fff,
    28vw 80vh #fff,
    73vw 74vh #ffeedd,
    6vw 28vh #fff,
    71vw 17vh #dfe6ff,
    53vw 18vh #fff,
    73vw 39vh #fff,
    13vw 74vh #fff,
    47vw 12vh #fff,
    72vw 7vh #fff,
    63vw 87vh #ffeedd,
    99vw 40vh #ffeedd,
    74vw 58vh #dfe6ff,
    38vw 31vh #fff,
    89vw 99vh #fff,
    10vw 73vh #dfe6ff,
    67vw 63vh #dfe6ff,
    93vw 57vh #dfe6ff,
    77vw 9vh #fff,
    65vw 53vh #fff,
    96vw 43vh #fff,
    62vw 53vh #fff,
    85vw 9vh #dfe6ff,
    43vw 88vh #dfe6ff,
    76vw 63vh #ffeedd,
    8vw 11vh #dfe6ff,
    60vw 89vh #fff,
    7vw 93vh #dfe6ff,
    82vw 73vh #ffeedd,
    36vw 91vh #ffeedd,
    85vw 44vh #fff,
    59vw 45vh #fff,
    78vw 14vh #ffeedd,
    7vw 27vh #dfe6ff,
    16vw 94vh #fff,
    50vw 50vh #ffeedd,
    10vw 21vh #ffeedd,
    51vw 70vh #dfe6ff,
    17vw 55vh #dfe6ff,
    90vw 53vh #dfe6ff,
    87vw 48vh #fff,
    19vw 10vh #fff,
    19vw 29vh #fff,
    1vw 62vh #fff,
    33vw 36vh #fff,
    18vw 53vh #dfe6ff,
    78vw 72vh #dfe6ff,
    16vw 88vh #fff,
    58vw 99vh #ffeedd,
    50vw 51vh #ffeedd,
    13vw 61vh #ffeedd,
    7vw 24vh #fff,
    26vw 56vh #fff,
    14vw 43vh #fff,
    13vw 0vh #fff,
    68vw 12vh #dfe6ff,
    78vw 3vh #fff,
    26vw 78vh #ffeedd,
    19vw 81vh #dfe6ff,
    44vw 77vh #dfe6ff,
    60vw 15vh #fff,
    62vw 59vh #ffeedd,
    61vw 39vh #fff,
    18vw 13vh #dfe6ff,
    94vw 33vh #ffeedd,
    88vw 20vh #fff,
    26vw 67vh #dfe6ff,
    18vw 88vh #fff,
    97vw 67vh #dfe6ff,
    82vw 11vh #dfe6ff,
    66vw 46vh #fff,
    45vw 98vh #fff,
    68vw 69vh #dfe6ff,
    81vw 28vh #fff,
    30vw 51vh #fff,
    25vw 66vh #ffeedd,
    45vw 93vh #fff,
    3vw 35vh #ffeedd,
    33vw 24vh #dfe6ff,
    57vw 92vh #dfe6ff,
    46vw 10vh #fff,
    13vw 29vh #ffeedd,
    25vw 43vh #fff,
    61vw 79vh #fff,
    61vw 83vh #dfe6ff,
    82vw 10vh #fff,
    49vw 100vh #fff,
    61vw 22vh #ffeedd,
    81vw 42vh #fff,
    92vw 50vh #ffeedd,
    51vw 95vh #fff,
    92vw 20vh #fff,
    16vw 3vh #fff,
    75vw 59vh #fff,
    78vw 76vh #ffeedd,
    84vw 44vh #fff,
    70vw 70vh #fff,
    2vw 1vh #fff,
    67vw 95vh #fff,
    55vw 24vh #fff,
    3vw 32vh #fff,
    37vw 64vh #fff,
    97vw 75vh #dfe6ff;
}
.sky .s2 {
  width: 2px;
  height: 2px;
  box-shadow:
    33vw 69vh #ffeedd,
    16vw 7vh #dfe6ff,
    58vw 84vh #ffeedd,
    64vw 16vh #fff,
    67vw 65vh #fff,
    56vw 99vh #fff,
    77vw 0vh #fff,
    22vw 18vh #ffeedd,
    79vw 92vh #fff,
    71vw 7vh #dfe6ff,
    87vw 66vh #ffeedd,
    100vw 99vh #fff,
    71vw 7vh #fff,
    24vw 35vh #fff,
    98vw 12vh #ffeedd,
    71vw 3vh #fff,
    56vw 41vh #fff,
    88vw 35vh #ffeedd,
    65vw 68vh #ffeedd,
    64vw 31vh #dfe6ff,
    71vw 25vh #ffeedd,
    17vw 53vh #fff,
    50vw 56vh #dfe6ff,
    9vw 85vh #fff,
    54vw 9vh #fff,
    85vw 38vh #fff,
    99vw 19vh #dfe6ff,
    18vw 32vh #fff,
    59vw 28vh #fff,
    50vw 62vh #fff,
    85vw 28vh #fff,
    90vw 55vh #ffeedd,
    43vw 53vh #fff,
    45vw 40vh #fff,
    92vw 46vh #fff,
    43vw 70vh #ffeedd,
    56vw 90vh #fff,
    49vw 42vh #dfe6ff,
    65vw 8vh #fff,
    100vw 29vh #fff;
  animation: twinkle 4.5s ease-in-out infinite alternate;
}
.sky .s3 {
  width: 3px;
  height: 3px;
  box-shadow:
    10vw 33vh #dfe6ff,
    5vw 99vh #fff,
    34vw 96vh #fff,
    54vw 86vh #dfe6ff,
    51vw 19vh #ffeedd,
    89vw 41vh #fff,
    35vw 7vh #fff,
    54vw 9vh #dfe6ff,
    2vw 81vh #fff,
    33vw 10vh #fff,
    8vw 33vh #fff,
    58vw 1vh #dfe6ff,
    70vw 53vh #dfe6ff,
    79vw 16vh #fff;
  animation: twinkle 3s ease-in-out 1s infinite alternate;
}
@keyframes twinkle {
  from {
    opacity: 0.25;
  }
}
.sky .meteor {
  top: 8vh;
  left: 78vw;
  width: 110px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, transparent);
  opacity: 0;
  transform: rotate(-35deg);
  animation: meteor 11s linear 3s infinite;
}
.sky .meteor + .meteor {
  top: 34vh;
  left: 96vw;
  animation-duration: 17s;
  animation-delay: 9s;
}
@keyframes meteor {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-35deg);
  }
  2% {
    opacity: 1;
  }
  8% {
    opacity: 0;
    transform: translate(-45vw, 32vw) rotate(-35deg);
  }
  100% {
    opacity: 0;
    transform: translate(-45vw, 32vw) rotate(-35deg);
  }
}

h1,
h2,
h3 {
  margin: 0 0 0.4em;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
h1 {
  font-size: clamp(32px, 6vw, 56px);
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 18px;
}
p {
  margin: 0 0 0.8em;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--brand);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.lead {
  max-width: 52ch;
  font-size: 18px;
  color: var(--muted);
}
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--card);
}
.skip:focus {
  left: 8px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--sun);
  color: #2a2000;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--sun-d);
}

/* ---------- шапка ---------- */

.topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1120px;
  margin: 10px auto 0;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}
.brand-globe {
  width: 36px;
  height: 36px;
}
.brand-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.brand-name em {
  font-style: normal;
  color: var(--brand);
}

.nav {
  display: flex;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--muted);
  font-weight: 700;
  transition:
    background-color 0.15s,
    color 0.15s,
    transform 0.15s;
}
.nav-item:hover {
  color: var(--ink);
  background: var(--card-2);
}
.nav-item.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 0 var(--brand-d);
  transform: translateY(-1px);
}
.nav-item[data-role],
.feature[data-role] {
  display: none;
}
body[data-role='student'] .nav-item[data-role='student'],
body[data-role='teacher'] .nav-item[data-role='teacher'],
body[data-role='admin'] .nav-item[data-role='admin'],
body[data-role='student'] .feature[data-role='student'] {
  display: flex;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  box-shadow: 0 3px 0 var(--line);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.icon-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}
.account-btn {
  height: 42px;
  max-width: 160px;
  padding: 0 16px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--ok);
  color: #04281c;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--ok-d);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.account-btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.bulb {
  width: 26px;
  height: 26px;
  overflow: visible;
}
.bulb .rays {
  fill: none;
  stroke: #f0b429;
  stroke-width: 1.5;
  stroke-linecap: round;
  transform-origin: 12px 10px;
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.bulb .glass {
  fill: #ffe27a;
  stroke: #c58b0a;
  stroke-width: 1.4;
  transition:
    fill 0.3s,
    stroke 0.3s;
}
.bulb .fil {
  fill: none;
  stroke: #d9731a;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bulb .base {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}
:root[data-theme='dark'] .bulb .rays {
  opacity: 0;
  transform: scale(0.5);
}
:root[data-theme='dark'] .bulb .glass {
  fill: #2c2f4a;
  stroke: #8a8fb8;
}
:root[data-theme='dark'] .bulb .fil {
  stroke: #5b6090;
}
.bulb.flick .glass {
  animation: flick 0.5s steps(1);
}
@keyframes flick {
  0% {
    fill-opacity: 0.2;
  }
  20% {
    fill-opacity: 1;
  }
  40% {
    fill-opacity: 0.3;
  }
  60% {
    fill-opacity: 1;
  }
  80% {
    fill-opacity: 0.5;
  }
  100% {
    fill-opacity: 1;
  }
}

/* ---------- страницы ---------- */

main {
  overflow-x: clip;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.page.active > * {
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.page.active > :nth-child(2) {
  animation-delay: 0.06s;
}
.page.active > :nth-child(3) {
  animation-delay: 0.12s;
}
.page.active > :nth-child(4) {
  animation-delay: 0.18s;
}
.page.active > :nth-child(n + 5) {
  animation-delay: 0.24s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.gtiles > *,
.feature-grid > *,
.topics > *,
.lesson-list > *,
.task-list > * {
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.gtiles > :nth-child(2),
.feature-grid > :nth-child(2),
.topics > :nth-child(2),
.lesson-list > :nth-child(2),
.task-list > :nth-child(2) {
  animation-delay: 0.04s;
}
.gtiles > :nth-child(3),
.feature-grid > :nth-child(3),
.topics > :nth-child(3),
.lesson-list > :nth-child(3),
.task-list > :nth-child(3) {
  animation-delay: 0.08s;
}
.gtiles > :nth-child(4),
.feature-grid > :nth-child(4),
.topics > :nth-child(4),
.lesson-list > :nth-child(4),
.task-list > :nth-child(4) {
  animation-delay: 0.12s;
}
.gtiles > :nth-child(5),
.topics > :nth-child(5),
.lesson-list > :nth-child(5),
.task-list > :nth-child(5) {
  animation-delay: 0.16s;
}
.gtiles > :nth-child(n + 6),
.topics > :nth-child(n + 6),
.lesson-list > :nth-child(n + 6),
.task-list > :nth-child(n + 6) {
  animation-delay: 0.2s;
}

.page-heading {
  margin-bottom: 22px;
}
.sec-h {
  margin: 32px 0 14px;
  font-size: 24px;
}
.footer {
  padding: 22px 16px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.credit {
  display: block;
  margin-top: 4px;
}

/* ---------- карточки, кнопки, формы ---------- */

.card {
  position: relative;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card-head h2 {
  margin: 0;
}
.link {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 800;
}
.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.back {
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(var(--brand), var(--brand-d) 160%);
  color: #fff;
  font-weight: 800;
  box-shadow:
    0 5px 0 var(--brand-d),
    0 12px 20px -8px rgba(80, 50, 220, 0.55);
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    filter 0.15s;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--brand-d);
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn-ghost {
  background: var(--card-2);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
}
.btn-ghost:active {
  box-shadow: 0 1px 0 var(--line);
}
.btn-danger {
  background: linear-gradient(var(--rose), var(--rose-d) 160%);
  box-shadow: 0 5px 0 var(--rose-d);
}
.btn-danger:active {
  box-shadow: 0 1px 0 var(--rose-d);
}
.btn-small {
  padding: 7px 14px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--brand-d);
}
.btn-ghost.btn-small {
  box-shadow: 0 3px 0 var(--line);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  font-size: 14px;
  font-weight: 700;
  transition:
    transform 0.12s,
    background-color 0.15s;
}
.chip:hover {
  transform: translateY(-2px);
}
.chip.on {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 0 var(--brand-d);
}
.chips span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--brand-l);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type='checkbox'],
input[type='radio'] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--brand);
}
textarea {
  min-height: 110px;
  line-height: 1.45;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 4px var(--brand-l);
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 800;
}
.field small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bar,
.tbar,
.xpbar {
  display: block;
  height: 12px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 99px;
  background: var(--card-2);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.12);
}
.bar u,
.tbar u,
.xpbar u {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ok), var(--sky));
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.facts {
  margin: 0 0 8px;
}
.facts div {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-weight: 800;
}

.profile-grid,
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.profile-grid .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 200;
  max-width: 86vw;
  padding: 12px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.xp-pop {
  position: fixed;
  left: 50%;
  top: 96px;
  z-index: 300;
  padding: 8px 18px;
  border-radius: 99px;
  background: var(--ok);
  color: #04281c;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ok-d);
  pointer-events: none;
  animation: xp-up 1.1s ease-out forwards;
}
.xp-pop.bad {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 4px 0 var(--rose-d);
}
@keyframes xp-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -36px);
  }
}

/* ---------- главная ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 34px;
}
.hero h1 {
  max-width: 13ch;
  background: linear-gradient(100deg, var(--ink) 30%, var(--brand) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14);
}
.stat:nth-child(1) {
  background: var(--t3);
}
.stat:nth-child(2) {
  background: var(--t1);
}
.stat:nth-child(3) {
  background: var(--t2);
}
.stat-num {
  font-size: 24px;
  font-weight: 900;
}
.stat-cap {
  font-size: 12px;
  color: var(--muted);
}
.ic-flame {
  width: 24px;
  height: 24px;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 290px;
}
.globe-wrap {
  position: relative;
  width: min(300px, 74vw);
  aspect-ratio: 1;
  animation: float 7s ease-in-out infinite alternate;
}
@keyframes float {
  to {
    transform: translateY(-10px);
  }
}
.globe-wrap::before {
  content: '';
  position: absolute;
  inset: -22%;
  background: radial-gradient(closest-side, var(--halo), transparent);
}
.globe-wrap::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -14%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 20, 120, 0.35), transparent);
}
:root[data-theme='dark'] .globe-wrap::after {
  display: none;
}
.globe {
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #8fd8f5, #2f86c0 55%, #103d63);
  transition: opacity 0.4s;
}
.globe-wrap:has(canvas.ready) .globe {
  opacity: 0;
}
#planet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}
#planet:active {
  cursor: grabbing;
}
.sticker {
  position: absolute;
  right: 2%;
  bottom: 0;
  width: 100px;
  padding: 7px;
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 8px 0 rgba(0, 0, 0, 0.12),
    0 18px 26px -10px rgba(40, 20, 120, 0.5);
  transform: rotate(7deg);
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: rotate(3deg) translateY(-8px);
  }
}

.map-card .card-head {
  margin-bottom: 14px;
}
.map-preview {
  position: relative;
  text-align: center;
  cursor: pointer;
}
.kzprev {
  display: block;
  width: 100%;
  border-radius: 16px;
  transition: transform 0.3s;
}
.map-preview:hover .kzprev {
  transform: scale(1.01);
}
.mapopen-btn {
  margin-top: 12px;
}
.streak {
  display: none;
}

.feature-grid,
.gtiles,
.topics {
  perspective: 1000px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.feature {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  text-align: left;
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.14),
    0 16px 24px -14px rgba(40, 20, 120, 0.45);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.feature:nth-child(4n + 1) {
  background: var(--t1);
}
.feature:nth-child(4n + 2) {
  background: var(--t2);
}
.feature:nth-child(4n + 3) {
  background: var(--t3);
}
.feature:nth-child(4n) {
  background: var(--t4);
}
.feature:hover {
  transform: translateY(-5px) rotateX(5deg);
  box-shadow:
    0 11px 0 rgba(0, 0, 0, 0.14),
    0 24px 30px -14px rgba(40, 20, 120, 0.5);
}
.feature:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14);
}
.feature b {
  font-size: 19px;
  font-weight: 800;
}
.feature span:last-child {
  font-size: 13px;
  color: var(--muted);
}
.feature-num {
  font-size: 15px;
  font-weight: 900;
  color: var(--brand);
}

.daily {
  padding-top: 22px;
}
.daily-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.daily-h b {
  font-size: 21px;
  font-weight: 800;
}
.daily-h span {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
}
.dq {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.dq-t {
  flex: 1;
}
.dq-t b {
  font-size: 14px;
}
.dq-r {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: 800;
}
.dq-r em {
  font-size: 12px;
  font-style: normal;
  color: var(--sun-d);
}
.dq.done .dq-t b {
  text-decoration: line-through;
  opacity: 0.55;
}
.dq.done .dq-r {
  color: var(--ok-d);
}
.chest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.chest img {
  width: 50px;
  height: 54px;
  padding: 4px;
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}
.chest small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.chest.got b {
  color: var(--ok-d);
}

/* ---------- учёба ---------- */

.lrn-sum {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.lrn-sum span {
  color: var(--muted);
}

.topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.topic {
  --c: #6a4cff;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 12px 13px 32px;
  border: 1px solid var(--line);
  border-radius: 6px 16px 16px 6px;
  background:
    linear-gradient(90deg, var(--c) 0 18px, rgba(0, 0, 0, 0.25) 18px 20px, transparent 20px), var(--card);
  box-shadow:
    4px 0 0 -1px var(--card),
    4px 0 0 0 var(--line),
    var(--shadow);
  color: var(--ink);
  text-align: left;
  transform-origin: left center;
  transition: transform 0.22s;
}
.topic:hover {
  transform: rotateY(-10deg) translateY(-3px);
}
.topic:nth-child(6n + 1) {
  --c: #6a4cff;
}
.topic:nth-child(6n + 2) {
  --c: #ff4f78;
}
.topic:nth-child(6n + 3) {
  --c: #2f8cff;
}
.topic:nth-child(6n + 4) {
  --c: #ffb21e;
}
.topic:nth-child(6n + 5) {
  --c: #17c58a;
}
.topic:nth-child(6n) {
  --c: #14b8c4;
}
.topic b,
.feature b,
.gtile b {
  overflow-wrap: anywhere;
}
.topic b {
  font-size: 17px;
  font-weight: 800;
}
.topic small {
  font-size: 12px;
  color: var(--muted);
}
.topic em {
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  color: var(--brand);
}
.tno {
  font-size: 14px;
  font-weight: 900;
  color: var(--sun-d);
}
.tno.big {
  font-size: 42px;
}

.hub-btns {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}
.hubbtn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.hubbtn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.hubbtn b {
  font-size: 22px;
  font-weight: 800;
}
.hubbtn span {
  font-size: 13px;
  color: var(--muted);
}
.search {
  margin-bottom: 8px;
}
.term {
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}
.term b {
  font-size: 17px;
  font-weight: 800;
  color: var(--brand);
}
.term p {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.45;
}

.fc {
  height: 300px;
  cursor: pointer;
  perspective: 1000px;
}
.fc-in {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.fc.flip .fc-in {
  transform: rotateY(180deg);
}
.fc-f,
.fc-b {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
  text-align: center;
  backface-visibility: hidden;
}
.fc-b {
  background: var(--card-2);
  transform: rotateY(180deg);
}
.fc-f h2 {
  font-size: 26px;
}
.fc small {
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--sun-d);
}
.fc-b p {
  font-size: 17px;
  line-height: 1.45;
}

.lvgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 10px;
}
.lv {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, var(--card), var(--card-2) 75%);
  box-shadow:
    0 6px 0 var(--line),
    0 14px 18px -10px rgba(40, 20, 120, 0.45),
    inset 0 -4px 8px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.lv:hover {
  transform: translateY(-3px);
}
.lv:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--line);
}
.lv b {
  font-size: 20px;
  font-weight: 900;
}
.lv span {
  display: flex;
}
.lv .ic {
  width: 13px;
  height: 13px;
}
.lv.done {
  background: radial-gradient(circle at 35% 28%, #7df0c4, var(--ok) 70%);
  box-shadow:
    0 6px 0 var(--ok-d),
    0 14px 18px -10px rgba(14, 150, 103, 0.6);
  color: #04281c;
}
.lv.lock {
  opacity: 0.45;
}
.stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 0 8px;
}
.stars .ic {
  width: 38px;
  height: 38px;
}

.lesson-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.lesson-card {
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.lesson-card b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}
.lesson-card span {
  font-size: 14px;
  color: var(--muted);
}
.lesson-card em {
  float: right;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  color: var(--sun-d);
}
.article h1 {
  font-size: 32px;
}
.article .fact,
.note,
.mapinfo .fact {
  padding: 13px 15px;
  border-radius: 6px 16px 16px 6px;
  border-left: 5px solid var(--sun);
  background: var(--card-2);
}
.article .fact {
  margin-top: 14px;
}
.quiz-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.region-detail {
  margin-top: 14px;
}

/* ---------- игры и полноэкранные окна ---------- */

.gfs,
.mapfs {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: none;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}
.gfs.open,
.mapfs.open {
  display: flex;
  animation: pop-in 0.25s ease-out;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}
.g-top {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 16px 8px;
}
.g-top b {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
}
.g-hud {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
}
.g-hud .ic {
  width: 20px;
  height: 20px;
}
.g-bar {
  width: calc(100% - 32px);
  max-width: 788px;
  height: 12px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 99px;
  background: var(--card-2);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.12);
}
.g-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sun), var(--rose));
}
.g-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  overflow: auto;
}
.g-q {
  font-weight: 800;
  color: var(--muted);
}
.g-text {
  margin: 4px 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}
.g-text small {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--sun-d);
}
.g-ans {
  display: grid;
  gap: 12px;
}
.g-ans.two {
  grid-template-columns: 1fr 1fr;
}
.g-btn {
  width: 100%;
  min-height: 60px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 5px 0 var(--line);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    background-color 0.15s;
}
.g-btn:hover:not(:disabled) {
  background: var(--card-2);
}
.g-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--line);
}
.g-ans.two .g-btn {
  min-height: 90px;
  font-size: 19px;
  text-align: center;
}
.g-btn.go {
  border: 0;
  background: linear-gradient(var(--brand), var(--brand-d) 160%);
  box-shadow: 0 5px 0 var(--brand-d);
  color: #fff;
  text-align: center;
}
.g-btn.good {
  border-color: transparent;
  background: var(--ok-bg);
  box-shadow: 0 5px 0 var(--ok);
  animation: nod 0.35s;
}
.g-btn.bad {
  border-color: transparent;
  background: var(--bad-bg);
  box-shadow: 0 5px 0 var(--rose);
  animation: shake 0.35s;
}
@keyframes nod {
  40% {
    transform: translateY(-4px);
  }
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.g-fb {
  text-align: center;
}
.g-fb p {
  margin: 6px 0;
}
.g-big,
.meme-reaction {
  display: block;
  margin: 0 auto;
  padding: 7px;
  border-radius: 22px;
  background: #fff;
  object-fit: contain;
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.12),
    0 16px 22px -10px rgba(40, 20, 120, 0.4);
}
.g-big {
  width: 170px;
  height: 180px;
  animation: bounce-in 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.meme-reaction {
  width: 110px;
  height: 120px;
  animation: bounce-in 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}
@keyframes bounce-in {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-6deg);
  }
}

.gtiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.gtile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 16px;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  text-align: left;
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.14),
    0 16px 24px -14px rgba(40, 20, 120, 0.45);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.gtile:nth-child(5n + 1) {
  background: var(--t1);
}
.gtile:nth-child(5n + 2) {
  background: var(--t2);
}
.gtile:nth-child(5n + 3) {
  background: var(--t3);
}
.gtile:nth-child(5n + 4) {
  background: var(--t4);
}
.gtile:nth-child(5n) {
  background: var(--t5);
}
.gtile:hover {
  transform: translateY(-5px) rotateX(5deg);
  box-shadow:
    0 11px 0 rgba(0, 0, 0, 0.14),
    0 24px 30px -14px rgba(40, 20, 120, 0.5);
}
.gtile:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14);
}
.gtile img {
  width: 68px;
  height: 74px;
  padding: 4px;
  border-radius: 16px;
  background: #fff;
  object-fit: contain;
}
.gtile b {
  font-size: 17px;
  font-weight: 800;
}
.gtile span {
  font-size: 12px;
  color: var(--muted);
}
.gtile em {
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  color: var(--brand);
}
.gtile.top {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: var(--sun);
  color: #2a2000;
}
.gtile.top span {
  color: #5a4600;
}

.hang {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 6px 0;
}
.hang span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 38px;
  border-bottom: 3px solid var(--ink);
  font-size: 22px;
  font-weight: 800;
}
.kbd {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.kbd button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--line);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}
.kbd button:active {
  transform: translateY(3px);
  box-shadow: none;
}
.kbd .good {
  background: var(--ok-bg);
}
.kbd .bad {
  background: var(--bad-bg);
  opacity: 0.6;
}
.shape {
  display: block;
  width: 100%;
  max-height: 200px;
  margin: 10px auto 4px;
}
.pairs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pc {
  min-height: 78px;
  padding: 4px;
  border: 0;
  border-radius: 16px;
  background: var(--brand);
  box-shadow: 0 5px 0 var(--brand-d);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.1s;
}
.pc:active {
  transform: translateY(4px);
}
.pc.o {
  background: var(--card);
  box-shadow: 0 5px 0 var(--sun);
  color: var(--ink);
}
.pc.m {
  background: var(--ok-bg);
  box-shadow: none;
  color: var(--ink);
  opacity: 0.8;
}
.lb-me {
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--brand-l);
  font-weight: 800;
}
.lb-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

.mclose {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--line);
}
.mclose:active {
  transform: translateY(3px);
  box-shadow: none;
}
.mclose .ic {
  width: 20px;
  height: 20px;
}

/* ---------- карта ---------- */

.mapbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  font-size: 20px;
  font-weight: 800;
}
.mapview {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.mapview canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.maplayers {
  position: absolute;
  left: 10px;
  top: 8px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.maplayers button {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--line);
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.maplayers button.on {
  border-color: transparent;
  background: var(--brand);
  box-shadow: 0 3px 0 var(--brand-d);
  color: #fff;
}
.minpanel {
  position: absolute;
  left: 10px;
  top: 52px;
  right: 66px;
  z-index: 4;
  max-width: 460px;
  max-height: 42%;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
}
.minpanel[hidden] {
  display: none;
}
.mp-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mp-h b {
  font-size: 14px;
}
.mp-h button {
  margin-left: 5px;
  padding: 5px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--card-2);
  font-size: 12px;
  font-weight: 800;
}
.mp-c {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mp-c button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  font-size: 12px;
  font-weight: 700;
}
.mp-c button.on {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}
.mp-c i {
  display: block;
  width: 11px;
  height: 11px;
  border: 1.5px solid #fff;
  border-radius: 3px;
  transform: rotate(45deg);
}
.mapctl {
  position: absolute;
  right: 12px;
  top: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
}
.mapctl button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: 0 4px 0 var(--line);
  font-size: 22px;
}
.mapctl button:active {
  transform: translateY(4px);
  box-shadow: none;
}
.city-info {
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--card-2);
  font-size: 14px;
}
.mapinfo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  width: 100%;
  max-width: 820px;
  max-height: 38vh;
  margin: 0 auto;
  padding: 16px;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: var(--card);
  box-shadow: 0 -12px 30px -14px rgba(40, 20, 120, 0.45);
  animation: sheet 0.28s ease-out;
}
.mapinfo:empty {
  display: none;
}
@keyframes sheet {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
}
.mapinfo small {
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--brand);
}
.mapinfo .ct {
  display: block;
  margin: 2px 0 6px;
  font-size: 22px;
  font-weight: 800;
}
.mapinfo p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- маскот, приветствие ---------- */

.mascot {
  position: fixed;
  left: 12px;
  bottom: 90px;
  z-index: 95;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.mascot.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.mascot img {
  width: 66px;
  height: 74px;
  padding: 5px;
  border-radius: 18px;
  background: #fff;
  object-fit: contain;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.12),
    0 14px 20px -8px rgba(40, 20, 120, 0.5);
}
.mascot-bubble {
  order: 2;
  max-width: 230px;
  padding: 11px 14px;
  border-radius: 18px 18px 18px 4px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
  font-weight: 600;
}
body.mapopen .mascot {
  top: 104px;
  bottom: auto;
}
body.mapopen .mascot img {
  width: 48px;
  height: 54px;
}
body.gopen .mascot {
  display: none;
}

.onb {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  background: rgba(12, 9, 36, 0.72);
  animation: pop-in 0.25s;
}
.onb-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
  text-align: center;
  animation: bounce-in 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.onb-card > img {
  width: 140px;
  height: 150px;
  padding: 7px;
  border-radius: 22px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
}
.onb-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0;
}
.onb-dots i {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--line);
  transition: width 0.2s;
}
.onb-dots i.on {
  width: 24px;
  background: var(--brand);
}
.text-button {
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
}

/* ---------- вход и регистрация ---------- */

.auth {
  text-align: left;
}
.auth h2 {
  text-align: center;
}
.seg {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 16px;
  background: var(--card-2);
}
.seg button {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 12px;
  background: none;
  font-weight: 800;
  color: var(--muted);
}
.seg .on {
  background: var(--brand);
  box-shadow: 0 3px 0 var(--brand-d);
  color: #fff;
}
.auerr {
  min-height: 20px;
  margin: 6px 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--rose);
}
.auth .btn {
  width: 100%;
}
.auth .text-button {
  display: block;
  margin: 6px auto 0;
}
.pw {
  position: relative;
}
.pw button {
  position: absolute;
  right: 8px;
  top: 9px;
  padding: 6px 8px;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
}

/* ---------- задания и кабинет учителя ---------- */

.task-list {
  display: grid;
  gap: 12px;
}
.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.task:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.task b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}
.task small {
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--card-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.ok {
  background: var(--ok-bg);
  color: var(--ok-d);
}
.badge.new {
  background: var(--t3);
  color: var(--sun-d);
}
.badge.warn {
  background: var(--bad-bg);
  color: var(--rose-d);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tab {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-weight: 800;
}
.tab.on {
  border-color: transparent;
  background: var(--brand);
  box-shadow: 0 4px 0 var(--brand-d);
  color: #fff;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.tcard h3 {
  margin: 0 0 4px;
}

.editor fieldset {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.editor legend {
  padding: 0 8px;
  font-size: 17px;
  font-weight: 800;
}
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}
.grade-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.grade-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.term-row {
  display: grid;
  grid-template-columns: 1fr 2fr 38px;
  gap: 8px;
  margin-bottom: 8px;
}
.q-block {
  margin-bottom: 14px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 16px;
}
.opt-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.x-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--rose);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.note {
  margin-bottom: 14px;
}
.card-text p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- адаптив ---------- */

.sky .s1,
.sky .s2,
.sky .s3,
.sky .meteor,
.sky .sun,
.sky .cloud,
.sky .flock {
  display: none;
}
:root[data-theme='dark'] .sky .s1,
:root[data-theme='dark'] .sky .s2,
:root[data-theme='dark'] .sky .s3,
:root[data-theme='dark'] .sky .meteor {
  display: block;
}
:root[data-theme='light'] .sky .sun,
:root[data-theme='light'] .sky .cloud {
  display: block;
}
:root[data-theme='light'] .sky .flock {
  display: flex;
}

.sky .sun {
  top: 64px;
  right: 8vw;
  left: auto;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle at 38% 34%, #fffbe0, #ffe27a 55%, #ffc93c);
  box-shadow:
    0 0 50px 26px rgba(255, 214, 90, 0.5),
    0 0 140px 70px rgba(255, 230, 150, 0.35);
}
.sky .sun::before {
  content: '';
  position: absolute;
  inset: -52px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 224, 120, 0.32) 0 6deg, transparent 6deg 22deg);
  -webkit-mask: radial-gradient(closest-side, transparent 52%, #000 53%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 52%, #000 53%, transparent 100%);
  animation: sun-spin 80s linear infinite;
}
@keyframes sun-spin {
  to {
    transform: rotate(360deg);
  }
}

.sky .cloud {
  top: var(--y);
  left: 0;
  width: 150px;
  height: 44px;
  border-radius: 44px;
  background: #fff;
  opacity: 0.92;
  box-shadow: 0 10px 18px -6px rgba(90, 140, 200, 0.35);
  animation: cloud var(--t) linear var(--d) infinite;
}
.sky .cloud::before,
.sky .cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: #fff;
}
.sky .cloud::before {
  left: 22px;
  top: -28px;
  width: 66px;
  height: 66px;
}
.sky .cloud::after {
  left: 66px;
  top: -42px;
  width: 84px;
  height: 84px;
}
.sky .c1 {
  --y: 14vh;
  --s: 1.1;
  --t: 150s;
  --d: -40s;
}
.sky .c2 {
  --y: 34vh;
  --s: 0.7;
  --t: 210s;
  --d: -130s;
  opacity: 0.7;
}
.sky .c3 {
  --y: 58vh;
  --s: 1.5;
  --t: 120s;
  --d: -90s;
  opacity: 0.85;
}
.sky .c4 {
  --y: 80vh;
  --s: 0.9;
  --t: 180s;
  --d: -20s;
  opacity: 0.6;
}
@keyframes cloud {
  from {
    transform: translateX(-320px) scale(var(--s));
  }
  to {
    transform: translateX(calc(100vw + 40px)) scale(var(--s));
  }
}

.sky .flock {
  position: absolute;
  top: 24vh;
  left: 0;
  gap: 18px;
  animation: flock 70s linear -15s infinite;
}
.sky .flock svg {
  width: 26px;
  height: 12px;
  fill: none;
  stroke: #35507a;
  opacity: 0.55;
  stroke-width: 1.8;
  stroke-linecap: round;
  animation: flap 0.9s ease-in-out infinite alternate;
}
.sky .flock svg:nth-child(2) {
  margin-top: 16px;
  animation-delay: -0.3s;
}
.sky .flock svg:nth-child(3) {
  margin-top: -6px;
  animation-delay: -0.6s;
}
@keyframes flock {
  from {
    transform: translate(-120px, 30px);
  }
  to {
    transform: translate(calc(100vw + 60px), -70px);
  }
}
@keyframes flap {
  to {
    transform: scaleY(0.45);
  }
}

@media (max-width: 719px) {
  body {
    padding-bottom: 84px;
  }
  .topbar {
    top: 0;
    margin: 0;
    border-width: 0 0 1px;
    border-radius: 0 0 20px 20px;
  }
  .nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    justify-content: space-around;
    gap: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow-lift);
  }
  .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 7px 10px;
    font-size: 11px;
  }
  .nav-item .ic {
    width: 22px;
    height: 22px;
  }
  .brand-name {
    font-size: 21px;
  }
  .mascot {
    bottom: 96px;
  }
  .toast {
    bottom: 104px;
  }
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    margin-bottom: 46px;
  }
  .home-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .profile-grid {
    grid-template-columns: 1fr 1fr;
  }
  .topics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lesson-list {
    grid-template-columns: 1fr 1fr;
  }
  .gtiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lvgrid {
    grid-template-columns: repeat(6, 1fr);
  }
  .hub-btns {
    grid-template-columns: repeat(3, 1fr);
  }
  .mascot {
    bottom: 22px;
  }
  .toast {
    bottom: 28px;
  }
  .kzprev {
    max-height: 520px;
    object-fit: contain;
  }
}

@media (min-width: 960px) {
  .feature-grid,
  .topics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  main,
  .topbar {
    max-width: 1280px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .topbar {
    position: static;
  }
  .mascot {
    display: none;
  }
}

@media (max-height: 500px) and (orientation: landscape) and (max-width: 719px) {
  body {
    padding-bottom: 66px;
  }
  .nav {
    padding: 3px;
  }
  .nav-item {
    flex-direction: row;
    padding: 6px 18px;
  }
  .nav-item span {
    display: none;
  }
}

@media (max-width: 520px) {
  .stat-row {
    gap: 8px;
  }
  .stat {
    padding: 8px 11px;
  }
  .grid2,
  .grade-row {
    grid-template-columns: 1fr;
  }
  .term-row {
    grid-template-columns: 1fr 38px;
  }
  .term-row input:nth-child(2) {
    grid-column: 1 / 2;
  }
  .brand-globe {
    width: 32px;
    height: 32px;
  }
  .account-btn {
    max-width: 110px;
  }

  .sky .sun {
    top: 70px;
    right: 6vw;
    width: 76px;
    height: 76px;
  }
}

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

.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.35;
}
.consent input {
  margin-top: 3px;
  flex: none;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.stat-grid .card {
  text-align: center;
}
.stat-grid b {
  display: block;
  font-size: 1.7rem;
}
.admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.admin-tools input,
.admin-tools select {
  min-width: 0;
}
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  line-height: 1.6;
}
.legal h2 {
  margin-top: 1.6em;
}
.admin-tools input {
  flex: 1 1 180px;
}
.admin-tools select {
  flex: 0 1 180px;
}
