/* =====================================================================
   wsa-site.css — единый файл стилей сайта wsa.infinitynado.ru
   Части файла:
     1. Страница «Городские турниры»: карта, карточки городов, правила участия
     2. Регистрация: кнопки, плавающая кнопка, модальное окно с формой организатора
   Все правила привязаны к своим блокам (.distribution-map, .city-descriptions,
   .tournament-rules, .reg-*) и не влияют на шапку, подвал и остальной шаблон.
   Кнопки регистрации открывают окно через атрибут data-open-registration.
   ===================================================================== */

/* #####################################################################
   1. СТРАНИЦА «ГОРОДСКИЕ ТУРНИРЫ»
   ##################################################################### */

/* ---------- базовые правила (раньше были глобальными) ---------- */

/* :where() даёт нулевую специфичность, как у прежнего "div, img",
   поэтому .centered-y, .map-point и др. по-прежнему переопределяют position */
:where(.distribution-map, .city-descriptions) :where(div, img) {
  position: relative;
  box-sizing: border-box;
}

.distribution-map h1, .distribution-map h2, .distribution-map h3,
.distribution-map h4, .distribution-map h5, .distribution-map h6 {
  margin-bottom: 20px;
  text-transform: uppercase;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-weight: 300;
}
.distribution-map h2 { font-size: 24pt; }
.distribution-map h3 { font-size: 18pt; }

.distribution-map p {
  font-size: 12pt;
  margin-bottom: 12pt;
}

.distribution-map a {
  transition: color 0.25s ease-in-out;
  font-family: 'Rubik', Helvetica, sans-serif;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
}
.distribution-map a:visited {
  color: #fff;
}

.distribution-map .centered-y {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
}

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

.distribution-map {
  position: relative;
  width: 100%;
  max-width: 1200px;
  padding: 20px;
  box-sizing: border-box;
  margin: 20px auto;
  overflow-x: hidden;
}
.distribution-map > img {
  width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
}
.distribution-map .map-point {
  cursor: pointer;
  outline: none;
  z-index: 0;
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);

  transform: translate(-50%, -50%);
  -moz-transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
  -o-transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
  -webkit-transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out, z-index 0.25s ease-in-out;
  -webkit-transition-delay: 0.25s, 0.25s, 0.25s, 0.25s;
  transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
  background: rgba(26, 26, 26, 0.85);
  border: 5px solid #c1d116;
}
.distribution-map .map-point .content {
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  width: 100%;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
  overflow: overlay;
}
.distribution-map .map-point:active, .distribution-map .map-point:focus {
  margin: 0;
  padding: 0;
  filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
  opacity: 1;
  width: 300px;
  height: 220px;
  color: #fff;
  z-index: 1;
  transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out;
}
.distribution-map .map-point:active .content, .distribution-map .map-point:focus .content {
  filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
  opacity: 1;
  -moz-transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
  -o-transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
  -webkit-transition: opacity 0.25s ease-in-out, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
  -webkit-transition-delay: 0.25s, 0s, 0s;
  transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
  overflow: hidden;
}
.distribution-map .map-point:active .content a:hover, .distribution-map .map-point:active .content a:active, .distribution-map .map-point:focus .content a:hover, .distribution-map .map-point:focus .content a:active {
  color: #c1d116;
}

/* активная ссылка «Открыть информацию» */
.distribution-map .map-point a[data-target].is-active {
  color: #c1d116;
  text-decoration: underline;
}

/* Название города справа от точки (текст дублирует h2 внутри карточки).
   Не перехватывает клики и прячется, когда карточка раскрыта. */
.distribution-map .map-point .map-point__label {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 8px;
  transform: translateY(-50%);
  white-space: nowrap;
  pointer-events: none;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: clamp(9px, 1.4vw, 16px);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 4px #000, 0 0 8px #000;
  opacity: 1;
  transition: opacity 0.25s ease-in-out;
}
.distribution-map .map-point:focus .map-point__label,
.distribution-map .map-point:active .map-point__label {
  opacity: 0;
}

/* Точки у левого края карты: раскрытая карточка растёт вправо от точки */
.distribution-map .map-point.map-point--left {
  transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s, transform 0.25s ease-in-out 0.25s;
}
.distribution-map .map-point.map-point--left:focus,
.distribution-map .map-point.map-point--left:active {
  transform: translate(-20px, -50%); /* левый край карточки = левый край кружка (кружок 40px) */
  transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out, z-index 0.25s ease-in-out, transform 0.25s ease-in-out;
}

/* ---------- блоки описаний под картой ---------- */

.city-descriptions {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 20px;
  box-sizing: border-box;
}

.city-descriptions .city-description {
  display: block;
  padding: 24px 28px;
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.85);
  border: 5px solid #c1d116;
  color: #fff;
  animation: cityFade .3s ease;
}
/* важно: атрибут hidden должен выигрывать у display:block */
.city-descriptions .city-description[hidden] {
  display: none;
}

