:root {
  color-scheme: dark;
  --ink: #f7f4ea;
  --muted: #d6ddd9;
  --panel: rgba(11, 16, 19, .78);
  --line: rgba(255, 255, 255, .18);
  --accent: #e8b44b;
  --good: #5fc79c;
  --danger: #eaa493;
  --shadow: 0 18px 50px rgba(0, 0, 0, .36);
  /* Высота кнопок в шапке списка разделов: «Обучение» и сворачивание должны
     быть одинаковыми, поэтому размер один на двоих. */
  --head-btn: 30px;
  /* Ширина левой колонки: табличка с названием раздела стоит ровно над списком
     разделов, и обе должны быть одной ширины. */
  --sidebar-w: 244px;
}

* {
  box-sizing: border-box;
}

/* Скрытое остаётся скрытым. Любое правило с display у класса перебивает
   атрибут hidden (браузер задаёт его самым слабым правилом), и элемент
   «оживает» — так, например, вылезала кнопка «Убрать» у пустого поля картинки.
   Поэтому фиксируем поведение один раз здесь, а не в каждом блоке. */
[hidden] {
  display: none !important;
}

html,
body,
.app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #070a0d;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 1px solid var(--line);
  background: rgba(12, 18, 22, .8);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: rgba(255, 255, 255, .36);
  background: rgba(28, 38, 44, .92);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.landing-page {
  height: auto;
  min-height: 100%;
  overflow: auto;
}

.landing {
  min-height: 100vh;
  background: #070a0d;
}

.landing-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.landing-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 9, .72), rgba(4, 7, 9, .2) 56%, rgba(4, 7, 9, .55)),
    linear-gradient(180deg, rgba(4, 7, 9, .12), rgba(4, 7, 9, .72));
}

.landing-nav {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 72px);
}

.brand-link {
  font-size: 18px;
  font-weight: 900;
}

/* Кнопка входа в шапке. Раньше она была почти невидимой — так вход прятали на
   время закрытого теста. Тест кончился, страница продаёт продукт, и главное
   действие обязано быть видно с первого экрана: посетитель, который уже всё
   решил, не должен искать, куда нажать. */
.nav-login {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(232, 180, 75, .5);
  border-radius: 999px;
  background: rgba(232, 180, 75, .14);
  color: var(--ink);
  font-weight: 800;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease;
}

.nav-login:hover {
  border-color: var(--accent);
  background: rgba(232, 180, 75, .26);
  color: var(--ink);
}

.nav-login:focus-visible {
  background: rgba(12, 18, 22, .8);
  color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Одноэкранный hero: две колонки — питч и форма */
.hero-grid {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: clamp(6px, 1.5vh, 20px) clamp(20px, 5vw, 72px);
  min-height: 0;
}

.hero-pitch {
  max-width: 640px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(232, 180, 75, .32);
  background: rgba(232, 180, 75, .12);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.hero-pitch h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 1.03;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .5);
}

.hero-pitch .lead {
  max-width: 560px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.4;
  text-wrap: pretty;
  text-shadow: 0 1px 16px rgba(0, 0, 0, .4);
}

.value-points {
  display: grid;
  gap: 10px;
  max-width: 560px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.value-points li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(13, 18, 22, .46);
  color: var(--muted);
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.42;
  backdrop-filter: blur(6px);
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}

.value-points li:hover {
  border-color: rgba(232, 180, 75, .38);
  background: rgba(18, 24, 28, .62);
  transform: translateX(3px);
}

.value-points strong {
  color: var(--ink);
  font-weight: 800;
}

.vp-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(232, 180, 75, .9), rgba(214, 150, 50, .82));
  color: #1c1305;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(232, 180, 75, .28);
}

.hero-form-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  justify-self: end;
}

.waitlist-form {
  display: grid;
  gap: 0; /* интервалы заданы margin'ами ниже — чтобы сворачиваемые поля
            не оставляли пустой зазор, когда скрыты */
  width: 100%;
  padding: clamp(20px, 2vw, 28px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(232, 180, 75, .08), transparent 60%),
    rgba(9, 13, 16, .76);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .46);
  backdrop-filter: blur(16px);
}

/* Равномерные интервалы между блоками формы (замена grid-gap) */
.waitlist-form > * + * {
  margin-top: 14px;
}

/* Плавное появление/скрытие полей «предмет» и «другое» — без скачков.
   Анимируем высоту строки сетки (0fr→1fr), отступ и прозрачность.
   Пока поле свёрнуто — margin:0 и высота 0, поэтому лишнего зазора нет. */
.waitlist-form .collapsible {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  transition: grid-template-rows .32s ease, margin-top .32s ease, opacity .26s ease;
}

.waitlist-form .collapsible.is-open {
  grid-template-rows: 1fr;
  margin-top: 14px;
  opacity: 1;
}

.collapsible-inner {
  overflow: hidden;
  min-height: 0;
}

/* После раскрытия снимаем обрезку, чтобы не срезалось кольцо фокуса у поля */
.waitlist-form .collapsible.is-open .collapsible-inner {
  overflow: visible;
  transition: overflow 0s .32s;
}

.form-head {
  display: grid;
  gap: 6px;
  margin-bottom: 2px;
}

.form-head h2 {
  margin: 0;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.1;
}

.form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.waitlist-form .field {
  display: grid;
  gap: 6px;
}

.waitlist-form .field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.waitlist-form input,
.waitlist-form select,
.login-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-size: 16px; /* >=16px — иначе iOS зумит поле при фокусе */
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Мягкое, приятное кольцо фокуса вместо жёсткого контура */
.waitlist-form input:focus,
.waitlist-form input:focus-visible,
.select-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* Кастомный выпадающий список */
.select {
  position: relative;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.select-trigger:hover {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(6, 10, 12, .7);
}

.select.is-open .select-trigger {
  border-color: var(--accent);
}

/* Когда снизу мало места — список раскрывается вверх (JS добавляет .is-up) */
.select.is-up .select-list {
  top: auto;
  bottom: calc(100% + 6px);
}

.select-value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-value.is-placeholder {
  color: rgba(214, 221, 217, .5);
}

.select-arrow {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  transition: transform .2s ease;
}

.select.is-open .select-arrow {
  transform: rotate(180deg);
}

.select-list {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 264px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 18, 22, .98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: select-pop .14s ease;
}

@keyframes select-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 7px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
}

.select-option.is-active {
  background: rgba(255, 255, 255, .08);
}

.select-option[aria-selected="true"] {
  color: var(--accent);
  font-weight: 800;
}

.select-option[aria-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  font-weight: 900;
}

.waitlist-form .consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.waitlist-form .consent input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.waitlist-form .consent a {
  color: var(--accent);
  text-decoration: underline;
}

.waitlist-form .consent a:hover {
  text-decoration: none;
}

/* Атрибут hidden должен скрывать поля, несмотря на display:grid у .field */
.waitlist-form .field[hidden],
.field-error[hidden],
.select-list[hidden] {
  display: none;
}

/* Деликатные подсказки рядом с полями — не кричащие, но заметные */
.field-error {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  animation: error-fade .22s ease;
}

@keyframes error-fade {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.field-error::before {
  content: "i";
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(234, 164, 147, .18);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
}

.field.is-error input,
.field.is-error .select-trigger {
  border-color: rgba(234, 164, 147, .65);
}

.consent-wrap.is-error .consent {
  color: var(--danger);
}

.consent-wrap.is-error .consent input[type="checkbox"] {
  outline: 2px solid rgba(234, 164, 147, .55);
  outline-offset: 2px;
  border-radius: 4px;
}

.form-note.is-good {
  color: var(--good);
  font-weight: 600;
}

.form-note.is-bad {
  color: var(--danger);
  font-weight: 600;
}

.waitlist-submit {
  min-height: 54px;
  margin-top: 18px;
  border-radius: 12px;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1c1305;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(232, 180, 75, .26);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.waitlist-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(232, 180, 75, .36);
  transform: translateY(-1px);
  background: linear-gradient(145deg, #f3c873, #e6ad45);
  border-color: transparent;
}

.waitlist-submit:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(232, 180, 75, .24);
}

.login-form button[type="submit"] {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 10px;
  background: rgba(232, 180, 75, .92);
  border-color: rgba(232, 180, 75, .92);
  color: #161006;
  font-weight: 900;
}

.login-form button[type="submit"]:hover {
  background: rgba(242, 196, 96, 1);
  border-color: rgba(242, 196, 96, 1);
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .4);
}

.hero-footer {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: var(--muted);
  font-size: 13px;
}

.hero-footer p {
  margin: 0;
}

.hero-footer a {
  color: var(--muted);
  text-decoration: underline;
}

.hero-footer a:hover {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #161006;
  font-weight: 900;
  transition: top .15s ease;
}

.skip-link:focus {
  top: 12px;
}

.login-dialog {
  width: min(420px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 16, 19, .96);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, .62);
}

.login-form {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 10px;
}

