/* ===== Шрифт Slovic (положи файл в папку fonts/) ===== */
@font-face {
  font-family: 'Slovic';
  src:
    url('../fonts/Slovic.woff2') format('woff2'),
    url('../fonts/Slovic.woff') format('woff'),
    url('../fonts/Slovic.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope-7';
  src:
    url('../fonts/Manrope-7.woff2') format('woff2'),
    url('../fonts/Manrope-7.woff') format('woff'),
    url('../fonts/Manrope-7.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

[hidden] {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
}

#panorama-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#panorama-container canvas {
  display: block;
  filter: contrast(1.08) saturate(1.15);
  image-rendering: -webkit-optimize-contrast;
}

#panorama-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.35) 100%
  );
}

#fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

#preloader {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #ccc;
  z-index: 20;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #c9a96e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Хотспоты навигации ===== */
.hotspot-container {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

.hotspot-pulse {
  width: clamp(18px, 2.2vw, 26px);
  height: clamp(18px, 2.2vw, 26px);
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.9);
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.5);
  animation: hotspot-pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes hotspot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
    box-shadow: 0 0 8px rgba(201, 169, 110, 0.4);
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
    box-shadow: 0 0 22px rgba(201, 169, 110, 0.8);
  }
}

.hotspot-text {
  font-size: clamp(0.75rem, 1.3vw, 1rem);
  color: #fff;
  text-shadow:
    0 1px 5px rgba(0, 0, 0, 0.95),
    0 0 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

/* ===== Хотспоты информации (свитки) ===== */
.hotspot-info {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

.hotspot-info-icon {
  width: clamp(28px, 3.5vw, 40px);
  height: clamp(28px, 3.5vw, 40px);
  color: #c9a96e;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #c9a96e;
  border-radius: 50%;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    background 0.2s;
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.4);
}

.hotspot-info-icon svg {
  width: 100%;
  height: 100%;
}

.hotspot-info:hover .hotspot-info-icon {
  transform: scale(1.1);
  background: rgba(201, 169, 110, 0.2);
}

.hotspot-info-text {
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  color: #c9a96e;
  text-shadow:
    0 1px 5px rgba(0, 0, 0, 0.95),
    0 0 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  font-style: italic;
}

/* ===== Кнопка «Домой» ===== */
#home-button {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #e9a84f;
  color: #e9a84f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    background 0.2s,
    transform 0.2s;
}
#home-button.visible {
  opacity: 1;
  pointer-events: auto;
}
#home-button:hover {
  background: rgba(233, 168, 79, 0.2);
  transform: scale(1.06);
}
#home-button svg {
  width: 24px;
  height: 24px;
}

/* ===== Карта Тропоса ===== */
#map-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#map-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.map-frame {
  position: relative;
  line-height: 0;
}
.map-frame img {
  display: block;
  max-height: 80vh;
  max-height: 80dvh;
  max-width: 90vw;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.map-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9a96e;
  border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.9);
  transform: translate(-50%, -50%);
  animation: map-marker-pulse 1s ease-in-out infinite;
}
@keyframes map-marker-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0.55;
  }
}

.map-label {
  position: absolute;
  transform: translate(-50%, 20px);
  white-space: nowrap;
  color: #fff;
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 5px rgba(0, 0, 0, 0.95),
    0 0 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

/* --- Кнопка закрытия карты (режим навигации) --- */
.map-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #c9a96e;
  color: #c9a96e;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  display: none;
  transition:
    background 0.2s,
    transform 0.2s;
}
.map-close:hover {
  background: rgba(201, 169, 110, 0.25);
  transform: scale(1.06);
}
.map-close svg {
  width: 22px;
  height: 22px;
}

/* --- Маркеры режима навигации (все точки) --- */
.map-nav-markers {
  position: absolute;
  inset: 0;
  display: none;
}
.map-nav-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.map-nav-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e9a84f;
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(233, 168, 79, 0.8);
  animation: map-marker-pulse 1.5s ease-in-out infinite;
}
.map-nav-label {
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  line-height: 1;
}

