/* ==========================================================================
   АЛВ — визуальное обновление и анимации публичных страниц.
   Подключается после styles.css (кроме admin.html).
   Анимации появления при прокрутке включаются классом .js-anim на <html>
   (ставит animations.js); без JS весь контент виден сразу.
   ========================================================================== */
:root {
  --bg-page: #ffffff;
  --grad-primary: linear-gradient(135deg, #0a5be0 0%, #003d9b 55%, #002c70 100%);
  --grad-accent: linear-gradient(135deg, #ffa24a 0%, #fb7800 60%, #e85d00 100%);
  --grad-brand: linear-gradient(90deg, #0052cc, #3b82f6 45%, #fb7800);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-glow: 0 18px 40px -12px rgba(0, 61, 155, 0.35);
}

::selection {
  background: rgba(251, 120, 0, 0.22);
  color: var(--color-primary-dark);
}

/* ---------- Полоса прогресса прокрутки и кнопка «наверх» ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--grad-brand);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  z-index: 3000;
  pointer-events: none;
}

.to-top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
  z-index: 900;
}

.to-top-btn.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top-btn.is-shown:hover {
  transform: translateY(-3px);
}

.to-top-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Кнопки ---------- */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: -1;
}

.btn:hover::after {
  animation: btnShine 0.8s var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible,
.nav-link:focus-visible,
.contact-link-card:focus-visible {
  outline: 3px solid rgba(251, 120, 0, 0.55);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--grad-primary);
  box-shadow: 0 8px 20px -8px rgba(0, 61, 155, 0.55);
}

.btn-primary:hover {
  background: var(--grad-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--grad-accent);
  box-shadow: 0 8px 20px -8px rgba(251, 120, 0, 0.6);
}

.btn-secondary:hover {
  background: var(--grad-accent);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(251, 120, 0, 0.6);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.85);
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(0, 61, 155, 0.45);
}

@keyframes btnShine {
  to { left: 130%; }
}

/* ---------- Шапка ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: box-shadow 0.3s ease, background 0.3s ease;
  animation: headerIn 0.7s var(--ease-out) both;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
}

.header-container {
  transition: height 0.3s var(--ease-out);
}

.site-header.is-scrolled .header-container {
  height: 64px;
}

.logo-mark {
  transition: transform 0.6s var(--ease-spring);
}

.brand-logo:hover .logo-mark {
  transform: rotate(-20deg) scale(1.08);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}

.nav-link:hover::after,
.nav-link.active::after {
  background: var(--grad-brand);
  transform: scaleX(1);
  transform-origin: left;
}

@keyframes headerIn {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Мобильное меню: пункты выезжают по очереди */
.drawer-link {
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.drawer-link:hover {
  transform: translateX(4px);
}

.mobile-drawer.active .drawer-link {
  animation: drawerItemIn 0.5s var(--ease-out) both;
}

.mobile-drawer.active .drawer-link:nth-child(1) { animation-delay: 0.08s; }
.mobile-drawer.active .drawer-link:nth-child(2) { animation-delay: 0.12s; }
.mobile-drawer.active .drawer-link:nth-child(3) { animation-delay: 0.16s; }
.mobile-drawer.active .drawer-link:nth-child(4) { animation-delay: 0.2s; }
.mobile-drawer.active .drawer-link:nth-child(5) { animation-delay: 0.24s; }
.mobile-drawer.active .drawer-link:nth-child(6) { animation-delay: 0.28s; }

@keyframes drawerItemIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.hero-section {
  padding: 100px 0 120px;
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(251, 120, 0, 0.1), transparent 60%),
    linear-gradient(160deg, #f5f8ff 0%, #e8f0fd 55%, #fdf3e9 100%);
  border-bottom: none;
}

.hero-bg-overlay {
  background-image: radial-gradient(rgba(0, 61, 155, 0.12) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.hero-blob-blue {
  width: 440px;
  height: 440px;
  top: -140px;
  left: 30%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.24) 0%, rgba(59, 130, 246, 0.1) 40%, transparent 70%);
  animation: blobDrift 20s ease-in-out infinite alternate;
}

.hero-blob-amber {
  width: 380px;
  height: 380px;
  top: 10%;
  right: 12%;
  background: radial-gradient(circle, rgba(251, 120, 0, 0.2) 0%, rgba(251, 120, 0, 0.08) 42%, transparent 70%);
  animation: blobDrift 24s ease-in-out infinite alternate-reverse;
}

/* Декоративный мяч убран */
.hero-decor {
  display: none !important;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.highlight-text {
  background: linear-gradient(90deg, #fb7800, #ff9f43, #e85d00, #fb7800);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
}

.feature-chip {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(0, 61, 155, 0.1);
  color: var(--color-primary-dark);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
  animation: chipIn 0.6s var(--ease-spring) both;
}

.feature-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(251, 120, 0, 0.45);
  box-shadow: 0 10px 20px -12px rgba(251, 120, 0, 0.6);
}

.feature-chip:nth-child(1) { animation-delay: 0.55s; }
.feature-chip:nth-child(2) { animation-delay: 0.65s; }
.feature-chip:nth-child(3) { animation-delay: 0.75s; }
.feature-chip:nth-child(4) { animation-delay: 0.85s; }

/* Каскадное появление контента hero */
.hero-content > * {
  animation: heroIn 0.9s var(--ease-out) both;
}

.hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-content > *:nth-child(2) { animation-delay: 0.3s; }
.hero-content > *:nth-child(3) { animation-delay: 0.45s; }
.hero-content > *:nth-child(4) { animation-delay: 0.6s; }

.hero-event-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 22px;
  box-shadow: 0 30px 60px -25px rgba(0, 44, 112, 0.35);
  animation: heroIn 1s var(--ease-out) 0.5s both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes chipIn {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

@keyframes decorIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}


@keyframes blobDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(50px, 35px, 0) scale(1.1); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- Метрики: плавающая карточка поверх hero ---------- */
.metrics-strip {
  background: transparent;
  border-bottom: none;
  padding: 0;
  margin-top: -64px;
  position: relative;
  z-index: 2;
}

.metrics-grid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 28px 20px;
  box-shadow: 0 30px 60px -30px rgba(0, 44, 112, 0.35), 0 2px 6px rgba(0, 61, 155, 0.04);
  gap: 0;
}

.metric-card {
  position: relative;
  padding: 6px 16px;
}

.metric-card + .metric-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: linear-gradient(transparent, var(--border-color), transparent);
}

.metric-num {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.metric-card:nth-child(2) .metric-num {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- Заголовки секций ---------- */
.section {
  padding: 90px 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-full);
  background: var(--color-accent-soft);
  border: 1px solid rgba(251, 120, 0, 0.2);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}

.section-tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: tagPulse 2.4s ease-out infinite;
}

.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  letter-spacing: -0.03em;
  color: #0b1f4d;
}

