/* 🥊 Ring Enhancements - Избранные анимации и эффекты из design-system */

/* Scroll-reveal: visible by default (no opacity:0 flash / no scroll jank). */
.scroll-reveal,
.scroll-reveal-left,
.scroll-reveal-right,
.scroll-reveal-scale {
  opacity: 1;
  transform: none;
}

/* Entrance helpers kept for demos/display — prefer static pages. */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fadeInUp,
.animate-fadeInDown,
.animate-fadeInLeft,
.animate-fadeInRight,
.animate-scaleIn {
  animation: none;
}

.animate-delay-200,
.animate-delay-300,
.animate-delay-500 {
  animation-delay: 0s;
}

/* ============================================
   HOVER ЭФФЕКТЫ
   ============================================ */

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), 0 0 20px rgba(200, 16, 46, 0.2);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(200, 16, 46, 0.5);
}

/* ============================================
   НЕПРЕРЫВНЫЕ АНИМАЦИИ
   ============================================ */

@keyframes pulse-mk {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.03);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-pulse {
  animation: pulse-mk 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ============================================
   УЛУЧШЕННЫЕ КНОПКИ
   ============================================ */

.btn-glow {
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.3);
  transition: all 0.3s ease;
}

.btn-glow:hover {
  box-shadow: 0 0 30px rgba(200, 16, 46, 0.6);
  transform: translateY(-2px);
}

.btn-pulse {
  animation: pulse-mk 2s ease-in-out infinite;
}

/* Эффект "удара" при клике */
.btn-strike {
  position: relative;
  overflow: hidden;
}

.btn-strike::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

.btn-strike:active::before {
  width: 300px;
  height: 300px;
}

/* ============================================
   УЛУЧШЕННЫЕ БЕЙДЖИ
   ============================================ */

.badge-enhanced {
  animation: scaleIn 0.4s ease-out;
  transition: all 0.3s ease;
}

.badge-enhanced:hover {
  transform: scale(1.08);
}

/* Пульсация для статуса "Live" */
@keyframes flicker {
  0%, 100% { 
    opacity: 1;
    box-shadow: 0 0 10px currentColor;
  }
  50% { 
    opacity: 0.85;
    box-shadow: 0 0 20px currentColor;
  }
}

.badge-live-pulse {
  animation: flicker 1.5s ease-in-out infinite;
}

/* ============================================
   ГРАДИЕНТНЫЙ ТЕКСТ (MK стиль)
   ============================================ */

.text-gradient-mk {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   СПЕЦИАЛЬНЫЕ ЭФФЕКТЫ ДЛЯ RING
   ============================================ */

/* VS-экран: эффект "трейлера" */
@keyframes trailer {
  0% { 
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
    filter: blur(10px);
  }
  100% { 
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
}

.vs-trailer {
  animation: trailer 0.5s ease-out;
  text-shadow: 
    0 0 20px var(--gold),
    0 0 40px var(--gold2);
}

/* Появление игрока слева */
.player-enter-left {
  animation: fadeInLeft 0.8s ease-out;
}

/* Появление игрока справа */
.player-enter-right {
  animation: fadeInRight 0.8s ease-out;
}

/* Счёт: пульсация при изменении */
@keyframes score-change {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    color: var(--gold2);
  }
}

.score-pulse {
  animation: score-change 0.5s ease-out;
}

/* ============================================
   КАРТОЧКИ С ЭФФЕКТАМИ
   ============================================ */

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow), 0 0 30px rgba(200, 16, 46, 0.15);
}

/* Эффект свечения для активных элементов */
.active-glow {
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.4),
              inset 0 0 20px rgba(200, 16, 46, 0.1);
}

/* ============================================
   НАВИГАЦИЯ С ПОДЧЁРКИВАНИЕМ
   ============================================ */

.nav-animated a {
  position: relative;
  transition: color 0.3s ease;
}

.nav-animated a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-animated a:hover::after {
  transform: scaleX(1);
}

/* ============================================
   ЗАГРУЗЧИК (Ring стиль)
   ============================================ */

@keyframes ring-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 4px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ring-spin 1s linear infinite;
}

/* ============================================
   ФОТО УЧАСТНИКОВ
   ============================================ */

.player-photo {
  transition: all 0.3s ease;
}

.player-photo:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(200, 16, 46, 0.5);
}

/* Эффект "выход на ринг" */
@keyframes walkout {
  0% {
    opacity: 0;
    transform: translateX(-100px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateX(10px) scale(1.05);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

.player-walkout {
  animation: walkout 1s ease-out;
}

/* ============================================
   СЕТКА ТУРНИРА
   ============================================ */

.bracket-match {
  transition: all 0.3s ease;
}

.bracket-match:hover {
  transform: scale(1.05);
  background: var(--card);
  box-shadow: 0 0 20px rgba(200, 16, 46, 0.3);
}

/* Подсветка активного матча */
.bracket-match.active {
  animation: pulse-mk 2s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(200, 16, 46, 0.6);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
  .animate-fadeInUp,
  .animate-fadeInDown,
  .animate-fadeInLeft,
  .animate-fadeInRight {
    animation-duration: 0.4s;
  }
  
  .hover-lift:hover,
  .hover-scale:hover {
    transform: none; /* Отключаем на мобильных */
  }
}

/* Отключение анимаций для prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }
}
