/* css/twitch.css — баннер на всю ширину, LIVE-плеер и адаптивность */

.twitch-section {
  position: relative;
}

.twitch-card {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(170, 198, 238, 0.14);
  background: linear-gradient(145deg, rgba(16, 26, 42, 0.92), rgba(7, 13, 22, 0.96));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.twitch-card:hover {
  border-color: rgba(132, 184, 255, 0.36);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.38);
}

/* Офлайн-карточка: баннер сверху на всю ширину, инфо-блок снизу */
.twitch-offline {
  display: flex;
  flex-direction: column;
}

.twitch-offline-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: clamp(220px, 46vw, 520px);
  background: #080e18;
  overflow: hidden;
}

.twitch-offline-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.twitch-offline-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(7, 13, 22, 0.88) 100%);
  pointer-events: none;
}

/* На самой картинке уже есть текст/бренд, поэтому дублирующий оверлей скрыт */
.twitch-offline-banner .twitch-channel-info {
  display: none;
}

.twitch-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(137, 197, 255, 0.5);
  object-fit: cover;
  flex-shrink: 0;
}

.twitch-offline .twitch-info {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  border-top: 1px solid rgba(175, 207, 255, 0.12);
}

.twitch-offline .twitch-info > p {
  flex: 1 1 280px;
  margin: 0;
}

.twitch-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9fcaff;
}

.twitch-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  width: fit-content;
  flex-shrink: 0;
}

.twitch-status.offline {
  color: #aab6c9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(175, 207, 255, 0.12);
}

.twitch-status.live {
  color: #fff;
  background: #eb0400;
}

.twitch-status.live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: twitch-pulse 1.4s infinite;
}

@keyframes twitch-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.twitch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.8rem 1.35rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
  width: fit-content;
  flex-shrink: 0;
  background: linear-gradient(115deg, #69baff, #8b9bff);
  color: #07111d;
  border: 1px solid rgba(197, 229, 255, 0.35);
}

.twitch-btn:hover {
  background: linear-gradient(115deg, #8bceff, #a6aaff);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(67, 145, 225, 0.24);
  text-decoration: none;
}

/* LIVE-режим: плеер 16:9 на всю ширину и панель метаданных */
.twitch-live {
  display: flex;
  flex-direction: column;
}

.twitch-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72svh;
  background: #000;
}

.twitch-player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.twitch-live-meta {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(175, 207, 255, 0.12);
}

.twitch-live-meta > div:first-child {
  min-width: 0;
  flex: 1 1 260px;
}

.twitch-live-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.twitch-live-sub {
  font-size: 0.82rem;
  color: #9ba8bb;
  margin-top: 0.2rem;
}

.twitch-live-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
}

.twitch-viewers {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.twitch-viewers small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #748198;
  font-weight: 700;
}

@media (max-width: 767px) {
  .twitch-card {
    border-radius: 18px;
  }

  .twitch-offline .twitch-info {
    padding: 1.15rem;
    flex-direction: column;
    align-items: stretch;
  }

  .twitch-offline .twitch-btn,
  .twitch-live-actions .twitch-btn {
    width: 100%;
  }

  .twitch-live-meta {
    padding: 1.1rem;
  }
}