/* ============================================================
   3D-ПОСЁЛОК — интерфейс
   Минимализм: белый, тонкие линии, Inter, воздух
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./vendor/fonts/inter-latin-300-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./vendor/fonts/inter-cyrillic-300-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./vendor/fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./vendor/fonts/inter-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./vendor/fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./vendor/fonts/inter-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --ink: #1c1c1a;
  --ink-2: #6f6f6a;
  --ink-3: #a5a5a0;
  --line: #e7e7e2;
  --line-2: #d9d9d3;
  --paper: rgba(255, 255, 255, 0.86);
  --accent: #1c1c1a;
  --radius: 14px;
  --font: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #fbfbf9;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

#view { position: fixed; inset: 0; }
#view canvas { display: block; }

.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

/* ---------- общие панели ---------- */

.panel {
  position: absolute;
  background: var(--paper);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(28, 28, 26, 0.05);
}

.panel-flat {
  position: absolute;
  background: transparent;
  pointer-events: none;
}

.hidden { display: none !important; }

button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
}

.icon-btn {
  width: 22px; height: 22px;
  border-radius: 6px;
  position: relative;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.icon-btn:hover { opacity: 1; background: #f1f1ee; }
.icon-btn::before, .icon-btn::after {
  content: ''; position: absolute; left: 6px; right: 6px; top: 50%;
  height: 1.2px; background: var(--ink);
}
.icon-btn.close::before { transform: rotate(45deg); }
.icon-btn.close::after { transform: rotate(-45deg); }
#layersCollapse::before { transform: rotate(-20deg); }
#layersCollapse::after { transform: rotate(20deg); transform-origin: left; top: calc(50% + 1px); }
#layersCollapse.collapsed::before { transform: rotate(20deg); }
#layersCollapse.collapsed::after { transform: rotate(-20deg); transform-origin: left; top: calc(50% + 1px); }

/* ---------- бренд ---------- */

#brand { top: 22px; left: 24px; }

.brand-logo {
  display: block;
  height: 26px;
  width: auto;
  margin-bottom: 12px;
  opacity: 0.92;
}

.brand-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.brand-sub {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

/* ---------- настройки (шестерёнка) ---------- */

#leftPanels {
  position: absolute;
  top: 88px; left: 24px;
  display: flex; flex-direction: column; gap: 12px;
  width: 236px;
}
#leftPanels .panel { position: static; }

#settingsPanel { width: 236px; }
#settingsPanel.collapsed { width: 46px; }
#settingsPanel.collapsed .panel-body { display: none; }
#settingsPanel.collapsed .settings-head { padding: 7px; justify-content: center; }

.settings-head {
  display: flex; justify-content: flex-end;
  padding: 8px 10px 4px;
}
.gear { width: 28px; height: 28px; opacity: 0.7; }
.gear:hover { opacity: 1; }
.gear::before, .gear::after { display: none; }
.gear svg {
  width: 18px; height: 18px; display: block; margin: auto;
  fill: none; stroke: var(--ink); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}

#settingsBody { padding: 6px 14px 14px; }
.set-row { margin-bottom: 13px; }
.set-row .time-head { margin-bottom: 7px; }
.set-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 7px;
}

.time-head {
  display: flex; align-items: center; gap: 9px;
}
.time-head svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--ink-2);
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
#timeLabel {
  margin-left: auto;
  font-size: 13px; font-weight: 500; letter-spacing: 0.05em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.toggle-btn {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font-size: 12px;
  color: var(--ink);
  background: none;
  transition: background 0.14s, border-color 0.14s;
}
.toggle-btn:hover { background: #f3f3ef; border-color: var(--ink-3); }
.toggle-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* свитчер сезонов: сегментная кнопка (Лето / Осень / Зима) */
.seg {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 8px;
}
.seg-btn {
  flex: 1;
  padding: 8px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.14s;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn:hover { background: #f3f3ef; }
.seg-btn.on { background: var(--accent); color: #fff; }

#timeSlider, #fogSlider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%; height: 18px;
  background: transparent;
  cursor: pointer;
}
#timeSlider::-webkit-slider-runnable-track,
#fogSlider::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-2);
  border-radius: 2px;
}
#timeSlider::-webkit-slider-thumb,
#fogSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  margin-top: -5.5px;
}
#timeSlider::-moz-range-track, #fogSlider::-moz-range-track { height: 2px; background: var(--line-2); border-radius: 2px; }
#timeSlider::-moz-range-thumb, #fogSlider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: none; }

/* дата (месяц / число): две компактные дорожки под слайдером времени,
   высоту панели не раздувают (ползунки мельче, чем у #timeSlider) */
#dateLabel {
  margin-left: auto;
  font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
#monthSlider, #daySlider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%; height: 13px;
  background: transparent;
  cursor: pointer;
}
#monthSlider { margin-bottom: 1px; }
#monthSlider::-webkit-slider-runnable-track,
#daySlider::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-2);
  border-radius: 2px;
}
#monthSlider::-webkit-slider-thumb,
#daySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  margin-top: -4.5px;
}
#monthSlider::-moz-range-track, #daySlider::-moz-range-track { height: 2px; background: var(--line-2); border-radius: 2px; }
#monthSlider::-moz-range-thumb, #daySlider::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: none; }