.login-form h2 {
  margin: 0 40px 4px 0;
  font-size: 26px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.login-form p {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
}

.dialog-close {
  position: absolute;
  right: 6px;
  top: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

/* Глиф/иконка во всех кнопках управления — строго по центру.
   place-items центрирует по осям, line-height:1 убирает вертикальный сдвиг. */
.viewer-actions button,
.chrome-toggle,
.back-button,
.panel-toggle,
.dialog-close,
#closeObject,
#objectNext,
.quest-next {
  display: grid;
  place-items: center;
  line-height: 1;
}

.is-hidden {
  display: none;
}

/* Страница документа (политика обработки ПДн) */
.doc-page {
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: #070a0d;
}

.doc-nav {
  padding: 20px clamp(18px, 6vw, 86px);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.doc {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.doc h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
}

.doc-meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.doc section {
  margin-bottom: 28px;
}

.doc h2 {
  margin: 0 0 10px;
  font-size: clamp(19px, 3vw, 23px);
}

.doc p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.doc ul {
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.doc li {
  margin-bottom: 6px;
}

.doc a {
  color: var(--accent);
  text-decoration: underline;
}

.doc a:hover {
  text-decoration: none;
}

.doc-back {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

/* ---------- Юридические страницы: оферта, соглашение, политика, согласие,
   cookie, возврат, реквизиты ----------
   Светлые, в отличие от остальных страниц на .doc-page (админка, конструктор,
   тарифы, личный кабинет — они часть тёмного интерфейса). Это документы: их
   читают подряд, печатают и сверяют, и на белом фоне длинный текст читается
   заметно легче. Шапка остаётся тёмной, чтобы страница узнавалась как часть
   сайта. Поэтому светлая тема висит на отдельном классе is-legal, а не на
   .doc-page: иначе побелела бы вся служебная часть сайта. */
.doc-page.is-legal {
  background: #ffffff;
  color: #3d4855;
}

.is-legal .doc-nav {
  padding: 18px clamp(18px, 6vw, 86px);
  background: #0b1014;
}

.is-legal .doc {
  padding: clamp(36px, 5vw, 56px) 0 72px;
}

.is-legal .doc h1 {
  margin-bottom: 8px;
  color: #101820;
  font-size: clamp(26px, 4.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.is-legal .doc-meta {
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e3e7eb;
  color: #6a7683;
  line-height: 1.55;
}

.is-legal .doc section { margin-bottom: 30px; }

.is-legal .doc h2 {
  margin-bottom: 12px;
  color: #101820;
  font-size: clamp(18px, 2.6vw, 22px);
  line-height: 1.3;
}

.is-legal .doc p,
.is-legal .doc ul,
.is-legal .doc ol {
  color: #3d4855;
  line-height: 1.7;
}

.is-legal .doc ol { margin: 0 0 12px; padding-left: 22px; }
.is-legal .doc li { margin-bottom: 8px; }
.is-legal .doc a { color: #7a5406; }
.is-legal .doc strong { color: #101820; }

/* Таблица «поле — значение»: реквизиты, состав cookie. */
.is-legal .doc-facts {
  display: grid;
  gap: 1px;
  margin: 0 0 12px;
  background: #e3e7eb;
  border: 1px solid #e3e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.is-legal .doc-facts > div {
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr);
  padding: 14px 18px;
  background: #ffffff;
}

@media (max-width: 640px) {
  .is-legal .doc-facts > div { grid-template-columns: minmax(0, 1fr); }
}

.is-legal .doc-facts dt { color: #6a7683; font-size: 14px; }
.is-legal .doc-facts dd { margin: 0; color: #101820; font-size: 15px; line-height: 1.5; }

.is-legal .doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #e3e7eb;
  font-size: 15px;
}

.is-legal .doc-back {
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
  color: #6a7683;
}

/* Незаполненный реквизит виден и на светлой странице, и в подвале главной:
   значения подставляет scripts/fill_requisites.js, и до этого в документе
   не должно быть ничего похожего на настоящий ИНН. */
.doc-fill {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(232, 180, 75, .22);
  border-bottom: 1px dashed #b4881f;
  color: #7a5406;
  font-weight: 700;
  white-space: nowrap;
}

.lp-footer-legal .doc-fill { color: #e8b44b; background: rgba(232, 180, 75, .14); }

/* ---------- Админ-панель ---------- */
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-logout {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.admin {
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.admin h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}

.admin-sub {
  margin: 8px 0 20px;
  color: var(--muted);
}

.admin-login {
  max-width: 380px;
}

.admin-login-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.admin-login-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.admin-login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}

.admin-login-form button {
  min-height: 48px;
  margin-top: 4px;
  border-radius: 10px;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1c1305;
  font-weight: 900;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-count {
  color: var(--accent);
}

.admin-muted {
  color: rgba(255, 255, 255, .45);
  font-size: .9em;
}

.admin-badge {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: .72em;
  font-weight: 800;
  vertical-align: middle;
  color: #070a0d;
  background: var(--accent);
}

.admin-refresh {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: #0d1316;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, .03);
}

.admin-empty {
  margin-top: 16px;
  color: var(--muted);
}

/* Фильтры по столбцам таблицы (вкладка «Покупки»).
   Строка фильтров НЕ липкая, в отличие от шапки: две липкие строки подряд
   наезжали бы друг на друга при прокрутке. */
.admin-table tr.admin-filters th {
  position: static;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .02);
  text-transform: none;
  letter-spacing: 0;
  vertical-align: top;
  /* У ячеек таблицы стоит nowrap — с ним два поля («с/по», «от/до») остаются
     на одной строке, вылезают из столбца и наезжают на соседний. */
  white-space: normal;
}

.admin-table tr.admin-filters input,
.admin-table tr.admin-filters select {
  /* Блочные: каждое поле занимает свою строку в ячейке и ровно её ширину. */
  display: block;
  width: 100%;
  min-width: 96px;
  min-height: 34px;
  padding: 0 8px;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

/* Списку нужно место под собственную стрелку браузера, иначе выбранное
   значение обрезается многоточием. */
.admin-table tr.admin-filters select {
  min-width: 132px;
}

/* Две даты и «от/до» по сумме — в одном столбце друг под другом. */
.admin-table tr.admin-filters input + input {
  margin-top: 6px;
}

.admin-table tr.admin-filters input:focus,
.admin-table tr.admin-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.admin-section {
  margin-top: 40px;
}

.admin-section h2 {
  margin: 0;
  font-size: clamp(18px, 3vw, 22px);
}

.admin-hint {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

/* Карточки статистики */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  /* Снизу отступ обязателен: сразу под плитками статистики идёт меню разделов,
     и без него две разные полосы читались как одна. */
  margin: 24px 0 30px;
}

.stat-card {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(13, 18, 22, .6);
}

.stat-val {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.stat-key {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* Форма создания пользователя */
.admin-user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-user-form input {
  flex: 1 1 200px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.admin-user-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}

.admin-user-form button {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1c1305;
  font-weight: 900;
}

/* Вторичная кнопка генерации пароля — контурная, не отвлекает от «Создать». */
.admin-user-form button.btn-generate {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.admin-user-form button.btn-generate:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-ok {
  margin: 4px 0 12px;
  color: var(--good);
  font-size: 14px;
  font-weight: 600;
}

/* Кнопки действий в таблице */
.admin-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.admin-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.admin-actions button.danger {
  border-color: rgba(234, 164, 147, .5);
  color: var(--danger);
}

.admin-actions button.danger:hover {
  background: rgba(234, 164, 147, .12);
  border-color: var(--danger);
}

.map-screen,
.panorama-screen {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* учитывает адрес-бар мобильных браузеров */
  overflow: hidden;
}

/* Свой жест перетаскивания карты — отключаем браузерные жесты прокрутки/зума. */
.map-screen {
  touch-action: none;
}

.world-art,
.world-art-fill,
#gl {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#gl {
  background: #000;
  touch-action: none;
}

.world-art {
  /* Фон раздела показывается ЦЕЛИКОМ и ничего не обрезает (contain), поэтому
     карта не «сжимается» и не теряет края, а метки уровней (они считаются по
     тем же contain-пропорциям в positionMapPoints) точно ложатся на объекты.
     Пустоту по бокам при неподходящих пропорциях экрана закрывает .world-art-fill,
     так что визуально фон всё равно занимает весь экран. */
  object-fit: contain;
  transform-origin: 0 0;
  z-index: 1;
}

/* Размытая копия того же фона: заполняет вьюпорт целиком (cover) и стоит ПОД
   основным изображением — благодаря ей нет чёрных полос, но сам фон не режется. */
.world-art-fill {
  object-fit: cover;
  z-index: 0;
  filter: blur(26px) saturate(1.05) brightness(.72);
  transform: scale(1.08);   /* убирает светлую кромку по краям от размытия */
  pointer-events: none;
}

.map-shade {
  position: absolute;
  inset: 0;
  /* Затемнение лежит над обоими слоями фона (у .world-art появился z-index). */
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(6, 10, 12, .68), rgba(6, 10, 12, .16) 44%, rgba(6, 10, 12, .55)),
    linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .58));
  pointer-events: none;
}

/* ---------- Меню пользователя в левом нижнем углу карты ---------- */
.user-menu {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  /* Выше списка разделов (z-index 6): раскрытое меню уходит вверх и при длинном
     списке разделов иначе оказалось бы под ним. Загрузчик остаётся выше всех. */
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.user-menu-btn:hover { background: rgba(255, 255, 255, .1); }

.user-menu-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(232, 180, 75, .22);
  font-size: 15px;
  line-height: 1;
}

/* Иконка в кружке — картинка, а не эмодзи: рисунок эмодзи стоит на базовой
   линии и при центрировании строки уезжает вниз примерно на пятую часть кегля
   (в кружке 26 px это сразу видно), а блочный <img> грид центрирует точно. */
.user-menu-icon {
  display: block;
  width: 16px;
  height: 16px;
}

/* Оба значка меню — контурные SVG одного набора: заливки нет, линия берётся из
   цвета текста. Так они читаются на тёмной панели и краснеют вместе с «Выйти»,
   а не остаются тёмно-синими, как прежние цветные PNG. */
.user-menu-icon,
.user-menu-item .menu-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Всплывающая панель: раскрывается ВВЕРХ от кнопки, чтобы не уезжать за экран. */
.user-menu-pop {
  width: min(300px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.user-menu-pop[hidden] { display: none; }

.user-menu-profile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.user-menu-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.user-menu-profile strong {
  font-size: 14px;
  word-break: break-all;
}

.user-menu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-menu-row code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  word-break: break-all;
}

.user-menu-row button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  cursor: pointer;
}

.user-menu-row button:hover { background: rgba(255, 255, 255, .12); }

.user-menu-tier {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(232, 180, 75, .18);
  color: #f0cf8c;
  font-size: 13px;
  font-weight: 700;
}

/* Пункты меню профиля: иконка одной ширины + подпись. Раньше значки были
   эмодзи, а у них ширина зависит от символа (🗑 уже, чем 💳), и подписи
   вставали лесенкой. Теперь это картинки фиксированного размера, поэтому все
   подписи начинаются с одной вертикали. */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.user-menu-item .menu-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}
/* Счётчик непрочитанных прижимаем к правому краю пункта. */
.user-menu-item .notif-badge { margin-left: auto; }

.user-menu-item:hover { background: rgba(255, 255, 255, .1); }
.user-menu-item.is-exit { color: #f0a9a4; }

/* Пункт меню-кнопка (уведомления) — выглядит так же, как ссылки рядом. */
button.user-menu-item {
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.notif-badge {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #d9534f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.notif-badge[hidden] { display: none; }

/* Панель уведомлений поверх карты. */
.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 10, .6);
  backdrop-filter: blur(3px);
}

.notif-overlay[hidden] { display: none; }

.notif-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(70vh, 620px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notif-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.notif-panel-head strong { flex: 1 1 auto; font-size: 16px; }

.notif-panel-head button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.notif-panel-head button:hover { background: rgba(255, 255, 255, .12); }

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

/* Непрочитанное выделяем полосой слева — цвет тот же, что у значка счётчика. */
.notif-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  cursor: default;
}

.notif-item.is-unread {
  border-left-color: #d9534f;
  background: rgba(255, 255, 255, .08);
}

.notif-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-item-head strong { font-size: 14px; }
.notif-item-time { color: var(--muted); font-size: 12px; }

.notif-item-body {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.notif-empty { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.notif-empty[hidden] { display: none; }

@media (max-width: 480px) {
  /* На узком экране оставляем только иконку — кнопкам зума хватает места. */
  .user-menu-btn-text { display: none; }
}

/* Верхняя панель карты: шапка + действия в один ряд, вкладки — ниже по центру.
   Раскладка через flex, поэтому элементы физически не могут наехать друг на друга
   на любой ширине экрана. */
.map-topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding:
    max(14px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    0
    max(16px, env(safe-area-inset-left));
  pointer-events: none; /* пустые места пропускают перетаскивание карты */
}
.map-topbar > * { pointer-events: auto; }

.map-header {
  position: static;
  order: 1;
  /* Ширина ровно как у списка разделов под ней: две таблички в левой колонке
     должны читаться как одна колонка, а не как ступенька. Длинное название
     переносится по словам (см. .map-header h1), поэтому фиксированная ширина
     ничего не обрезает. */
  flex: 0 0 auto;
  width: var(--sidebar-w);
  max-width: calc(100% - 24px);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto; /* значок «360» не сжимаем — сжимается только заголовок */
  width: 34px;
  height: 34px;
  border: 1px solid rgba(232, 180, 75, .62);
  border-radius: 7px;
  background: rgba(232, 180, 75, .14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.map-header h1,
.map-header p,
.scene-heading h2,
.scene-heading p,
.quest-panel p,
.object-panel p {
  margin: 0;
}

/* Обёртка заголовка может сжиматься — иначе flex не даст тексту обрезаться. */
.map-header > div {
  min-width: 0;
}

.map-header h1 {
  font-size: 17px;
  line-height: 1.15;
  /* Длинное название раздела переносим по словам, а не обрезаем многоточием:
     табличка теперь фиксированной ширины, и «Английский: продолжаем» иначе
     превращался бы в «Английский: прод…». Слово длиннее строки ломаем — иначе
     оно вылезет за рамку. */
  overflow-wrap: anywhere;
  /* Не больше двух строк: список разделов стоит на фиксированной высоте
     (top: 92px), и на третьей строке табличка до него достаёт. Двух строк
     хватает всем нашим названиям, а совсем длинное дожимается многоточием. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* На карте описание под заголовком прячем — табличка компактная. */
.map-header p {
  display: none;
}

.map-header p,
.scene-heading p,
.quest-panel p,
.object-panel p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.38;
}

.map-points {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* пустые места пропускают перетаскивание карты */
}

/* Подсказка для раздела, в котором ещё нет уровней (сам раздел показываем сразу). */
.map-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

.map-empty[hidden] { display: none; }

/* Кнопки приближения/отдаления карты */
.map-zoom {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-zoom button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(12px);
}

/* Вкладки всегда на своей строке под шапкой — по центру. */
/* Список разделов — скрываемая прокручиваемая панель слева. */
.map-sidebar {
  position: absolute;
  /* Тот же левый край, что у таблички с названием раздела (её задаёт отступ
     .map-topbar): колонка должна быть одной линией, а не ступенькой. */
  left: max(16px, env(safe-area-inset-left));
  top: 92px;
  z-index: 6;
  width: var(--sidebar-w);
  max-width: calc(100% - 24px);
  max-height: min(70vh, calc(100% - 176px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform .22s ease, opacity .22s ease;
}
.map-sidebar.collapsed { transform: translateX(-120%); opacity: 0; pointer-events: none; }
.map-sidebar-head {
  display: flex; align-items: center;
  /* Кнопка сворачивания — у ПРАВОГО края панели, а не вплотную к заголовку:
     так она стоит на самой границе, за которую панель и уезжает. */
  justify-content: space-between; gap: 8px;
  padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.map-sidebar-head strong { font-size: 14px; letter-spacing: .01em; }
.map-sidebar-toggle, .map-sidebar-show {
  /* Высота — общая с кнопкой «Обучение» (--head-btn): в шапке списка они стоят
     в один ряд, и разница в пару пикселей читается как перекос. */
  display: inline-grid; place-items: center; min-width: var(--head-btn); height: var(--head-btn); padding: 0 8px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04);
  color: var(--ink); font-weight: 900; font-size: 16px; cursor: pointer;
  /* Шрифтовой знак стоит на базовой линии, поэтому при центрировании СТРОКИ
     рисунок оказывается ниже середины кнопки. У «☰» это ещё терпимо (замер:
     +0,4 px), а стрелку сворачивания мы вообще заменили на SVG-шеврон — он
     центрируется точно, как и в панели наград. */
  line-height: 1;
}
/* Тот же шеврон, что у панели наград, только смотрит влево. */
.map-sidebar-toggle .chevron { width: 13px; height: 13px; transform: rotate(90deg); }
.map-sidebar-toggle:hover, .map-sidebar-show:hover { background: rgba(255,255,255,.1); }
.map-sidebar-show {
  position: absolute; left: 12px; top: 92px; z-index: 6; height: 40px; gap: 6px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.map-sidebar-show[hidden] { display: none; }

/* Вертикальный прокручиваемый список разделов. */
.map-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.map-tab {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.map-tab:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.map-tab.is-active { background: var(--accent); color: #161006; }

@media (max-width: 640px) {
  /* На телефоне левая колонка уже — сужаем обе таблички разом. */
  :root { --sidebar-w: 210px; }
  .map-tab { padding: 8px 12px; font-size: 14px; }
  /* На телефоне список разделов уже и опускается ниже более высокой шапки. */
  .map-sidebar { top: 118px; max-height: min(60vh, calc(100% - 200px)); }
  .map-sidebar-show { top: 118px; }
  /* На телефоне прячем значок «360» — освобождаем место, чтобы заголовок и
     кнопки «Конструктор/Выйти» уместились в одном верхнем ряду. */
  .map-header .brand-mark {
    display: none;
  }
}

.map-point {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background: var(--point);
  box-shadow: 0 0 0 4px rgba(232, 180, 75, .16), 0 6px 16px rgba(0, 0, 0, .3);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: auto;
  z-index: 1;
}

/* Лишние пины при переключении вкладок реально скрываются
   (иначе .map-point{display:grid} перебивает атрибут [hidden]). */
.map-point[hidden] {
  display: none;
}

/* Эмодзи внутри пина — подсказывает, что внутри локации. */
.pin-emoji {
  font-size: 15px;
  line-height: 1;
  font-style: normal;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45));
}

/* Панель действий карты (Конструктор + Выйти) — справа в верхнем ряду. */
.map-top-actions {
  position: static;
  order: 2;
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.map-action,
.map-top-actions .logout-link {
  position: static;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 800;
  backdrop-filter: blur(12px);
  white-space: nowrap;
}

.map-action[hidden] { display: none; }

#editorLink {
  color: #161006;
  background: linear-gradient(180deg, #f0c065, #e0a73f);
  border-color: transparent;
}

#editorLocked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  opacity: .8;
  cursor: not-allowed;
}
/* Атрибут hidden должен побеждать display у #editorLocked (иначе «скоро» видно всем). */
#editorLink[hidden], #editorLocked[hidden] { display: none; }

/* Плашка «скоро» на заблокированной кнопке конструктора. */
.soon-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(232, 180, 75, .18);
  border: 1px solid rgba(232, 180, 75, .5);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  text-transform: uppercase;
  line-height: 1.4;
}

.logout-link {
  position: static;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 800;
  backdrop-filter: blur(12px);
}

@media (max-width: 640px) {
  .map-top-actions { gap: 8px; }
  .map-action, .map-top-actions .logout-link { min-height: 38px; padding: 8px 12px; font-size: 14px; }
}

.map-point::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255, 255, 255, .85);
  border-bottom: 2px solid rgba(255, 255, 255, .85);
  background: var(--point);
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

.map-point strong {
  display: block;
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  width: max-content;
  max-width: 190px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
  white-space: normal;
}

.map-point span {
  display: none;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Уровень не по тарифу: серый пин вместо цветного.
   Саму --point выставляет addPin инлайном (инлайн перебил бы правило отсюда),
   здесь — только обводка, тень и обесцвеченное эмодзи: цветная картинка на
   сером кружке смотрится как ошибка отрисовки. */
.map-point.is-locked {
  border-color: rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 4px rgba(154, 160, 166, .14), 0 6px 16px rgba(0, 0, 0, .22);
}

.map-point.is-locked .pin-emoji {
  filter: grayscale(1) drop-shadow(0 1px 1px rgba(0, 0, 0, .4));
  opacity: .75;
}

/* Причина — второй строкой в той же карточке, что и название. Правило перебивает
   общее «.map-point span { display: none }», под которое подсказка тоже подпадает
   как вложенный span. */
.map-point strong .pin-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.map-point:hover,
.map-point:focus-visible {
  z-index: 3;
}

.map-point:hover strong,
.map-point:focus-visible strong {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(6, 10, 12, .78);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 0 0 6px rgba(95, 199, 156, .2), 0 14px 32px rgba(0, 0, 0, .36);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.hotspot.is-hidden {
  display: none;
}

.hotspot.is-target {
  box-shadow: 0 0 0 7px rgba(232, 180, 75, .25), 0 0 28px rgba(232, 180, 75, .38);
}

/* Кнопка взаимодействия (диалог) — просто круглая, в том же стиле, что и
   остальные хотспоты, без иконки и «хвостика» речевого облачка. */
.hotspot.is-dialogue {
  width: 40px;
  height: 40px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  opacity: .62;
  transition: opacity .16s ease;
}

/* При наведении/фокусе — снова чёткая. */
.hotspot.is-dialogue:hover,
.hotspot.is-dialogue:focus-visible {
  opacity: 1;
}

/* Буква или цифра внутри кружка. У .is-dialogue font-size: 0 (кружок пустой),
   поэтому размер задаём самой метке, иначе её не было бы видно. */
.hotspot.has-mark { opacity: .88; }
.hotspot-mark {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  pointer-events: none;
}

/* Два знака (номера от 10) — мельче, чтобы остался воздух по краям кружка. */
.hotspot-mark.is-wide { font-size: 14px; letter-spacing: -.5px; }

/* Пошаговый мастер создания уровня в конструкторе. */
.wiz-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.wiz-dot {
  border: 1px solid rgba(140,140,160,.4); background: transparent; color: inherit;
  padding: 5px 11px; border-radius: 999px; font-size: .82rem; cursor: pointer;
}
.wiz-dot.active { background: #e8b44b; color: #221a06; border-color: #e8b44b; font-weight: 700; }
.wiz-dot.done { border-color: #2f9e6f; }
/* ---------- Ожидание генерации панорамы ----------
   Кружок слева, текст и факт справа; на узком экране — в колонку, кружок
   сверху. Никаких фиксированных ширин: блок живёт и в 320 px, и в 900 px. */
/* Ширина ФИКСИРОВАНА, а у факта задана минимальная высота: факты разной длины,
   и блок, подогнанный под текст, менял размер на каждой смене — читать было
   невозможно. */
.gen-wait {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  width: min(560px, 100%);
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}
.gen-wait[hidden] { display: none; }
.gen-wait-ring {
  flex: none;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid rgba(232, 180, 75, .22);
}
.gen-wait-ring > i {
  display: block;
  width: 58px;
  height: 58px;
  margin: -3px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: gen-spin 1.1s linear infinite;
}
@keyframes gen-spin { to { transform: rotate(360deg); } }
.gen-wait-text { flex: 1 1 220px; min-width: 0; display: grid; gap: 4px; }
.gen-wait-text > strong { font-size: 16px; }
.gen-wait-sub { color: var(--muted); font-size: 13px; line-height: 1.4; }
.gen-wait-fact {
  min-height: 4.4em;
  margin: 6px 0 0;
  padding-left: 12px;
  border-left: 2px solid rgba(232, 180, 75, .5);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
@media (prefers-reduced-motion: reduce) {
  .gen-wait-ring > i { animation-duration: 3s; }
}

/* Поле значка: ввод + кнопка «Выбрать», под ними — панель с готовым набором. */
.icon-field { position: relative; display: flex; align-items: center; gap: 8px; }
.icon-field input { flex: 1; min-width: 0; text-align: center; font-size: 20px; }
.icon-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: min(320px, calc(100vw - 40px));
  max-height: 280px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.icon-pop[hidden] { display: none; }
.icon-pop-group {
  display: block;
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.icon-pop-group:first-child { margin-top: 0; }
.icon-pop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.icon-pop-item {
  height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.icon-pop-item:hover { border-color: var(--accent); background: rgba(232, 180, 75, .16); }

/* Необязательный шаг, которого пока нет: пунктирная рамка и «＋» — так видно,
   что это не пройденный этап, а предложение добавить. */
.wiz-dot.is-add {
  border-style: dashed;
  border-color: rgba(140, 140, 160, .55);
  color: var(--muted);
}
.wiz-dot.is-add:hover { border-color: var(--accent); color: var(--ink); }
.wiz-step { margin-bottom: 10px; }
.wiz-controls { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0; }

/* Редактор тарифов в админке. */
/* Рассылка уведомлений пользователям (админ-панель) */
.admin-notif-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.admin-notif-form input[type="text"],
.admin-notif-form textarea {
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.admin-notif-form textarea { min-height: 110px; resize: vertical; }
.admin-notif-form input[type="text"]:focus,
.admin-notif-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}
.admin-notif-form button[type="submit"] {
  align-self: flex-start;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1c1305;
  font-weight: 900;
}
.admin-notif-aud { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.admin-notif-aud label { display: inline-flex; align-items: center; gap: 6px; }
.admin-notif-pick[hidden] { display: none; }
.admin-notif-pick-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 8px; color: var(--muted); font-size: 13px;
}
.admin-notif-pick-head button {
  min-height: 30px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
/* Список получателей прокручивается: пользователей может быть много. */
.admin-notif-users {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px;
  max-height: 220px; overflow: auto;
  padding: 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px;
}
.admin-notif-users label { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.tiers-wrap { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }

/* Строка тарифа: десять полей в одну обёртку. Раньше между подписью и её полем
   было 4 пикселя, а между соседними полями 8 — глазу не за что зацепиться,
   и «Цена ₽» читалась как приклеенная к чужому вводу. Теперь каждое поле —
   отдельная плашка с фоном, между плашками воздуха вдвое больше, чем внутри. */
.tier-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
}
.tier-row input[type="text"], .tier-row input:not([type]) { min-width: 72px; }
.tier-row input[type="number"] { width: 78px; }

.tier-row label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  font-size: .85rem;
  white-space: nowrap;
}

/* У галочек подпись стоит справа от квадратика, поэтому отступы зеркальные. */
.tier-row label:has(input[type="checkbox"]) { padding: 4px 12px 4px 10px; }

.tier-row > button { margin-left: auto; }

/* История активаций промокода: строка-гармошка под самим кодом. Открывается
   по кнопке «История» и грузится только тогда — у кода их может быть до ста. */
.promo-history > td { padding: 0 12px 14px; }

.promo-history-head { margin: 6px 0 8px; color: var(--muted); font-size: 13px; }

.promo-history-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}

.promo-history-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  font-size: 13px;
}

.promo-history-when { flex: none; min-width: 150px; color: var(--muted); }
.promo-history-who { word-break: break-all; }

/* Точка-телепорт: ведёт на другую панораму раздела — другого (бирюзового) цвета. */
.hotspot.is-portal {
  background: radial-gradient(circle at 50% 38%, #7fe6d6, #2aa9c7);
  box-shadow: 0 0 0 6px rgba(42, 169, 199, .22), 0 0 22px rgba(42, 169, 199, .5);
  opacity: .8;
}
.hotspot.is-portal:hover,
.hotspot.is-portal:focus-visible { opacity: 1; }

/* Кнопка перехода в окне точки-телепорта. */
#objectGo {
  background: #2aa9c7;
  color: #04252c;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 6px;
}
#objectGo:hover { background: #45c3dd; }

.viewer-top {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.viewer-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.back-button,
.chrome-toggle,
.scene-heading,
.viewer-actions button,
.quest-panel,
.object-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

/* Картинка к реплике точки: методика курсов английского требует «сначала
   картинка, потом звук, потом слово», а для этого картинка нужна и там, где
   задания ещё нет — в самой реплике героя. */
.object-pic {
  display: block;
  width: 100%;
  max-height: 190px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
  object-fit: contain;
}

.object-pic[hidden] { display: none; }

.back-button {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
  text-align: center;
  pointer-events: auto;
}

.chrome-toggle {
  display: grid;
  place-items: center;
  min-width: 72px;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  pointer-events: auto;
}

/* Язык уровня: подпись всего из двух букв, поэтому кнопка квадратная —
   иначе она шире «Панелей» и ряд разъезжается. */
.lang-toggle {
  min-width: 44px;
  padding: 0;
  letter-spacing: .04em;
}

.scene-heading {
  position: relative;
  max-width: 480px;
  padding: 10px 38px 10px 13px; /* справа место под кнопку сворачивания */
}

/* Текст в панелях уровня — компактнее (карту не трогаем). */
.scene-heading p,
.quest-panel p,
.object-panel p {
  font-size: 13px;
  line-height: 1.32;
}

.scene-heading span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.scene-heading h2 {
  font-size: 20px;
  line-height: 1.08;
}

.viewer-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  pointer-events: auto;
}

.viewer-actions button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.quest-panel {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(340px, calc(100% - 36px));
  padding: 11px 38px 11px 13px; /* справа место под кнопку сворачивания */
}

/* Кнопка сворачивания панели (добавляется скриптом в .scene-heading и .quest-panel) */
.panel-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Свёрнутая панель ужимается до одной кнопки. */
.scene-heading.is-collapsed,
.quest-panel.is-collapsed {
  padding: 6px;
  max-width: none;
  width: auto;
}

.scene-heading.is-collapsed > :not(.panel-toggle),
.quest-panel.is-collapsed > :not(.panel-toggle) {
  display: none;
}

.scene-heading.is-collapsed .panel-toggle,
.quest-panel.is-collapsed .panel-toggle {
  position: static;
}

.quest-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.quest-title span {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(95, 199, 156, .16);
  color: var(--good);
  font-size: 12px;
  font-weight: 900;
}

.quest-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

/* Кнопка перехода к следующей локации (появляется при выполнении квеста). */
.quest-next {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(232, 180, 75, .5);
  border-radius: 8px;
  background: rgba(232, 180, 75, .16);
  color: var(--accent);
  font-weight: 900;
  pointer-events: auto;
}

.quest-next:hover {
  background: rgba(232, 180, 75, .28);
}

.quest-next[hidden] {
  display: none;
}

.object-panel {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(330px, calc(100% - 36px));
  padding: 13px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.level-loader {
  position: absolute;
  inset: 0;
  z-index: 8;   /* перекрывает всё, включая меню пользователя (7) */
  display: grid;
  place-items: center;
  background: #070a0d;
}

/* Без этого .is-hidden (display:none) проигрывает по каскаду правилу
   .level-loader (display:grid) выше, и загрузчик не скрывается. */
.level-loader.is-hidden {
  display: none;
}

.level-loader > div {
  width: min(420px, calc(100% - 40px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.level-loader strong {
  display: block;
  margin-bottom: 12px;
}

.level-loader span {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}

.level-loader i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .12s linear;
}

.object-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#closeObject {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
}

#objectKind {
  display: block;
  margin-right: 36px;
  color: var(--good);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

/* «Что внутри точки»: те же слова, что во всплывающей подсказке на кружке.
   На широком экране подсказка у кружка на месте, поэтому строка не нужна —
   показываем её только там, где кружок спрятан (телефон, см. ниже). */
.object-inside {
  display: none;
  margin: 0 34px 8px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(122, 79, 214, .18);
  color: #d9c6ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.object-inside[hidden] { display: none; }

.object-panel h3 {
  margin: 6px 34px 7px 0;
  font-size: 18px;
  line-height: 1.14;
}

.object-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

#objectStep {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

#objectNext {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

/* Плавное приглушение интерфейса по кнопке «Панели». */
.viewer-primary-actions,
.viewer-actions,
.scene-heading,
.quest-panel {
  transition: opacity .2s ease;
}

/* «Скрыть»: прячем панели и кнопки управления, КРОМЕ кнопок «Карта»/«Показать».
   Метки диалогов НЕ скрываются — лишь становятся прозрачнее (и кликабельны).
   Карточка объекта (диалог) сюда не входит — она не меняется вообще. */
body.is-chrome-hidden .scene-heading,
body.is-chrome-hidden .viewer-actions,
body.is-chrome-hidden .quest-panel {
  opacity: 0;
  pointer-events: none;
}

/* «Карта» и «Показать» остаются видимыми, но полупрозрачными и кликабельными. */
body.is-chrome-hidden .viewer-primary-actions {
  opacity: .4;
}

/* Метки диалогов при «Скрыть» — прозрачнее, но видимы и активны;
   при наведении снова чёткие (правило .hotspot.is-dialogue:hover выше). */
body.is-chrome-hidden .hotspot {
  opacity: .55;
}

@media (max-width: 760px) {
  .map-header {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    top: max(12px, env(safe-area-inset-top));
    max-width: none;
  }

  .map-header h1 {
    font-size: 22px;
  }

  .map-point {
    width: 27px;
    height: 27px;
  }

  .map-point .pin-emoji {
    font-size: 13px;
  }

  .map-point strong {
    font-size: 12px;
  }

  .map-point span,
  .scene-heading p {
    display: none;
  }

  /* Верхняя панель: кнопки в один ряд, заголовок переносится на свою строку. */
  .viewer-top {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
    flex-wrap: wrap;
    gap: 8px;
  }

  .scene-heading {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    padding: 10px 14px;
  }

  .scene-heading h2 {
    font-size: 18px;
  }

  .viewer-actions {
    margin-left: auto;
  }

  .quest-panel,
  .object-panel {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
  }

  /* На узком экране панель объекта и задания делят низ — прячем задание,
     когда открыта карточка объекта, чтобы они не накладывались. */
  body:has(.object-panel.is-open) .quest-panel {
    opacity: 0;
    pointer-events: none;
  }

  /* Открытая точка на телефоне — ОДНО окно и ничего больше. Прежде на экран
     сразу попадали три вещи об одном и том же: кружок, подсказка над ним и
     сама карточка. Кружки прячем целиком (вернутся, как только окно закрыть),
     а «что внутри» показываем строкой в самой карточке. */
  body:has(.object-panel.is-open) .hotspot-layer { display: none; }
  .object-inside:not([hidden]) { display: inline-block; }
  .object-panel {
    max-height: 68vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Подсказку у кружка на сенсорном экране не показываем вовсе: :hover после
     касания «залипает», и подпись остаётся висеть поверх панорамы. */
  .hotspot-tip { display: none; }
}

@media (max-width: 480px) {
  .map-header {
    gap: 10px;
    padding: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .map-header h1 {
    font-size: 19px;
  }

  .scene-heading h2 {
    font-size: 16px;
  }

  .quest-panel {
    padding: 12px;
  }

  .quest-panel p {
    font-size: 14px;
  }

  .object-panel h3 {
    font-size: 19px;
  }

  /* Кнопка «Панели» — компактнее, чтобы влезал ряд управления. */
  .chrome-toggle {
    min-width: 56px;
    font-size: 12px;
  }

  /* Правило выше идёт позже общего .lang-toggle и перебило бы его ширину. */
  .lang-toggle {
    min-width: 40px;
  }
}

/* Планшет и уже: одна колонка, страница может прокручиваться */
@media (max-width: 900px) {
  .landing-hero {
    height: auto;
    min-height: 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 32px;
    padding: 24px clamp(16px, 5vw, 48px) 40px;
  }

  .hero-form-wrap {
    justify-self: stretch;
    max-width: 520px;
  }
}

/* Мобильная адаптация лендинга */
@media (max-width: 640px) {
  .landing-nav {
    padding: 14px 16px;
  }

  .hero-grid {
    gap: 28px;
    padding: 20px 16px 36px;
  }

  .hero-pitch h1 {
    line-height: 1.06;
  }

  .hero-form-wrap {
    max-width: none;
  }

  .hero-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
}

/* Невысокие экраны (ноутбуки): ужимаем вёрстку по высоте, чтобы лендинг
   целиком помещался в один экран при 100% масштабе без прокрутки. */
@media (min-width: 901px) and (max-height: 820px) {
  .landing-nav { padding-top: 12px; padding-bottom: 12px; }
  .hero-grid { padding-top: 10px; padding-bottom: 10px; gap: clamp(24px, 4vw, 56px); }
  .eyebrow { margin-bottom: 8px; }
  .hero-pitch h1 { margin-bottom: 10px; font-size: clamp(28px, 3vw, 46px); }
  .hero-pitch .lead { margin-bottom: 14px; font-size: clamp(15px, 1.2vw, 18px); }
  .value-points { gap: 8px; }
  .value-points li { padding: 10px 14px; }
  .waitlist-form { padding: 20px; }
  .waitlist-form > * + * { margin-top: 11px; }
  .form-head h2 { font-size: 22px; }
  .waitlist-form input,
  .waitlist-form select,
  .select-trigger { min-height: 48px; }
  .waitlist-submit { min-height: 50px; margin-top: 14px; }
  .hero-footer { padding-top: 11px; padding-bottom: 11px; }
}

@media (min-width: 901px) and (max-height: 700px) {
  .landing-nav { padding-top: 9px; padding-bottom: 9px; }
  .hero-grid { padding-top: 6px; padding-bottom: 6px; }
  .eyebrow { margin-bottom: 6px; padding: 5px 11px; }
  .hero-pitch h1 { margin-bottom: 8px; font-size: clamp(26px, 2.6vw, 38px); }
  .hero-pitch .lead { margin-bottom: 10px; font-size: 15px; line-height: 1.35; }
  .value-points { gap: 7px; }
  .value-points li { padding: 8px 13px; font-size: 14px; }
  .vp-ico { width: 30px; height: 30px; font-size: 15px; }
  .form-head { gap: 3px; }
  .form-head p { display: none; }
  .form-head h2 { font-size: 20px; }
  .waitlist-form { padding: 16px; border-radius: 16px; }
  .waitlist-form > * + * { margin-top: 9px; }
  .waitlist-form input,
  .waitlist-form select,
  .select-trigger { min-height: 44px; }
  .waitlist-submit { min-height: 46px; margin-top: 12px; }
  .hero-footer { padding-top: 9px; padding-bottom: 9px; font-size: 12px; }
}

/* Уважаем системную настройку «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ======================= Комикс-предыстория ======================= */
.comic-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;                 /* выше загрузчика уровня (z-index:6) */
  display: flex;
  flex-direction: column;
  overflow-y: auto;            /* длинные истории на мобильном можно прокрутить */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: radial-gradient(120% 90% at 50% 20%, #12161c 0%, #05070a 100%);
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
           max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  animation: comic-in .28s ease;
  outline: none;
}

.comic-overlay.is-leaving {
  animation: comic-out .26s ease forwards;
}

@keyframes comic-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes comic-out { from { opacity: 1; } to { opacity: 0; } }

/* Окно загрузки истории: пока картинки не готовы — спиннер вместо кадров. */
.comic-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.comic-overlay:not(.is-loading) .comic-loading { display: none; }
.comic-overlay.is-loading .comic-stage,
.comic-overlay.is-loading .comic-bar { display: none; }
.comic-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: comic-spin 1s linear infinite;
}
@keyframes comic-spin { to { transform: rotate(360deg); } }
.comic-loading-text { margin: 0; color: var(--muted); font-size: 15px; font-weight: 700; }

/* Полоса прогресса загрузки истории (плавно заполняется). */
.comic-loadbar {
  display: block;
  width: min(280px, 70vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}
.comic-loadbar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .12s linear;
}

.comic-stage {
  flex: 1 0 auto;             /* растёт, чтобы центрировать; не сжимается ниже контента (тогда оверлей прокручивается) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 6px 0;
}

.comic-img {
  max-width: min(760px, 100%);
  max-height: 62vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #0b0f12;
  animation: comic-frame .35s ease;
}

@keyframes comic-frame {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}

.comic-text {
  max-width: min(720px, 100%);
  margin: 0;
  text-align: center;
  font-size: clamp(16px, 2.4vw, 21px);
  line-height: 1.5;
  color: var(--ink);
  text-wrap: balance;
}

.comic-bar {
  position: sticky;
  bottom: 0;                  /* кнопка «Далее» всегда видна и доступна */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: min(760px, 100%);
  width: 100%;
  margin: 12px auto 0;
  padding: 12px 0 4px;
  background: linear-gradient(180deg, transparent, #05070a 45%);
}

.comic-dots {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.comic-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  transition: background .2s ease, transform .2s ease;
}

.comic-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

/* Кнопки навигации по комиксу: правая «Далее» — жёлтая, левая «Назад» — серая. */
.comic-back,
.comic-next {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

/* «Далее»/«Начать» (справа) — главное действие, ВСЕГДА жёлтая на любом шаге.
   Ховер/фокус/актив перечислены явно, иначе глобальный button:hover (он
   специфичнее) перекрашивал бы кнопку в серый — особенно на телефоне, где
   после тапа «наведение» залипает. */
.comic-next,
.comic-next.is-start,
.comic-next:hover,
.comic-next:focus,
.comic-next:active {
  background: linear-gradient(180deg, #f0c065, #e0a73f);
  color: #161006;
  border-color: transparent;
}

/* «Назад» (слева) — второстепенная, сплошная серая во всех состояниях. */
.comic-back,
.comic-back:hover,
.comic-back:focus,
.comic-back:active {
  background: #3b4048;
  border-color: transparent;
  color: #eef0f2;
}

/* На первом кадре «Назад» неактивна (темнее). Идёт после ховера — перебивает его. */
.comic-back:disabled,
.comic-back:disabled:hover {
  background: #23262b;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .7;
}

/* Кнопка возврата на карту — сверху слева поверх истории. */
.comic-map {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 2;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 16, 19, .72);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

/* ======================= Чеклист заданий ======================= */
.task-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task-list[hidden] { display: none; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--muted);
  transition: color .2s ease;
}

.task-check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: #161006;
  font-size: 12px;
  font-weight: 900;
  transition: background .2s ease, border-color .2s ease;
}

.task-item.is-done {
  color: var(--ink);
}

.task-item.is-done .task-check {
  background: var(--good);
  border-color: var(--good);
}

.task-item.is-done .task-text {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, .35);
}

@media (max-width: 760px) {
  .comic-img { max-height: 46vh; }
  .comic-text { font-size: clamp(15px, 4.2vw, 18px); }
}
@media (max-width: 480px) {
  .comic-img { max-height: 42vh; }
  .comic-next,
  .comic-back { padding: 11px 16px; font-size: 15px; }
}

/* Плавная смена текущего задания (одно сменяет другое). */
.task-swap { animation: taskSwap .3s ease; }
@keyframes taskSwap {
  from { opacity: .25; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* Чекбокс права «Конструктор» в таблице пользователей админки */
.perm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.perm-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ======================= Конструктор уровней ======================= */
.editor { max-width: 1100px; }

.editor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.editor-tab {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}
.editor-tab.is-active {
  background: var(--accent);
  color: #161006;
  border-color: transparent;
}

.editor-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font-weight: 800;
}
.editor-btn.primary { background: linear-gradient(180deg, #f0c065, #e0a73f); color: #161006; border-color: transparent; }
.editor-btn.danger { color: var(--danger); border-color: rgba(234, 164, 147, .4); }
.editor-btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }

.editor-back {
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.editor-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.editor-inline-form input { flex: 1; min-width: 140px; min-height: 48px; padding: 10px 14px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); font-size: 16px; }
.editor-inline-form input[maxlength="4"] { flex: 0 0 70px; text-align: center; }

.editor-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.editor-card {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  width: 100%;
}
/* Карточка-витрина (библиотека разделов и уровней): столбиком, во всю высоту
   ячейки сетки. Высота одинаковая у всех карточек ряда, описание тянется, а
   кнопка «Забрать к себе» прижата к низу — иначе кнопки стоят на разной высоте
   и ряд читается как лесенка. */
.editor-card.static {
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}
.editor-card.static .editor-card-body { flex: 1 1 auto; }
.editor-card.static > .editor-btn { margin-top: auto; }
.editor-card-icon { font-size: 26px; }
.editor-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.editor-card-body strong { font-size: 15px; }
.editor-card-sub { font-size: 12px; color: var(--muted); }
.editor-card-desc { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.editor-section-head { display: grid; grid-template-columns: 1fr 90px 90px; gap: 12px; margin-bottom: 12px; }
.editor-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
/* Панель сохранения прилипает к низу. Фон СПЛОШНОЙ, а не растворяющийся:
   с градиентом текст, уезжающий под панель, был виден наполовину и читался как
   наложение блоков. Полоска сверху показывает, что содержимое уходит под неё. */
.editor-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 20px;
  padding: 12px 0;
  background: #070a0d;
  border-top: 1px solid var(--line);
}
.editor-savestate { color: var(--good); font-weight: 800; font-size: 14px; }

.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.editor-col h3 { margin: 20px 0 8px; }
.editor-col h3:first-child { margin-top: 0; }
.editor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

.field .field-label, .editor-field .editor-sublabel { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 800; color: var(--muted); }
/* Флажки и радиокнопки исключены намеренно: под общее правило они попадали
   как обычные поля и растягивались во всю ширину строки. */
.editor .field input:not([type="checkbox"]):not([type="radio"]),
.editor-field input:not([type="checkbox"]):not([type="radio"]),
.editor-field textarea,
.editor-field select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); font-size: 16px;
}
.editor-field input[type="checkbox"],
.editor-field input[type="radio"],
.editor-item input[type="checkbox"],
.editor-item input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}
.editor .field { margin-bottom: 12px; }
.editor-field { display: block; margin-bottom: 10px; }

/* ----- Ритм конструктора -----
   Один шаг отступа: 8 внутри блока, 16 между блоками, 28 между смысловыми
   разделами. Раньше вложенные боксы (точка → вкладка → игра) прилегали друг к
   другу вплотную, и было не видно, где кончается один и начинается другой. */
.editor-item { margin: 0; }
.editor-item + .editor-item { margin-top: 12px; }
.editor-item .editor-item { margin-top: 10px; background: rgba(255, 255, 255, .05); }
.editor-item > .editor-field:last-child,
.editor-item > .editor-dialogs:last-child { margin-bottom: 0; }
.editor-item .editor-field + .editor-field { margin-top: 10px; }
.editor-dialogs { margin-top: 12px; }
.editor-list { gap: 12px; margin: 12px 0 16px; }
.wiz-step > h3 { margin: 28px 0 8px; }
.wiz-step > h3:first-child { margin-top: 0; }
.wiz-step > .editor-hint { margin-bottom: 16px; }
.editor-upload { margin-top: 4px; }
.editor-field > .ed-select { margin-top: 2px; }
/* Кнопка «＋ …» всегда отделена от того, что перечисляет. */
.editor-field > .editor-btn.small,
.editor-dialogs > .editor-btn.small { margin-top: 10px; }
/* Пояснение под списком («Точкой слева отмечается…») — со своей строки:
   как inline-элемент оно вставало впритык к кнопке «＋ Добавить». */
.editor-field > .editor-btn.small + .editor-hint,
.editor-field > .editor-hint:last-child { display: block; margin: 8px 0 0; }

/* ----- Единая сетка настроек -----
   Все поля конструктора — одной высоты и по одной вертикали: подпись сверху,
   элемент во всю ширину. Раньше высота прыгала (input 48, select 36, кнопка 30),
   и формы выглядели рваными. */
.editor-item input[type="text"],
.editor-item input[type="number"],
.editor-item input[type="search"],
.editor-item textarea,
.editor-field input[type="text"],
.editor-field input[type="number"],
.editor-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.editor-item .ed-select-btn { min-height: 44px; }
/* Кнопки в строках настроек — той же высоты, что и поля рядом. */
.editor-item .editor-btn.small,
.editor-dialog-row .editor-btn.small { min-height: 40px; display: inline-flex; align-items: center; }
.editor-item .editor-x,
.editor-dialog-row .editor-x { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }

/* Строка «подпись слева — действие справа» (заголовки списков). */
.editor-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.editor-row-head .editor-sublabel { margin: 0; }

/* Пары «поле — поле» выстраиваем в две ровные колонки, а не в поток. */
.editor-pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
/* Строка варианта ответа: [отметка] [картинка] [подпись] [удалить].
   Колонки фиксированы, поэтому строки стоят одна под другой, а не «лесенкой». */
.editor-option-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr 40px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.editor-option-row + .editor-option-row { border-top: 1px solid rgba(255, 255, 255, .06); }
.editor-option-row.has-choice { grid-template-columns: 20px minmax(120px, 180px) 1fr 40px; }
/* Внутри строки варианта подпись «Картинка» и надпись «Без картинки» лишние:
   колонка и так одна, а состояние видно по кнопке («Выбрать» / «Заменить»). */
.editor-option-row .editor-image-field > .editor-sublabel,
.editor-option-row .editor-image-field .editor-hint { display: none; }
.editor-image-field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.editor-image-field .editor-comic-preview { margin: 0; }
.editor-image-field .editor-comic-preview img { max-height: 72px; }
.editor-image-field .editor-form-actions { gap: 6px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .editor-option-row, .editor-option-row.has-choice { grid-template-columns: 1fr auto; }
}

/* ---------- Разметка областей на большой картинке ---------- */
/* Область ставится мышью прямо по картинке: вписывать проценты руками
   невозможно — автор не знает, на каком проценте у него красный карандаш.
   Кружок задан в процентах ШИРИНЫ и aspect-ratio: 1 — ровно так же, как
   считает попадание игра (js/games.js, sceneHunt). */
.editor-spots {
  position: relative;
  margin: 6px 0 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  overflow: hidden;
  cursor: crosshair;
}

.editor-spots img { display: block; width: 100%; height: auto; user-select: none; }

.editor-spot {
  position: absolute;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid rgba(232, 180, 75, .85);
  border-radius: 50%;
  background: rgba(232, 180, 75, .16);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.editor-spot.is-picked {
  border-color: var(--good);
  border-style: dashed;
  background: rgba(95, 199, 156, .2);
}

.editor-spot i {
  font-style: normal;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
}

/* Строка реплики: [картинка] [текст] [удалить]. Текст занимает всё место —
   реплика длиннее варианта ответа, и её надо видеть целиком. */
.editor-option-row.is-dialog { grid-template-columns: minmax(110px, 150px) 1fr 40px; }

/* Строка области: [номер] [что искать] [размер] [удалить]. */
.editor-option-row.is-spot { grid-template-columns: 42px 1fr minmax(120px, 180px) 40px; }
.editor-option-row.is-spot.is-picked { background: rgba(95, 199, 156, .1); border-radius: 10px; }
.editor-inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.editor-inline .editor-sublabel { margin: 0; white-space: nowrap; }
.editor-inline input[type="range"] { flex: 1; min-width: 70px; }

@media (max-width: 620px) {
  .editor-option-row.is-spot { grid-template-columns: 42px 1fr auto; }
}

.editor-badge-row { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; }
.editor-badge-row input { margin: 0; }
.editor-badge-icon { width: 48px; height: 48px; object-fit: contain; }

/* Заголовок свёрнутой вкладки: название слева, кнопки справа, ровная высота. */
.editor-tab-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.editor-tab-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.editor-collapse > summary.editor-tab-summary::before { flex: none; }

@media (max-width: 620px) {
  .editor-pair-row { grid-template-columns: 1fr; }
}
.editor input[type="color"] { padding: 4px; min-height: 48px; }

.editor-map-pick { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: crosshair; background: #0b0f12; }
.editor-map-pick img { display: block; width: 100%; height: auto; }
.editor-map-marker { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--accent); border: 2px solid #161006; box-shadow: 0 0 0 3px rgba(232,180,75,.4); pointer-events: none; }

.editor-map-underlay { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-top: 8px; }
.editor-map-underlay-preview { flex: 1 1 320px; max-width: 460px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0f12; }
.editor-map-underlay-preview img { display: block; width: 100%; height: auto; }
.editor-map-underlay-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.editor-map-underlay-status { margin: 2px 0 0; color: var(--muted, #9aa7b0); font-size: 13px; }

.editor-upload { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border-radius: 11px; border: 1px dashed var(--line); background: rgba(255,255,255,.04); color: var(--ink); font-weight: 800; cursor: pointer; }
.editor-pano-wrap { position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: crosshair; background: #0b0f12; }
.editor-pano-wrap img { display: block; width: 100%; height: auto; }
.editor-hotspots { position: absolute; inset: 0; pointer-events: none; }
.editor-hotspot { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--accent); color: #161006; font-size: 12px; font-weight: 900; border: 2px solid #161006; pointer-events: auto; cursor: grab; touch-action: none; }
.editor-hotspot:hover { box-shadow: 0 0 0 3px rgba(232,180,75,.45); }
.editor-hotspot.dragging { cursor: grabbing; box-shadow: 0 0 0 4px rgba(232,180,75,.6); z-index: 2; }
/* Точка со своей меткой (буква/цифра) — тем же цветом, что и в игре. */
.editor-hotspot.has-mark { background: #fff; color: #161006; }
/* Точка, которая появляется только после другой: пунктир — её сначала не видно. */
.editor-hotspot.is-gated { border-style: dashed; background: rgba(232,180,75,.45); }
.editor-mark-input { width: 68px; text-align: center; text-transform: uppercase; }

.editor-actions-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-card-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.editor-help { margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.editor-help > summary { cursor: pointer; padding: 10px 12px; font-weight: 700; }
.editor-help-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.editor-help-body p { margin: 0; color: var(--muted, #9aa7b0); font-size: 14px; }
.editor-prompt { width: 100%; box-sizing: border-box; font: 13px/1.45 ui-monospace, "SF Mono", monospace; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #0b0f12; color: var(--ink); resize: vertical; }

/* Шапка редактора: кнопки справа */
.admin-nav-actions { display: flex; align-items: center; gap: 10px; }

/* Обучение — модальный пошаговый гид */
.tutorial-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.tutorial-overlay[hidden] { display: none; }
.tutorial-modal { position: relative; width: min(680px, 100%); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 24px 20px; }
.tutorial-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); color: var(--ink); font-size: 16px; cursor: pointer; }
.tutorial-close:hover { background: rgba(255,255,255,.1); }
.tutorial-step-info { margin: 0 0 6px; color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.tutorial-modal h2 { margin: 0 0 12px; }
.tutorial-body { color: var(--ink); line-height: 1.55; }
.tutorial-body p { margin: 0 0 10px; }
.tutorial-body ul { margin: 0 0 10px; padding-left: 20px; }
.tutorial-body li { margin: 4px 0; }
.tutorial-body .kbd { background: rgba(255,255,255,.1); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-weight: 800; white-space: nowrap; }
.tutorial-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.tutorial-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; flex: 1; }
.tutorial-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.25); }
.tutorial-dot.is-active { background: var(--accent); }
/* Снимок конструктора в шаге обучения: показывает то самое место,
   о котором говорит текст. Ширина по модалке, рамка — как у панелей. */
.tutorial-shot {
  display: block;
  width: 100%;
  margin: 14px 0 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

/* Точка в конструкторе свёрнута: в списке из 40 точек иначе не сориентироваться. */
.editor-collapse > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  padding: 2px 0;
}
.editor-collapse > summary::-webkit-details-marker { display: none; }
.editor-collapse > summary::before { content: "▸ "; color: var(--muted); }
.editor-collapse[open] > summary::before { content: "▾ "; }
.editor-collapse[open] > summary { margin-bottom: 8px; border-bottom: 1px solid var(--line); }

/* ----- Окно выбора картинки: банк, свои картинки, загрузка ----- */
.picker-overlay { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.66); backdrop-filter: blur(4px); }
.picker-overlay[hidden] { display: none; }
.picker-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(920px, 100%);
  max-height: 88vh;
  padding: 20px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.picker-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-right: 44px; }
.picker-head strong { margin-right: 6px; font-size: 16px; }
.picker-search {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--ink);
  font-size: 15px;
}
.picker-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-themes[hidden] { display: none; }
.editor-chip-btn {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.editor-chip-btn:hover { background: rgba(255,255,255,.12); }
.editor-chip-btn.is-active { background: var(--accent); color: #221a06; border-color: var(--accent); font-weight: 700; }

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
}
.editor-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.editor-pick:hover { border-color: var(--accent); background: rgba(232,180,75,.1); }
.editor-pick img { width: 100%; height: 84px; object-fit: contain; }
.editor-pick span { font-size: 12px; line-height: 1.25; text-align: center; color: var(--muted); }

.editor-list { display: flex; flex-direction: column; gap: 12px; margin: 10px 0; }
.editor-item { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.editor-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.editor-x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--muted); font-weight: 900; }
.editor-dialogs { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.editor-dialog-row { display: flex; gap: 6px; align-items: center; }
.editor-dialog-row input { flex: 1; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); font-size: 16px; }
.editor-comic-preview { margin: 8px 0; }
.editor-comic-preview img { max-width: 100%; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); }
.editor-targets { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.editor-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 13px; }
.editor-select-native { width: 100%; }

/* ----- Свой выпадающий список конструктора -----
   Системный <select> раскрывается средствами ОС: на тёмной странице это был
   белый список чужого вида. Здесь кнопка + всплывающий список в оформлении
   конструктора (см. dropdown() в js/editor.js). */
.ed-select { position: relative; display: block; }
.ed-select.is-wide { width: 100%; }
.ed-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.ed-select-btn:hover { background: rgba(255, 255, 255, .08); }
.ed-select-btn[aria-expanded="true"] { border-color: var(--accent); }
.ed-select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-select-caret { flex: none; color: var(--muted); transition: transform .16s ease; }
.ed-select-btn[aria-expanded="true"] .ed-select-caret { transform: rotate(180deg); }

.ed-select-pop {
  /* Координаты ставит dropdown() в js/editor.js: список часто оказывается
     внутри прокручиваемого окна, где absolute обрезался бы по краю. */
  position: fixed;
  z-index: 70;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  /* Непрозрачный: список ложится поверх формы, сквозь него читать нельзя. */
  background: #0f1519;
  box-shadow: var(--shadow);
}
.ed-select-pop[hidden] { display: none; }
.ed-select-group {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ed-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.ed-select-option:hover, .ed-select-option:focus-visible { background: rgba(255, 255, 255, .1); }
.ed-select-option.is-active { background: rgba(232, 180, 75, .16); }
.ed-select-option-text { flex: 1; min-width: 0; }
.ed-select-mark { flex: none; width: 14px; text-align: center; color: var(--accent); }

/* Вход на первом экране: та же карточка, что была у заявки, — чтобы не ломать
   раскладку героя. Заявка уехала в отдельную секцию ниже. */
.hero-login .form-head { margin-bottom: 14px; }
.hero-login-switch { margin-top: 12px; }
.hero-login-switch a { color: var(--accent); }
.landing-waitlist {
  padding: 56px 20px 72px;
  display: flex;
  justify-content: center;
  background: rgba(6, 9, 12, .92);
}
.landing-waitlist .hero-form-wrap { width: min(520px, 100%); }
.login-alt-note { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* Вкладки админ-панели: разделов много, открыт один. */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.admin-tab:hover { background: rgba(255, 255, 255, .1); }
.admin-tab.is-active { background: var(--accent); border-color: transparent; color: #2a1c05; }
.admin-section[hidden] { display: none; }

/* Вход через внешнего провайдера: отделён от формы, чтобы не спорил с ней. */
.login-alt { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 14px; }
.login-alt[hidden] { display: none; }
.login-alt-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.login-alt-or::before, .login-alt-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-alt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .06);
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.login-alt-btn:hover { background: rgba(255, 255, 255, .12); border-color: var(--accent); }

/* Вложения к обращению в админ-панели: миниатюра картинки или ссылка на ролик. */
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
}
.msg-file img { display: block; max-width: 120px; max-height: 90px; border-radius: 6px; }

/* ----- Список точек: одна строка на точку -----
   Все строки одной высоты, метка слева, кнопки справа по одной вертикали. */
.point-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}
.point-row + .point-row { margin-top: 8px; }
.point-row-mark {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(232, 180, 75, .18);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.point-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.point-row-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.point-row-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.point-row .editor-btn.small { flex: none; }

/* ----- Окно настройки точки: шаги слева направо, содержимое по центру ----- */
.point-overlay { align-items: start; }
.point-modal {
  width: min(720px, 100%);
  /* Ровная высота: окно не прыгает при переходе между шагами. */
  min-height: min(520px, 82vh);
  max-height: min(88vh, 900px);
  margin: min(6vh, 48px) 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0e1418;
  box-shadow: var(--shadow);
}
.point-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.point-head strong { font-size: 17px; }

.point-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.point-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}
.point-step.is-active { border-color: var(--accent); color: var(--ink); background: rgba(232, 180, 75, .1); }
.point-step.is-done { color: var(--ink); }
.point-step-num {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.point-step.is-active .point-step-num { background: var(--accent); color: #2a1c05; }
.point-step-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Шаг — кнопка: по названиям шагов можно ходить нажатием, а не только
   «Назад/Далее». Сама рамка и подсветка остались на <li>, кнопка внутри
   прозрачная и занимает его целиком. */
.point-step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
}
.point-step:not(.is-active):hover { border-color: rgba(232, 180, 75, .45); color: var(--ink); }

/* Свёрнутые необязательные настройки. Одна строка вместо трёх полей, которые
   в девяти точках из десяти остаются пустыми. */
.editor-optional {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.editor-optional > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  user-select: none;
}
.editor-optional > summary::-webkit-details-marker { display: none; }
.editor-optional > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .14s ease;
}
.editor-optional[open] > summary::before { content: "▾ "; }
.editor-optional > summary:hover { color: var(--ink); }
.editor-optional > *:not(summary) { margin-top: 10px; }

.point-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.point-foot { display: flex; align-items: center; gap: 10px; }
.point-foot-space { flex: 1; }

/* Шаг «тип точки»: крупные карточки — видно все варианты сразу. */
.point-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.point-kind {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
.point-kind:hover { border-color: var(--accent); background: rgba(232, 180, 75, .08); transform: translateY(-1px); }
.point-kind.is-active { border-color: var(--accent); background: rgba(232, 180, 75, .14); }
.point-kind-icon { font-size: 22px; line-height: 1; }
.point-kind-title { font-size: 15px; }
.point-kind-hint { color: var(--muted); font-size: 12px; line-height: 1.35; }

@media (max-width: 620px) {
  .point-kinds { grid-template-columns: 1fr; }
  .point-steps { flex-direction: column; align-items: stretch; }
}

.editor-page .brand-link, .editor-page .admin-logout { text-decoration: none; }

/* Шапка конструктора: «Карта мира», «Обучение», «Выйти» строго на одной прямой. */
.editor-page .admin-nav { gap: 12px; flex-wrap: nowrap; }
.editor-page .admin-nav .brand-link,
.editor-page .admin-nav-actions .editor-btn,
.editor-page .admin-nav-actions .admin-logout {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  line-height: 1;
  box-sizing: border-box;
}
.editor-page .admin-nav-actions .editor-btn { min-height: 40px; padding: 0 16px; }

@media (max-width: 760px) {
  .editor-grid { grid-template-columns: 1fr; gap: 18px; }
  .editor-section-head { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Окно точки: мини-игра или видео (js/games.js).
   Окно общее для всех типов; содержимое рисует соответствующая игра.
   ========================================================================== */
.game-window {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px;
  background: rgba(6, 10, 18, .62);
  backdrop-filter: blur(6px);
}

.game-window.is-open { display: grid; }

.gw-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: gw-pop .18s ease;
}

/* Видео шире игр — под 16:9 нужен запас по ширине. */
.gw-panel:has(.gw-video) { width: min(860px, 100%); }

@keyframes gw-pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.gw-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: .6;
}
.gw-close:hover { opacity: 1; }

.gw-title {
  margin: 0 40px 0 0;
  font-size: 19px;
  line-height: 1.16;
}

.gw-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* Расстояние между блоками окна задания. Было 12 — на доске из картинок
     нижний ряд почти касался кнопок с ответами, и пальцем легко промахнуться
     мимо своего блока. */
  gap: 16px;
}

/* Варианты ответа — отдельный блок, а не продолжение доски: добавляем к общему
   зазору ещё немного, чтобы «поле игры» и «ответы» читались как две части. */
.gw-body > .gw-pool { margin-top: 4px; }

/* Счётчик под игрой («Осталось: 6», «Круг 1 из 3») не должен липнуть к последней
   кнопке. */
.gw-body > .gw-speak-note { margin-top: 2px; }

.gw-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.38;
}

/* ----- Общая карточка-ответ (используют викторина, пары и порядок) ----- */
.gw-option,
.gw-card {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: inherit;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.gw-option:hover:not(:disabled),
.gw-card:hover:not(:disabled) {
  background: rgba(255, 255, 255, .1);
  transform: translateY(-1px);
}

.gw-option.is-right,
.gw-card.is-done {
  border-color: var(--good);
  background: rgba(95, 199, 156, .22);
  cursor: default;
  transform: none;
}

.gw-card.is-done { opacity: .55; }

.gw-option.is-wrong,
.gw-card.is-wrong {
  border-color: #d9534f;
  background: rgba(217, 83, 79, .2);
  animation: gw-shake .3s ease;
}

.gw-card.is-picked {
  border-color: var(--accent);
  background: rgba(232, 180, 75, .2);
}

@keyframes gw-shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.gw-options { display: flex; flex-direction: column; gap: 8px; }

/* ----- Пары: две колонки ----- */
.gw-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gw-column { display: flex; flex-direction: column; gap: 8px; }
.gw-columns .gw-card { text-align: center; }

/* ----- Порядок: полка выбранного + пул карточек ----- */
.gw-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.gw-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(95, 199, 156, .22);
  border: 1px solid var(--good);
  font-size: 13px;
  font-weight: 700;
}

.gw-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-pool .gw-card { flex: 1 1 40%; text-align: center; }

/* ----- Видео ----- */
.gw-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 10px;
  background: #000;
}

/* ----- Подвал: подсказка и результат ----- */
.gw-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

.gw-footer[hidden] { display: none; }

.gw-hint {
  color: var(--muted);
  font-size: 13px;
}

.gw-done {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--good);
}

.gw-ok {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: var(--good);
  color: #06251b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Переход к следующему заданию точки: жёлтая, как «главное действие» везде в
   игре, и всегда в правом конце подвала — рядом с подсказкой «осталось N». */
.gw-next {
  margin-left: auto;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #221a06;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.gw-next:hover { background: #f3c463; }

/* Точка-игра и точка-видео — свой цвет метки, как у телепорта. */
.hotspot.is-game {
  background: radial-gradient(circle at 50% 38%, #c9a6ff, #7a4fd6);
  box-shadow: 0 0 0 6px rgba(122, 79, 214, .22), 0 0 22px rgba(122, 79, 214, .5);
  opacity: .8;
}
.hotspot.is-video {
  background: radial-gradient(circle at 50% 38%, #ffb0a0, #e2563c);
  box-shadow: 0 0 0 6px rgba(226, 86, 60, .22), 0 0 22px rgba(226, 86, 60, .5);
  opacity: .8;
}
.hotspot.is-game:hover,
.hotspot.is-game:focus-visible,
.hotspot.is-video:hover,
.hotspot.is-video:focus-visible { opacity: 1; }

/* Кнопка открытия окна в панели точки (рядом с «Перейти →»). */
#objectPlay {
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: #7a4fd6;
  color: #fff;
}
#objectPlay[hidden] { display: none; }

@media (max-width: 760px) {
  .gw-panel { padding: 16px 14px 12px; max-height: 88vh; }
  .gw-columns { gap: 8px; }
  .gw-pool .gw-card { flex-basis: 100%; }
}

/* ----- Картинки в играх ----- */
.gw-pic {
  align-self: center;
  max-width: min(260px, 100%);
  max-height: 180px;
  border-radius: 10px;
  object-fit: contain;
}

.gw-pics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.gw-pic-tile {
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  transition: transform .12s ease, border-color .12s ease;
}
.gw-pic-tile img { width: 100%; height: 100%; object-fit: contain; }
.gw-pic-empty { font-size: 30px; }
.gw-pic-tile:hover:not(:disabled) { transform: translateY(-2px); }
.gw-pic-tile.is-picked { border-color: var(--accent); background: rgba(232, 180, 75, .18); }
.gw-pic-tile.is-done { border-color: var(--good); opacity: .5; cursor: default; }
.gw-pic-tile.is-wrong { border-color: #d9534f; animation: gw-shake .3s ease; }

/* ----- Мемори и карточки-перевёртыши ----- */
.gw-memory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.gw-flip {
  position: relative;
  min-height: 74px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, transform .15s ease;
}
.gw-flip .gw-flip-face { display: none; }
.gw-flip .gw-flip-back { font-size: 22px; opacity: .65; }
.gw-flip.is-open { background: rgba(232, 180, 75, .16); }
.gw-flip.is-open .gw-flip-face { display: block; }
.gw-flip.is-open .gw-flip-back { display: none; }
.gw-flip.is-done { border-color: var(--good); background: rgba(95, 199, 156, .2); opacity: .6; cursor: default; }

/* ----- Буквы: собери слово, пропущенная буква, угадай слово ----- */
.gw-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.gw-slot {
  min-width: 34px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-bottom: 3px solid var(--line);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .02em;
}
.gw-slot.is-filled { border-bottom-color: var(--good); }

.gw-tile {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: inherit;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
}
.gw-tile:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.gw-tile.is-done { opacity: .35; cursor: default; }
.gw-tile.is-wrong { border-color: #d9534f; animation: gw-shake .3s ease; }

/* ----- Экранная клавиатура ----- */
.gw-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  /* Клавиши буквенных игр стояли в 4px друг от друга — теснее всего в окне;
     детский палец легко задевал соседнюю. Ровняем на общий зазор ответов. */
  gap: 6px;
}

.gw-key {
  min-width: 32px;
  height: 36px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.gw-key-wide { min-width: 62px; }
.gw-key:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
.gw-key.is-right { border-color: var(--good); background: rgba(95, 199, 156, .28); }
.gw-key.is-miss { opacity: .3; }
.gw-key:disabled { cursor: default; }

/* ----- Поле «слово из 5 букв» ----- */
/* Сетка «вордли»: 5px между клетками было теснее любого другого зазора в окне. */
.gw-grid { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gw-grid-row { display: flex; gap: 6px; }
.gw-cell {
  width: 42px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 7px;
  font-size: 21px;
  font-weight: 900;
}
.gw-cell.is-hit { background: #5fc79c; border-color: #5fc79c; color: #06251b; }
.gw-cell.is-near { background: #e8b44b; border-color: #e8b44b; color: #2b1d00; }
.gw-cell.is-miss { background: rgba(255, 255, 255, .08); opacity: .65; }

/* ----- Верно / неверно ----- */
.gw-statements { display: flex; flex-direction: column; gap: 8px; }
.gw-statement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
}
.gw-statement.is-done { border-color: var(--good); background: rgba(95, 199, 156, .16); opacity: .7; }
.gw-statement.is-wrong { border-color: #d9534f; animation: gw-shake .3s ease; }
.gw-mini-row { display: flex; gap: 8px; }
.gw-mini {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.gw-mini:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
.gw-mini:disabled { opacity: .4; cursor: default; }

/* ----- Внутренности задания ----- */
/* У большинства типов в корне игры НЕСКОЛЬКО блоков: доска и ответы (корзины,
   «картинка и слово»), клетки слова и клавиатура («угадай слово», «вордли»),
   клетки и буквы («пропущенная буква»). Своего отступа у обёртки не было, и
   нижний ряд доски упирался в ответы вплотную — палец промахивался мимо своего
   блока. Отступ здесь БОЛЬШЕ, чем зазор между соседними ответами (8px): так
   видно, что это две разные части задания, а не один длинный список. */
.gw-game > * + * { margin-top: 14px; }

/* ----- Корзины ----- */
.gw-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.gw-bucket {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 92px;
  padding: 9px;
  border: 2px dashed var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.gw-bucket:hover { border-color: var(--accent); background: rgba(232, 180, 75, .08); }
.gw-bucket strong { font-size: 14px; }
.gw-bucket.is-wrong { border-color: #d9534f; animation: gw-shake .3s ease; }

/* ----- Поймай нужное ----- */
.gw-field {
  position: relative;
  height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(122, 79, 214, .16), rgba(0, 0, 0, .12));
}

.gw-drop {
  position: absolute;
  top: -44px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: #5fc79c;
  color: #06251b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  animation: gw-fall linear forwards;
}
.gw-drop.is-bad { background: #e2563c; color: #fff; }
.gw-drop.is-hit { outline: 3px solid #fff; }

@keyframes gw-fall {
  from { transform: translateY(0); }
  to   { transform: translateY(330px); }
}

/* ----- Кнопка озвучки ----- */
/* Кнопка звука — единственный способ услышать слово, поэтому она крупная,
   по центру и, пока слово не прослушали, слегка пульсирует. */
.gw-speak {
  align-self: center;
  padding: 13px 26px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #2b1d00;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(232, 180, 75, .3);
  cursor: pointer;
}
.gw-speak:hover { filter: brightness(1.06); }
.gw-speak.is-calling { animation: gw-speak-call 1.8s ease-in-out infinite; }
@keyframes gw-speak-call {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 24px rgba(232, 180, 75, .3); }
  50%      { transform: scale(1.05); box-shadow: 0 14px 30px rgba(232, 180, 75, .5); }
}
@media (prefers-reduced-motion: reduce) { .gw-speak.is-calling { animation: none; } }
.gw-speak-note {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}

/* ---------- Большая сцена: «Найди на картинке» и «Слушай и покажи» ---------- */
/* Отметки лежат В ОДНОЙ системе координат с картинкой: и круг попадания, и его
   кружок на экране заданы в процентах ШИРИНЫ (aspect-ratio: 1 делает из этого
   настоящий круг). Поэтому область попадания совпадает с тем, что видно, на
   любом размере экрана. */
.gw-scene {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, .25);
  overflow: hidden;
  cursor: crosshair;
  touch-action: manipulation;
}

.gw-scene.is-wrong { border-color: #d9534f; animation: gw-shake .3s ease; }

.gw-scene-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.gw-scene-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gw-scene-mark {
  position: absolute;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.gw-scene-mark.is-found {
  border: 3px solid var(--good);
  background: rgba(95, 199, 156, .22);
}

.gw-scene-mark.is-found i {
  font-style: normal;
  font-weight: 900;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

/* Круг-подсказка после трёх промахов: мигает и сам исчезает. */
.gw-scene-mark.is-hint {
  border: 3px dashed var(--accent);
  background: rgba(232, 180, 75, .16);
  animation: gw-speak-call 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) { .gw-scene-mark.is-hint { animation: none; } }

.gw-scene-ask {
  margin: 0 0 8px;
  font-size: 1.06rem;
  font-weight: 800;
  text-align: center;
}

.gw-scene-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.gw-scene-help { flex: 0 0 auto; }

/* ---------- «Что исчезло» ---------- */
/* Плитка доски не кнопка: нажимать нужно не по ней, а по варианту ответа ниже. */
.gw-pic-tile.is-static { cursor: default; }
.gw-pic-tile.is-gone {
  border-style: dashed;
  border-color: var(--accent);
  background: rgba(232, 180, 75, .12);
}

.gw-memo-board { margin-bottom: 10px; }

/* ---------- «Одинаковые или разные» ---------- */
.gw-sd-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}

.gw-sd-pair.is-wrong { animation: gw-shake .3s ease; }

.gw-sd-card {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}

.gw-sd-card img { width: 100%; max-height: 160px; object-fit: contain; }
.gw-sd-vs { color: var(--muted); font-size: 1.4rem; font-weight: 900; }

.gw-sd-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gw-sd-answers .gw-card { text-align: center; font-weight: 800; }

/* ---------- «Скажи вслух» ---------- */
.gw-speak-card {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-bottom: 6px;
}

.gw-speak-phrase {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  text-wrap: balance;
}

.gw-speak-done {
  align-self: center;
  margin-top: 10px;
  min-width: 180px;
  text-align: center;
  font-weight: 800;
}

.gw-speak-done:disabled { opacity: .45; cursor: default; }

@media (max-width: 760px) {
  .gw-sd-pair { grid-template-columns: 1fr; }
  .gw-sd-vs { display: none; }
  .gw-field { height: 230px; }
  .gw-cell { width: 36px; height: 40px; font-size: 18px; }
  .gw-memory { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
}

/* ==========================================================================
   Сборка урока с ИИ — отдельная страница ai.html.
   Слева то, что рассказал учитель, справа разговор. На узком экране колонки
   встают друг под другом: страница прокручивается целиком, ничего не
   «залипает» и не прячется под сгибом.
   ========================================================================== */
/* Окно «нарисовать карту по описанию»: узкое, в нём одна форма. */
.sec-map-modal { width: min(620px, 100%); }

/* Предпросмотр нарисованной карты перед вопросом «использовать её?».
   Карта широкая (16:9), поэтому вписываем по ширине окна и ограничиваем
   высоту — иначе на ноутбуке кнопки «да/нет» уезжают за край экрана. */
.sec-map-preview {
  margin: 8px 0 12px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, .18);
}

.sec-map-preview img {
  display: block;
  width: 100%;
  max-height: 46vh;
  object-fit: contain;
}

.ai-page { padding-bottom: 32px; }
.ai-page-title { margin: 8px 0 6px; font-size: 26px; }

.ai-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

.ai-inputs .editor-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ai-inputs .field { margin-bottom: 14px; }
.ai-inputs input[type="text"],
.ai-inputs textarea { width: 100%; }

.ai-chat {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-log {
  min-height: 320px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.ai-msg { display: grid; gap: 4px; }
.ai-msg-who {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ai-msg-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}
.ai-msg.is-user .ai-msg-text {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(232, 180, 75, .12);
}

/* Ответ модели приходит в Markdown; разбирает его js/ai.js, здесь — только вид. */
.ai-md { display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }
.ai-md-head { font-size: 15px; }
.ai-md-p { margin: 0; }
.ai-md-list { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.ai-md code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
}

.ai-ask { display: flex; align-items: flex-end; gap: 8px; }
.ai-ask textarea { flex: 1; min-width: 0; }

/* Подвал: строка баланса занимает всю ширину, кнопки — своей строкой справа. */
.ai-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.ai-foot .pano-gen-left { flex: 1 1 100%; margin: 0; text-align: left; }

.ai-refs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ai-ref { position: relative; width: 72px; height: 72px; }
.ai-ref img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ai-ref .editor-x { position: absolute; right: -6px; top: -6px; width: 24px; height: 24px; }

/* Список механик с галочками: «какие задания хочу» и «какие не использовать». */
.ai-pick-pop { max-height: 320px; overflow-y: auto; padding: 6px; }
.ai-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
}
.ai-pick-item:hover { background: rgba(255, 255, 255, .07); }
.ai-pick-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.ai-pick .ed-select-label { white-space: normal; text-align: left; line-height: 1.3; }

@media (max-width: 900px) {
  .ai-body { grid-template-columns: minmax(0, 1fr); }
  .ai-chat { position: static; }
  .ai-log { min-height: 240px; max-height: none; }
}

/* ==========================================================================
   Пазл, тест и колесо (js/games.js)
   ========================================================================== */

/* Звук в конструкторе: ряд кнопок, поле ссылки и предпрослушивание. */
.editor-audio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.editor-audio { display: block; width: 100%; margin-top: 8px; }
.editor-audio[hidden] { display: none; }

/* Плеер звука: и отдельной вкладкой, и над игрой. Во всю ширину окна —
   системный плеер иначе прижимается влево и выглядит потерянным. */
.gw-audio {
  display: block;
  width: 100%;
  margin: 6px 0 10px;
}

/* Галочка в настройках игры: подпись справа от квадратика, а не над ним. */
.editor-flag { display: flex; align-items: center; gap: 10px; }
.editor-flag .editor-sublabel { margin: 0; }

/* ----- Заполни пропуски ----- */
.gw-cloze-line {
  margin: 4px 0 14px;
  font-size: 19px;
  line-height: 2;
  text-align: center;
}
.gw-cloze-gap {
  display: inline-block;
  min-width: 92px;
  margin: 0 4px;
  padding: 2px 10px;
  border-bottom: 2px dashed var(--line);
  color: var(--accent);
  font-weight: 800;
  text-align: center;
}
.gw-cloze-gap.is-filled { border-bottom-color: var(--accent); }

/* ----- Слова-пазлы ----- */
.gw-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gw-parts-col { display: grid; gap: 8px; }
.gw-parts-item { font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.gw-parts-item.is-picked { border-color: var(--accent); background: rgba(232, 180, 75, .18); }
.gw-parts-item.is-done { opacity: .45; }
.gw-parts-word {
  min-height: 28px;
  margin: 12px 0 0;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

/* ----- Вопрос по картинке ----- */
.gw-open-stage { display: grid; justify-items: center; }
/* Ряд кнопок и счётчик под ним: без зазора счётчик прилипал к кнопкам. */
.gw-open-question + .gw-scene-actions { margin-bottom: 10px; }
.gw-open-question {
  margin: 12px 0 10px;
  font-size: 19px;
  font-weight: 800;
  text-align: center;
}

/* Утверждение с картинкой: картинка слева, подпись рядом, кнопки справа. */
.gw-statement.has-pic { align-items: center; }
.gw-statement.has-pic .gw-pic-sm {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
}

/* ----- Пазл ----- */
.gw-puzzle {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), 1fr);
  gap: 4px;
  width: min(420px, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}
.gw-puzzle-cell {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, .25);
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.gw-puzzle-cell:hover { transform: scale(.97); }
.gw-puzzle-cell.is-picked { border-color: var(--accent); transform: scale(.93); }
.gw-puzzle-cell.is-right { border-color: rgba(95, 199, 156, .55); }
.gw-puzzle.is-done { gap: 0; padding: 0; }
.gw-puzzle.is-done .gw-puzzle-cell { border-color: transparent; border-radius: 0; }
.gw-puzzle.is-done .gw-puzzle-cell:hover { transform: none; }

/* ----- Тест ----- */
/* Отмеченный вариант виден и цветом, и рамкой: только цвет на проекторе в
   классе теряется. */
.gw-test-option.is-picked {
  border-color: var(--accent);
  background: rgba(232, 180, 75, .18);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.gw-test-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.gw-test-note { color: var(--muted); font-size: 13px; }
.gw-test-answer { min-width: 140px; }

/* ----- Колесо ----- */
.gw-wheel {
  position: relative;
  width: min(320px, 82vw);
  height: min(320px, 82vw);
  margin: 6px auto 14px;
}
.gw-wheel-rotor {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* Долгий «выкат» в конце: колесо должно тормозить, а не останавливаться. */
  transition: transform 2.6s cubic-bezier(.17, .84, .2, 1);
}
.gw-wheel-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .14);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
}
.gw-wheel-labels { position: absolute; inset: 0; }
.gw-wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 92px;
  color: #16110a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.gw-wheel-label.is-used { opacity: .35; }
/* Тот же переход, что у колеса: подпись едет вместе с сектором и всё это время
   остаётся горизонтальной. */
.gw-wheel-label { transition: transform 2.6s cubic-bezier(.17, .84, .2, 1); }
/* Стрелка сверху — она и показывает выпавший сектор. */
.gw-wheel-pin {
  position: absolute;
  left: 50%;
  top: -6px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--ink);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.gw-wheel-spin { display: block; margin: 0 auto; min-width: 160px; }
.gw-wheel-stage { display: grid; justify-items: center; gap: 8px; margin-top: 14px; }
.gw-wheel-word { font-size: 22px; }

@media (prefers-reduced-motion: reduce) {
  .gw-wheel-rotor { transition-duration: .6s; }
}

@media (max-width: 760px) {
  .gw-puzzle { width: 100%; }
  .gw-wheel-label { max-width: 70px; font-size: 11px; }
}

/* Строка «картинка + подпись» в конструкторе (игра «Картинка и слово»). */
.editor-pair-row { align-items: flex-start; }
.editor-pair-row .editor-field { flex: 0 0 auto; width: 128px; }
.editor-pair-row .editor-comic-preview { min-height: 70px; }

/* ==========================================================================
   Панель класса в правом нижнем углу карты: достижения ученика, а у учителя —
   выбор ученика, за которого он работает, и выдача награды за урок.
   ========================================================================== */
.class-panel {
  position: absolute;
  /* Слева от кнопок масштаба (они 42 px у правого края) — иначе панель их
     перекрывала и до «+»/«−» было не дотянуться. */
  right: calc(max(16px, env(safe-area-inset-right)) + 52px);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(280px, calc(100% - 88px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.class-panel[hidden] { display: none; }

.class-row { display: flex; align-items: center; gap: 6px; }
.class-label { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; }

/* Шапка панели и сворачивание: панель стоит в углу карты и мешает, когда
   награды не нужны — свёрнутая остаётся полоской с названием. */
.class-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.class-title { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.class-collapse {
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.class-collapse:hover { background: rgba(255, 255, 255, .15); }
/* Шеврон — SVG во всю кнопку: у символа «⌄» своя высота строки, и в кнопке
   26x26 он вставал заметно ниже центра. */
.chevron { display: block; width: 12px; height: 12px; }
.class-collapse .chevron { width: 13px; height: 13px; }
.class-panel.is-collapsed .class-collapse { transform: rotate(180deg); }
/* Свёрнутая панель ужимается до подписи с кнопкой и перестаёт закрывать карту. */
.class-panel.is-collapsed { width: auto; }
.class-body { display: flex; flex-direction: column; gap: 8px; }
.class-panel.is-collapsed .class-body { display: none; }

/* Выбор ученика: свой список вместо системного select — с инициалами,
   отметкой выбранного и оформлением остальной панели. */
#classPick { flex-direction: column; align-items: stretch; gap: 4px; }
.student-line { display: flex; align-items: center; gap: 6px; }
.student-pick { position: relative; flex: 1; min-width: 0; }
.student-current {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.student-current:hover { background: rgba(255, 255, 255, .12); }
.student-current[aria-expanded="true"] { border-color: var(--accent); }
.student-ava {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), #f3d089);
  color: #2a1c05;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.student-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-caret { flex: none; color: var(--muted); font-size: 11px; line-height: 1; transition: transform .16s ease; }
.student-current[aria-expanded="true"] .student-caret { transform: rotate(180deg); }

/* Панель висит у нижнего края, поэтому список раскрывается ВВЕРХ. */
.student-pop {
  position: absolute;
  /* Тянем список от левого края триггера вправо: имена длиннее узкой кнопки,
     а панель прижата к правому краю карты, поэтому наружу расти нельзя. */
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 244px;
  bottom: calc(100% + 6px);
  z-index: 8;
  max-height: 224px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* Список непрозрачный: он ложится поверх карты, сквозь полупрозрачный фон
     панели имена читались бы плохо. */
  background: #0b1013;
  box-shadow: var(--shadow);
}
.student-pop[hidden] { display: none; }
.student-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.student-option:hover, .student-option:focus-visible { background: rgba(255, 255, 255, .12); }
.student-option.is-active { background: rgba(232, 180, 75, .16); }
.student-option .student-mark { flex: none; width: 14px; text-align: center; color: var(--accent); }

.class-mini {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.class-mini:hover { background: rgba(255, 255, 255, .15); }
.class-mini.is-ok { background: var(--good); color: #06251b; border-color: transparent; font-weight: 800; }

.class-form { display: flex; flex-direction: column; gap: 6px; }
.class-form[hidden] { display: none; }
.class-form input {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: inherit;
  font: inherit;
  font-size: 13px;
}
.class-form-actions { display: flex; gap: 6px; }
.class-note { color: var(--muted); font-size: 12px; }

/* Полка достижений: неполученные — приглушённые. Нажатие открывает карточку
   награды, где учитель её и выдаёт (других способов получить награду нет). */
.class-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.class-badge {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease;
}
.class-badge:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.class-badge img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1); opacity: .3; }
.class-badge.is-owned img { filter: none; opacity: 1; }

/* ----- Окно награды: карточка с кнопкой «Выдать» и поздравление ----- */
.badge-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 9, 15, .72);
  backdrop-filter: blur(4px);
}
.badge-overlay[hidden] { display: none; }

.badge-panel {
  position: relative;
  width: min(360px, 100%);
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}
.badge-x {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.badge-x:hover { background: rgba(255, 255, 255, .1); color: inherit; }

.badge-big {
  width: 108px;
  height: 108px;
  object-fit: contain;
  margin-bottom: 12px;
}
.badge-title { display: block; font-size: 20px; }
.badge-text { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.badge-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
/* «Забрать» у выданной награды: нарочно тихая кнопка. Забирать приходится
   редко (ошиблись учеником), и она не должна спорить с самой наградой —
   поэтому едва видна и проявляется при наведении. */
.badge-revoke {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  opacity: .35;
  cursor: pointer;
  transition: opacity .16s ease, color .16s ease, border-color .16s ease;
}
.badge-revoke:hover,
.badge-revoke:focus-visible { opacity: 1; color: var(--danger); border-color: rgba(234, 164, 147, .5); }
.badge-revoke:disabled { opacity: .3; cursor: default; }

.badge-give {
  margin-top: 16px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #2b1d00;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.badge-give[hidden] { display: none; }
.badge-give:disabled { opacity: .6; cursor: default; }

/* Поздравление: та же карточка, но награда крупнее и «выезжает». */
.badge-panel.is-congrats .badge-big {
  width: 148px;
  height: 148px;
  animation: badgePop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.badge-panel.is-congrats .badge-title { color: var(--accent); font-size: 24px; }

@keyframes badgePop {
  from { transform: scale(.4) rotate(-12deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-panel.is-congrats .badge-big { animation: none; }
}

/* ---------- Карта на телефоне ----------
   Правило одно: у низа экрана ОДИН ряд управления (профиль, «?», обратная
   связь слева и масштаб справа), а всё остальное встаёт над ним. Прежде полка
   наград растягивалась во всю ширину на высоте 76 px и накрывала колонку
   кнопок масштаба — до «+»/«−» было не дотянуться. */
@media (max-width: 760px) {
  /* Кнопки нижнего ряда — только значки: три подписи в ширину телефона не
     помещаются, а ряд стоит поверх карты и не должен её съедать. */
  .user-menu {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  .user-menu-bar { gap: 6px; }
  .user-menu-btn-text { display: none; }
  .user-menu-btn { width: 42px; padding: 0; justify-content: center; gap: 0; }

  /* Масштаб — в строку, на той же высоте, что и кнопки слева: вертикальная
     колонка занимала правый край на 90 px вверх и упиралась в полку наград. */
  .map-zoom {
    flex-direction: row;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  /* Полка наград — над рядом управления, во всю ширину и с прокруткой:
     значков у ученика бывает десяток, и без ограничения высоты панель
     закрывала бы карту целиком. */
  .class-panel {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 50px);
    width: auto;
    max-height: 46vh;
    overflow: auto;
    overscroll-behavior: contain;
  }
}

/* Подсказка на точке: какая игра или видео за ней скрыты. */
.hotspot-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(12, 16, 24, .94);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
}

.hotspot:hover .hotspot-tip,
.hotspot:focus-visible .hotspot-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----- Вкладки в окне точки ----- */
.gw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 36px;
}
.gw-tabs[hidden] { display: none; }

.gw-tab {
  position: relative;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.gw-tab:hover { background: rgba(255, 255, 255, .12); }
.gw-tab.is-active { border-color: var(--accent); background: rgba(232, 180, 75, .2); }
.gw-tab.is-done { border-color: var(--good); }
.gw-tab.is-done::after {
  content: "✓";
  margin-left: 6px;
  color: var(--good);
  font-weight: 900;
}

/* ----- Картинки внутри вариантов ----- */
.gw-option.has-pic,
.gw-card.has-pic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.gw-pic-sm {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 8px;
}

.gw-opt-text { font-size: 14px; font-weight: 700; }

/* Пул карточек с картинками раскладываем сеткой. */
.gw-pool { align-items: flex-start; }
.gw-pool .gw-card.has-pic { flex: 0 1 auto; min-width: 104px; }

/* Оборот карточки для перевода: картинка, перевод или и то и другое.
   Пока карточка не перевёрнута, оборот скрыт (.gw-flip .gw-flip-face выше),
   поэтому раскладку задаём только у открытой — иначе она бы всё показала. */
.gw-flip.is-open .gw-flip-face.has-pic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gw-flip-pic { width: 100%; max-height: 62px; object-fit: contain; }
.gw-flip-word { font-size: 15px; font-weight: 700; }

/* Фишка в корзине: маленькая картинка и подпись рядом. */
.gw-chip.has-pic { display: inline-flex; align-items: center; gap: 6px; }
.gw-chip-pic { width: 26px; height: 26px; object-fit: contain; }

.gw-drop-pic { width: 34px; height: 34px; object-fit: contain; vertical-align: middle; }

.gw-drop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 760px) {
  .gw-pic-sm { width: 66px; height: 66px; }
}

/* Свой набор достижений карты в конструкторе раздела. */
.editor-badge-row { display: flex; align-items: center; gap: 10px; }
.editor-badge-row input { flex: 1; min-width: 0; }
.editor-badge-icon { width: 42px; height: 42px; object-fit: contain; flex: 0 0 auto; }
.editor-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ==================== Точка-награда и конфетти ==================== */
/* Кружок с наградой — золотой и слегка «дышит»: подарок видно издалека. */
.hotspot.is-reward {
  background: radial-gradient(circle at 50% 34%, #ffe9a8, #e0a119);
  box-shadow: 0 0 0 6px rgba(232, 180, 75, .26), 0 0 26px rgba(232, 180, 75, .6);
  opacity: .92;
  animation: reward-pulse 2.6s ease-in-out infinite;
}
.hotspot.is-reward:hover,
.hotspot.is-reward:focus-visible { opacity: 1; }
@keyframes reward-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(232, 180, 75, .26), 0 0 26px rgba(232, 180, 75, .55); }
  50%      { box-shadow: 0 0 0 10px rgba(232, 180, 75, .16), 0 0 34px rgba(232, 180, 75, .8); }
}

/* Точка, которая ещё не открылась: её на панораме просто нет. Держим в DOM
   (а не убираем), чтобы появление можно было показать анимацией. */
.hotspot.is-gated {
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(.4);
  pointer-events: none;
}
/* Появление кружка после прохождения предыдущего: «выпрыгивает» из точки. */
.hotspot.just-opened { animation: hotspot-pop .62s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes hotspot-pop {
  0%   { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.22); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hotspot.is-reward { animation: none; }
  .hotspot.just-opened { animation: none; }
}

/* Окно награды: карточки на выбор. */
.gw-rewards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.gw-reward {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid rgba(232, 180, 75, .45);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 246, 224, .12), rgba(232, 180, 75, .08));
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .3s ease;
}
.gw-reward:hover:not(:disabled),
.gw-reward:focus-visible {
  transform: translateY(-3px) scale(1.03);
  border-color: #e8b44b;
  box-shadow: 0 12px 26px rgba(232, 180, 75, .3);
}
.gw-reward img { width: 84px; height: 84px; object-fit: contain; }
.gw-reward.is-chosen {
  border-color: #e8b44b;
  background: linear-gradient(180deg, rgba(255, 226, 150, .3), rgba(232, 180, 75, .18));
  transform: scale(1.06);
  box-shadow: 0 16px 34px rgba(232, 180, 75, .4);
}
.gw-reward.is-faded { opacity: .28; filter: grayscale(.6); }
.gw-reward:disabled { cursor: default; }

/* Поздравление после выбора награды. */
.gw-reward-got {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(122, 199, 79, .18), rgba(122, 199, 79, .06));
  text-align: center;
  animation: hotspot-pop .5s cubic-bezier(.2, 1.5, .4, 1);
}
.gw-reward-got strong { font-size: 1.12rem; }
.gw-reward-got span { opacity: .8; font-size: .92rem; }

/* Конфетти: слой поверх окна, элементы падают и крутятся. */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  z-index: 5;
}
.confetti-piece {
  position: absolute;
  top: -6%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: .95;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: both;
}
.confetti-piece.is-round { width: 10px; height: 10px; border-radius: 50%; }
/* Падение задаём через top, а НЕ через translateY в процентах: проценты в
   transform считаются от размера самой конфетти (14 px), и она пролетала
   полтора сантиметра у верхней кромки вместо всего окна. */
@keyframes confetti-fall {
  0%   { top: -6%; transform: translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { top: 106%; transform: translateX(var(--drift, 0)) rotate(var(--spin, 360deg)); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}

/* ==================== Обучение: подсветка элементов ==================== */
/* Тур подсвечивает настоящие кнопки страницы (js/tour.js): «дырку» рисуем
   огромной тенью вокруг рамки — так затемнение и вырез это один элемент. */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
.tour-overlay.is-open { display: block; }

.tour-hole {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(4, 8, 11, .72), 0 0 0 3px var(--accent), 0 0 26px rgba(232, 180, 75, .55);
  transition: left .28s cubic-bezier(.4, 0, .2, 1), top .28s cubic-bezier(.4, 0, .2, 1),
              width .28s cubic-bezier(.4, 0, .2, 1), height .28s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
/* Шаг без якоря — просто затемнение на весь экран. */
.tour-hole.is-hidden {
  left: 50%; top: 50%; width: 0; height: 0;
  box-shadow: 0 0 0 9999px rgba(4, 8, 11, .78);
}

.tour-card {
  position: fixed;
  width: min(330px, calc(100vw - 24px));
  display: grid;
  gap: 6px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 24, 28, .98), rgba(11, 16, 19, .98));
  box-shadow: var(--shadow);
  transition: left .28s cubic-bezier(.4, 0, .2, 1), top .28s cubic-bezier(.4, 0, .2, 1);
}
.tour-card.is-move { animation: tour-card-in .28s ease; }
@keyframes tour-card-in {
  from { opacity: .3; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}
.tour-counter { color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tour-title { font-size: 1.08rem; line-height: 1.25; }
.tour-text { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.45; }
.tour-nav { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tour-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease, border-color .16s ease;
}
.tour-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.tour-btn:disabled { opacity: .4; cursor: default; }
.tour-btn.is-primary { margin-left: auto; border-color: transparent; background: var(--accent); color: #221a06; }
.tour-btn.is-primary:hover { background: #f3c463; }
.tour-skip {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .86rem;
  text-decoration: underline;
  cursor: pointer;
}
.tour-skip:hover { color: var(--ink); }

/* Стрелка вместо подсветки — для целей размером с экран (карта раздела).
   Вырезать в затемнении «окно» во весь экран бессмысленно: подсветка исчезает,
   а карточка по центру закрывает ровно то, о чём рассказывает. */
.tour-arrow {
  position: fixed;
  z-index: 1;
  width: 38px;
  height: 38px;
  display: none;
  background: var(--accent);
  clip-path: polygon(0 34%, 56% 34%, 56% 10%, 100% 50%, 56% 90%, 56% 66%, 0 66%);
  filter: drop-shadow(0 2px 10px rgba(232, 180, 75, .55));
  animation: tour-arrow-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
.tour-arrow.is-on { display: block; }
@keyframes tour-arrow-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-hole, .tour-card { transition: none; }
  .tour-card.is-move { animation: none; }
  .tour-arrow { animation: none; }
}

/* Кнопка «Обучение» переехала в нижний ряд управления и стала значком «?»
   (.user-menu-btn.is-icon) — см. .user-menu-bar. */

/* ==================== «Доступно по подписке» ==================== */
.locked-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 8, 11, .68);
  backdrop-filter: blur(5px);
  animation: locked-fade .16s ease;
}
@keyframes locked-fade { from { opacity: 0; } to { opacity: 1; } }
.locked-panel {
  width: min(400px, 100%);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 26px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(20, 26, 30, .98), rgba(11, 16, 19, .98));
  box-shadow: var(--shadow);
  text-align: center;
  animation: gw-pop .2s ease;
}
.locked-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(232, 180, 75, .16);
  font-size: 26px;
}
.locked-title { font-size: 1.16rem; }
.locked-text { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.locked-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.locked-btn {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.locked-btn:hover { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.locked-btn.is-primary { border-color: transparent; background: var(--accent); color: #221a06; }
.locked-btn.is-primary:hover { background: #f3c463; }

/* Кнопка конструктора без подписки: тот же размер, но приглушённая и с замком. */
.map-action.is-locked {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  cursor: pointer;
}
.map-action.is-locked:hover { background: rgba(255, 255, 255, .12); color: var(--ink); }

/* Экран конструктора без подписки. */
.gate-locked { display: grid; gap: 10px; justify-items: center; text-align: center; }
.gate-lock {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(232, 180, 75, .16);
  font-size: 30px;
}
.gate-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }

/* ==================== Термины конструктора: «?» с подсказкой ==================== */
.term-q {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 2px;
  padding: 0;
  border: 1px solid rgba(232, 180, 75, .55);
  border-radius: 50%;
  background: rgba(232, 180, 75, .14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  transition: background .14s ease, transform .14s ease;
}
.term-q:hover,
.term-q:focus-visible { background: var(--accent); color: #221a06; transform: scale(1.12); }

.term-tip {
  position: fixed;
  z-index: 120;
  width: min(320px, calc(100vw - 20px));
  padding: 11px 13px;
  border: 1px solid rgba(232, 180, 75, .35);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 30, 34, .99), rgba(14, 19, 22, .99));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  color: var(--ink);
  font-size: .86rem;
  line-height: 1.5;
  pointer-events: none;
  animation: term-tip-in .14s ease;
}
@keyframes term-tip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==================== Отделка интерфейса ====================
   Слой идёт последним и намеренно перекрывает частные правила выше: до него
   кнопки, панели и карточки набирались по месту, и один и тот же элемент в
   разных экранах выглядел по-разному. Здесь собраны общие решения — радиусы,
   тени, наведение, нажатие и видимый фокус. Ничего, кроме внешнего вида. */

/* Видимый фокус для клавиатуры — одинаковый везде. Мышью он не появляется. */
/* Радиус НЕ задаём: обводка и так повторяет форму элемента, а фиксированные
   8px превратили бы круглые кнопки (метки на панораме) в квадраты. */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Панели плеера и карты — те же мягкие углы, что у окна игры (14px),
   и чуть более глубокая тень: панель должна отделяться от панорамы. */
.object-panel,
.quest-panel,
.scene-heading,
.map-action,
.map-top-actions .logout-link {
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .38), 0 2px 0 rgba(255, 255, 255, .04) inset;
}

/* Кнопки: подъём при наведении и осадка при нажатии — интерфейс отвечает. */
.map-action,
.editor-btn,
.tour-btn,
.locked-btn,
.gw-ok,
.quest-next {
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.map-action:hover,
.editor-btn:hover:not(:disabled),
.quest-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .34);
}
.map-action:active,
.editor-btn:active:not(:disabled),
.tour-btn:active,
.locked-btn:active,
.quest-next:active {
  transform: translateY(0) scale(.985);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
}
.editor-btn.primary:hover:not(:disabled) { box-shadow: 0 12px 28px rgba(232, 180, 75, .32); }
#editorLink:hover { box-shadow: 0 12px 28px rgba(232, 180, 75, .34); }

/* Метка уровня на карте: заметнее под курсором, ровный порядок наложения. */
.map-point {
  transition: transform .18s cubic-bezier(.2, 1.2, .4, 1), box-shadow .18s ease;
}
.map-point:hover,
.map-point:focus-visible {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 6px rgba(232, 180, 75, .22), 0 10px 22px rgba(0, 0, 0, .38);
  z-index: 3;
}
/* Закрытый уровень не притворяется доступным: подъёма нет, курсор — «нельзя». */
.map-point.is-locked { cursor: not-allowed; }
.map-point.is-locked:hover { transform: translate(-50%, -50%) scale(1.06); }

/* Кружки на панораме: под курсором крупнее, чтобы попасть было легче. */
.hotspot {
  transition: opacity .16s ease, transform .18s cubic-bezier(.2, 1.2, .4, 1), box-shadow .18s ease;
}
.hotspot:hover:not(.is-gated),
.hotspot:focus-visible {
  transform: translate(-50%, -50%) scale(1.14);
  z-index: 4;
}

/* Варианты ответа и карточки: заметный отклик и понятные состояния. */
.gw-option,
.gw-card,
.gw-chip,
.gw-flip {
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.gw-option:hover:not(:disabled),
.gw-card:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .26);
}
.gw-option:active:not(:disabled),
.gw-card:active:not(:disabled) { transform: scale(.98); }
.gw-option.is-right,
.gw-card.is-done { box-shadow: 0 0 0 3px rgba(95, 199, 156, .22); }
.gw-option.is-wrong { animation: gw-shake .32s ease; }
@keyframes gw-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Переключатель вкладок окна точки: активная вкладка приподнята. */
.gw-tab { transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.gw-tab:hover { transform: translateY(-1px); }
.gw-tab.is-active { box-shadow: 0 6px 16px rgba(232, 180, 75, .22); }

/* Карточки разделов и уровней в конструкторе: приподнимаются под курсором. */
.editor-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.editor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 180, 75, .38);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .3);
}

/* Полосы прокрутки — тонкие и в цвет интерфейса, а не системные серые. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .34); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Кому анимации мешают — отключаем всё разом. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================== Конструктор: отделка по итогам осмотра ==================== */
/* Знак «?» рядом с вкладками — по центру строки, а не под потолком:
   в флекс-контейнере он тянулся во всю высоту вкладки. */
.editor-tabs .term-q,
.editor-actions-row .term-q,
.admin-head .term-q { align-self: center; flex: 0 0 auto; }

/* Страница конструктора не должна быть плоской чернотой: мягкая подсветка
   сверху задаёт «верх» экрана и отделяет шапку от полотна. */
body.editor-page {
  background:
    radial-gradient(1200px 520px at 50% -10%, rgba(232, 180, 75, .09), transparent 70%),
    linear-gradient(180deg, #0b1014 0%, #070a0d 45%);
  background-attachment: fixed;
}

/* Пять типов точек в два столбца оставляли последний ряд полупустым:
   раскладываем по ширине окна. */
.point-kinds {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* Карточка типа точки: под курсором приподнимается, выбранная — с рамкой. */
.point-kind { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.point-kind:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .3); }
.point-kind.is-active { box-shadow: 0 0 0 2px rgba(232, 180, 75, .5) inset; }

/* Кнопка «Обучение» в шапке — заметнее прочих: с неё начинают новички. */
#tutorialBtn {
  border-color: rgba(232, 180, 75, .5);
  background: rgba(232, 180, 75, .14);
}
#tutorialBtn:hover { background: rgba(232, 180, 75, .26); }

/* ---------- Страница тарифов (/tariffs.html, js/billing.js) ---------- */
.tariffs-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  display: grid;
  gap: 14px;
}
.tariffs-wrap h1 { margin: 0; }
.tariffs-lead { margin: 0; color: var(--muted); }
.tariffs-foot { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.tariffs-foot a { color: var(--accent); }
/* Кнопка «Обратная связь» стоит справа от профиля в левом нижнем углу карты.
   Класс НЕ user-menu-row: так называются строки внутри профиля, и там есть
   правило `.user-menu-row button { width: 28px }` для кнопки «скопировать» —
   от «Профиль» оставалась одна буква под кружком «Тарифы». */
.user-menu-bar { display: flex; align-items: center; gap: 8px; }
.user-menu-bar > * { flex: 0 0 auto; }

/* Кнопка-значок в том же ряду (сейчас это «?» — обучение): текста нет, поэтому
   кружок стоит по центру круглой кнопки, а не прижат к левому краю. */
.user-menu-btn.is-icon {
  width: 42px;
  padding: 0;
  justify-content: center;
  gap: 0;
}

/* «?» — шрифтовой знак: в кружке 26 px он центрируется по строке и потому
   поднят на пиксель вверх начертанием, поэтому вес и кегль задаём сами. */
.user-menu-btn.is-icon .user-menu-avatar {
  font-size: 16px;
  font-weight: 900;
}

/* ---------- Страница возврата с оплаты (/payment.html, js/payment.js) ---------- */
/* Один экран — один ответ: прошла оплата или нет. Поэтому карточка узкая и
   стоит по центру, а внутри всё в одну колонку: значок, заголовок, объяснение,
   короткий список фактов и кнопка «что дальше». */
.pay-wrap {
  /* Проценты тут не работают: у .doc-page высота auto. Берём высоту окна —
     dvh, чтобы на телефоне карточку не резала адресная строка. */
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 20px 60px;
}
.pay-card {
  width: min(460px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
  text-align: center;
}
.pay-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 2px;
}
/* Значок рисуем линиями (stroke), а не заливкой: та же галочка, что и в
   наградах, читается на тёмном фоне и не зависит от шрифта эмодзи. */
.pay-icon svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pay-icon.is-ok svg { stroke: var(--good); }
.pay-icon.is-bad svg { stroke: var(--danger); }
.pay-icon.is-wait svg { stroke: var(--accent); }
.pay-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: comic-spin 1s linear infinite;
}
.pay-title { margin: 0; font-size: clamp(22px, 4vw, 28px); line-height: 1.15; }
.pay-text { margin: 0; color: var(--muted); }
/* Факты платежа — двумя колонками: подпись слева, значение справа. */
.pay-facts {
  width: 100%;
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  text-align: left;
}
.pay-facts dt { color: var(--muted); }
.pay-facts dd { margin: 0; text-align: right; }
.pay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
/* Часть кнопок — ссылки: выравниваем их так же, как настоящие кнопки. */
.pay-actions .billing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pay-foot { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.pay-foot a { color: var(--accent); }

@media (max-width: 480px) {
  .pay-wrap { padding: 24px 14px 40px; }
  .pay-actions .billing-btn { flex: 1 1 100%; }
}

/* ---------- Карточки тарифов и таблица сравнения (js/billing.js) ---------- */
/* Три тарифа карточками плюс таблица сравнения: карточка отвечает на «сколько
   это стоит», таблица — на «чем отличается». На узком экране карточки идут
   столбиком, а таблица прокручивается вбок: сжимать её нельзя — колонок три,
   и текст в них превращался бы в лесенку из одиночных букв. */
.billing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.billing-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
}
/* Свой тариф подсвечен рамкой, а не заливкой: заливка спорила бы с кнопкой. */
.billing-card.is-current { border-color: var(--good); }
.billing-card.is-best { border-color: var(--accent); }
.billing-card-name { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.billing-price { display: flex; align-items: baseline; gap: 6px; font-size: 26px; }
.billing-price small { color: var(--muted); font-size: 13px; font-weight: 400; }
/* Цена до скидки. Мельче и приглушённее нынешней: рядом с ней зачёркнутое
   число должно читаться справкой, а не вторым предложением. */
.billing-price-was { color: var(--muted); font-size: 15px; font-weight: 400; opacity: .8; }
.billing-off {
  justify-self: start;
  margin-top: -6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(232, 180, 75, .16);
  color: var(--accent);
  font-size: 11px;
}
.billing-card-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.billing-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(95, 199, 156, .18);
  color: var(--good);
  font-size: 11px;
}
.billing-btn {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.billing-btn.is-primary { border-color: transparent; background: var(--accent); color: #1b1206; font-weight: 600; }
/* Необратимое действие (удаление аккаунта): красная рамка и текст, но не
   заливка — кнопка не должна выглядеть основным действием страницы. */
.billing-btn.is-danger { border-color: var(--danger); color: var(--danger); }
.billing-btn:disabled { opacity: .5; cursor: not-allowed; }
.billing-btn:hover:not(:disabled) { filter: brightness(1.08); }

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.billing-table th, .billing-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.billing-table thead th { border-top: 0; color: var(--muted); font-weight: 500; }
.billing-table tbody th { font-weight: 500; color: var(--muted); }
.billing-table td { color: var(--ink); }

.billing-auto { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.billing-auto-box { width: 16px; height: 16px; }
.billing-manage { margin: 0; color: var(--muted); font-size: 14px; }
.billing-manage a { color: var(--accent); }

/* Согласие на регулярное списание. Стоит НАД карточками, а не мелким шрифтом
   под кнопкой: пока галочки нет, кнопки оплаты выключены, и человек должен
   понять почему, не разглядывая сноски. */
.billing-consent {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}
.billing-consent[hidden] { display: none; }
.billing-consent-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.4;
}
.billing-consent-line input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.billing-consent-terms { margin: 0 0 0 28px; color: var(--muted); font-size: 13px; }
/* Нажали приглушённую кнопку оплаты — блок согласия вспыхивает зелёным: это
   ответ на действие, без него нажатие выглядит как поломка. Зелёный, а не
   красный: человек ничего не сделал неправильно, ему показывают, что осталось
   сделать. */
.billing-consent.is-asking { animation: billing-consent-ask 1.6s ease-out; }
@keyframes billing-consent-ask {
  0%   { border-color: var(--good); background: rgba(95, 199, 156, .20); box-shadow: 0 0 0 0 rgba(95, 199, 156, .5); }
  25%  { border-color: var(--good); background: rgba(95, 199, 156, .10); box-shadow: 0 0 0 10px rgba(95, 199, 156, 0); }
  45%  { border-color: var(--good); background: rgba(95, 199, 156, .20); box-shadow: 0 0 0 0 rgba(95, 199, 156, .5); }
  70%  { border-color: var(--good); background: rgba(95, 199, 156, .10); box-shadow: 0 0 0 10px rgba(95, 199, 156, 0); }
  100% { border-color: var(--line); background: rgba(255, 255, 255, .05); box-shadow: none; }
}
/* Кому анимация мешает — просто зелёная рамка на те же полторы секунды
   (класс снимает js/billing.js по таймеру). */
@media (prefers-reduced-motion: reduce) {
  .billing-consent.is-asking {
    animation: none;
    border-color: var(--good);
    background: rgba(95, 199, 156, .16);
  }
}
/* Кнопка без согласия: выглядит неактивной, но НАЖИМАЕТСЯ — иначе она не
   смогла бы объяснить, чего не хватает (у disabled нет события click). */
.billing-btn.is-locked { opacity: .55; }
.billing-btn.is-locked:hover:not(:disabled) { filter: none; }

/* ---------- Управление подпиской (/subscription.html, js/subscription.js) ---------- */
.submgr-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  display: grid;
  gap: 16px;
}
.submgr-wrap h1 { margin: 0; }
.submgr-card {
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
}
.submgr-h { margin: 0; font-size: 17px; }
.submgr-sub { margin: 0; color: var(--muted); font-size: 14px; }
/* Факты подписки: подпись слева, значение справа — та же пара, что на странице
   возврата с оплаты, чтобы человек читал их одинаково. */
.submgr-facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 14px;
}
.submgr-facts dt { color: var(--muted); }
.submgr-facts dd { margin: 0; text-align: right; }
.submgr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.submgr-actions .billing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.submgr-note { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 480px) {
  .submgr-wrap { padding: 24px 14px 60px; }
  .submgr-actions .billing-btn { flex: 1 1 100%; }
  .submgr-facts { grid-template-columns: 1fr; gap: 2px; }
  .submgr-facts dd { text-align: left; margin-bottom: 6px; }
}

@media (max-width: 720px) {
  .billing-cards { grid-template-columns: 1fr; }
  .tariffs-wrap { padding: 24px 14px 60px; }
  /* Таблицу на узком экране не сжимаем — колонок три, и текст в них
     превращался бы в лесенку из одиночных букв; вместо этого прокручиваем. */
  .billing-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Срок действия прав в таблице пользователей админки: дата и «бессрочно» стоят
   в одной ячейке, потому что это один выбор — одно исключает другое. */
/* Дата и галочка стоят друг под другом: в строку они растягивали таблицу так,
   что кнопки действий уезжали за край и до них приходилось прокручивать. */
.admin-term { white-space: normal; }
.admin-term input[type="date"] { width: 126px; }
.admin-term label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  opacity: .85;
}
.admin-term input[type="date"]:disabled { opacity: .45; }

/* ======= Шаг «Панорама»: свой файл или рисунок по описанию =======
   Раскладка резиновая, без медиазапросов: карточки путей — auto-fit-сетка,
   ряды кнопок переносятся. На телефоне это даёт колонку само собой. */
.pano-ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.pano-way {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pano-way:hover { background: rgba(255, 255, 255, .08); }
/* Выбранный путь помечаем той же жёлтой рамкой, что и активный шаг мастера. */
.pano-way.is-active { border-color: #e8b44b; background: rgba(232, 180, 75, .14); }
.pano-way-icon { font-size: 22px; line-height: 1; }
.pano-way strong { font-size: 15px; }
.pano-way-hint { color: var(--muted); font-size: 13px; }

.pano-gen { margin-top: 4px; }
.pano-gen-left { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
/* Предупреждение про чужих героев: его нельзя пролистать мимо, поэтому оно с
   заливкой и рамкой, а не обычной подсказкой. */
.pano-gen-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 180, 75, .45);
  border-radius: 12px;
  background: rgba(232, 180, 75, .1);
  font-size: 13px;
  line-height: 1.45;
}
.pano-gen-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.pano-gen-ref-img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.editor-upload.small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
/* Загрузка панорамы — главное действие своего шага, поэтому жёлтая. */
.editor-upload.is-primary {
  border-color: transparent;
  background: var(--accent);
  color: #221a06;
  font-weight: 800;
}
.editor-upload.is-primary:hover { background: #f3c463; }

.pano-gen-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pano-gen-state { color: var(--muted); font-size: 13px; }
.pano-gen-result { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pano-gen-preview,
.pano-chosen img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0f12;
}
.pano-gen-preview { margin-bottom: 10px; }
.pano-chosen { margin-top: 14px; }
.pano-chosen .editor-hint { margin-top: 6px; }
/* Кнопка-ссылка «Скачать» стоит в одном ряду с обычными кнопками. */
a.editor-btn#genDownload { text-decoration: none; }

/* ==================== Главная страница: секции ниже первого экрана ====================
   ОФОРМЛЕНИЕ. Страница выдержана в цветах самого сервиса: тёмный фон, тёплый
   светлый текст и фирменное золото. Первый экран, секции, финал и подвал — одна
   гамма, поэтому переход с сайта в игру не выглядит переходом на другой сайт.

   ОДИН АКЦЕНТ. Раньше у каждой секции была своя пара подсветок: золото, синий,
   зелёный, фиолетовый, бирюзовый, оранжевый, серо-синий. Семь разных настроений
   подряд читаются как пестрота, а не как фирменный стиль: если выделено всё, не
   выделено ничего. Теперь цвет один и работает только там, где нужно действие:
   кнопка, номер шага, рамка выбранного тарифа, надзаголовок секции. Соседние
   секции различаются тоном фона и воздухом, а не цветом.

   РАЗМЕРЫ. Ритм задают три числа: отступ секции clamp(64px, 8vw, 104px), ширина
   колонки 1120px и радиус скругления 14px. Их и держаться при добавлении блоков.

   ТЕКСТ. Секция — это заголовок, одна строка пояснения и блок содержимого.
   Абзац на пять строк на продающей странице не читают: если мысль не помещается
   в две строки, ей место в документации или в ответе на вопрос внизу. */

.landing-page {
  /* Палитра светлой части нет: и первый экран, и секции ниже — тёмные. */
  --lp-ink: #f7f4ea;                          /* заголовки */
  --lp-body: #c3cdcb;                         /* абзацы */
  --lp-muted: #8f9c9d;                        /* подписи, сноски */
  --lp-line: rgba(255, 255, 255, .12);        /* границы карточек и разделители */
  --lp-surface: #0b1014;                      /* фон секции */
  --lp-surface-alt: #080d11;                  /* фон соседней секции: чуть глубже */
  --lp-card: rgba(255, 255, 255, .045);       /* карточки поверх фона */
  --lp-card-hover: rgba(255, 255, 255, .07);
  --lp-brand: #e8b44b;                        /* фирменное золото: только действия */
  --lp-brand-soft: rgba(232, 180, 75, .16);
  --lp-card-shadow: 0 18px 40px rgba(0, 0, 0, .38);
}

.landing {
  min-height: 100vh;
  background: var(--lp-surface);
}

.lp-section,
.lp-final { scroll-margin-top: 16px; }

/* ---------- Шапка первого экрана ---------- */
.lp-nav {
  display: flex;
  gap: clamp(14px, 2vw, 26px);
  align-items: center;
}

.lp-nav a {
  color: rgba(247, 244, 234, .82);
  font-size: 15px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.lp-nav a:hover { color: var(--lp-ink); border-bottom-color: var(--lp-brand); }

@media (max-width: 900px) { .lp-nav { display: none; } }

/* ---------- Кнопки ----------
   Одна кнопка-действие на экран: золотая с тёмным текстом. Всё остальное —
   контуром, чтобы не спорить с главной. */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--lp-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.lp-btn:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.lp-btn:focus-visible { outline: 3px solid rgba(232, 180, 75, .6); outline-offset: 2px; }

.lp-btn.is-primary {
  border-color: transparent;
  background: var(--lp-brand);
  color: #241a04;
  box-shadow: 0 8px 22px rgba(232, 180, 75, .28);
}

.lp-btn.is-primary:hover { background: #f0c163; box-shadow: 0 12px 28px rgba(232, 180, 75, .36); }
.lp-btn.is-big { min-height: 58px; padding: 0 38px; font-size: 17px; }

.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 14px;
}

.lp-trust {
  margin: 0;
  color: rgba(214, 221, 217, .85);
  font-size: 14px;
  line-height: 1.5;
}

.lp-scroll { white-space: nowrap; }

/* ---------- Раскладка секций ---------- */
.lp-section {
  position: relative;
  padding: clamp(64px, 8vw, 104px) 0;
  background: var(--lp-surface);
  color: var(--lp-body);
}

.lp-section.is-alt { background: var(--lp-surface-alt); }

/* Тонкая линия между секциями одного тона: без неё они сливаются в полотно. */
.lp-section + .lp-section:not(.is-alt) { border-top: 1px solid rgba(255, 255, 255, .07); }

.lp-wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.lp-narrow { max-width: 760px; }

/* Надзаголовок: короткое слово над h2. Держит ритм секций и подсказывает,
   где человек находится, без ещё одного заголовка. */
.lp-eyebrow {
  margin: 0 0 10px;
  color: var(--lp-brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lp-section h2 {
  margin: 0 0 12px;
  color: var(--lp-ink);
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.lp-lead {
  max-width: 62ch;
  margin: 0 0 clamp(28px, 4vw, 44px);
  color: var(--lp-body);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.6;
}

.lp-note {
  margin: 22px 0 0;
  color: var(--lp-muted);
  font-size: 15px;
  line-height: 1.55;
}

.lp-note a,
.lp-faq a { color: var(--lp-brand); text-decoration: underline; }

/* ---------- Две колонки: шаги и снимки ---------- */
.lp-split {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.lp-split-media { display: grid; gap: 18px; }
.lp-split-media .lp-shot { margin: 0; }

@media (max-width: 900px) { .lp-split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Короткие факты о сервисе ----------
   Строка справки сразу после определения: тот, кто читать не станет, за пять
   секунд поймёт формат, аудиторию и цену. Ровно три колонки: фактов шесть,
   и при auto-fit последняя строка оставалась наполовину пустой. */
.lp-facts {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(28px, 4vw, 44px) 0 0;
  background: var(--lp-line);
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  overflow: hidden;
}

.lp-facts > div {
  padding: 18px 20px;
  background: var(--lp-surface);
}

.lp-section.is-alt .lp-facts > div { background: var(--lp-surface-alt); }

.lp-facts dt {
  margin-bottom: 6px;
  color: var(--lp-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lp-facts dd {
  margin: 0;
  color: var(--lp-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

@media (max-width: 900px) { .lp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lp-facts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Три шага урока ---------- */
.lp-steps {
  display: grid;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lp-step;
}

.lp-steps li {
  position: relative;
  padding-left: 60px;
  counter-increment: lp-step;
}

.lp-steps li::before {
  content: counter(lp-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--lp-brand-soft);
  color: var(--lp-brand);
  font-size: 18px;
  font-weight: 900;
}

.lp-steps h3,
.lp-card h3,
.lp-faq h3 {
  margin: 0 0 8px;
  color: var(--lp-ink);
  font-size: 18px;
  line-height: 1.3;
}

.lp-steps p,
.lp-card p { margin: 0; color: var(--lp-body); font-size: 15px; line-height: 1.6; }

/* ---------- Карточки возможностей ---------- */
.lp-cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.lp-cards.is-compact { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* В коротком ряду заголовки разной длины: «Репетитору» в одну строку, «Семейному
   обучению и кружку» в две. Без запаса на вторую строку текст под ними начинается
   на разной высоте и ряд выглядит неровным. */
@media (min-width: 720px) {
  .lp-cards.is-compact h3 { min-height: 2.6em; }
}

.lp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  background: var(--lp-card);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.lp-card:hover {
  border-color: rgba(255, 255, 255, .22);
  background: var(--lp-card-hover);
  transform: translateY(-2px);
}

/* ---------- Снимки продукта ---------- */
.lp-shots {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: clamp(24px, 3vw, 36px);
}

.lp-shot {
  margin: 0;
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  background: var(--lp-card);
  overflow: hidden;
  box-shadow: var(--lp-card-shadow);
}

/* Исходники сняты в разных пропорциях (872×498, 880×448, 900×620, 900×590).
   Если оставить height: auto, соседние снимки получаются разной высоты, и
   подписи под ними не совпадают по линии. Приводим все к 16:9 и кадрируем. */
.lp-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--lp-line);
}

.lp-shot figcaption {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 12px 16px;
  color: var(--lp-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Тарифы ---------- */
.lp-plans {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  /* stretch, а не start: три карточки разной длины иначе стоят лесенкой,
     и нижние кнопки оказываются на трёх разных высотах. Список внутри
     растягивается (flex: 1), поэтому кнопка у всех прижата к низу. */
  align-items: stretch;
}

.lp-plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: var(--lp-card);
}

/* Выбранный тариф выделен рамкой и подписью, а не другим фоном: так видно
   рекомендацию, но карточки остаются одной семьёй. */
.lp-plan.is-best {
  border-color: rgba(232, 180, 75, .75);
  background: rgba(232, 180, 75, .07);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .38);
}

/* Подпись «выбирают чаще» есть только у одного тарифа, и без запаса на неё
   соседние карточки уезжали вверх: цены стояли на разной высоте. */
@media (min-width: 860px) {
  .lp-plan:not(.is-best)::before {
    content: "";
    display: block;
    height: 26px;
  }
}

.lp-plan-badge {
  align-self: flex-start;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--lp-brand-soft);
  color: var(--lp-brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lp-plan h3 {
  margin: 0;
  color: var(--lp-ink);
  font-size: 20px;
}

.lp-price {
  margin: 0;
  color: var(--lp-ink);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.lp-price small {
  margin-left: 6px;
  color: var(--lp-muted);
  font-size: 15px;
  font-weight: 600;
}

/* Строка «было столько-то» есть не у всех тарифов, но место под неё занято в
   каждой карточке: без этого списки в соседних карточках встают на разной
   высоте — та же причина, что у ::before выше. */
.lp-price-was {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  margin: 0;
}

.lp-price-was s {
  color: var(--lp-muted);
  font-size: 17px;
  font-weight: 700;
}

.lp-off {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lp-brand-soft);
  color: var(--lp-brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.lp-plan ul {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.lp-plan li {
  position: relative;
  padding-left: 26px;
  color: var(--lp-body);
  font-size: 15px;
  line-height: 1.5;
}

.lp-plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--lp-brand);
  font-weight: 900;
}

.lp-plan .lp-btn { width: 100%; }

/* ---------- Новости ---------- */
.lp-news {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-news li {
  padding: 22px 24px;
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  background: var(--lp-card);
}

.lp-news h3 { margin: 0 0 8px; color: var(--lp-ink); font-size: 18px; }
.lp-news p { margin: 0; color: var(--lp-body); font-size: 15px; line-height: 1.6; }

.lp-news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px !important;
  color: var(--lp-muted) !important;
  font-size: 13px !important;
}

.lp-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(95, 199, 156, .16);
  color: #7fd8b5;
  font-size: 12px;
  font-weight: 800;
}

.lp-tag.is-soon { background: var(--lp-brand-soft); color: var(--lp-brand); }

/* ---------- Вопросы ---------- */
.lp-faq { border-top: 1px solid var(--lp-line); }

.lp-qa { border-bottom: 1px solid var(--lp-line); }

.lp-qa > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  cursor: pointer;
  list-style: none;
}

.lp-qa > summary::-webkit-details-marker { display: none; }
.lp-qa > summary::marker { content: ""; }
.lp-qa > summary:hover h3 { color: var(--lp-brand); }
.lp-qa > summary h3 { margin: 0; font-size: 17px; font-weight: 700; transition: color .15s ease; }

.lp-qa > summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--lp-muted);
  border-bottom: 2px solid var(--lp-muted);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .18s ease;
}

.lp-qa[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.lp-qa > summary:focus-visible { outline: 3px solid rgba(232, 180, 75, .6); outline-offset: -3px; }

.lp-qa p {
  margin: 0 0 18px;
  color: var(--lp-body);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------- Последний призыв и подвал ----------
   Финал отделён от последней секции не цветом, а мягким золотым свечением
   сверху: тот же приём, что у точки-награды в самой игре. */
.lp-final {
  padding: clamp(64px, 8vw, 104px) 0;
  background:
    radial-gradient(80% 120% at 50% -20%, rgba(232, 180, 75, .16), transparent 62%),
    var(--lp-surface-alt);
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: var(--lp-body);
  text-align: center;
}

.lp-final h2 {
  margin: 0 0 14px;
  color: var(--lp-ink);
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.lp-final .lp-lead { margin-inline: auto; }
.lp-final .lp-note a { color: var(--lp-brand); }

.lp-footer {
  padding: clamp(40px, 5vw, 60px) 0 28px;
  background: #060a0d;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(214, 221, 217, .8);
  font-size: 15px;
}

.lp-footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr));
  align-items: start;
}

@media (max-width: 900px) {
  .lp-footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.lp-footer-about p { margin: 0 0 10px; line-height: 1.6; }

.lp-footer-brand {
  color: var(--lp-ink);
  font-size: 18px;
  font-weight: 900;
}

/* Возрастная маркировка: требование статьи 12 ФЗ-436 к информационной продукции. */
.lp-footer-age {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  color: rgba(214, 221, 217, .9);
  font-size: 13px;
  font-weight: 800;
}

.lp-footer-title {
  margin: 0 0 12px;
  color: var(--lp-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lp-footer nav { display: grid; gap: 9px; }

.lp-footer nav a {
  color: rgba(214, 221, 217, .8);
  text-decoration: none;
}

.lp-footer nav a:hover { color: var(--lp-brand); }

.lp-footer-legal {
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(214, 221, 217, .6);
  font-size: 13px;
}

.lp-footer-legal p { margin: 0 0 6px; line-height: 1.55; }

/* ---------- Промокоды в админке ---------- */
/* Полей много и они разной длины (код, тариф, дни, дата, число активаций),
   поэтому не ряд, а сетка: на широком экране в две-три колонки, на узком —
   в одну, и подпись всегда над своим полем. */
/* Панель раздела над таблицей: пока в ней одна кнопка «Новый промокод», но
   место для соседних действий уже есть. */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.admin-create {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1a1206;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-create:hover { filter: brightness(1.06); }

/* Окно поверх страницы. Разметка та же, что у окон в редакторе
   (.picker-overlay): затемнение с размытием и панель по центру. */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(4px);
}

.admin-overlay[hidden] { display: none; }

.admin-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(680px, 100%);
  max-height: 90vh;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: auto;
}

.admin-modal-head { display: flex; align-items: center; gap: 12px; }
.admin-modal-head h3 { flex: 1 1 auto; margin: 0; font-size: 18px; }

.admin-modal-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.admin-modal-close:hover { border-color: var(--accent); color: var(--accent); }

/* Кнопки окна — в правом нижнем углу, «Создать» последней: так же устроены
   остальные формы панели. */
.admin-modal-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.admin-cancel {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.admin-cancel:hover { border-color: var(--accent); color: var(--accent); }

.admin-promo-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-promo-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-promo-form input,
.admin-promo-form select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.admin-promo-form input:focus,
.admin-promo-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}

/* Код и кнопка «Сгенерировать» — одной строкой: это одно поле, просто
   заполнить его можно двумя способами. */
.admin-promo-code { display: flex; gap: 8px; }
.admin-promo-code input { flex: 1 1 auto; min-width: 0; }
.admin-promo-code .btn-generate {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

/* Код и комментарий длиннее прочих полей — занимают всю строку. Кнопка
   «Сгенерировать» из-за этого больше не делит место с соседним полем. */
.admin-field-wide { grid-column: 1 / -1; }

/* Подсказка под полем: тихая строка, а не второй заголовок. */
.admin-promo-form small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }

/* «Без ограничения» рядом со своим числом: галочка гасит поле, а не прячет. */
.admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.admin-check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
}
.admin-promo-form input:disabled { opacity: .45; cursor: not-allowed; }

.admin-promo-form button[type="submit"] {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1c1305;
  font-weight: 900;
}

/* ---------- Промокод на странице тарифов ---------- */
/* Отдельно от кнопок оплаты: код не скидка к платежу, он сам выдаёт подписку,
   и стоять рядом с ценой ему незачем. */
.billing-promo {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}

.billing-promo label { color: var(--muted); font-size: 14px; font-weight: 700; }

.billing-promo-row { display: flex; flex-wrap: wrap; gap: 10px; }

.billing-promo-row input {
  flex: 1 1 220px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 10, 12, .7);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.billing-promo-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 180, 75, .16);
}

.billing-promo-row button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1c1305;
  font-weight: 900;
}

.billing-promo-row button:disabled { opacity: .6; cursor: default; }

.billing-promo-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Очередь подписок под тарифом в таблице пользователей. */
.admin-queue { margin-top: 4px; font-size: 11px; line-height: 1.3; }

/* Окно с просьбой об обратной связи (js/feedback-ask.js). Три кнопки в ряд:
   «Позже», «Не хочу» и главная — «Сделать добро». */
.ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px);
}

.ask-modal {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ask-text { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.55; }

.ask-row { display: flex; flex-wrap: wrap; gap: 10px; }

.ask-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.ask-btn:hover { border-color: var(--accent); color: var(--accent); }

.ask-btn.is-primary {
  flex: 1.4 1 auto;
  border-color: transparent;
  background: linear-gradient(145deg, #f0c065, #e0a73f);
  color: #1a1206;
  font-weight: 800;
}

.ask-btn.is-primary:hover { filter: brightness(1.06); color: #1a1206; }

/* Благодарность после отправки обращения (js/contact.js). Показывается вместо
   формы: письмо ушло, писать больше нечего. */
.contact-thanks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(95, 199, 156, .08);
}

.contact-thanks p { margin: 0; }
.contact-thanks-title { color: var(--good); font-size: 20px; font-weight: 800; }
.contact-thanks-note { color: var(--muted); font-size: 14px; }
.contact-thanks-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.contact-thanks-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0c065, #e0a73f);
  color: #161006;
  font-weight: 800;
  text-decoration: none;
}

.contact-thanks-more {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.contact-thanks-more:hover { border-color: var(--accent); color: var(--accent); }

/* Отметка о возврате на обращении в админке. */
.msg-refund { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; }
.msg-refund button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.msg-refund button:hover { border-color: var(--accent); color: var(--accent); }

/* Свой раздел без действующей подписки: вкладка на карте с замком. Раздел
   остаётся на месте — человек видит, что его работа цела, — но уровни в нём
   открываются только по подписке. */
.map-tab.is-locked { opacity: .72; }
.map-tab.is-locked::after {
  content: "🔒";
  margin-left: 6px;
  font-size: 11px;
}

/* Кошелёк скидок на странице тарифов: коды, которые человек уже активировал.
   Скидка разовая, поэтому у каждой строки видно, к чему она применится. */
.billing-wallet { display: grid; gap: 10px; margin: 6px 0 18px; }
.billing-wallet h2 { margin: 0; font-size: 17px; }
.billing-wallet-note { margin: 0; color: var(--muted); font-size: 13px; }
.billing-wallet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.billing-wallet-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

.billing-wallet-item.is-used { opacity: .55; }
.billing-wallet-head { display: flex; align-items: baseline; gap: 10px; }
.billing-wallet-head strong { font-size: 18px; color: var(--accent); }
.billing-wallet-head code { color: var(--muted); font-size: 12px; }
.billing-wallet-facts { flex: 1 1 220px; color: var(--muted); font-size: 13px; }

.billing-wallet-flag {
  flex-basis: 100%;
  color: var(--good);
  font-size: 12px;
}

/* Объяснение про покупку тарифа выше — под таблицей, до подписи про оферту. */
.tariffs-how { display: grid; gap: 10px; margin: 22px 0 10px; }
.tariffs-how h2 { margin: 0; font-size: 18px; }
.tariffs-how p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.tariffs-how-example { color: var(--ink); }

/* Выбор вида промокода в окне создания: дни или разовая скидка. */
.admin-kind { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.admin-kind label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 400; font-size: 13px; }
.admin-kind input { width: 16px; height: 16px; min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--accent); }

/* Цена следующего месяца под карточкой со скидкой: скидка разовая, и человек
   должен видеть, во что обойдётся продление. */
.billing-next { color: var(--muted); font-size: 12px; }