@keyframes tagPulse {
  0% { box-shadow: 0 0 0 0 rgba(251, 120, 0, 0.5); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(251, 120, 0, 0); }
}

/* ---------- Фоны секций ---------- */
body {
  background-color: #ffffff;
}

.tournaments-section {
  background: #ffffff;
}

.news-section {
  background: #ffffff;
}

.about-section {
  background: #ffffff;
}

.locations-section {
  background: #ffffff;
}

.contacts-section {
  background: #ffffff;
}

/* ---------- Карточки турниров и новостей ---------- */
.tournament-card {
  border-radius: 20px;
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s ease;
}

.tournament-card:hover {
  box-shadow: 0 24px 48px -24px rgba(0, 44, 112, 0.3);
  border-color: #c7d6ef;
}

.tc-header {
  background: linear-gradient(120deg, #f7faff, #eef4fe);
  position: relative;
}

.tc-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-brand);
}

.news-card {
  border-radius: 20px;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.3s ease;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 50px -28px rgba(0, 44, 112, 0.4);
  border-color: #c7d6ef;
}

.nc-thumb-img {
  transition: transform 0.7s var(--ease-out);
}

.news-card:hover .nc-thumb-img {
  transform: scale(1.08);
}

.spotlight-card,
.sidebar-card {
  border-radius: 20px;
}

.spotlight-card {
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.spotlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -30px rgba(0, 44, 112, 0.4);
}

/* ---------- О сообществе ---------- */
.about-panel-glow,
.about-panel-glow-blue,
.about-panel-glow-amber {
  display: none !important;
}

.about-feature-panel {
  background-image: none !important;
  background-color: #ffffff !important;
}

.about-feature-card {
  overflow: hidden;
}

