/* Мир аналогов — вид сайта.
 * 24.09.2026, по макету Архитектора: тёмно-фиолетовая ночь, стеклянные
 * плашки, фон локации на всю страницу, живая карта под плашками.
 * Цвета и размеры — в переменных ниже: новый блок сразу выходит в стиле. */

:root {
    --bg: #0d0a14;
    --glass: rgba(22, 16, 32, 0.58);
    --glass-strong: rgba(18, 13, 27, 0.8);
    --line: rgba(214, 190, 255, 0.18);
    --line-soft: rgba(214, 190, 255, 0.1);
    --text: #f1ecf7;
    --muted: #a99fb8;
    --faint: #7d7390;
    --accent: #e0772f;
    --accent-hot: #f08a3f;
    --accent-glow: rgba(240, 138, 63, 0.45);
    --violet: #a778ff;
    /* тонкий металлический контур плашек и рамки портрета (слово Архитектора) */
    --metal: linear-gradient(135deg, #e9ecf1 0%, #8b919c 22%, #f4f6f9 45%, #6c727d 68%, #d3d7de 100%);
    --radius: 14px;
    --title: "Cormorant Garamond", "Times New Roman", serif;
    --body: "Manrope", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
    -webkit-tap-highlight-color: transparent;   /* без голубой вспышки при нажатии на телефоне */
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 14px;
}

button { font-family: inherit; }

/* ---------------------------------------------------------------- фон локации */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: var(--bg);
    background-size: cover;
    background-position: center top;
}

.backdrop::after {
    /* затемнение книзу: плашки и карта читаются на любом фоне */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 10, 20, 0.15) 0%, rgba(13, 10, 20, 0.55) 45%, rgba(13, 10, 20, 0.9) 100%);
}

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

/* Одна строка (24.09, слово Архитектора): название — плашки — «Скачать».
   Отдельной полосы над картой нет: карте остаётся больше экрана. */
.top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand strip download";
    align-items: center;
    gap: 18px;
    padding: 14px 28px 12px;
}

.brand { grid-area: brand; }
.strip { grid-area: strip; }
.download { grid-area: download; }

@media (max-width: 1279px) {
    .top {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "brand download" "strip strip";
        row-gap: 12px;
    }
}

.brand-mark {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.brand-mark::before {
    content: "◌";
    margin-right: 8px;
    color: var(--violet);
}

.place {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

h1.place-title {
    margin: 2px 0 0;
    font-family: var(--title);
    font-weight: 500;
    font-size: clamp(28px, 3.4vw, 48px);
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.place-motto {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.place-motto:empty { display: none; }

.place-switch {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--glass);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.place-switch:hover { border-color: var(--violet); }

.place-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 5;
    min-width: 230px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--glass-strong);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.place-menu[hidden] { display: none; }

.place-menu button {
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.place-menu button:hover { background: rgba(167, 120, 255, 0.14); }
.place-menu button.current { color: var(--accent-hot); }
.place-menu li:first-child button { color: var(--muted); border-bottom: 1px solid var(--line-soft); border-radius: 8px 8px 0 0; }

/* кнопка «Скачать» — квадратик с закруглёнными углами и свечением */
.download {
    display: flex;
    flex-flow: row wrap;               /* значок и «Скачать» в строку, версия под ними: вдвое ниже (30.09) */
    align-items: center;
    align-content: center;
    justify-content: center;
    gap: 0 6px;
    width: 96px;
    height: 48px;
    padding: 4px 8px;
    border: 1px solid var(--accent);
    border-radius: 16px;
    background: rgba(40, 20, 12, 0.55);
    color: var(--text);
    text-decoration: none;
    text-align: center;
    box-shadow: 0 0 18px var(--accent-glow), inset 0 0 12px rgba(240, 138, 63, 0.18);
    backdrop-filter: blur(8px);
}

.download[hidden] { display: none; }
.download:hover { background: rgba(70, 32, 16, 0.7); }
.download-icon { color: var(--accent-hot); font-size: 18px; line-height: 1; }
.download-title { font-size: 14px; font-weight: 600; }
.download-note { flex-basis: 100%; color: var(--muted); font-size: 10px; line-height: 1.2; }

/* ---------------------------------------------------------------- стеклянные плашки */

.strip {
    display: grid;
    grid-template-columns: 1fr;          /* телефон — друг под другом */
    gap: 12px;
}

@media (min-width: 900px) {
    /* Плашка пэта — прежней ширины (1,2 из 3,2 доли); «Послания» занимают остальное (30.09: плашку «В мире» убрали). */
    .strip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); }
}

.panel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    height: 96px;
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Металлический контур толщиной в точку: кольцо поверх края, без заливки. */
.panel::before,
.avatar::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: var(--metal);
    opacity: 0.55;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.avatar::before { opacity: 0.8; }

.panel-title {
    font-family: var(--title);
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
}

.panel-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    font-size: 20px;
}

.panel-stub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

/* 1. Мой аналог */

.avatar {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 56px;
    height: 76px;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 30%, rgba(167, 120, 255, 0.28), rgba(20, 14, 30, 0.92) 75%);
}

.live-pet-image {
    max-width: 50px;
    max-height: 70px;
    object-fit: contain;          /* персонаж целиком, ничего не обрезано */
    image-rendering: pixelated;
}

.live-pet-image[hidden],
.live-pet-stub[hidden] { display: none; }

.live-pet-stub { font-size: 30px; line-height: 1; }

.pet-info { flex: 1; min-width: 0; }

.live-pet-name {
    font-family: var(--title);        /* ник — главное на плашке (30.09) */
    color: var(--text);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-pet-note,
.pet-line {
    margin-top: 2px;
    color: var(--faint);
    font-size: 12px;
}

.live-pet-note:empty { display: none; }
.pet-line[hidden] { display: none; }

/* Плашка пэта (30.09): портрет | ник и состояние | «в мире» и кнопки под ним. */
.pet-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}
.pet-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.pet-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.pet-actions .account { flex-direction: column; align-items: flex-end; gap: 6px; }
.pet-actions .account-enter { padding: 6px 16px; font-size: 13px; }