/* верхняя строка: картинка слева, текст справа; правила идут ниже на всю ширину */
.city-descriptions .city-description__main {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

/* место под картинку */
.city-descriptions .city-description__image {
  flex: 0 0 40%;
  max-width: 40%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #333; /* фон, пока картинка грузится */
}
.city-descriptions .city-description__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* картинка заполняет рамку без искажений */
  margin: 0;
  padding: 0;
}

.city-descriptions .city-description__text {
  flex: 1 1 auto;
  min-width: 0;
}
.city-descriptions .city-description h3 {
  margin: 0 0 12px;
  color: #c1d116;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 18pt;
  font-weight: 300;
  text-transform: uppercase;
}
.city-descriptions .city-description p {
  margin: 0 0 12px;
  font-size: 12pt;
  line-height: 1.5;
  color: rgba(229, 229, 229, 0.85);
}

/* дата турнира: плашка в фирменном салатовом, заметная, но в стиле карточки */
.city-descriptions .city-description p.city-description__date {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 16px;
  border: 2px solid #c1d116;
  border-radius: 999px;
  background: rgba(193, 209, 22, 0.12);
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 14pt;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

/* временные слоты: подпись и ряд «таблеток» с временем */
.city-descriptions .city-description p.city-description__slots-title {
  margin: 0 0 10px;
}
.city-descriptions .city-description ul.city-description__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.city-descriptions .city-description ul.city-description__slots li {
  margin: 0;
  padding: 6px 16px;
  list-style: none;
  border-radius: 999px;
  background: #c1d116;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 14pt;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #1a1a1a;
}
.city-descriptions .city-description ul.city-description__slots li::before {
  content: none;
}

/* выделенная фраза про регистрацию */
.city-descriptions .city-description p.city-description__notice {
  color: #c1d116;
  font-weight: 700;
}

.city-descriptions .city-description a:hover {
  color: #c1d116;
}

/* ---------- правила участия: общий блок под картой и описаниями ---------- */

/* внешний контейнер: та же ширина и боковые отступы, что у карты и блоков городов */
.tournament-rules {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 20px;
  box-sizing: border-box;
}
/* карточка в стиле блоков городов */
.tournament-rules .tournament-rules__card {
  padding: 24px 28px;
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.85);
  border: 5px solid #c1d116;
  color: #fff;
}
.tournament-rules .tournament-rules__title {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(193, 209, 22, 0.4);
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 18pt;
  font-weight: 300;
  text-transform: uppercase;
  color: #c1d116;
}
.tournament-rules .tournament-rules__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tournament-rules .tournament-rules__list li {
  position: relative;
  margin: 0 0 12px;
  padding-left: 22px;
  font-size: 12pt;
  line-height: 1.5;
  color: rgba(229, 229, 229, 0.85);
}
.tournament-rules .tournament-rules__list li:last-child {
  margin-bottom: 0;
}
.tournament-rules .tournament-rules__list li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c1d116;
}
.tournament-rules .tournament-rules__list li a {
  color: #c1d116;
  text-decoration: underline;
  word-break: break-all;
  transition: color 0.25s ease-in-out;
}
.tournament-rules .tournament-rules__list li a:hover {
  color: #fff;
}

/* ---------- кнопка «Зарегистрироваться» в карточке города ---------- */

.city-descriptions .city-description button.city-description__register {
  display: inline-block;
  margin: 8px 0 0;
  padding: 12px 28px;
  border: 2px solid #c1d116;
  border-radius: 12px;
  background: #c1d116;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 14pt;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a1a;
  cursor: pointer;
  transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out, transform 0.25s ease-in-out;
}
.city-descriptions .city-description button.city-description__register:hover {
  background: #fff;
  border-color: #fff;
}
.city-descriptions .city-description button.city-description__register:active {
  transform: scale(0.98);
}
.city-descriptions .city-description button.city-description__register:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

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

@media (max-width: 767px) {
  .city-descriptions {
    padding: 0 10px;
  }
  .city-descriptions .city-description {
    padding: 16px;
  }
  .city-descriptions .city-description__main {
    flex-direction: column;
    gap: 16px;
  }
  .tournament-rules {
    padding: 0 10px;
    margin-bottom: 24px;
  }
  .tournament-rules .tournament-rules__card {
    padding: 16px;
  }
  .tournament-rules .tournament-rules__title {
    font-size: 15pt;
  }
  .city-descriptions .city-description button.city-description__register {
    display: block;
    width: 100%;
    font-size: 12pt;
    text-align: center;
  }
  .city-descriptions .city-description__image {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
}

@keyframes cityFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}


/* #####################################################################
   2. РЕГИСТРАЦИЯ (главная и «Городские турниры»)
   ##################################################################### */

/* ---------- кнопка регистрации ---------- */

