/* ==========================================================================
   Блок «Карта участников»: глобус из точек с метками городов и поиском.
   Логика — js/globe.js, данные — js/globe-data.js (точки суши + города и
   количество участников; точных адресов там нет).
   Размеры — в px макета, весь блок масштабируется через --zoom, как остальные.
   ========================================================================== */

.globe-block {
  --w: 1200px;
  --gold: #ddd3b2;
  position: relative;
  overflow: hidden;
  background-color: #0c0d0e;
}

.globe-block__canvas {
  position: relative;
  width: var(--w);
  margin: 0 auto;
  padding: 100px 100px 80px;
  zoom: var(--zoom);
}

.globe-block__title {
  margin: 0;
  color: #fff;
  font-size: 40px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -1.8px;
  text-align: center;
}
.globe-block__subtitle {
  margin: 30px 0 0;
  color: #f5f5f5;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.6px;
  text-transform: uppercase;
  text-align: center;
}
.globe-block__subtitle b { color: var(--gold); font-weight: 600; }

/* ---------------------------------------------------------------- поиск */
.globe-search {
  position: relative;
  z-index: 5;
  width: 360px;
  margin: 30px auto 0;
}
.globe-search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 6px 0 20px; /* справа = отступу кнопки сверху и снизу: (50 - 2 рамка - 36) / 2 */
  border: 1px solid #303132;
  border-radius: 100px;
  background-color: #17191b;
  transition: border-color .2s;
}
.globe-search__field:focus-within { border-color: #4d5a67; }
.globe-search__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: -0.4px;
}
.globe-search__input::placeholder { color: rgba(245, 245, 245, .4); }
.globe-search__button {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 100px;
  background-color: var(--gold);
  color: #2b2923;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.3px;
  text-transform: uppercase;
  cursor: pointer;
}
.globe-search__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid #303132;
  border-radius: 15px;
  background-color: #17191b;
}
.globe-search__list[hidden] { display: none; }
.globe-search__option {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #f5f5f5;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.3px;
  cursor: pointer;
}
.globe-search__option small { color: rgba(245, 245, 245, .45); font-size: 12px; }
.globe-search__option.is-active,
.globe-search__option:hover { background-color: #2b2f33; }
.globe-search__result {
  min-height: 16px;
  margin: 12px 0 0;
  color: rgba(245, 245, 245, .7);
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.3px;
  text-align: center;
}
.globe-search__result b { color: var(--gold); font-weight: 600; }

/* ---------------------------------------------------------------- глобус */
.globe {
  position: relative;
  height: 560px;
  margin-top: 10px;
  cursor: grab;
  touch-action: pan-y; /* вертикальная прокрутка страницы — браузеру, по горизонтали крутим глобус */
  user-select: none;
  -webkit-user-select: none;
}
.globe.is-dragging { cursor: grabbing; }
.globe__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.globe__hint {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px); /* низ глобуса — на 20px выше низа .globe (js), отсюда 30px до подписи */
  z-index: 3;
  translate: -50% 0;
  padding: 8px 14px;
  border-radius: 100px;
  background: #2b2f33;
  color: rgba(245, 245, 245, .7);
  font-size: 10px;
  line-height: 12px;
  letter-spacing: -0.3px;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity .4s;
}
.globe.is-touched .globe__hint { opacity: 0; }

/* ---------------------------------------------------------------- метки */
.globe__markers { position: absolute; inset: 0; pointer-events: none; }

/* .globe-pin — точка города (0×0, двигается из JS). Над ней — капля с иконкой
   человека (острый кончик указывает на город) и золотая плашка с числом. */
.globe-pin {
  --s: 24px;       /* размер капли */
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.globe-pin__bubble {
  position: absolute;
  left: calc(var(--s) / -2);
  top: calc(var(--s) * -1.21);   /* кончик капли (повёрнутый угол) — ровно в точке города */
  width: var(--s);
  height: var(--s);
  pointer-events: auto;
  cursor: pointer;
}
.globe-pin__avatar {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: #2b2f33;
  box-shadow: 0 0 0 1.5px var(--gold), 0 2px 8px rgba(0, 0, 0, .5);
}
/* иконка человека: голова + плечи (повёрнута обратно) */
.globe-pin__avatar::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  rotate: 45deg;
  transform: translateY(-1.5px); /* иконка целиком чуть выше — визуально по центру капли */
  background:
    radial-gradient(17% 17% at 50% calc(36% + 1px), var(--gold) 96%, transparent 100%),
    radial-gradient(32% 24% at 50% 92%, var(--gold) 96%, transparent 100%);
}
.globe-pin__more {
  position: absolute;
  left: calc(var(--s) * .5);
  top: calc(var(--s) * -.3);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 100px;
  background-color: var(--gold);
  box-shadow: 0 0 0 1.5px #0c0d0e;
  color: #2b2923;
  font-size: 9px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-align: center;
  white-space: nowrap;
}
.globe-pin.is-found .globe-pin__avatar { background: #5a5547; }

.globe-pin__label {
  position: absolute;
  bottom: calc(var(--s) * 1.21 + 10px);
  left: 0;
  translate: -50% 0;
  padding: 7px 11px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  color: #2b2923;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: -0.3px;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.globe-pin__label b { color: #0c0d0e; font-weight: 600; }
.globe-pin.is-open,
.globe-pin.is-found { z-index: 200 !important; }
.globe-pin.is-open .globe-pin__label,
.globe-pin.is-found .globe-pin__label { opacity: 1; }
/* подпись по наведению мышью (класс ставит js/globe.js, только при настоящем движении мыши;
   на телефоне — по нажатию) */
.globe:not(.is-dragging) .globe-pin.is-hover { z-index: 200 !important; }
.globe:not(.is-dragging) .globe-pin.is-hover .globe-pin__label { opacity: 1; }

/* ---------------------------------------------------------------- мобильный */
@media (max-width: 959px) {
  .globe-block { --w: 320px; }
  .globe-block__canvas { padding: 70px 10px 64px; }
  .globe-block__title { font-size: 26px; line-height: 26px; letter-spacing: -1.5px; text-align: left; }
  .globe-block__subtitle { margin-top: 16px; font-size: 9px; line-height: 11px; letter-spacing: -0.3px; text-align: left; }
  .globe-search { width: auto; margin-top: 20px; }
  .globe-search__field { height: 44px; padding: 0 5px 0 16px; } /* (44 - 2 - 32) / 2 = 5 */
  .globe-search__input { font-size: 13px; }
  .globe-search__button { height: 32px; padding: 0 12px; font-size: 10px; }
  .globe-search__option { padding: 9px 12px; font-size: 12px; }
  .globe-search__result { font-size: 11px; line-height: 14px; text-align: left; }
  .globe { height: 320px; margin: 0 -10px; }
  .globe__hint { top: calc(100% + 6px); font-size: 9px; } /* низ глобуса — 24px выше низа .globe */
  .globe-pin { --s: 17px; }
  .globe-pin__avatar { box-shadow: 0 0 0 1px var(--gold), 0 2px 6px rgba(0, 0, 0, .5); }
  .globe-pin__avatar::before { inset: 2px; }
  .globe-pin__more { min-width: 12px; height: 12px; padding: 0 3px; font-size: 7px; line-height: 12px; box-shadow: 0 0 0 1px #0c0d0e; }
  .globe-pin__label { bottom: calc(var(--s) * 1.21 + 8px); font-size: 10px; line-height: 13px; padding: 6px 9px; }
}