.ghost-button {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.ghost-button:hover { border-color: var(--violet); }
.ghost-button[hidden] { display: none; }

/* Сумка — окно «Экипировка» (bag.js) — стили ниже, в конце файла. */
.pet-panel { z-index: 20; }
.pet-actions { position: relative; }

/* 2. В мире */

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

.map-frame {
    position: relative;
    width: calc(100% - 56px);      /* точный размер ставит map.js: карта целиком, снизу отступ */
    height: 420px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(8, 6, 12, 0.6);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
}

.map-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: var(--metal);
    opacity: 0.45;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.map-view {
    position: absolute;
    inset: 0;
    overflow: hidden;
    user-select: none;
}

.map-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

/* Рамка меняет пропорцию плавно, когда входишь в место с картинкой другой формы (30.09). */
.map-frame.reshaping { transition: width 0.6s ease, height 0.6s ease; }
.map-frame.reshaping .map-layer { transition: width 0.6s ease, height 0.6s ease, transform 0.6s ease; }

/* Сцены лежат одна на другой; видимая растворяется в следующую. */
.map-scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
}

.map-scene.shown {
    opacity: 1;
    pointer-events: auto;
}

.map-scene.instant { transition: none; }

.map-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.map-frame.is-empty .map-scene { filter: blur(6px) brightness(0.45); }

.map-points {
    position: absolute;
    inset: 0;
}

/* Телефон (29.09): нажал на значок — без голубой вспышки на всю его прозрачную
   рамку; обводка фокуса — только с клавиатуры. */
.map-point,
.map-point * {
    -webkit-tap-highlight-color: transparent;
}
.map-point:focus { outline: none; }
.map-point:focus-visible { outline: 2px solid var(--accent, #ffb870); outline-offset: 4px; border-radius: 8px; }

.map-point {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.map-point-mark {
    filter: opacity(var(--icon-opacity, 1));       /* непрозрачность из редактора (29.09) */
    width: 26px;
    height: 26px;
    border: 2px solid rgba(255, 200, 140, 0.9);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 170, 80, 0.9) 0 30%, rgba(255, 140, 50, 0.15) 60%, transparent 70%);
    box-shadow: 0 0 22px var(--accent-glow);
    animation: pulse 2.4s ease-in-out infinite;
}

/* 29.09 (слово Архитектора): точка на карте — середина значка, как в редакторе.
   Подпись висит под значком и не сдвигает его вверх. */
.map-point:not(.member) > .map-point-label {
    position: absolute;
    top: 100%;
    left: 50%;
    margin-top: 6px;
    transform: translateX(-50%);
}

.map-point-label {
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass-strong);
    font-size: 13px;
    white-space: nowrap;
}