/* ---------- слои ---------- */

#layersPanel { width: 236px; }
#layersPanel.collapsed { width: 46px; }
#layersPanel.collapsed .panel-body { display: none; }
#layersPanel.collapsed .panel-head { padding: 7px; justify-content: center; }
#layersPanel .panel-title { display: none; flex: 1; padding-left: 4px; }
#layersPanel:not(.collapsed) .panel-title { display: block; }
/* иконка слоёв всегда видна и работает как toggle (как у солнца) */
#layersPanel.collapsed .panel-head { padding-bottom: 12px; }

.panel-head .ico { width: 28px; height: 28px; opacity: 0.75; }
.panel-head .ico:hover { opacity: 1; }
.panel-head .ico::before, .panel-head .ico::after { display: none; }
.panel-head .ico svg {
  width: 18px; height: 18px; display: block; margin: auto;
  fill: none; stroke: var(--ink); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-2);
  cursor: default;
}
#layersPanel.collapsed .panel-head { padding-bottom: 12px; }

.panel-body { padding: 0 8px 8px; }

.layer-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
  transition: background 0.13s;
}
.layer-row:hover { background: #f3f3ef; }

.layer-row .lname {
  flex: 1;
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.layer-row.layer-off .lname { color: var(--ink-3); }

/* кастомный чекбокс */
.ckb {
  width: 15px; height: 15px; flex: none;
  border: 1.2px solid var(--line-2);
  border-radius: 4.5px;
  position: relative;
  transition: border-color 0.13s, background 0.13s;
}
.layer-row:not(.layer-off) .ckb { background: var(--accent); border-color: var(--accent); }
.ckb::after {
  content: ''; position: absolute;
  left: 4px; top: 1.2px;
  width: 4px; height: 8px;
  border-right: 1.6px solid #fff; border-bottom: 1.6px solid #fff;
  transform: rotate(43deg) scale(0);
  transition: transform 0.15s;
}
.layer-row:not(.layer-off) .ckb::after { transform: rotate(43deg) scale(1); }

/* ---------- режимы (pill) ---------- */

#modeBar {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  display: flex; gap: 2px;
  padding: 5px;
  background: var(--paper);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(28, 28, 26, 0.06);
}

.mode-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.mode-btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
}
.mode-btn span { font-size: 12px; letter-spacing: 0.02em; }
.mode-btn:hover { background: #f1f1ee; color: var(--ink); }
.mode-btn.active { background: var(--accent); color: #fff; }

.pill .sep { width: 1px; align-self: stretch; margin: 6px 5px; background: var(--line); }

.home-btn { padding-right: 14px; }
.home-btn svg { stroke-width: 1.4; }

/* кинотур: кнопка «Тур» → «Стоп» во время облёта */
.tour-btn .ico-stop { display: none; }
.tour-btn.on { background: var(--accent); color: #fff; }
.tour-btn.on .ico-tour { display: none; }
.tour-btn.on .ico-stop { display: block; }
.tour-btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- планировки ---------- */

#plansOverlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(248, 248, 245, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade-in 0.22s ease both;
}
@keyframes fade-in { from { opacity: 0; } }

.plans-card {
  width: min(960px, 94vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(28, 28, 26, 0.12);
  overflow: hidden;
}

.plans-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 0;
}
.plans-title { font-size: 16px; font-weight: 500; letter-spacing: 0.01em; }
.plans-head .icon-btn { margin-top: 4px; }

.plans-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.plan-tab {
  padding: 7px 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  transition: all 0.14s;
}
.plan-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.plan-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.plans-body {
  flex: 1;
  min-height: 0;
  padding: 16px 20px 6px;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
  scrollbar-width: thin;
}
.plans-body::-webkit-scrollbar { width: 6px; height: 6px; }
.plans-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.plans-body img {
  max-width: 100%;
  max-height: 57vh;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fdfdfc;
}
.plans-note {
  padding: 8px 20px 14px;
  font-size: 10.5px; color: var(--ink-3);
  letter-spacing: 0.03em;
  text-align: center;
  min-height: 16px;
}

/* ---------- подсказка ---------- */

#hint {
  position: absolute;
  left: 50%; bottom: 84px;
  transform: translateX(-50%);
  padding: 7px 14px;
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
#hint.show { opacity: 1; }

/* ---------- тосты ---------- */

#toasts {
  position: absolute;
  right: 24px; bottom: 26px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  max-width: 320px;
  padding: 9px 14px;
  font-size: 11.5px; line-height: 1.45;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 6px 24px rgba(28, 28, 26, 0.05);
  animation: toast-in 0.25s ease both;
}
.toast strong { font-weight: 500; color: var(--ink); }
.toast.out { animation: toast-out 0.3s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- инфо-карточка ---------- */

#infoCard {
  left: 24px; bottom: 26px;
  width: 264px;
  padding: 16px 16px 14px;
}
.card-kicker {
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.card-title { font-size: 15px; font-weight: 500; letter-spacing: 0.01em; margin-bottom: 12px; }
.card-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.card-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.card-row .k { color: var(--ink-3); }
.card-row .v { color: var(--ink); text-align: right; }
.card-row.big .v { font-size: 14px; font-weight: 500; }

.card-actions { display: flex; gap: 8px; }
.card-actions button {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font-size: 12px;
  transition: background 0.14s, border-color 0.14s;
}
.card-actions button:hover { background: #f3f3ef; border-color: var(--ink-3); }

#infoClose { position: absolute; top: 10px; right: 10px; }

/* ---------- прочее ---------- */

#uiToggle {
  right: 24px; bottom: 26px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--paper);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  opacity: 0.7; cursor: pointer;
  transition: opacity 0.15s;
}
#uiToggle:hover { opacity: 1; }
#uiToggle svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 1.3; }
body.ui-hidden .hud > * { opacity: 0; pointer-events: none; transition: opacity 0.25s; }
body.ui-hidden #uiToggle { opacity: 0.25; pointer-events: auto; }

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(28, 28, 26, 0.45);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* ---------- модалка имени ---------- */
#nameModal {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(248, 248, 245, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade-in 0.22s ease both;
}
#nameModal.hidden { display: none; }
.name-card {
  width: min(360px, calc(100vw - 40px));
  background: #fff; border-radius: 16px; padding: 22px 22px 18px;
  box-shadow: 0 18px 60px rgba(28, 28, 26, 0.18);
  display: flex; flex-direction: column; gap: 10px;
}
.name-title { font-size: 17px; font-weight: 600; color: #2c2c28; }
.name-sub { font-size: 12.5px; line-height: 1.45; color: #8a8a84; }
#nameInput {
  border: 1px solid #d9d9d2; border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 14px; color: #2c2c28; outline: none;
}
#nameInput:focus { border-color: #9dbb8c; box-shadow: 0 0 0 3px rgba(157, 187, 140, 0.25); }
.name-row { display: flex; gap: 8px; margin-top: 4px; }
.name-btn {
  flex: 1; border: 1px solid #d9d9d2; background: #fff; border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 13px; cursor: pointer; color: #2c2c28;
}
.name-btn.primary { background: #2c2c28; border-color: #2c2c28; color: #fff; }
.name-btn:hover { filter: brightness(0.97); }

/* ---------- гости онлайн (столбик слева) ---------- */

#onlineBadge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 46px;
  padding: 9px 0;
  background: var(--paper);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(28, 28, 26, 0.05);
  pointer-events: none;
}
#onlineBadge svg {
  width: 16px; height: 16px;
  fill: none; stroke: var(--ink); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
#onlineBadge .num {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.lbl-guest .lbl-main {
  font-size: 10px; font-weight: 300;
  color: var(--ink-2);
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}
.lbl-view .lbl-main {
  font-size: 10px; font-weight: 400;
  color: #b07f2e;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}

/* ---------- лоадер ---------- */

#loader {
  position: fixed; inset: 0; z-index: 100;
  background: #fbfbf9;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.55s ease, visibility 0.55s;
}
#loader.done { opacity: 0; visibility: hidden; }

