/* =========================================================
   STREAMS — styleStreams.css
   Панель стримера (личный кабинет) + виджет активных стримов
   (главная / страница подразделения) + модалка со списком.
   Палитра сайта: тёмный фон rgba(18,21,28), акцент #dc3545.
   ========================================================= */

/* ── Панель стримера (самодостаточная: работает и вне styleProfile) ── */
.streamer-panel {
  background: rgba(18, 21, 28, 0.94);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 28px;
  color: #e8e8e8;
}
.streamer-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
}
.streamer-panel .panel-title {
  margin: 0;
  font-size: 1.25em;
  font-weight: 700;
  color: #fff;
}
.streamer-panel .panel-title-icon { color: #dc3545; margin-right: 8px; }

/* Кнопки внутри панели (не зависят от глобальных .btn-primary/.btn-ghost) */
.streamer-start-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  background: #dc3545;
  color: #fff;
  font-weight: 700;
  font-size: 0.95em;
  cursor: pointer;
  transition: filter 0.15s;
}
.streamer-start-btn:hover { filter: brightness(1.1); }
.streamer-start-btn:disabled { opacity: 0.6; cursor: default; }

.streamer-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e8e8e8;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.streamer-edit-btn:hover { background: rgba(255, 255, 255, 0.12); }

.streamer-panel .streamer-loading {
  color: #9aa0aa;
  font-size: 0.95em;
  padding: 8px 0;
}

.streamer-status-pill {
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.streamer-status-pill.is-live {
  color: #ff5b6a;
  background: rgba(220, 53, 69, 0.14);
  border-color: rgba(220, 53, 69, 0.4);
}
.streamer-status-pill.is-off {
  color: #9aa0aa;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.streamer-hint {
  color: #b8bdc7;
  margin: 0 0 18px;
  line-height: 1.55;
}

.streamer-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
}

.streamer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.streamer-field-label {
  font-size: 0.85em;
  color: #9aa0aa;
  font-weight: 600;
}
.streamer-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: #f0f0f0;
  font-size: 0.95em;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.streamer-input:focus {
  outline: none;
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
}

.streamer-reminder {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffd977;
  font-size: 0.88em;
  line-height: 1.5;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.streamer-reminder i {
  margin-top: 2px;
  color: #ffc107;
}

/* Активный стрим */
.streamer-live-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.streamer-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #ff5b6a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85em;
}
.streamer-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b4e;
  box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.7);
  animation: streamPulse 1.6s infinite;
}
.streamer-live-since {
  color: #9aa0aa;
  font-size: 0.85em;
}
.streamer-live-title {
  font-size: 1.15em;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.streamer-live-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6ea8ff;
  word-break: break-all;
  margin-bottom: 16px;
}
.streamer-live-link:hover { text-decoration: underline; }
.streamer-live-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.streamer-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(220, 53, 69, 0.5);
  background: rgba(220, 53, 69, 0.16);
  color: #ff6b78;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.streamer-stop-btn:hover { background: rgba(220, 53, 69, 0.28); }
.streamer-stop-btn:disabled { opacity: 0.6; cursor: default; }

@keyframes streamPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 59, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0); }
}

/* ── Виджет-баннер активных стримов ────────────────────────── */
.streams-widget { width: 100%; }
/* На главной ограничиваем ширину и центрируем — чтобы баннер не тянулся
   от края до края экрана, а жил в едином ритме с остальными секциями. */
.streams-widget[data-context="home"] {
  max-width: var(--container-w, min(1180px, 92vw));
  margin: 26px auto 6px;
  padding: 0 16px;
  box-sizing: border-box;
}
.streams-banner[hidden] { display: none !important; }

.streams-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 16px;
  background:
    radial-gradient(130% 180% at 0% 0%, rgba(220, 53, 69, 0.28), transparent 55%),
    linear-gradient(135deg, rgba(34, 12, 16, 0.97), rgba(15, 17, 23, 0.98));
  border: 1px solid rgba(220, 53, 69, 0.32);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  flex-wrap: wrap;
}
.streams-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(220, 53, 69, 0.55);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(220, 53, 69, 0.22);
}
/* Светящаяся акцентная линия сверху с бегущим бликом */
.streams-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff3b4e 20%, #ff9aa2 50%, #ff3b4e 80%, transparent);
  background-size: 200% 100%;
  animation: streamsSheen 4.5s linear infinite;
}
/* Мягкое пульсирующее свечение слева, за плиткой площадки */
.streams-banner::after {
  content: '';
  position: absolute;
  left: -60px; top: 50%;
  width: 240px; height: 240px;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(220, 53, 69, 0.22), transparent 70%);
  pointer-events: none;
  animation: streamsGlow 3.2s ease-in-out infinite;
}
/* Контент — поверх декоративных слоёв */
.streams-banner > * { position: relative; z-index: 1; }