/* Переключение режимов карты через класс nav-mode */
#map-overlay.nav-mode .map-close {
  display: flex;
}
#map-overlay.nav-mode .map-nav-markers {
  display: block;
}
#map-overlay.nav-mode .map-marker {
  display: none !important;
}
#map-overlay.nav-mode .map-label {
  display: none !important;
}

/* ===== Модальное окно инфоточек ===== */
#info-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}
#info-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.info-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modal-scale-in 0.3s ease;
}

@keyframes modal-scale-in {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.info-modal-close {
  position: absolute;
  top: -40px;
  right: -10px;
  width: 40px;
  height: 40px;
  border: 2px solid #c9a96e;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c9a96e;
  transition:
    background 0.2s,
    transform 0.2s;
  z-index: 10;
}
.info-modal-close:hover {
  background: rgba(201, 169, 110, 0.2);
  transform: scale(1.1);
}
.info-modal-close svg {
  width: 20px;
  height: 20px;
}

.info-modal-image {
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  touch-action: none;
}
.info-modal-image img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  max-height: 85dvh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}

/* ===== Приветственный экран ===== */
#welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* считаем по ВИДИМОЙ области, чтобы адресная строка не сплющивала */
  background: #fff4ed;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
  overflow: hidden;
  font-family: 'Manrope-7', sans-serif;
  font-style: normal;
  font-weight: 600;
  line-height: 150%;
  letter-spacing: 0.02em;
}
#welcome-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.welcome-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 5vmin 7vmin;
}

.logo {
  justify-content: flex-start;
  width: 100px;
  height: auto;
}

.welcome-title {
  color: #20542f;
  font-family: 'Slovic', sans-serif;
  font-size: clamp(33px, 5vmin, 63px);
  font-weight: 400;
  line-height: 115%;
  max-width: 60ch;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.welcome-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4vmin;
}

.welcome-text {
  color: #3d6648;
  font-size: clamp(14px, 3.2vmin, 21px);
  max-width: 52ch;
  line-height: 130%;
}

.welcome-buttons {
  display: flex;
  gap: 3vmin;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-btn {
  font-family: inherit;
  font-size: clamp(15px, 3.4vmin, 20px);
  letter-spacing: 0.02em;
  padding: 1.6vmin 4.5vmin;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  border: 2px solid #e9a84f;
}
.welcome-btn:hover {
  transform: scale(1.05);
}
.welcome-btn:active {
  transform: scale(0.97);
}

.welcome-btn-filled {
  background: #e9a84f;
  color: #4c6b1c;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.welcome-btn-filled:hover {
  background: #f2b763;
}

.welcome-btn-outline {
  background: transparent;
  color: #e9a84f;
}
.welcome-btn-outline:hover {
  background: rgba(233, 168, 79, 0.16);
}

.welcome-info {
  display: flex;
  flex-direction: column;
  gap: 1.4vmin;
  align-items: center;
}
.welcome-info-line {
  color: #3d6648;
  font-size: clamp(12px, 2.8vmin, 16px);
  display: flex;
  align-items: center;
  gap: 4px;
}

#ios-hint {
  font-style: italic;
  opacity: 0.85;
}

/* Inline-иконки в тексте заставки */
.inline-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e9a84f;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 6px rgba(233, 168, 79, 0.7);
  animation: inline-dot-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes inline-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}
.inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #e9a84f;
  flex-shrink: 0;
}
.inline-icon svg {
  width: 100%;
  height: 100%;
}

/* ===== Принудительная горизонтальная ориентация заставки =====
   На портретном телефоне поворачиваем экран на бок, чтобы он
   оставался строго горизонтальным и не реагировал на поворот. */
@media (orientation: portrait) and (hover: none) {
  #welcome-screen {
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    transform-origin: top left;
    transform: translateX(100vw) rotate(90deg);
  }
}

/* Мобильные */
@media (max-width: 640px) {
  .hotspot-container {
    gap: 4px;
  }
  .info-modal-close {
    top: -35px;
    right: 5px;
    width: 36px;
    height: 36px;
  }
}