.loader-inner { width: 260px; text-align: center; }
.loader-title {
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.34em; text-transform: uppercase;
  margin-bottom: 26px;
}
.loader-bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.loader-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s ease;
}
.loader-stage {
  font-size: 11px; color: var(--ink-2);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  min-height: 14px;
}
.loader-note {
  margin-top: 12px;
  font-size: 10.5px; color: var(--ink-3);
  letter-spacing: 0.04em;
  min-height: 13px;
}

/* ---------- CSS2D-подписи в сцене ---------- */

.lbl {
  font-family: var(--font);
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.lbl-parcel {
  text-align: center;
  transform: translateY(-2px);
}
.lbl-parcel .lbl-main {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}
.lbl-parcel .lbl-area {
  font-size: 10.5px; font-weight: 300;
  color: var(--ink-2);
  margin-top: 1px;
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}
.lbl-title .lbl-main {
  font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2);
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}
.lbl-marker .lbl-main {
  font-size: 11px; font-weight: 500;
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}
.lbl-marker .lbl-sub {
  font-size: 10px; font-weight: 300; color: var(--ink-2);
  text-shadow: 0 0 6px rgba(251, 251, 249, 0.9), 0 0 2px rgba(251, 251, 249, 0.9);
}

/* номера вилл: чёрные кружки-кнопки над домами (клик → иконки дома) */
.lbl-villanumber { text-align: center; }
.lbl-villanumber .lbl-main {
  width: 35px; height: 35px; border-radius: 50%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #1c1c1a;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0;
  cursor: pointer; pointer-events: auto;
  transition: transform 0.15s ease;
}
.lbl-villanumber .lbl-main:hover { transform: scale(1.08); }
@media (max-width: 760px) {
  .lbl-villanumber .lbl-main { width: 28px; height: 28px; font-size: 13px; }
}

