/* ============================================================
   «Для стримеров»: конструктор OBS-виджета сессионной статистики
   (/streamers). Подключается после profile.css / compare-players.css.
   ============================================================ */

.strm-layout {
  max-width: 1280px;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
}
@media (max-width: 980px) {
  .strm-layout { grid-template-columns: 1fr; }
  .strm-side { order: -1; }
}

.strm-main { min-width: 0; }
.strm-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
@media (max-width: 980px) { .strm-side { position: static; } }

/* ---- карточки ---- */
.strm-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 201, 77, 0.05), transparent 55%),
    linear-gradient(180deg, #171c19 0%, #131714 45%, #10130f 100%);
  padding: 18px 20px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.strm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.strm-card-title {
  margin: 0;
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}
.strm-card-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}
.strm-card-sub { margin: -6px 0 12px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.strm-hint { font-size: 12px; color: var(--text-faint); line-height: 1.5; }

/* ---- войти ---- */
.strm-login {
  text-align: center;
  padding: 34px 20px;
}
.strm-login h2 { margin: 0 0 8px; font-size: 22px; }
.strm-login p { margin: 0 auto 18px; max-width: 520px; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.strm-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  text-align: left;
}
.strm-feature {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
}
.strm-feature b { display: block; color: var(--text); font-size: 13px; margin-bottom: 3px; }

/* ---- мои виджеты ---- */
.strm-list { display: flex; flex-direction: column; gap: 8px; }
.strm-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.strm-item.active { border-color: rgba(255, 201, 77, 0.55); background: rgba(255, 201, 77, 0.06); }
.strm-item-main { min-width: 0; }
.strm-item-title { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strm-item-title .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; box-shadow: 0 0 6px var(--green); vertical-align: middle; }
.strm-item-title .live.off { background: var(--text-faint); box-shadow: none; }
.strm-item-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.strm-item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .strm-item { grid-template-columns: 1fr; }
  .strm-item-actions { justify-content: flex-start; }
}
.strm-mini-btn {
  padding: 6px 10px;
  border-radius: 2px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.strm-mini-btn:hover { border-color: var(--border-strong); color: var(--text); }
.strm-mini-btn.danger:hover { border-color: var(--magenta); color: var(--magenta); }
.strm-mini-btn.accent { background: var(--accent-grad); border-color: transparent; color: var(--accent-ink); }

/* ---- формы ---- */
.strm-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.strm-row:last-child { margin-bottom: 0; }
.strm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.strm-field > label, .strm-lbl {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.strm-input {
  padding: 9px 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}
.strm-input:focus { outline: none; border-color: rgba(255, 201, 77, 0.55); background: rgba(255, 255, 255, 0.07); box-shadow: 0 0 0 3px rgba(255, 201, 77, 0.12); }
select.strm-input { cursor: pointer; }
select.strm-input option { background: #171c19; }

.strm-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}
.strm-account-avatar {
  width: 32px; height: 32px;
  border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 15px;
}
.strm-account-nick { font-weight: 700; font-size: 14px; }
.strm-account-id { font-size: 11.5px; color: var(--text-faint); }

/* сегментированные переключатели */
.strm-seg { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(0, 0, 0, 0.25); flex-wrap: wrap; }
.strm-seg button {
  padding: 7px 12px;
  border-radius: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.strm-seg button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.strm-seg button.active { background: var(--accent-grad); color: var(--accent-ink); }

/* цвета */
.strm-swatches { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.strm-swatch {
  width: 26px; height: 26px;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.strm-swatch:hover { transform: translateY(-1px); }
.strm-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6); }
.strm-color-input {
  width: 34px; height: 26px;
  padding: 0; border: 1px solid var(--line); border-radius: 2px; background: transparent; cursor: pointer;
}

/* переключатели */
.strm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.strm-toggle input { display: none; }
.strm-toggle .knob {
  position: relative;
  width: 34px; height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.15s ease;
  flex: none;
}
.strm-toggle .knob::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.strm-toggle input:checked + .knob { background: var(--accent); }
.strm-toggle input:checked + .knob::after { transform: translateX(16px); }
.strm-toggle input:checked ~ span { color: var(--text); }

/* ползунок */
.strm-range { display: inline-flex; align-items: center; gap: 10px; }
.strm-range input[type="range"] { width: 160px; accent-color: var(--accent); }
.strm-range output { font-size: 12.5px; color: var(--text-dim); min-width: 40px; font-variant-numeric: tabular-nums; }

/* ---- показатели ---- */
.strm-metric-groups { display: flex; flex-direction: column; gap: 12px; }
.strm-metric-group-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.strm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.strm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 2px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.strm-chip:hover { border-color: var(--border-strong); color: var(--text); }
.strm-chip.active { border-color: rgba(255, 201, 77, 0.6); background: rgba(255, 201, 77, 0.1); color: var(--text); }
.strm-chip .ord {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 2px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 10px; font-weight: 800;
}
.strm-chip[title] { cursor: pointer; }

.strm-selected {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.strm-selected-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.strm-sel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.strm-sel button {
  width: 20px; height: 20px;
  border: none; background: transparent; color: var(--text-faint);
  cursor: pointer; font-size: 12px; line-height: 1; padding: 0; border-radius: 2px;
}
.strm-sel button:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.strm-sel button.rm:hover { color: var(--magenta); }
.strm-empty-sel { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

/* ---- действия ---- */
.strm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.strm-status { font-size: 12.5px; color: var(--text-dim); }
.strm-status.err { color: var(--magenta); }
.strm-status.ok { color: var(--green); }

/* ---- превью ---- */
.strm-preview-card { padding: 14px 16px 16px; }
.strm-preview-frame-wrap {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url('/backgrounds/hangar-bg.webp') center / cover no-repeat;
  min-height: 160px;
}
.strm-preview-frame-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.035) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.035) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  pointer-events: none;
}
.strm-preview-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 220px;
  border: none;
  background: transparent;
}
.strm-preview-note { margin-top: 8px; font-size: 12px; color: var(--text-faint); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.strm-preview-note b { color: var(--text-dim); font-weight: 600; }

/* ссылка */
.strm-url-box {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.strm-url-box input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.strm-url-empty {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
}

.strm-side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.strm-side-stat {
  padding: 8px 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
}
.strm-side-stat b { display: block; font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 600; color: var(--text); }
.strm-side-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; }

/* инструкция */
.strm-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 8px; }
.strm-steps li { position: relative; padding-left: 30px; font-size: 13px; color: var(--text-dim); line-height: 1.5; counter-increment: st; }
.strm-steps li::before {
  content: counter(st);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px;
  border-radius: 2px;
  background: rgba(255, 201, 77, 0.14);
  border: 1px solid rgba(255, 201, 77, 0.4);
  color: var(--accent);
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.strm-steps b { color: var(--text); font-weight: 600; }
.strm-steps code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 2px; color: var(--text); }
details.strm-details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-dim); list-style: none; display: flex; align-items: center; gap: 8px; }
details.strm-details summary::-webkit-details-marker { display: none; }
details.strm-details summary::before { content: '▸'; color: var(--accent); transition: transform 0.15s ease; }
details.strm-details[open] summary::before { transform: rotate(90deg); }
details.strm-details[open] summary { margin-bottom: 10px; }

/* тост */
.strm-toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px;
  border-radius: 3px;
  background: #171c19;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.strm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