/* Подсветка, следующая за курсором (--mx/--my ставит animations.js) */
.contact-link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(59, 130, 246, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.contact-link-card:hover::before {
  opacity: 1;
}

.about-feature-card:not(.about-card-founded):hover {
  transform: translateY(-5px);
  border-color: #bfd3f5;
  box-shadow: 0 24px 44px -24px rgba(0, 44, 112, 0.3);
}

.about-card-icon {
  transition: color 0.3s ease, background 0.3s ease, transform 0.5s var(--ease-spring), box-shadow 0.3s ease;
}

.about-feature-card:not(.about-card-founded):hover .about-card-icon {
  transform: scale(1.1) rotate(-8deg);
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: 0 10px 20px -8px rgba(0, 61, 155, 0.55);
}

.about-card-founded {
  background: linear-gradient(135deg, #0a4bc0, #0c3888 45%, #061d4d);
}

.about-card-founded::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: skewX(-20deg);
  animation: cardSheen 6s ease-in-out infinite;
  pointer-events: none;
}

.about-founded-decoration {
  animation: none;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
}

.about-founded-year {
  background: linear-gradient(180deg, #ffffff, #bfdbfe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.about-founded-divider {
  background: var(--grad-accent);
}

@keyframes cardSheen {
  0%, 60% { left: -60%; }
  100% { left: 140%; }
}

/* ---------- Зал ---------- */
.location-card-composite {
  border-radius: 24px;
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.location-card-composite:hover {
  transform: translateY(-4px);
  box-shadow: 0 34px 60px -32px rgba(0, 44, 112, 0.4);
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.location-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  animation: livePulse 2s ease-out infinite;
}

.location-title {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.location-features li {
  transition: transform 0.25s var(--ease-out), color 0.25s ease;
}

.location-features li:hover {
  transform: translateX(4px);
  color: var(--color-primary);
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(10, 135, 84, 0.5); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(10, 135, 84, 0); }
}

/* ---------- Контакты ---------- */
.contact-link-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 22px 48px 22px 22px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.3s ease;
}

.contact-link-card::after {
  content: '→';
  position: absolute;
  right: 20px;
  top: 50%;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-accent);
  opacity: 0;
  transform: translate(-10px, -50%);
  transition: opacity 0.3s ease, transform 0.35s var(--ease-out);
}

.contact-link-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 61, 155, 0.35);
  box-shadow: 0 24px 44px -24px rgba(0, 44, 112, 0.35);
}

.contact-link-card:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.cl-icon {
  border-radius: 16px;
  transition: transform 0.5s var(--ease-spring);
}

.contact-link-card:hover .cl-icon {
  transform: scale(1.1) rotate(-6deg);
}

/* ---------- Подвал ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(0, 82, 204, 0.25), transparent 70%),
    radial-gradient(500px 260px at 100% 100%, rgba(251, 120, 0, 0.12), transparent 70%),
    #0b1220;
  padding: 64px 0 36px;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0052cc, #3b82f6, #fb7800, #3b82f6, #0052cc);
  background-size: 200% 100%;
  animation: gradientShift 8s ease-in-out infinite;
}

.footer-links a {
  display: inline-block;
  transition: color 0.2s ease, transform 0.25s var(--ease-out);
}

.footer-links a:hover {
  transform: translateX(4px);
}

.footer-pill-btn {
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.footer-pill-btn:hover {
  background: var(--grad-primary);
  transform: translateY(-2px);
}

/* ---------- Модальные окна ---------- */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.modal-dialog {
  border-radius: 22px;
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform 0.45s var(--ease-out), opacity 0.3s ease;
}

.modal-backdrop.active .modal-dialog {
  transform: none;
  opacity: 1;
}

.modal-close-btn {
  transition: background 0.2s ease, color 0.2s ease, transform 0.3s var(--ease-out);
}

.modal-close-btn:hover {
  transform: rotate(90deg);
}

/* ---------- Внутренние страницы: декоративная шапка ---------- */
.tournaments-page,
.news-portal-page,
.legal-main {
  position: relative;
  isolation: isolate;
}

.tournaments-page::before,
.news-portal-page::before,
.legal-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  z-index: -1;
  background:
    radial-gradient(700px 300px at 85% 0%, rgba(59, 130, 246, 0.16), transparent 70%),
    radial-gradient(500px 260px at 0% 30%, rgba(251, 120, 0, 0.1), transparent 70%),
    linear-gradient(180deg, #edf3fe, transparent);
}

.news-portal-page {
  padding-top: 40px;
}

