/* THE ISLE — Clan Wars: анимации */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseLive {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 61, 90, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 61, 90, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes floatBg {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); }
  50% { transform: translate3d(0, -12px, 0) scale(1.12); }
}

@keyframes navGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes expandDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardHoverGlow {
  0%, 100% { border-color: var(--border); }
  50% { border-color: var(--accent-dim); }
}

/* ── Страницы ── */
.page-enter {
  animation: fadeSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-title {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.page-lead {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* ── Stagger для списков ── */
.stagger-item {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stagger-item:nth-child(1) { animation-delay: 0.04s; }
.stagger-item:nth-child(2) { animation-delay: 0.08s; }
.stagger-item:nth-child(3) { animation-delay: 0.12s; }
.stagger-item:nth-child(4) { animation-delay: 0.16s; }
.stagger-item:nth-child(5) { animation-delay: 0.2s; }
.stagger-item:nth-child(6) { animation-delay: 0.24s; }
.stagger-item:nth-child(7) { animation-delay: 0.28s; }
.stagger-item:nth-child(8) { animation-delay: 0.32s; }

/* ── Шапка ── */
.site-header {
  animation: fadeIn 0.4s ease both;
}

.site-logo .logo-mode {
  background: linear-gradient(90deg, var(--accent), var(--accent-alt, #7c5cff), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

.site-nav-link {
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.site-nav-link:hover {
  transform: translateY(-2px);
}

.site-nav-link.on {
  animation: navGlow 2.5s ease-in-out infinite;
}

/* ── LIVE ── */
.battle-status.live,
.tournament-bar .status.live,
.d-split .tb-match.is-live {
  animation: pulseLive 2s ease-in-out infinite;
}

.d-split .live-dot {
  animation: pulseLive 1.5s ease-in-out infinite;
}

/* ── Кланы ── */
.d-split .clan-item {
  transition: background 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.d-split .clan-item:hover {
  transform: translateX(4px);
}

.d-split .clan-item.active {
  box-shadow: inset 0 0 24px var(--accent-glow, rgba(0, 212, 255, 0.08));
}

.d-split .clan-detail.open {
  animation: expandDown 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.clan-avatar {
  transition: transform 0.25s, box-shadow 0.25s;
}

.clan-item:hover .clan-avatar,
.clan-card-lg:hover .clan-avatar,
.battle-card:hover .battle-icon {
  transform: scale(1.08);
  box-shadow: 0 0 20px var(--accent-glow, rgba(0, 212, 255, 0.35));
}

/* ── Карточки битв ── */
.battle-card {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s,
              border-color 0.3s;
}

.battle-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-dim);
}

.battle-card-accent {
  transition: height 0.3s;
}

.battle-card:hover .battle-card-accent {
  height: 100%;
}

/* ── Сетка ── */
.d-split .tb-slot[data-id] {
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.d-split .tb-slot[data-id]:hover {
  background: var(--accent-glow, rgba(0, 212, 255, 0.1));
  transform: translateX(3px);
}

.d-split .tb-match {
  transition: border-color 0.25s, box-shadow 0.25s;
}

/* ── Кнопки ── */
.btn {
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow, rgba(0, 212, 255, 0.25));
}

.btn:active {
  transform: translateY(0);
}

/* ── Панели ── */
.panel-glass {
  animation: scaleIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.split-sec {
  animation: fadeSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.split-sec:nth-child(2) { animation-delay: 0.1s; }

/* ── Фон (внутренние страницы) ── */
.arena-page .arena-bg-static {
  animation: floatBg 18s ease-in-out infinite;
}

/* ── Темы-пикер ── */
.theme-swatch {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.theme-swatch:hover {
  transform: scale(1.12);
}

.theme-swatch.on {
  box-shadow: 0 0 0 3px var(--page-bg, #05080c), 0 0 0 5px var(--accent);
}

.theme-picker-fab {
  transition: transform 0.25s, box-shadow 0.25s;
}

.theme-picker-fab:hover {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
