/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 7px 32px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  z-index: -1;
  transition: opacity var(--transition-base);
  border-radius: inherit;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

.btn--primary {
  background: var(--gradient-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-primary);
  border: none;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 118, 0, 0.4);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.btn--outline::before {
  display: none;
}

.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-secondary);
  transform: translateY(-2px);
}

.btn--secondary {
  background: var(--gradient-secondary);
  color: var(--color-white);
  box-shadow: var(--shadow-secondary);
}

.btn--secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 81, 173, 0.4);
}

.btn--small {
  padding: 10px 20px;
  font-size: var(--text-xs);
}

.btn--large {
  padding: 18px 40px;
  font-size: var(--text-base);
}

.btn--full {
  width: 100%;
}

/* ========== LOGO ========== */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: 85px;
  z-index: 1;
  cursor: pointer;
}

@media (max-width: 768px) {
  .logo {
    margin-left: 15px;
    justify-content: center;
  }
}

.logo img {
  max-width: 100px;
}

.logo__icon {
  font-size: 2rem;
  color: var(--color-primary);
  animation: logoSpin 3s ease-in-out infinite;
}

.logo__text {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 2px;
}

@keyframes logoSpin {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* ========== FORM ELEMENTS ========== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
  color: var(--color-gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(255, 118, 0, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-gray-500);
}

/* ========== MODAL ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);  
}

.modal__content {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(30px) scale(0.95);
  transition: transform var(--transition-bounce);
  box-shadow: var(--shadow-xl);
}

.modal.active .modal__content {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  font-size: var(--text-lg);
  transition: all var(--transition-base);
  z-index: 1;
}

.modal__close:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: rotate(90deg);
}

.modal__title {
  font-size: var(--text-2xl);
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.modal__tournament-name {
  text-align: center;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-xl);
}

.modal__form {
  margin-top: var(--space-xl);
}

/* ========== PRELOADER ========== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-dark);
  z-index: var(--z-preloader);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader__inner {
  text-align: center;
}

.preloader__ball {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  margin: 0 auto var(--space-lg);
  animation: preloaderBounce 0.6s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 118, 0, 0.5);
}

.preloader__text {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 4px;
  animation: preloaderPulse 1s ease-in-out infinite;
}

@keyframes preloaderBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========== SCROLL TO TOP ========== */
.scroll-top {
  position: fixed;
  bottom: 130px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: var(--z-fixed);
  cursor: pointer;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 25px rgba(255, 118, 0, 0.4);
}

/* ========== CURSOR BALL ========== */
.cursor-ball {
  position: fixed;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease, transform 0.1s ease;
  mix-blend-mode: difference;
}

@media (hover: hover) {
  .cursor-ball.active {
    opacity: 0.6;
  }
}

/* Floating Button */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  cursor: pointer;
  z-index: 1000;
  
  /* Стили кнопки */
  background: linear-gradient(135deg, #c8ff00, #a3d600);
  color: #1a1a1a;
  text-decoration: none;
  box-shadow: 
    0 4px 20px rgba(200, 255, 0, 0.4),
    0 0 0 0 rgba(200, 255, 0, 0.7);
  
  /* Анимация пульсации */
  animation: pulse 2s ease-in-out infinite;
}

.floating-btn:hover {
  transform: scale(1.05);
  box-shadow: 
    0 6px 30px rgba(200, 255, 0, 0.6),
    0 0 0 10px rgba(200, 255, 0, 0.2);
  animation: none;
}

.floating-btn:active {
  transform: scale(0.98);
}

.floating-btn__icon {
  font-size: 1.2em;
  animation: bounce 1s ease-in-out infinite;
}

.floating-btn__text {
  white-space: nowrap;
}

/* Анимация пульсации */
@keyframes pulse {
  0%, 100% {
    box-shadow: 
      0 4px 20px rgba(200, 255, 0, 0.4),
      0 0 0 0 rgba(200, 255, 0, 0.7);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(200, 255, 0, 0.4),
      0 0 0 15px rgba(200, 255, 0, 0);
  }
}

/* Анимация иконки */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .floating-btn {
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    font-size: calc(var(--text-sm) * 0.9);
  }
}

@media (max-width: 480px) {
  .floating-btn {
    bottom: 15px;
    right: 15px;
    padding: 14px;
    border-radius: 50%;
  }
  
  .floating-btn__text {
    display: none;
  }
  
  .floating-btn__icon {
    font-size: 1.5em;
    animation: none;
  }
}

/* Контейнер для частиц */
.btn-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: -1;
}

/* Мячик */
.ball-particle {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
}

.ball-particle--orange {
  background: radial-gradient(circle at 30% 30%, #ffcc80, #ff9800);
  box-shadow: 0 2px 4px rgba(255, 152, 0, 0.4);
}

.ball-particle--white {
  background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Анимации */
@keyframes explode {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.3);
  }
}

@keyframes fall {
  0% {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scale(0.3);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), calc(var(--ty) + 100px)) scale(0.1);
  }
}

/* Анимация падения */
@keyframes fall {
  0% {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scale(0.3);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), calc(var(--ty) + 100px)) scale(0.1);
  }
}

.floating-btn:hover .btn-particles::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 152, 0, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: hoverGlow 1s ease-in-out infinite;
}

@keyframes hoverGlow {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.2); }
}