button.reg-button {
  display: inline-block;
  margin: 0;
  padding: 14px 36px;
  border: 2px solid #c1d116;
  border-radius: 12px;
  background: #c1d116;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 14pt;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: #1a1a1a;
  cursor: pointer;
  transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, transform 0.25s ease-in-out;
}
button.reg-button:hover {
  background: #fff;
  border-color: #fff;
}
button.reg-button:active {
  transform: scale(0.98);
}
button.reg-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* блок с кнопкой под секцией: та же ширина и боковые отступы, что у остальных блоков страницы */
.reg-cta {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
  box-sizing: border-box;
  text-align: center;
}

/* если блок с кнопкой лежит внутри .container страницы, свои боковые отступы не нужны */
.container .reg-cta {
  padding: 0;
}

/* ---------- плавающая кнопка в правом нижнем углу ---------- */

button.reg-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 9000; /* выше контента страницы, но ниже окна регистрации (100000) */
  margin: 0;
  padding: 14px 24px;
  border: 2px solid #c1d116;
  border-radius: 999px;
  background: #c1d116;
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 12pt;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a1a;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  animation: regFabPulse 2.6s ease-out infinite;
  transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, transform 0.25s ease-in-out;
}
button.reg-fab:hover {
  background: #fff;
  border-color: #fff;
  animation-play-state: paused;
}
button.reg-fab:active {
  transform: scale(0.97);
}
button.reg-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
/* мягкое «дыхание» салатового ореола, чтобы кнопку замечали */
@keyframes regFabPulse {
  0%   { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(193, 209, 22, 0.55); }
  70%  { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 16px rgba(193, 209, 22, 0); }
  100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(193, 209, 22, 0); }
}
@media (prefers-reduced-motion: reduce) {
  button.reg-fab { animation: none; }
  .reg-modal, .reg-modal .reg-modal__dialog { transition: none; }
}

/* ---------- модальное окно с формой регистрации ---------- */

/* Окно не скрывается через display:none, а прячется visibility/opacity:
   внешний скрипт формы может измерять размеры и должен отработать при загрузке страницы. */
.reg-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease-in-out, visibility 0s linear 0.25s;
}
.reg-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.25s ease-in-out, visibility 0s linear 0s;
}
.reg-modal .reg-modal__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}
.reg-modal .reg-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #1a1a1a;
  border: 5px solid #c1d116;
  color: #fff;
  transform: translateY(-12px);
  transition: transform 0.25s ease-in-out;
}
.reg-modal.is-open .reg-modal__dialog {
  transform: none;
}
.reg-modal .reg-modal__title {
  margin: 0 40px 16px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(193, 209, 22, 0.4);
  font-family: 'Rubik', Helvetica, sans-serif;
  font-size: 18pt;
  font-weight: 300;
  text-transform: uppercase;
  color: #c1d116;
}
/* крестик рисуется двумя линиями, без картинок и шрифтовых иконок */
.reg-modal button.reg-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid #c1d116;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.25s ease-in-out;
}
.reg-modal button.reg-modal__close::before,
.reg-modal button.reg-modal__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: #c1d116;
  transition: background-color 0.25s ease-in-out;
}
.reg-modal button.reg-modal__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.reg-modal button.reg-modal__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.reg-modal button.reg-modal__close:hover {
  background: #c1d116;
}
.reg-modal button.reg-modal__close:hover::before,
.reg-modal button.reg-modal__close:hover::after {
  background: #1a1a1a;
}
.reg-modal button.reg-modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Организаторский infinity-nado.css рассчитан на отдельную полноэкранную страницу:
   .bl-register-form там min-height:100vh, чёрный фон и свои отступы, а .form серая карточка.
   Внутри окна приводим это к компактному виду. Правила действуют только внутри .reg-modal
   и не трогают сам файл организатора. */
.reg-modal .reg-modal__body .bl-register-form {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 4px;          /* запас под обводку полей при фокусе (box-shadow 2px) */
  background: transparent;
  overflow: visible;
}
.reg-modal .reg-modal__body .bl-register-form .bl-wr {
  padding: 0;
}
.reg-modal .reg-modal__body .bl-register-form .form {
  max-width: none;
  padding: 0;
  background: transparent; /* фон даёт само окно */
}
.reg-modal .reg-modal__body .bl-register-form .form-success {
  padding: 0;
}

/* пока окно открыто, страница под ним не прокручивается */
html.reg-modal-open,
html.reg-modal-open body {
  overflow: hidden;
}

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

@media (max-width: 767px) {
  button.reg-button {
    display: block;
    width: 100%;
    font-size: 12pt;
  }
  .reg-cta {
    margin: 24px auto;
    padding: 0 10px;
  }
  button.reg-fab {
    right: 12px;
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 12px 18px;
    font-size: 11pt;
  }
  .reg-modal {
    padding: 10px;
  }
  .reg-modal .reg-modal__dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }
  .reg-modal .reg-modal__title {
    font-size: 14pt;
  }
}