/* иконки над виллой: раскрываются справа от кружка с номером */
.villa-actions {
  display: flex; gap: 8px; pointer-events: none;
  margin-left: 66px; /* отступ от кружка-номера: край кнопок = pos + 28px, зазор ~10px при D35/кружке */
  animation: vaIn 0.18s ease;
}
@keyframes vaIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 760px) {
  .villa-actions { margin-left: 62px; } /* мобильный кружок D28: тот же зазор ~10px */
}
.villa-actions .va-btn {
  pointer-events: auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #e2e2dc;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.villa-actions .va-btn:hover { transform: scale(1.09); box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16); }
.villa-actions .va-btn svg { width: 17px; height: 17px; }
/* «взрыв-схема»: режим включён — подсветка; идут части — полупрозрачная без клика */
.villa-actions .va-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.villa-actions .va-btn.loading {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
  animation: vaPulse 1s ease-in-out infinite;
}
@keyframes vaPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.24; }
}

/* галерея визуализаций в окне проекта */
.plans-gallery {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  overflow-y: auto; width: 100%;
  align-content: start;
  padding: 2px;
}
.plans-gallery.hidden { display: none; }
.plans-gallery .viz-item img {
  width: 100%; display: block; border-radius: 8px;
  border: 1px solid #e8e8e4;
}

/* просмотр картинки на весь экран: клик по плану/визуализации — открыть, клик — закрыть */
#lightbox {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(250, 250, 248, 0.97);
  display: flex; align-items: center; justify-content: center;
  padding: 2vh 2vw;
  cursor: zoom-out;
}
#lightbox.hidden { display: none; }
#lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.2);
  background: #ffffff;
}
.plans-body img, .plans-gallery .viz-item img { cursor: zoom-in; }

.pin {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.85), 0 1px 5px rgba(0,0,0,0.18);
  pointer-events: none;
}
.pin.hover { background: #b0432b; }

/* курсор-цель в режиме прогулки по кликабельному */
#view.pointing { cursor: pointer; }
#view.flying-look { cursor: grabbing; }

/* ---------- тач-управление ---------- */

.joy, .tbtn { display: none; }

body.touch[data-mode="walk"] .joy,
body.touch[data-mode="fly"] .joy { display: block; }
body.touch[data-mode="walk"] #btnJump { display: flex; }
body.touch[data-mode="fly"] #btnUp,
body.touch[data-mode="fly"] #btnDown { display: flex; }

.joy {
  position: fixed;
  left: 26px; bottom: 30px;
  width: 116px; height: 116px;
  border-radius: 50%;
  border: 1.5px solid rgba(28, 28, 26, 0.22);
  background: rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  pointer-events: none;
  z-index: 5;
}
#joyKnob {
  position: absolute; left: 50%; top: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(28, 28, 26, 0.55);
  transition: transform 0.07s linear;
}

.tbtn {
  position: fixed;
  width: 56px; height: 56px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(28, 28, 26, 0.08);
  z-index: 6;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.tbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#btnJump { right: 32px; bottom: 118px; }
#btnUp { right: 32px; bottom: 192px; }
#btnDown { right: 32px; bottom: 120px; }

canvas { touch-action: none; }

@media (max-width: 760px) {
  .brand-sub { display: none; }
  #leftPanels { top: 84px; left: 12px; width: 208px; gap: 10px; }
  #infoCard { left: 12px; right: 12px; bottom: 86px; width: auto; }
  #modeBar { bottom: 16px; max-width: 96vw; overflow-x: auto; }
  .mode-btn span { display: none; }
  .mode-btn { padding: 9px 12px; }
  .home-btn span { display: inline; font-size: 11px; }
  #toasts { right: 12px; left: 12px; bottom: 150px; align-items: stretch; }
  #toasts .toast { max-width: none; }
  #hint { bottom: 78px; max-width: 92vw; white-space: normal; text-align: center; }
  #uiToggle { display: none; }
  .plans-card { width: 96vw; border-radius: 14px; }
  .plans-body img { max-height: 56vh; }
}