.tournaments-page-heading,
.news-hero-header,
.news-breadcrumbs,
.back-link,
.legal-page > .section-title {
  animation: heroIn 0.8s var(--ease-out) both;
}

.tournaments-page-heading,
.news-hero-header,
.legal-page > .section-title {
  animation-delay: 0.12s;
}

.news-page-title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  letter-spacing: -0.03em;
  color: #0b1f4d;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
}

.back-link:hover {
  transform: translateX(-3px);
  border-color: rgba(0, 61, 155, 0.35);
  box-shadow: 0 8px 18px -10px rgba(0, 61, 155, 0.4);
}

.tournament-subheading h2 {
  position: relative;
  padding-left: 16px;
}

.tournament-subheading h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 4px;
  border-radius: 4px;
  background: var(--grad-brand);
}

/* Юридическая страница: текст на «листе» */
.container.legal-page {
  max-width: 900px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 44px 52px 52px;
  box-shadow: 0 30px 60px -40px rgba(0, 44, 112, 0.35);
}

.container.legal-page h2 {
  padding-left: 14px;
  border-left: 4px solid var(--color-accent);
}

/* ---------- Появление при прокрутке ---------- */
.js-anim .reveal {
  opacity: 0;
}

.js-anim .reveal.is-visible {
  animation: revealUp 0.85s var(--ease-out) var(--reveal-delay, 0ms) both;
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
}

@media (max-width: 768px) {
  .section {
    padding: 64px 0;
  }

  .hero-section {
    padding: 64px 0 100px;
  }

  .metrics-strip {
    margin-top: -52px;
  }

  .metrics-grid {
    padding: 20px 8px;
    border-radius: 20px;
  }

  .metric-card {
    padding: 4px 6px;
  }

  .metric-label {
    font-size: 0.75rem;
  }

  .container.legal-page {
    padding: 28px 20px 32px;
    border-radius: 18px;
  }

  .to-top-btn {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

/* ==========================================================================
   ЦВЕТОВАЯ СХЕМА: синий hero, чередование тонированных секций
   ========================================================================== */
body {
  background-color: #ffffff;
}

/* Hero: photo on the right, a quiet dark background behind the copy. */
.hero-section {
  position: relative;
  overflow: hidden;
  border-bottom: none;
  padding: 90px 0 130px;
  background: #071d41;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
  pointer-events: none;
}

.hero-section .hero-container {
  z-index: 2;
}

.hero-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, #ffffff);
  pointer-events: none;
  z-index: 1;
}

.hero-bg-overlay {
  background: linear-gradient(90deg, rgba(7, 29, 65, .97) 0%, rgba(7, 29, 65, .91) 30%, rgba(7, 29, 65, .64) 48%, rgba(7, 29, 65, .12) 70%, transparent 100%);
  -webkit-mask-image: none;
  mask-image: none;
}

.hero-blob-blue { background: radial-gradient(circle, rgba(96, 165, 250, 0.42) 0%, rgba(96, 165, 250, 0.16) 42%, transparent 70%); }

.hero-blob-amber { top: 15%; bottom: auto; background: radial-gradient(circle, rgba(251, 120, 0, 0.36) 0%, rgba(251, 120, 0, 0.14) 42%, transparent 70%); }

.hero-title {
  color: #ffffff;
}

.hero-description {
  color: #e2ebf8;
}

@media (max-width: 1024px) {
  .hero-section .hero-content { max-width: 620px; }
}

@media (max-width: 640px) {
  .hero-section { padding: 48px 0 280px; }
  .hero-photo { top: auto; height: 310px; object-position: right center; }
  .hero-bg-overlay { background: linear-gradient(180deg, #071d41 0%, #071d41 calc(100% - 300px), transparent calc(100% - 140px)); }
  .hero-section::after { height: 55px; }
}

.feature-chip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: none;
}

.feature-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 162, 74, 0.7);
}

.hero-actions .btn-primary {
  background: var(--grad-accent);
  box-shadow: 0 12px 28px -10px rgba(251, 120, 0, 0.75);
}

.hero-actions .btn-primary:hover {
  background: var(--grad-accent);
  box-shadow: 0 18px 36px -12px rgba(251, 120, 0, 0.85);
}

.hero-actions .btn-outline {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.hero-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #ffffff;
}

/* Секции с чистым белым фоном */
.tournaments-section {
  background: #ffffff;
}

