/* =========================================================
   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-banner[hidden] { display: none !important; }

.streams-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(40, 12, 16, 0.96), rgba(18, 21, 28, 0.96));
  border: 1px solid rgba(220, 53, 69, 0.35);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  flex-wrap: wrap;
}

.streams-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.78em;
  letter-spacing: 0.06em;
  color: #ff5b6a;
  background: rgba(220, 53, 69, 0.16);
  border: 1px solid rgba(220, 53, 69, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.streams-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b4e;
  animation: streamPulse 1.6s infinite;
}

.streams-banner-platform {
  font-size: 1.6em;
  color: #fff;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.streams-banner-info {
  flex: 1 1 220px;
  min-width: 0;
}
.streams-banner-streamer {
  font-weight: 800;
  color: #fff;
  font-size: 1.05em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.streams-banner-division {
  font-size: 0.72em;
  font-weight: 600;
  color: #cbd0d8;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 999px;
}
.streams-banner-title {
  color: #c3c8d1;
  font-size: 0.92em;
  margin-top: 3px;
  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;
  white-space: nowrap;
}
.streams-banner-watch {
  background: #dc3545;
  color: #fff;
}
.streams-banner-watch:hover { filter: brightness(1.1); }
.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); }

/* ── Модалка со списком трансляций ─────────────────────────── */
.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;
}

/* ── Страница турнира ───────────────────────────────────────── */
.trn-stream-banner { margin: 0 0 18px; }
.trn-stream-panel { margin: 0 0 18px; }

@media (max-width: 640px) {
  .streams-banner { gap: 12px; }
  .streams-banner-platform { display: none; }
  .streams-banner-actions { width: 100%; }
  .streams-banner-watch, .streams-banner-more { flex: 1; justify-content: center; }
}
