/* === ADVENTURE PATH (интерактивная карта с героем) ===
   Вынесено из инлайнового <style> в index.html при рефакторинге —
   содержимое не изменено, только перенесено в отдельный файл. */

body { overflow-x: hidden; }

#smg-outer {
  position: relative;
  width: 100%;
  background: #0b1220;
}

#smg-scene {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  overflow: hidden;
  z-index: 9999;
}
#smg-scene.fixed  { position: fixed; top: 0; }
#smg-scene.bottom { position: absolute; top: auto; bottom: 0; }

/* Отдельный слой для панели — вынесен из #smg-scene, чтобы не быть
   ограниченным её стековым контекстом (z-index 9999) и всегда
   отображаться поверх облачного перехода (.divider-stone--clouds, z-index 10000) */
#smg-panel-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  z-index: 10001;
  pointer-events: none;
}
#smg-panel-layer.fixed  { position: fixed; top: 0; }
#smg-panel-layer.bottom { position: absolute; top: auto; bottom: 0; }

/* ── ФОН: статичное небо, заполняет весь контейнер ── */
#smg-sky {
  position: absolute;
  inset: 0;
  background: url('../assets/img/wp-sky.webp') center/cover no-repeat;
  z-index: 0;
}

/* ── ОБЛАКА УБРАНЫ ── */
#smg-clouds { display: none; }

/* Purely structural — see the comment on this element in index.html. Fills
   the same box #smg-world used to sit in directly, so #smg-world's own
   top:0/left:0 below still resolves to the same point. */
#smgWorldFlyWrap {
  position: absolute;
  inset: 0;
}

/* ── КАРТА ── */
#smg-world {
  position: absolute;
  top: 0; left: 0;
  width: 900px; height: 1120px;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 2;
}
#smg-map {
  display: block;
  width: 900px; height: 1120px;
  pointer-events: none;
  -webkit-user-drag: none;
}
#smg-trail {
  position: absolute;
  top: 0; left: 0;
  width: 900px; height: 1120px;
  pointer-events: none;
  z-index: 5;
}

/* ── ТОЧКИ — картинки ── */
.smg-wp {
  position: absolute;
  width: 70px; height: 70px;
  transform: translate(-50%,-50%);
  z-index: 10;
  pointer-events: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .3s ease, filter .3s ease;
}
.smg-wp.wp-done { filter: brightness(0.6) saturate(0.7); }
.smg-wp.wp-cur  {
  transform: translate(-50%,-50%) scale(1.25);
  filter: drop-shadow(0 0 18px rgba(255,215,0,0.9));
  animation: smg-pulse-wp 1.4s ease-in-out infinite;
}
@keyframes smg-pulse-wp {
  0%,100% { transform: translate(-50%,-50%) scale(1.25); }
  50%      { transform: translate(-50%,-50%) scale(1.36); }
}

/* ── ГЕРОЙ ── */
#smg-hero {
  position: absolute;
  transform: translate(-50%,-100%);
  will-change: left, top;
  z-index: 20;
  pointer-events: none;
}
.smg-hi   { width: 60px; height: auto; display: block; }
.smg-hi-l { display: none; }

@keyframes smg-walk      { 0%,100%{transform:translateY(0)}    50%{transform:translateY(-5px)} }
@keyframes smg-walk-flip { 0%,100%{transform:scaleX(-1) translateY(0)} 50%{transform:scaleX(-1) translateY(-5px)} }
@keyframes smg-celebrate      { 0%,100%{transform:scale(1) translateY(0)}    25%,75%{transform:scale(1.15) translateY(-6px)} }
@keyframes smg-celebrate-flip { 0%,100%{transform:scaleX(-1) scale(1) translateY(0)} 25%,75%{transform:scaleX(-1) scale(1.15) translateY(-6px)} }

#smg-hero.walking   .smg-hi-r { animation: smg-walk 0.4s ease-in-out infinite; }
#smg-hero.walking   .smg-hi-l { animation: smg-walk-flip 0.4s ease-in-out infinite; }
#smg-hero.celebrate .smg-hi-r { animation: smg-celebrate 0.5s ease-in-out infinite; }
#smg-hero.celebrate .smg-hi-l { animation: smg-celebrate-flip 0.5s ease-in-out infinite; }

/* ══════════════════════════════════════════
   ЕДИНАЯ ПАНЕЛЬ: прогресс + текст
   Прилипает к верху с отступом 20px
   ══════════════════════════════════════════ */
#smg-top-panel {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;

  background: rgba(6,12,28,0.88);
  border: 1px solid rgba(232,184,48,.4);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  padding: 20px 40px 24px;
  min-width: 340px;
  max-width: 640px;
  text-align: center;
}

/* Прогресс-пипсы */
#smg-prog {
  display: flex;
  gap: 11px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.smg-pip {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: rgba(232,184,48,.15);
  border: 1.5px solid rgba(232,184,48,.4);
  transition: background .35s, box-shadow .3s;
}
.smg-pip.on {
  background: #e8b830;
  box-shadow: 0 0 7px rgba(232,184,48,.8);
}

/* Заголовок точки */
#smg-hud-title {
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 8px;
  white-space: normal;
  word-break: break-word;
}

/* Hint */
#smg-hud-hint {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.3;
  color: rgba(232,184,48,.85);
}

/* Подсказка скролла */
#smg-hud-scroll {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,.3);
  margin-top: 8px;
}

/* На мобиле панель шириной от 340px (min-width) и заголовок 30px не
   помещались — длинные названия точек ("Разработка индивидуальной
   концепции события") ловили word-break: break-word посреди слова
   ("ИНДИВИДУАЛЬ" / "НОЙ"). Сужаем панель и уменьшаем шрифт, чтобы слова
   переносились целиком. */
@media (max-width: 639px) {
  #smg-top-panel {
    bottom: 20px;
    min-width: auto;
    width: min(320px, calc(100% - 32px));
    padding: 16px 20px 18px;
  }
  #smg-hud-title {
    font-size: 20px;
    margin-bottom: 6px;
  }
  #smg-hud-hint {
    font-size: 14px;
  }
  #smg-hud-scroll {
    font-size: 12px;
    margin-top: 6px;
  }
}

/* ── ВСТУПЛЕНИЕ: плашка над небом ──
   Обычный абсолютный блок в верхней части #smg-outer — не прилипает
   к вьюпорту, просто уезжает вместе со страницей при скролле. */
.adventure-intro {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 10002;
  max-width: 640px;
  margin: 0 auto;
  background: rgba(6,12,28,0.88);
  border: 1px solid rgba(232,184,48,.4);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  padding: 24px 40px;
  text-align: center;
}
.adventure-intro__title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  color: #ffedbe;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.adventure-intro__subtitle {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.3;
  color: #fff;
  opacity: .85;
  margin: 0;
}

/* ── СТРЕЛКА ── */
#smg-arrow {
  position: absolute;
  bottom: 28px; right: 28px;
  z-index: 100;
  pointer-events: none;
  opacity: .55;
  animation: smg-bounce 1.6s ease-in-out infinite;
  transition: opacity 0.4s;
}
@keyframes smg-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(9px); }
}