.news-section {
  background: #ffffff;
}

.news-section .section-tag {
  background: #ffffff;
}

.about-section {
  background: #ffffff;
}

.locations-section {
  background: #ffffff;
}

.about-feature-panel {
  background-color: #ffffff;
  border-color: #e2e8f0;
}

/* Блок прямой связи: чистый белый фон */
.contacts-section {
  background: #ffffff;
}

.site-footer {
  margin-top: 0;
}

/* Внутренние страницы: более насыщенная шапка */
.tournaments-page::before,
.news-portal-page::before,
.legal-main::before {
  height: 440px;
  background:
    radial-gradient(700px 320px at 85% 0%, rgba(59, 130, 246, 0.3), transparent 70%),
    radial-gradient(520px 280px at 0% 30%, rgba(251, 120, 0, 0.18), transparent 70%),
    linear-gradient(180deg, #d6e4fa, #eaf1fc);
}

/* ---------- Настройка системы «уменьшить движение» ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js-anim .reveal {
    opacity: 1;
  }
}


/* ==========================================================================
   НОВЫЕ РАЗДЕЛЫ И СТИЛИ: УРОВНИ, РАСПИСАНИЕ, СУДЬИ, ПРАВИЛА, ЗАЯВКА КОМАНДЫ
   ========================================================================== */

/* ---------- 1. Кнопка «Записаться» в шапке ---------- */
.btn-header-cta {
  background: var(--grad-accent);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(251, 120, 0, 0.28);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(251, 120, 0, 0.4);
  color: #ffffff;
}

/* Кнопки Hero: разделение путей */
.hero-cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.hero-btn-subtext {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.88;
  margin-top: 3px;
  text-transform: none;
  letter-spacing: normal;
}

/* ---------- 2. Уровни игры ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.level-content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.level-video-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  aspect-ratio: 16 / 9;
}

.level-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.level-info-pane h3 {
  font-size: 1.55rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.level-audience-badge {
  display: inline-block;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.level-info-pane p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.level-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 26px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.level-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-main);
  font-size: 0.94rem;
  font-weight: 500;
}

.level-bullets li::before {
  content: '✓';
  color: var(--color-green);
  font-weight: 800;
  background: var(--color-green-soft);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.78rem;
}

/* Dedicated levels guide and compact homepage entry. */
.levels-entry {
  padding: 32px 0;
  background: var(--color-primary-soft);
}

.levels-entry-inner,
.level-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.levels-entry h2,
.level-help h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.levels-entry p,
.level-help p {
  color: var(--text-muted);
}

.levels-entry .btn,
.level-help .btn {
  flex-shrink: 0;
}

.level-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.level-overview-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-weight: 700;
  line-height: 1.4;
}

.level-overview-link > span:last-child {
  margin-left: auto;
  color: var(--color-primary);
}

.level-overview-link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.level-overview-link:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.level-number {
  flex-shrink: 0;
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
}

.level-sections {
  display: grid;
  gap: 48px;
}

.level-detail-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.level-detail-heading h2 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.level-content-grid > * {
  min-width: 0;
}

.level-media figcaption {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

.level-video-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: radial-gradient(ellipse at top right, #164b86, transparent 70%), #0f2037;
}

.level-video-placeholder[hidden],
.level-video-frame video[hidden] {
  display: none;
}

.level-video-placeholder strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
}

