: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);
}

* {
  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 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(247, 244, 234, .07);
  font-weight: 800;
  transition: color .25s ease, background-color .25s ease;
}

.nav-login:hover {
  border: 0;
  background: rgba(255, 255, 255, .05);
  color: rgba(247, 244, 234, .32);
}

.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);
}

/* ---------- Админ-панель ---------- */
.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-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-top: 24px;
}

.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;
}

/* Всплывающая панель: раскрывается ВВЕРХ от кнопки, чтобы не уезжать за экран. */
.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: block;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.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;
  /* flex-basis:0 — шапка не навязывает свою ширину при переносе строк, поэтому
     действия «Конструктор/Выйти» всегда остаются в этом же ряду справа; сама
     шапка растягивается на свободное место, а заголовок при нехватке обрезается. */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  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.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* На карте описание под заголовком прячем — табличка компактная. */
.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;
  left: 12px;
  top: 92px;
  z-index: 6;
  width: 244px;
  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;
  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 {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; 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;
}
.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) {
  .map-tab { padding: 8px 12px; font-size: 14px; }
  /* На телефоне список разделов уже и опускается ниже более высокой шапки. */
  .map-sidebar { top: 118px; width: 210px; 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;
}

.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;
}

/* Пошаговый мастер создания уровня в конструкторе. */
.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; }
.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: 8px; margin: 10px 0; }
.tier-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
}
.tier-row input[type="text"], .tier-row input:not([type]) { min-width: 60px; }
.tier-row input[type="number"] { width: 74px; }
.tier-row label { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; }

/* Точка-телепорт: ведёт на другую панораму раздела — другого (бирюзового) цвета. */
.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);
}

.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;
}

.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-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;
  }
}

@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;
  }
}

/* Планшет и уже: одна колонка, страница может прокручиваться */
@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; }
.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; padding: 12px 0; background: linear-gradient(180deg, transparent, #070a0d 40%); }
.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; }

/* ----- Единая сетка настроек -----
   Все поля конструктора — одной высоты и по одной вертикали: подпись сверху,
   элемент во всю ширину. Раньше высота прыгала (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; }
}

.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-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); }

/* Точка в конструкторе свёрнута: в списке из 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; }

.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;
  gap: 12px;
}

.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;
}

/* Точка-игра и точка-видео — свой цвет метки, как у телепорта. */
.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;
  gap: 4px;
}

.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 букв» ----- */
.gw-grid { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.gw-grid-row { display: flex; gap: 5px; }
.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: 6px; }
.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; }

/* ----- Корзины ----- */
.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: flex-start;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #2b1d00;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 760px) {
  .gw-field { height: 230px; }
  .gw-cell { width: 36px; height: 40px; font-size: 18px; }
  .gw-memory { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
}

/* Строка «картинка + подпись» в конструкторе (игра «Картинка и слово»). */
.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-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; }
}

@media (max-width: 760px) {
  .class-panel {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: 76px;
    width: auto;
  }
}

/* Подсказка на точке: какая игра или видео за ней скрыты. */
.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; }
