/* =============================================================================
   FACEIT DUEL V10 - Enhanced Design System
   Улучшенный дизайн с сохранением оригинального стиля
   ============================================================================= */

/* ===== УЛУЧШЕННАЯ ТИПОГРАФИКА ===== */
:root {
  /* Spacing scale для консистентности */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 20px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Улучшенные shadows для глубины */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.35);
  
  /* Гладкие transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== УЛУЧШЕННЫЕ КАРТОЧКИ ИГРОКОВ ===== */
.player-card {
  position: relative;
  background: linear-gradient(135deg, rgba(17, 17, 20, 0.95), rgba(21, 21, 25, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-smooth);
}

.player-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.3), 
    rgba(139, 92, 246, 0.05) 50%, 
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.player-card:hover::before {
  opacity: 1;
}

.player-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 32px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Улучшенный аватар с glow эффектом */
.avatar {
  position: relative;
  isolation: isolate;
  transition: transform var(--transition-base);
}

.avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(
    from 180deg at 50% 50%,
    rgba(139, 92, 246, 0.4) 0deg,
    rgba(183, 156, 255, 0.2) 120deg,
    rgba(139, 92, 246, 0.4) 240deg,
    rgba(139, 92, 246, 0.4) 360deg
  );
  opacity: 0;
  z-index: -1;
  filter: blur(8px);
  transition: opacity var(--transition-base);
}

.player-card:hover .avatar::after {
  opacity: 1;
}

.player-card:hover .avatar {
  transform: scale(1.05);
}

/* ===== УЛУЧШЕННАЯ LIVE СЕКЦИЯ ===== */
.live-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, 
    rgba(17, 17, 20, 0.98), 
    rgba(21, 21, 25, 0.95)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-smooth);
}

.live-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Плавное обновление счёта без перезагрузки */
.live-score b {
  display: inline-block;
  transition: transform var(--transition-base), color var(--transition-base);
}

.live-score b.score-updated {
  animation: scoreUpdateSmooth 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scoreUpdateSmooth {
  0% {
    transform: translateY(0) scale(1);
    color: inherit;
  }
  25% {
    transform: translateY(-8px) scale(1.15);
    color: #b79cff;
    filter: brightness(1.3) drop-shadow(0 0 20px rgba(183, 156, 255, 0.6));
  }
  50% {
    transform: translateY(-6px) scale(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
    color: inherit;
  }
}

/* Плавное обновление статистики игроков */
.live-player span.stat-updated {
  animation: statUpdateSmooth 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes statUpdateSmooth {
  0% {
    transform: translateY(0) scale(1);
    color: inherit;
  }
  40% {
    transform: translateY(-3px) scale(1.08);
    color: #fff;
    text-shadow: 0 0 12px rgba(183, 156, 255, 0.5);
  }
  100% {
    transform: translateY(0) scale(1);
    color: inherit;
  }
}

/* ===== УЛУЧШЕННЫЕ МЕТРИКИ И СРАВНЕНИЕ ===== */
.cmp-row {
  position: relative;
  transition: background var(--transition-base);
}

.cmp-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--violet), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.cmp-row:hover::before {
  opacity: 1;
}

.cmp-row:hover {
  background: rgba(139, 92, 246, 0.04);
}

/* Улучшенные progress bars */
.cmp-track i {
  position: relative;
  overflow: hidden;
}

.cmp-track i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  50%, 100% {
    transform: translateX(200%);
  }
}

/* ===== УЛУЧШЕННАЯ КАРТОЧКА VS ===== */
.versus {
  position: relative;
  padding: var(--space-lg);
}

.vs-ring {
  position: relative;
  box-shadow: 
    0 0 0 4px rgba(139, 92, 246, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3);
}

.versus strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #b79cff, #fff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 4s ease infinite;
  display: block;
  margin-top: 12px;
}

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

/* ===== УЛУЧШЕННЫЕ КАРТЫ ===== */
.map-row {
  position: relative;
  transition: all var(--transition-smooth);
}

.map-row::before {
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.map-row:hover {
  transform: translateX(4px) scale(1.01);
}

.map-row:hover::before {
  opacity: 0.15;
  transform: scale(1.05);
}

.map-name {
  font-weight: 800;
  letter-spacing: 0.03em;
  transition: color var(--transition-base), text-shadow var(--transition-base);
}

.map-row:hover .map-name {
  color: #b79cff;
  text-shadow: 0 0 16px rgba(183, 156, 255, 0.4);
}

/* ===== УЛУЧШЕННАЯ НАВИГАЦИЯ ===== */
.topbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-base);
}