.level-video-placeholder p {
  max-width: 320px;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.level-video-symbol {
  font-size: 2.4rem;
  line-height: 1;
  color: #ffac60;
}

.level-help {
  padding: 28px;
  margin-top: 48px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
}

/* Keep the expanded public navigation clear of the logo and action button. */
.desktop-nav .nav-list {
  gap: 14px;
}

.desktop-nav .nav-link {
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (max-width: 1199px) {
  .desktop-nav { display: none; }
  .hamburger-btn { display: flex; }
}

@media (max-width: 768px) {
  .level-overview { grid-template-columns: 1fr; gap: 10px; }
  .level-overview-link { padding: 16px; }
  .levels-entry-inner,
  .level-help { flex-direction: column; align-items: flex-start; }
  .level-help { padding: 24px; }
}

@media (max-width: 640px) {
  .header-actions .btn-header-cta { display: none; }
}

/* Schedule layout is maintained in schedule.css. */

/* Referee profiles are styled in referees.css. */

/* ---------- 5. Страница правил волейбола (rules.html) ---------- */
.rules-tabs-nav {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 30px;
  overflow-x: auto;
}

.rules-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 22px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
}

.rules-tab-btn:hover {
  color: var(--color-primary);
}

.rules-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.rules-tab-pane {
  display: none;
}

.rules-tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.rules-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-accordion-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.rule-accordion-item.active {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.rule-accordion-header {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  gap: 14px;
}

.rule-accordion-header:hover {
  background: var(--bg-subtle);
}

.rule-accordion-icon {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
  color: var(--color-primary);
}

.rule-accordion-item.active .rule-accordion-icon {
  transform: rotate(180deg);
}

.rule-accordion-body {
  display: none;
  padding: 0 22px 22px 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px solid var(--border-color);
  background: #fafbfe;
}

.rule-accordion-item.active .rule-accordion-body {
  display: block;
  padding-top: 18px;
}

.rule-verdict-box {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: center;
}

.rule-verdict-allowed {
  background: var(--color-green-soft);
  color: var(--color-green);
}

.rule-verdict-fault {
  background: #fee2e2;
  color: #b91c1c;
}

.rules-download-banner {
  margin-top: 36px;
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

/* ---------- 6. Страница «Как заявить команду» (team-registration.html) ---------- */
.roadmap-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.roadmap-step-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
}

.roadmap-step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.roadmap-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-family: var(--font-heading);
}

.roadmap-step-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.roadmap-step-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.divisions-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 48px;
}

.division-info-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.division-badge-top {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.badge-div-light {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-div-medium {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.badge-div-hard {
  background: var(--color-accent-soft);
  color: #c25700;
}

.division-info-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.division-info-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.division-traits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* Форма онлайн-заявки команды */
.team-reg-form-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  margin-bottom: 48px;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group-full {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 61, 155, 0.12);
}

/* Динамический список игроков */
.roster-builder-wrap {
  margin: 24px 0;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.roster-row {
  display: grid;
  grid-template-columns: 40px 1.5fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.roster-row-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.roster-btn-remove {
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.roster-btn-remove:hover {
  background: #fca5a5;
}

/* ---------- 7. Универсальная модалка быстрой записи ---------- */
.booking-modal-dialog {
  max-width: 510px;
}

/* Booking opens an editable Telegram draft; confirmation comes from the organizer. */
.booking-heading { font: 800 1.5rem/1.3 var(--font-heading); color: #18375f; margin: 8px 30px 16px 0; }
.booking-event-details { display: flex; flex-direction: column; gap: 7px; padding: 18px; border: 1px solid #e0e8f3; border-radius: 10px; background: #f6f9fd; color: #6e7f96; font-size: .85rem; margin-bottom: 20px; }
.booking-event-details strong { color: #2a4367; line-height: 1.5; }
.booking-explanation { font-size: .86rem; line-height: 1.7; color: #6b7b92; margin: 0 0 18px; }
.booking-message-label { display: block; font-size: .74rem; color: #7d8b9e; margin-bottom: 7px; }
.booking-message { width: 100%; min-height: 125px; border: 1px solid #e0e6ef; border-radius: 8px; padding: 12px; font: .82rem/1.6 var(--font-body); resize: vertical; color: #415977; background: #fff; margin-bottom: 20px; }
.booking-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.booking-modal-actions .btn { width: 100%; }
.tournament-card { scroll-margin-top: 110px; }
.match-schedule-meta { margin-top: 7px; font-size: .74rem; color: #64748b; }

.booking-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: var(--radius-full);
  margin-bottom: 22px;
}

.booking-toggle-btn {
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.booking-toggle-btn.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
}

.booking-success-msg {
  display: none;
  text-align: center;
  padding: 30px 10px;
}

/* Адаптивность для мобильных */
@media (max-width: 991px) {
  .level-content-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .roadmap-steps-grid {
    grid-template-columns: 1fr 1fr;
  }
  .divisions-showcase-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .roster-row {
    grid-template-columns: 30px 1fr 1fr auto;
  }
  .roster-row .form-input-number {
    display: none;
  }
}

@media (max-width: 640px) {
  .roadmap-steps-grid {
    grid-template-columns: 1fr;
  }
  .level-content-grid {
    padding: 20px;
  }
  .team-reg-form-panel {
    padding: 20px 16px;
  }
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }
  .hero-cta-group .btn {
    width: 100%;
  }
}