@keyframes streamsSheen {
  0%   { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}
@keyframes streamsGlow {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.95; }
}

.streams-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.76em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff6b78;
  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.45);
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: inset 0 0 12px rgba(220, 53, 69, 0.15);
}
.streams-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b4e;
  box-shadow: 0 0 8px rgba(255, 59, 78, 0.9);
  animation: streamPulse 1.6s infinite;
}

.streams-banner-platform {
  font-size: 1.7em;
  color: #fff;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(220, 53, 69, 0.4), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px rgba(220, 53, 69, 0.3);
  flex-shrink: 0;
}

.streams-banner-info {
  flex: 1 1 220px;
  min-width: 0;
}
.streams-banner-streamer {
  font-weight: 800;
  color: #fff;
  font-size: 1.08em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.streams-banner-division {
  font-size: 0.72em;
  font-weight: 600;
  color: #e6c9cc;
  background: rgba(220, 53, 69, 0.16);
  border: 1px solid rgba(220, 53, 69, 0.3);
  padding: 3px 9px;
  border-radius: 999px;
}
.streams-banner-title {
  color: #c3c8d1;
  font-size: 0.92em;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streams-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.streams-banner-watch,
.streams-banner-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.streams-banner-watch {
  background: linear-gradient(180deg, #f0495a, #dc3545);
  color: #fff;
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.35);
}
.streams-banner-watch:hover { filter: brightness(1.1); transform: translateY(-1px); }
.streams-banner-more {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e8e8e8;
}
.streams-banner-more:hover { background: rgba(255, 255, 255, 0.12); }

@media (prefers-reduced-motion: reduce) {
  .streams-banner::before,
  .streams-banner::after { animation: none; }
}

/* ── Кнопка администратора «Завершить» ─────────────────────── */
.streams-admin-stop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.45);
  color: #ff8b95;
  transition: background 0.15s, filter 0.15s;
}
.streams-admin-stop:hover { background: rgba(220, 53, 69, 0.22); }
.streams-admin-stop:disabled { opacity: 0.6; cursor: default; }

/* ── Модалка со списком трансляций ─────────────────────────── */
.streams-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
/* Атрибут hidden должен перекрывать display:flex, иначе модалка не закрывается. */
.streams-modal-overlay[hidden] { display: none; }
body.streams-modal-open { overflow: hidden; }

.streams-modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(18, 21, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.streams-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.streams-modal-title {
  margin: 0;
  color: #fff;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.streams-modal-title i { color: #dc3545; }
.streams-modal-close {
  background: none;
  border: none;
  color: #9aa0aa;
  font-size: 1.2em;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}
.streams-modal-close:hover { color: #fff; }
.streams-modal-body {
  padding: 16px 22px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.streams-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.streams-card:hover {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.35);
}
.streams-card-icon {
  font-size: 1.4em;
  color: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.streams-card-body { flex: 1; min-width: 0; }
.streams-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.streams-card-live {
  font-size: 0.68em;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ff5b6a;
  background: rgba(220, 53, 69, 0.16);
  padding: 2px 7px;
  border-radius: 4px;
}
.streams-card-streamer {
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.streams-card-title {
  color: #c3c8d1;
  font-size: 0.9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.streams-card-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.streams-card-platform,
.streams-card-division {
  font-size: 0.72em;
  color: #9aa0aa;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
}
.streams-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ff6b78;
  font-weight: 700;
  font-size: 0.85em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Обёртка карточки в модалке (для админской кнопки завершения). */
.streams-card-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.streams-card-entry .streams-card { flex: 1; }
.streams-card-entry .streams-admin-stop {
  align-self: flex-end;
  padding: 8px 14px;
  font-size: 0.82em;
}

/* ── Страница турнира ───────────────────────────────────────── */
.trn-stream-banner { margin: 0 0 18px; }
.trn-stream-panel { margin: 0 0 18px; }

@media (max-width: 640px) {
  .streams-widget[data-context="home"] { margin-top: 18px; }
  .streams-banner { gap: 12px; padding: 16px; }
  .streams-banner-platform { display: none; }
  .streams-banner-actions { width: 100%; }
  .streams-banner-watch,
  .streams-banner-more,
  .streams-banner-actions .streams-admin-stop { flex: 1; justify-content: center; }
}