.topbar.scrolled {
  background: rgba(9, 9, 11, 0.9);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.nav-links a {
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all var(--transition-base);
}

.nav-links a::after {
  display: none;
}

.nav-links a:hover {
  background: rgba(139, 92, 246, 0.12);
  color: #b79cff;
  transform: translateY(0);
}

/* Активная кнопка - оригинальный стиль из style.css работает */

/* ===== УЛУЧШЕННЫЕ КНОПКИ ===== */
.icon-btn,
.feature-btn {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.icon-btn::before,
.feature-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(139, 92, 246, 0.2),
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.icon-btn:hover::before,
.feature-btn:hover::before {
  opacity: 1;
}

.icon-btn:hover,
.feature-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.icon-btn:active,
.feature-btn:active {
  transform: translateY(0);
}

/* ===== УЛУЧШЕННЫЕ МАТЧИ ===== */
.match-row {
  transition: all var(--transition-smooth);
  position: relative;
}

.match-row::before,
.match-row::after {
  transition: 
    opacity var(--transition-slow),
    transform var(--transition-slow),
    background var(--transition-base);
}

.match-row:hover {
  transform: translateX(6px) scale(1.005);
}

.match-row.match-win {
  border-left: 3px solid var(--green);
}

.match-row.match-loss {
  border-left: 3px solid var(--red);
}

.match-row.match-win:hover {
  box-shadow: 
    -3px 0 0 var(--green),
    0 8px 32px rgba(64, 201, 130, 0.15),
    inset 40px 0 60px rgba(64, 201, 130, 0.08);
}

.match-row.match-loss:hover {
  box-shadow: 
    -3px 0 0 var(--red),
    0 8px 32px rgba(240, 90, 103, 0.15),
    inset 40px 0 60px rgba(240, 90, 103, 0.08);
}

/* ===== УЛУЧШЕННЫЙ HERO ===== */
.hero-grid {
  gap: 32px;
  padding: 20px 0;
}

.hero-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.hero-item {
  position: relative;
  padding: 20px;
  background: linear-gradient(135deg, 
    rgba(17, 17, 20, 0.8), 
    rgba(21, 21, 25, 0.6)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  transition: all var(--transition-smooth);
  overflow: hidden;
}

.hero-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--violet),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.hero-item:hover::before {
  opacity: 1;
}

.hero-item:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, 
    rgba(21, 21, 25, 0.95), 
    rgba(25, 25, 30, 0.8)
  );
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-item small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.hero-item b {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: block;
  background: linear-gradient(135deg, #fff, #b79cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== УЛУЧШЕННЫЕ СЕКЦИИ ===== */
.section {
  margin-bottom: var(--space-2xl);
}

.section-head {
  margin-bottom: var(--space-xl);
  position: relative;
}

.section-head::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), transparent);
  border-radius: 999px;
  opacity: 0.6;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.section-head p {
  font-size: 14px;
  color: var(--soft);
  line-height: 1.6;
  max-width: 600px;
}

/* ===== SURFACE УЛУЧШЕНИЯ ===== */
.surface {
  background: linear-gradient(135deg, 
    rgba(17, 17, 20, 0.9), 
    rgba(21, 21, 25, 0.8)
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-smooth);
}

.surface:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ===== УЛУЧШЕННЫЕ ЧИПЫ ===== */
.chip {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 17, 20, 0.6);
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.chip strong {
  color: var(--violet);
}

/* ===== RESPONSIVE УЛУЧШЕНИЯ ===== */
@media (max-width: 1200px) {
  .hero-grid {
    gap: 24px;
  }
  
  .hero-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-grid {
    gap: 20px;
  }
  
  .hero-summary {
    grid-template-columns: 1fr;
  }
  
  .section-head h2 {
    font-size: 28px;
  }
  
  .hero-item b {
    font-size: 24px;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .vs-ring,
  .player-card,
  .map-row,
  .match-row {
    transform: none !important;
  }
}

/* ===== УЛУЧШЕННЫЕ СКЕЛЕТОНЫ ===== */
.skel i,
.skel span {
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 40%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.08) 60%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShine 1.5s ease-in-out infinite;
}

@keyframes skeletonShine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== УЛУЧШЕННЫЙ TOAST ===== */
.toast {
  background: rgba(17, 17, 20, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ===== ПЛАВНЫЕ СЧЁТЧИКИ ===== */
.counter {
  display: inline-block;
  transition: transform var(--transition-base);
}

.counter-fresh {
  animation: counterAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes counterAppear {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    filter: blur(4px);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ===== FORM SCORE УЛУЧШЕНИЯ ===== */
.form-score {
  transition: all var(--transition-base);
}

.player-card:hover .form-score b {
  color: var(--violet);
  text-shadow: 0 0 16px rgba(139, 92, 246, 0.5);
  transform: scale(1.1);
  display: inline-block;
}