.map-point:hover .map-point-mark { border-color: #fff; }

/* Игрок у костра: маленькая копия его пэта, ногами на месте точки, ник под ней. */
.map-point.member {
    gap: 3px;
    transform: translate(-50%, -85%);
}

.map-figure img,
.map-figure canvas {
    display: block;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.map-figure.no-picture {
    display: block;
    width: 18px;
    height: 36px;
    border-radius: 9px 9px 4px 4px;
    background: linear-gradient(180deg, rgba(214, 190, 255, 0.85), rgba(120, 90, 170, 0.6));
    box-shadow: 0 0 10px rgba(167, 120, 255, 0.6);
}

.map-point.member .map-point-label {
    padding: 1px 7px;
    font-size: 11px;
}

/* Виды точек (24.09): вход ⇨, место ◈ (свечение, как лагерь), осмотр — полупрозрачный глаз, взять ✦. */
.map-point-mark { display: grid; place-items: center; font-size: 13px; line-height: 1; color: #fff3e0; }
.map-point.exit .map-point-mark::after { content: "⇨"; }
.map-point.exit .map-point-mark {
    border-color: rgba(150, 210, 255, 0.9);
    background: radial-gradient(circle, rgba(110, 170, 255, 0.55) 0 35%, rgba(110, 170, 255, 0.12) 65%, transparent 72%);
    box-shadow: 0 0 18px rgba(120, 180, 255, 0.55);
}
.map-point.view .map-point-mark {
    width: 34px;
    height: 22px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    opacity: 0.55;
    animation: none;
    font-size: 22px;
    transition: opacity 0.2s;
}
.map-point.view .map-point-mark::after { content: "👁"; }
.map-point.view:hover .map-point-mark { opacity: 1; }
.map-point.view.found .map-point-mark { opacity: 1; }        /* нашёл — горит (29.09) */
/* Спрятанная точка любого вида (29.09): пока не найдена — бледная, без подписи. */
.map-point.hidden:not(.view) .map-point-mark { --icon-opacity: 0.55; animation: none; }
.map-point.hidden .map-point-mark[style*="--icon-opacity"] { opacity: 1; }
.map-point.board .map-point-mark::after { content: "✎"; color: #e1ffee; }
.map-point.board .map-point-mark {
    border-color: rgba(170, 240, 200, 0.95);
    background: radial-gradient(circle, rgba(90, 210, 150, 0.55) 0 35%, rgba(60, 180, 120, 0.12) 65%, transparent 72%);
    box-shadow: 0 0 18px rgba(90, 220, 160, 0.55);
}
.map-point.item .map-point-mark::after { content: "✦"; color: #ffe9a8; }
.map-point.item .map-point-mark { border-color: rgba(255, 225, 140, 0.95); }
.map-point.item.empty,
.map-point.item.taken { filter: grayscale(1); opacity: 0.55; }
.map-point.item.empty .map-point-mark,
.map-point.item.taken .map-point-mark { animation: none; }

/* Лежит без сил — миниатюра лёжа. */
.map-point.member.fainted .map-figure { transform: rotate(-90deg) translateX(-30%); filter: grayscale(0.6); }
.map-point.member.fainted .map-point-label { border-color: rgba(255, 120, 120, 0.6); }

.map-point-action {
    padding: 2px 8px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: rgba(40, 20, 12, 0.85);
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
}

.map-point-action:hover { background: rgba(80, 36, 16, 0.95); }

.pet-line.fainted { color: #ff9a9a; }

/* ---------------------------------------------------------------- осмотр: арт поверх фона локации */

/* 30.09 (слово Архитектора): открыл осмотр — интерфейс быстро прячется, остаётся
   только фон локации, слегка притемнённый, и арт на нём. */
body > * {
    transition: opacity 0.15s ease;
}
/* Гаснет чуть медленнее (0,45 с — пока карта приближается к значку),
   возвращается быстро (0,15 с). */
body.viewing > *:not(.backdrop):not(#lightbox) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.backdrop::after { transition: opacity 0.15s ease; }
body.viewing .backdrop::after { transition: opacity 0.45s ease; }

/* Карта совсем немного приближается к значку открытого осмотра
   (transform-origin — середина значка, ставит script.js). */
.map-view { transition: transform 0.5s ease; }
.map-view.zoom-in { transform: scale(1.07); }
body.viewing .backdrop::after { opacity: 0; }   /* без затемнения книзу — фон виден целиком */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;       /* картинка, а под ней подпись и «Назад» (30.09) */
    gap: 10px;
    padding: 24px 64px;
    background: rgba(8, 6, 14, 0.32);
    animation: fade-in 0.45s ease;
    touch-action: pan-y;          /* свайп влево-вправо — наш, прокрутку страницы не трогаем */
    user-select: none;
}

.lightbox[hidden] { display: none; }

/* «Втягивание» в точку (30.09): фон осмотра уходит сразу, кнопки прячутся,
   арт летит в значок поверх вернувшегося интерфейса. */
.lightbox.closing {
    background: transparent;
    pointer-events: none;
    transition: background 0.15s ease;
}
.lightbox.closing .lightbox-arrow,
.lightbox.closing .lightbox-bottom { visibility: hidden; }
.lightbox.closing .lightbox-frame { box-shadow: none; }

/* Рамка арта: в ней арт; подпись и «Назад» — отдельным рядом под ней. */
.lightbox-frame {
    position: relative;
    line-height: 0;
}

.lightbox-stage {
    position: relative;
    animation: fade-in 0.3s ease;   /* арт проявляется плавно, но быстро */
}
.lightbox-stage.from-right { animation: view-from-right 0.28s ease; }
.lightbox-stage.from-left { animation: view-from-left 0.28s ease; }

.lightbox-stage img {
    display: block;
    max-width: calc(100vw - 128px);
    max-height: calc(100vh - 48px - 92px);      /* внизу место под подпись и «Назад» */
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    -webkit-user-drag: none;
}

.lightbox-points {
    position: absolute;
    inset: 0;
    line-height: normal;
}

.lightbox .map-point { cursor: pointer; }

.lightbox-bottom {
    position: relative;
    z-index: 3;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    line-height: normal;
    pointer-events: none;
}

.lightbox-caption {
    font-family: var(--title);
    font-size: 22px;
    color: var(--text);
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}
.lightbox-caption:empty { display: none; }

/* «Назад» — под картинкой по центру; единственный способ закрыть мышью или пальцем. */
.lightbox-back {
    pointer-events: auto;
    padding: 9px 22px;
    border: 1px solid rgba(201, 168, 255, 0.55);
    border-radius: 999px;
    background: rgba(20, 14, 34, 0.82);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-back:hover { background: rgba(40, 28, 66, 0.9); }

/* Стрелки по бокам — еле заметные, только когда осмотров несколько. */
.lightbox-arrow {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 34px;
    line-height: 1;
    opacity: 0.22;
    cursor: pointer;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    transition: opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-arrow.prev { left: 10px; }
.lightbox-arrow.next { right: 10px; }
.lightbox.many .lightbox-arrow { display: block; }
.lightbox-arrow:hover { opacity: 0.6; }

/* Вертикальный экран (телефон): окно как у карты (30.09, слово Архитектора) — шириной
   в экран без полей, квадратное (1:1 — горизонтально влезает больше), со скруглением;
   арт — по высоте окна, в своих пропорциях, двигается в нём пальцем. Вокруг — фон. */
.lightbox.portrait {
    padding: 0 14px;
    touch-action: none;
}
.lightbox.portrait .lightbox-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 80vh;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(8, 6, 12, 0.6);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
}
.lightbox.portrait .lightbox-stage {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}
.lightbox.portrait .lightbox-stage.settle { transition: left 0.25s ease; }
.lightbox.portrait .lightbox-stage img {
    height: 100%;
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
}
.lightbox.portrait .lightbox-bottom { padding-bottom: env(safe-area-inset-bottom); }

@keyframes view-from-right {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: none; }
}
@keyframes view-from-left {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.18); opacity: 1; }
}

.map-back {
    border: 1px solid var(--line);
    background: var(--glass-strong);
    color: var(--text);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.map-back:hover { border-color: var(--violet); }

.map-back {
    border: 1px solid var(--line);
    background: var(--glass-strong);
    color: var(--text);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.map-back {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
}

.map-back[hidden] { display: none; }

.map-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 80%;
    padding: 14px 22px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--glass-strong);
    color: var(--text);
    text-align: center;
    pointer-events: none;
}

.map-empty[hidden] { display: none; }

#info-panel {
    position: absolute;
    left: 50%;
    bottom: 16px;
    padding: 8px 16px;
    transform: translate(-50%, 10px);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass-strong);
    color: var(--text);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

#info-panel.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------- телефон */

@media (max-width: 640px) {
    .top { padding: 12px 14px 8px; gap: 10px; }
    .strip { gap: 8px; }
    .panel { height: auto; min-height: 0; padding: 10px 12px; }
    .download { width: 96px; height: 36px; }
    .map-frame { width: calc(100% - 28px); margin: 0 auto 14px; }
    .map-view { cursor: grab; touch-action: pan-y; }
    .download-note { display: none; }
}

/* ---------------------------------------------------------------- вход (account.js) */

.account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.account-enter,
.auth-submit {
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
}

.account-enter:hover,
.auth-submit:hover {
    background: var(--accent-hot);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.account-link,
.auth-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.account-plaque {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.account-plaque .plaque-value {
    font-size: 18px;
}


/* ---------------------------------------------------------------- окно входа */

.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 10, 9, 0.72);
}

.modal[hidden],
.auth-form[hidden],
.auth-tabs[hidden],
.modal-close[hidden] {
    display: none;
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 22px 24px 24px;
    border-radius: 14px;
    background: rgba(24, 18, 34, 0.92);
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
}

.modal-box h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: none;
    color: #c9c9c4;
    font-size: 24px;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: #1a1a19;
    color: #c9c9c4;
    cursor: pointer;
}

.auth-tab.active {
    background: #3d3d3a;
    color: #ffffff;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: #c9c9c4;
}

.auth-form input {
    padding: 9px 10px;
    border: 1px solid #3d3d3a;
    border-radius: 8px;
    background: #1a1a19;
    color: #ffffff;
    font-size: 15px;
}

.auth-form input:focus {
    outline: 2px solid #d95926;
    outline-offset: 0;
}

.auth-form p {
    margin: 0;
}

.auth-hint {
    color: #9d9d97;
    font-size: 12px;
}

.auth-error {
    min-height: 1em;
    color: #ff8a65;
    font-size: 13px;
}

.recovery-code {
    padding: 14px;
    border-radius: 10px;
    background: #1a1a19;
    color: #ffd27a;
    font-family: Consolas, "Courier New", monospace;
    font-size: 22px;
    letter-spacing: 2px;
    text-align: center;
    user-select: all;
}

/* Свой значок точки (25.09.2026): картинка из редактора локаций вместо кружка. */
.map-point-icon {
    display: block;
    object-fit: contain;
    /* Прозрачность из редактора — в том же filter, что и тень (29.09: на телефоне
       отдельная opacity у картинки с тенью не работала). */
    filter: opacity(var(--icon-opacity, 1)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
    transition: transform 0.15s;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.map-point:hover .map-point-icon { transform: scale(1.08); }
.map-point.own-icon.empty .map-point-icon,
.map-point.own-icon.taken .map-point-icon { filter: grayscale(1) opacity(calc(var(--icon-opacity, 1) * 0.6)); }

/* Смена локации (25.09.2026): прежняя картинка растворяется поверх новой. */
.map-ghost {
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.9s ease;
    z-index: 2;
}
.map-ghost.gone { opacity: 0; }

/* Фон страницы меняется плавно — медленнее карты. */
.backdrop-next {
    opacity: 0;
    transition: opacity 1.6s ease;
}
.backdrop-next.shown { opacity: 1; }

/* Свой значок с пульсирующим кружком выбранного цвета. */
.map-point-iconwrap {
    position: relative;
    display: grid;
    place-items: center;
}
.map-point-pulse {
    position: absolute;
    inset: -18%;
    border: 2px solid var(--pulse, #ffc864);
    border-radius: 50%;
    box-shadow: 0 0 18px var(--pulse, #ffc864);
    animation: pulse-ring 2.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes pulse-ring {
    0%, 100% { transform: scale(0.92); opacity: 0.55; }
    50% { transform: scale(1.12); opacity: 1; }
}

/* Поиск (28.09): кнопка «Заняться поиском» и ход поиска — в углу карты. */
/* Поиск (29.09): маленький кружок с факелом; 1–8 ч — компактно рядом. */
.search-panel {
    position: absolute;
    z-index: 2;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.search-panel[hidden] { display: none; }
.search-panel .torch {
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--glass-strong);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.3s;
}
.search-panel .torch:hover { border-color: var(--violet); }
.search-panel .torch svg { width: 22px; height: 22px; }
.search-panel .torch-stick { fill: #8a7a6a; }
.search-panel .torch-flame { fill: #6f6a80; transition: fill 0.3s; }
.search-panel .torch:hover .torch-flame { fill: #ffb24a; }
.search-panel.lit .torch {
    border-color: rgba(255, 170, 70, 0.7);
    box-shadow: 0 0 14px rgba(255, 150, 50, 0.55);
}
.search-panel.lit .torch-flame {
    fill: #ffb24a;
    transform-origin: 12px 11px;
    animation: torch-flicker 1.4s ease-in-out infinite;
}
@keyframes torch-flicker {
    0%, 100% { transform: scale(1, 1); fill: #ffb24a; }
    50% { transform: scale(0.92, 1.08); fill: #ffd27a; }
}
.search-panel .torch-left {
    font-size: 11px;
    line-height: 1;
    color: #ffd28a;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}
.search-panel .torch-pop {
    display: none;
    grid-template-columns: repeat(4, 34px);
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--glass-strong);
    backdrop-filter: blur(10px);
}
.search-panel.open .torch-pop { display: grid; }
.search-panel.lit .torch-pop { grid-template-columns: auto; }
.search-panel .torch-pop button {
    height: 26px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.search-panel .torch-pop button:hover { border-color: #ffb24a; color: #ffd28a; }
@media (prefers-reduced-motion: reduce) {
    .search-panel.lit .torch-flame { animation: none; }
}

/* «В мире» — сверху правой колонки плашки пэта (30.09). */
.online-badge {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    cursor: default;
}
.online-badge b { color: var(--text); font-weight: 600; }
.online-badge i { color: #7be0a0; font-style: normal; font-size: 8px; margin-right: 3px; }


/* ---------------------------------------------------------------- Сумка пэта (bag.js, 30.09)
   Та же, что окно пэта на рабочем столе (bag_window.py): слева кукла со слотами, справа сетка
   с картинками. Общие классы .bag-modal / .bag-window / .bag-head / .bag-close / .bag-btn /
   .bag-status / .bag-none используют и доски посланий (board.js). Менять — в обеих сумках сразу. */
.bag-modal {
    position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 10px; overflow-y: auto;
    background: rgba(6, 4, 12, 0.66); backdrop-filter: blur(3px);
}
.bag-modal[hidden] { display: none; }
.bag-window {
    width: min(640px, 100%); max-height: min(92vh, 720px); overflow-y: auto;
    padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: 16px;
    background: rgba(18, 14, 30, 0.97); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6); text-align: left;
}
.bag-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bag-head h2 { margin: 0; font-family: var(--title); font-size: 20px; font-weight: 600; }
.bag-close { border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.bag-close:hover { color: var(--text); }
.bag-none { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.bag-btn {
    padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.05);
    color: var(--text); font-size: 13px; cursor: pointer;
}
.bag-btn:hover { border-color: var(--violet); }
.bag-btn:disabled { opacity: 0.5; cursor: default; }
.bag-status { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--muted); }

.bg-window {
    position: relative; display: flex; width: min(820px, 100%); min-height: 560px; max-height: 96vh; overflow: auto;
    border: 1px solid rgba(200, 185, 255, 0.24); border-radius: 18px; text-align: left; color: #f1edf8;
    background: radial-gradient(ellipse at 50% 0%, rgba(36, 28, 62, 0.97), rgba(18, 13, 32, 0.98));
    box-shadow: 0 0 0 6px rgba(143, 91, 255, 0.12), 0 18px 54px rgba(0, 0, 0, 0.65); user-select: none;
}
.bg-left { flex: none; width: 330px; padding: 14px 14px 14px 16px; border-right: 1px solid rgba(200, 185, 255, 0.18); }
.bg-right { flex: 1; min-width: 0; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.bg-title { margin: 0 0 6px; font-family: var(--title); font-size: 17px; font-weight: 700; }
.bg-top { display: flex; align-items: center; justify-content: space-between; }
.bg-top .bg-title { margin: 0; }
.bg-window > .bg-close { position: absolute; top: 12px; right: 14px; z-index: 6; }
.bg-close {
    width: 28px; height: 28px; border: 1px solid rgba(200, 185, 255, 0.25); border-radius: 14px; background: none;
    color: #a79fbd; font-size: 14px; cursor: pointer;
}
.bg-close:hover { color: #f1edf8; border-color: #c9a8ff; }
.bg-doll { position: relative; width: 300px; height: 330px; margin: 0 auto; }
.bg-figure { position: absolute; left: 80px; top: 36px; width: 140px; height: 280px; object-fit: contain; object-position: bottom; image-rendering: pixelated; pointer-events: none; }
.bg-slot {
    position: absolute; width: 52px; height: 52px; box-sizing: border-box; display: grid; place-items: center;
    border: 1px solid rgba(200, 185, 255, 0.18); border-radius: 12px; background: rgba(10, 8, 20, 0.6); cursor: default;
}
.bg-slot.worn { border: 1.3px solid #e8c27a; background: linear-gradient(#3c2a12cc, #181008cc); cursor: pointer; touch-action: manipulation; }
.bg-slot.fits { border: 1.3px solid #c9a8ff; }
.bg-slot.hot { border: 2px solid #c9a8ff; box-shadow: 0 0 0 4px rgba(201, 168, 255, 0.3); }
.bg-slot-name { font-size: 10.5px; line-height: 1.15; color: #6f6884; text-align: center; white-space: pre-line; }
.bg-pic { display: grid; place-items: center; font-size: 13px; color: #a79fbd; pointer-events: none; }
.bg-pic img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.bg-stats { width: 100%; margin-top: 4px; border-collapse: collapse; color: #a79fbd; font-size: 13px; }
.bg-stats td { padding: 2px; }
.bg-stats td:last-child { text-align: right; }
.bg-stats b { color: #f1edf8; }
.bg-hp { height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.bg-hp i { display: block; height: 100%; background: #ff4d5e; }
.bg-filters, .bg-sets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bg-chip {
    padding: 3px 11px; border: 1px solid rgba(200, 185, 255, 0.25); border-radius: 12px; background: transparent;
    color: #a79fbd; font-size: 12.5px; cursor: pointer;
}
.bg-chip:hover { color: #f1edf8; border-color: #c9a8ff; }
.bg-chip.on { color: #f1edf8; border-color: #8f5bff; background: rgba(143, 91, 255, 0.25); }
.bg-sets-label { color: #a79fbd; font-size: 12.5px; }
.bg-scroll { flex: 1; min-height: 160px; overflow-y: auto; padding: 2px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: 8px; align-content: start; }
.bg-cell {
    position: relative; width: 72px; height: 80px; box-sizing: border-box; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; padding: 4px 3px;
    border: 1.5px solid rgba(200, 185, 255, 0.18); border-radius: 12px; background: rgba(70, 58, 120, 0.32); touch-action: manipulation;
}
.bg-cell:not([data-code]) { background: rgba(10, 8, 20, 0.45); }
.bg-cell[data-kind="weapon"] { border-color: rgba(232, 160, 110, 0.55); }
.bg-cell[data-kind="armor"] { border-color: rgba(110, 160, 232, 0.55); }
.bg-cell[data-code] .bg-pic { filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.25)); }
.bg-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.2; color: #cfc7ef; pointer-events: none; }
.bg-cell[data-code] { cursor: pointer; }
.bg-cell[data-code]:hover { border-color: #c9a8ff; }
.bg-cell.sel { border: 1.4px solid #e8c27a; }
.bg-worn { position: absolute; top: 3px; left: 6px; font-size: 13px; font-weight: 700; color: #7be38a; pointer-events: none; }
.bg-count { position: absolute; right: 6px; bottom: 18px; font-size: 10.5px; color: #f1edf8; pointer-events: none; }
.bg-new {
    position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #ffd68c;
    box-shadow: 0 0 0 3px rgba(255, 180, 74, 0.35); pointer-events: none;
}
.bg-links { display: flex; flex-wrap: wrap; gap: 14px; }
.bg-link {
    padding: 0 0 1px; border: 0; border-bottom: 1px dotted #a79fbd; background: none; color: #a79fbd; font-size: 12px; cursor: pointer;
}
.bg-link:hover { color: #f1edf8; }
.bg-status { min-height: 16px; font-size: 12px; color: #a79fbd; }
/* Карточка вещи (05.10): панель внизу сумки (компьютер) / внизу экрана (телефон). */
.bg-card {
    position: absolute; z-index: 5; left: 330px; right: 0; bottom: 0; padding: 12px 16px 16px;
    border-top: 2px solid #6b5bc4; border-radius: 18px 18px 18px 0; background: #251e44;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45); font-size: 14px; line-height: 1.5;
}
.bg-card[hidden] { display: none; }
.bg-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.bg-card-head > div { flex: 1; min-width: 0; }
.bg-card-pic { flex: none; border: 2px solid rgba(201, 168, 255, 0.5); border-radius: 14px; background: rgba(70, 58, 120, 0.45); padding: 6px; }
.bg-card-close { flex: none; align-self: flex-start; }
.bg-card-title { font-size: 16px; font-weight: 700; }
.bg-card-dim { color: #a79fbd; font-size: 13px; }
.bg-card-plus { color: #7be38a; }
.bg-card-minus { color: #ff8a96; }
.bg-card-line { padding: 1px 0; }
.bg-card-buttons { display: flex; gap: 10px; margin-top: 10px; }
.bg-card-btn { flex: 1; padding: 10px; border-radius: 12px; font-size: 14px; cursor: pointer; border: 1px solid rgba(200, 185, 255, 0.25); background: none; color: #f1edf8; }
.bg-card-btn.main { background: #4a3c8c; border-color: #7a6bd0; }
.bg-card-btn.main:hover { background: #5a4aa8; }
.bg-card-btn.danger { color: #ff9aa8; border-color: #6b3c4c; }
.bg-card-btn.danger:hover { background: rgba(255, 90, 110, 0.12); }
/* Ячейки куклы (05.10): серый силуэт в пустой, «лев./пр.» у парных. */
.bg-slot-icon { width: 30px; height: 30px; fill: #c9bfee; opacity: 0.3; pointer-events: none; }
.bg-slot-side { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 9px; color: #8f86b3; pointer-events: none; }
.bg-slot.worn .bg-slot-side { color: #e8c27a; }
/* Вкладки — только на узком экране; на широком «Снаряжение» и «Сумка» рядом. */
.bg-tabs, .bg-worn-strip { display: none; }
.bg-pages, .bg-track { display: contents; }
.bg-ghost { position: fixed; z-index: 400; pointer-events: none; opacity: 0.9; }
@media (max-width: 860px) {
    .bg-window { flex-direction: column; min-height: 0; }
    .bg-left { width: auto; border-right: 0; }
    .bg-doll { transform-origin: top center; }
    /* 05.10: одно окно одного размера; страницы лежат рядом и плавно листаются вбок. */
    .bg-window { height: min(92vh, 760px); height: min(92dvh, 760px); max-height: none; overflow: hidden; }
    .bg-tabs { position: relative; flex: none; display: flex; margin: 12px 54px 6px 12px; padding: 4px; border-radius: 14px; background: rgba(10, 8, 20, 0.6); }
    .bg-tabs::before {
        content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px;
        background: #4a3c8c; transition: transform 0.28s ease;
    }
    .bg-window.tab-bag .bg-tabs::before { transform: translateX(100%); }
    .bg-tab { position: relative; flex: 1; padding: 9px 6px; border: 0; border-radius: 10px; background: none; color: #a79fbd; font-size: 15px; cursor: pointer; transition: color 0.28s; }
    .bg-tab.on { color: #fff; }
    .bg-window .bg-title { display: none; }
    .bg-pages { display: block; flex: 1; min-height: 0; overflow: hidden; }
    .bg-track { display: flex; width: 100%; height: 100%; transition: transform 0.3s ease; }
    .bg-window.tab-bag .bg-track { transform: translateX(-100%); }
    .bg-left, .bg-right { flex: none; width: 100%; height: 100%; box-sizing: border-box; }
    .bg-left { overflow-y: auto; }
    .bg-right { overflow: hidden; padding-top: 6px; }
    .bg-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
    .bg-cell { width: auto; }
    .bg-worn-strip {
        display: flex; flex: none; align-items: center; gap: 6px; width: 100%; padding: 5px 10px; box-sizing: border-box;
        border: 1px solid rgba(232, 194, 122, 0.35); border-radius: 12px; background: rgba(60, 42, 18, 0.35); color: #e8c27a;
        font-size: 12.5px; cursor: pointer; text-align: left;
    }
    .bg-worn-label { margin-right: 2px; }
    .bg-worn-go { margin-left: auto; color: #a79fbd; }
    .bg-card { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; border-radius: 22px 22px 0 0; padding-bottom: 22px; }
}
@media (max-width: 360px) { .bg-doll { transform: scale(0.88); height: 290px; } }

/* ---------------------------------------------------------------- Послания (board.js, 30.09) */
.letters-body { min-width: 0; flex: 1; }
.letters-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.letters-place {
    color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.letters-text {
    margin: 2px 0 0; color: var(--text); font-size: 13px; line-height: 1.35; transition: opacity 0.25s;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.letters-text.fading { opacity: 0; }
.letters-meta { margin-top: 1px; color: var(--faint, var(--muted)); font-size: 11px; min-height: 13px; }

.board-window { width: min(520px, 100%); }
.board-menu[hidden], .board-list[hidden], .board-form[hidden] { display: none; }
.board-menu { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.board-menu .bag-btn { padding: 12px 14px; font-size: 14px; }
.board-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.board-back { align-self: flex-start; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 0; }
.board-back:hover { color: var(--text); }
.note {
    position: relative; padding: 10px 12px 10px; border: 1px solid var(--line); border-radius: 10px;
    background: rgba(255, 255, 255, 0.04); opacity: var(--glow, 1);
}
.note.mine { border-color: rgba(170, 240, 200, 0.5); }
.note-text { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.note-meta { margin-top: 4px; font-size: 11px; color: var(--muted); }
.note-btn { margin-top: 8px; padding: 5px 12px; font-size: 12px; }
.board-form textarea {
    width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); border-radius: 10px;
    background: rgba(255, 255, 255, 0.05); color: var(--text); font: inherit; font-size: 14px; resize: vertical;
}
.board-count { margin-top: 4px; font-size: 11px; color: var(--muted); text-align: right; }
.board-count.over { color: #ff8a8a; }
.board-actions { display: flex; gap: 8px; margin-top: 8px; }


/* Статус над головой пэта (30.09): нажали на игрока на карте — всплывает фраза, которую он задал в сумке. */
.map-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    z-index: 6;
    width: max-content;
    max-width: 200px;
    padding: 6px 11px;
    border: 1px solid rgba(201, 168, 255, 0.6);
    border-radius: 12px;
    background: rgba(20, 14, 34, 0.94);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
    pointer-events: none;
    animation: bubble-in 0.18s ease-out;
}
.map-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: rgba(201, 168, 255, 0.6);
}
@keyframes bubble-in {
    from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.9); }
    to { opacity: 1; transform: translateX(-50%); }
}

/* «Статус» в сумке (bag.js): под куклой с аватаром. */
.bg-status-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 26px; }
.bg-status-text { flex: 1; min-width: 0; color: #a79fbd; font-size: 12.5px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ---------------------------------------------------------------- три плашки (02.10, script.js) */
/* 02.10 (слово Архитектора): всё одинаково на всех версиях — и на телефоне, и на компьютере. */
.trio { min-width: 0; }
.tile-body { min-width: 0; flex: 1; }
.tile-text { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* Ряд из трёх. Раскрытая растёт, сжатые — полоски у своих краёв; порядок не меняется. */
    .trio { display: flex; gap: 8px; }
    .trio > .tile {
        flex: 1 1 0px;
        height: 96px;
        min-height: 0;
        padding: 10px;
        gap: 10px;
        overflow: hidden;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: flex-grow 0.35s ease, flex-basis 0.35s ease, padding 0.35s ease, gap 0.35s ease;
    }
    .trio .panel-icon { flex: none; transition: opacity 0.25s, width 0.35s, height 0.35s, font-size 0.35s; }
    .trio:not(.has-open) .panel-icon,
    .trio > .tile.shut .panel-icon { width: 28px; height: 28px; font-size: 14px; }
    .trio .tile-body,
    .trio .letters-body { transition: opacity 0.25s; }

    /* Три равные: значок над названием, остальное прячется. */
    .trio:not(.has-open) > .tile { flex-direction: column; justify-content: center; gap: 4px; text-align: center; }
    .trio:not(.has-open) .tile-body,
    .trio:not(.has-open) .letters-body { flex: none; }
    .trio:not(.has-open) .panel-title { font-size: 13px; line-height: 1.15; }
    .trio:not(.has-open) .letters-place,
    .trio:not(.has-open) .letters-text,
    .trio:not(.has-open) .letters-meta,
    .trio:not(.has-open) .tile-text { display: none; }

    /* Раскрытая — вся ширина, что осталась от полосок. */
    .trio > .tile.open { cursor: default; }

    /* Полоска: узкая, виден только значок. */
    .trio > .tile.shut { flex: 0 0 30px; padding: 10px 0; gap: 0; justify-content: center; }
    .trio > .tile.shut .tile-body,
    .trio > .tile.shut .letters-body { opacity: 0; width: 0; flex: 0 0 0px; overflow: hidden; }
    .trio > .tile.shut .panel-icon { opacity: 0.8; }
@media (max-width: 640px) { .trio > .tile { height: 84px; } }

@media (prefers-reduced-motion: reduce) {
    .trio > .tile { transition: none; }
}


/* ---------------------------------------------------------------- действия на карте (02.10, script.js) */
.acts { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-width: 0; }
.act {
    position: relative; flex: none; width: 36px; height: 36px; padding: 0;
    display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 50%;
    background: var(--glass-strong); cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.3s, opacity 0.3s;
}
.act svg { width: 20px; height: 20px; position: relative; }
.act .torch-stick { fill: #8a7a6a; }
.act .torch-flame { fill: #b49a6a; transition: fill 0.3s; }
.act .eye-lid { fill: none; stroke: #b8b0c8; stroke-width: 1.6; }
.act .eye-ball { fill: #b8b0c8; }
.act-eye.on { border-color: var(--violet); }
.act-eye.on .eye-lid { stroke: #d8c8ff; }
.act-eye.on .eye-ball { fill: #d8c8ff; }
/* Искать нечего — бледный. */
.act-torch.pale { opacity: 0.45; }
.act-torch.pale .torch-flame { fill: #6f6a80; }
/* Есть что искать — по контуру бежит лёгкое золотое свечение. */
.act-torch.glow .torch-flame { fill: #e0a850; }
.act-torch.glow::before {
    content: ""; position: absolute; inset: -1px; border-radius: 50%; padding: 2px;
    background: conic-gradient(from 0deg, transparent 0 65%, rgba(255, 210, 122, 0.25) 78%, #ffd27a 92%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: act-run 2.4s linear infinite;
    pointer-events: none;
}
@keyframes act-run { to { transform: rotate(1turn); } }
/* Идёт поиск — горит, как на карте. */
.act-torch.lit { border-color: rgba(255, 170, 70, 0.7); box-shadow: 0 0 12px rgba(255, 150, 50, 0.5); }
.act-torch.lit .torch-flame { fill: #ffb24a; transform-origin: 12px 11px; animation: torch-flicker 1.4s ease-in-out infinite; }

.acts-extra { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.acts-extra.scroll { overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.acts-extra.scroll::-webkit-scrollbar { display: none; }
.acts-note {
    color: var(--muted); font-size: 11.5px; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    animation: acts-in 0.25s ease-out;
}
.act-chip {
    flex: none; height: 28px; padding: 0 9px;
    border: 1px solid var(--line); border-radius: 999px;
    background: rgba(255, 255, 255, 0.06); color: var(--text);
    font: inherit; font-size: 12px; cursor: pointer;
    animation: acts-in 0.25s ease-out;
}
.act-chip:active, .act-chip:hover { border-color: #ffb24a; color: #ffd28a; }
.act-view {
    flex: none; width: 30px; height: 30px; padding: 0;
    display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 50%;
    background: var(--glass-strong) center / 70% no-repeat;
    cursor: pointer; animation: acts-in 0.25s ease-out;
}
.act-view svg { width: 16px; height: 16px; }
.act-view .eye-lid { fill: none; stroke: #d8c8ff; stroke-width: 1.6; }
.act-view .eye-ball { fill: #d8c8ff; }
@keyframes acts-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Карта едет к осмотру; значок пару раз пульсирует. */
.map-layer.gliding { transition: transform 0.6s ease; }
.map-point.pulse-twice { animation: point-pulse 0.7s ease-in-out 2; }
@keyframes point-pulse {
    0%, 100% { filter: none; scale: 1; }
    50% { filter: drop-shadow(0 0 10px rgba(255, 210, 122, 0.95)); scale: 1.35; }
}

/* Факел живёт в плашке, на карте его нет (везде). */
.search-panel { display: none !important; }
.trio:not(.has-open) .acts { display: none; }
/* Раскрытые «Действия»: кружки и есть содержимое — большой значок плашки не нужен. */
#tile-actions.open > .panel-icon { display: none; }
@media (prefers-reduced-motion: reduce) {
    .act-torch.glow::before, .act-torch.lit .torch-flame, .map-point.pulse-twice { animation: none; }
    .map-layer.gliding { transition: none; }
}

/* ---------------------------------------------------------------- оповещения и почта (02.10, mail.js) */
/* Значок плашки: есть новое — золотая точка со счётом. */
.panel-icon.has-news { position: relative; border-color: rgba(255, 190, 90, 0.7); }
.panel-icon.has-news::after {
    content: attr(data-count);
    position: absolute; top: -4px; right: -6px;
    min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
    border-radius: 999px; background: #e0a850; color: #1a1020;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.news { display: flex; align-items: center; gap: 6px; margin-top: 6px; min-width: 0; }
.news-chip {
    flex: 1 1 0; min-width: 0; height: 36px; padding: 0 6px;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    border: 1px solid var(--line); border-radius: 12px;
    background: rgba(255, 255, 255, 0.04); color: var(--muted);
    font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap; overflow: hidden;
    animation: acts-in 0.25s ease-out;
}
.news-chip b { color: var(--text); font-size: 14px; }
.news-chip.fresh { border-color: rgba(255, 190, 90, 0.6); color: #ffd28a; }
.news-chip.fresh b { color: #ffd28a; }
.trio:not(.has-open) .news { display: none; }
#tile-mail.open > .panel-icon { display: none; }

.mail-window { width: min(520px, 100%); }
.mail-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.mail-tab {
    flex: 1; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px;
    background: rgba(255, 255, 255, 0.04); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.mail-tab.on { border-color: var(--violet); color: var(--text); }
.mail-tab i {
    margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #e0a850; color: #1a1020;
    font-style: normal; font-size: 11px; font-weight: 700;
}
.mail-body { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.mail-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.mail-row-text { flex: 1; min-width: 0; }
.mail-row-title { font-size: 14px; }
.mail-row-meta { font-size: 11px; color: var(--muted); }
.mail-switch { display: flex; gap: 14px; }
.mail-switch-btn { border: 0; background: none; padding: 0 0 2px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; border-bottom: 1px solid transparent; }
.mail-switch-btn.on { color: var(--text); border-bottom-color: var(--violet); }
.letter { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); cursor: pointer; }
.letter.unread { border-color: rgba(255, 190, 90, 0.6); }
.letter.unread .letter-head b::before { content: "● "; color: #e0a850; }
.letter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.letter-head span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.letter-text {
    margin-top: 3px; font-size: 13.5px; line-height: 1.4; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.letter.open .letter-text { display: block; color: var(--text); }
.mail-left { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 2px; }
.mail-to { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* Голубь рядом со статусом чужого пэта на карте. */
.map-bubble.with-extra { overflow: visible; }
.map-pigeon {
    position: absolute; left: 100%; top: 50%; margin-left: 8px; transform: translateY(-50%);
    width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
    border: 1px solid rgba(160, 200, 255, 0.6); border-radius: 50%;
    background: rgba(20, 14, 34, 0.94); cursor: pointer; pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.map-pigeon svg { width: 18px; height: 18px; fill: #cfe0ff; }
.map-pigeon:hover { border-color: #cfe0ff; }

/* Картинка вещи в находках (02.10, mail.js). */
.mail-row-pic {
    flex: none; width: 44px; height: 44px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
    background: rgba(255, 255, 255, 0.04) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) { .bg-track, .bg-tabs::before { transition: none !important; } }
