/* WoW Hub — тариф «Стрімер».
   1) Плашки й виділення на публічних сторінках (керує streamer-plan.js).
   2) Розділ «Стрімер» у профілі (керує streamer-profile.js).
   Публічна сторінка /u/нікнейм має власний inline-стиль у class-streamer-profile.php. */

:root {
  --whsp-line: var(--wh-line, #283241);
  --whsp-line-soft: var(--wh-line-soft, #202936);
  --whsp-text: var(--wh-text, #f3f6fa);
  --whsp-muted: var(--wh-muted, #94a0b2);
  --whsp-accent: var(--wh-accent, #f0b429);
  --whsp-accent-soft: var(--wh-accent-soft, #ffd166);
  --whsp-green: var(--wh-green, #35c878);
}

/* ---------- 1. Публічні плашки ---------- */

/* Виділений блок має бути такого самого розміру, як сусідні: міняємо лише кольори.
   Жодних зовнішніх кілець і тіней — контейнер стрічки має overflow-y: hidden
   і лише 4px вертикального запасу, тож усе за межами блока обрізалося б.
   Рамку не потовщуємо, а лише перефарбовуємо — товщина лишається 1px, як у решти. */
.whsp-paid {
  background: var(--whsp-bg, #9146ff) !important;
  color: var(--whsp-fg, #fff) !important;
  border-color: var(--whsp-bg, #9146ff) !important;
}

.whsp-paid .streamer-online-name,
.whsp-paid .wst-name,
.whsp-paid .wst-substats,
.whsp-paid .wst-offline-label {
  color: var(--whsp-fg, #fff) !important;
}

/* Топ M+, канал в ефірі: червона крапка біля ніка і логотип Twitch без фону
   по центру картки. Обидві позначки малює streamer-plan.js. */
.whsp-live-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e91916;
  box-shadow: 0 0 0 3px rgba(233, 25, 22, .22);
  animation: whsp-twitch-blink 2.6s ease-in-out infinite;
}

.whsp-mplus-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0 auto;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: none !important;
  box-shadow: none !important;
  color: var(--whsp-bg, #9146ff) !important;
  line-height: 0;
  text-decoration: none !important;
}

.whsp-mplus-badge svg {
  display: block;
  width: 22px;
  height: 22px;
  animation: whsp-twitch-blink 2.6s ease-in-out infinite;
  transition: transform .15s;
}

/* Середина картки вільна лише на широких екранах — там і центруємо логотип. */
@media (min-width: 900px) {
  .whsp-mplus-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .whsp-mplus-badge svg { width: 36px; height: 36px; }
}

.whsp-mplus-badge:hover svg,
.whsp-mplus-badge:focus-visible svg {
  animation-play-state: paused;
  opacity: 1;
  transform: scale(1.12);
}

.whsp-mplus-badge:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@keyframes whsp-twitch-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  .whsp-mplus-badge svg { animation: none; }
}

.whsp-recommended {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid rgba(145, 70, 255, .4);
  border-radius: 16px;
  background: #151d2e;
  color: #f8fafc;
}

.whsp-recommended h3 { color: inherit !important; }

.whsp-recommended a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  text-decoration: none;
}

.whsp-recommended img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.whsp-recommended[hidden] { display: none !important; }

/* ---------- 2. Розділ «Стрімер» у профілі ---------- */

.whsp-section {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--whsp-line);
  border-radius: 18px;
  background: linear-gradient(145deg, #10151d, #121923);
  color: var(--whsp-text);
}

.whsp-section h1,
.whsp-section h2,
.whsp-section h3 { color: var(--whsp-text) !important; }

.whsp-section h1 { margin: 4px 0 6px; font-size: clamp(24px, 4vw, 34px); line-height: 1.12; }
.whsp-section h2 { margin: 0; font-size: 17px; }
.whsp-section h3 { margin: 0; font-size: 14px; }
.whsp-section p { margin: 0; }

.whsp-head { margin-bottom: 22px; }
.whsp-head p { max-width: 720px; color: var(--whsp-muted); }

/* Статус тарифу */
.whsp-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin: 0 0 18px;
  padding: 20px 22px;
  border: 1px solid var(--whsp-line, #283241);
  border-radius: 16px;
  background: linear-gradient(135deg, #141b26, #171f2c);
  color: var(--whsp-text, #f3f6fa);
}

.whsp-panel.is-active {
  border-color: rgba(53, 200, 120, .38);
  background: linear-gradient(135deg, #101a17, #141d26);
}

.whsp-panel h2 { margin: 6px 0 4px !important; color: var(--whsp-text, #f3f6fa) !important; font-size: 20px; }
.whsp-panel p { margin: 0; color: var(--whsp-muted, #94a0b2); font-size: 14px; }
.whsp-panel-main { min-width: 0; }
.whsp-panel-cta { display: grid; gap: 8px; justify-items: end; }

.whsp-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.whsp-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.whsp-status.is-on { color: var(--whsp-green, #35c878); background: rgba(53, 200, 120, .13); }
.whsp-status.is-off { color: var(--whsp-muted, #94a0b2); background: rgba(148, 160, 178, .12); }

/* Тарифні пакети */
.whsp-packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.whsp-pack {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--whsp-line);
  border-radius: 14px;
  background: #131a24;
  color: var(--whsp-text) !important;
  text-decoration: none !important;
  transition: .15s;
}

.whsp-pack:hover,
.whsp-pack:focus-visible {
  border-color: var(--whsp-accent);
  background: #171f2b;
  transform: translateY(-2px);
}

.whsp-pack b { font-size: 17px; }
.whsp-pack span { color: var(--whsp-muted); font-size: 13px; }
.whsp-pack em { color: var(--whsp-accent); font-size: 12px; font-style: normal; font-weight: 800; }

/* Перелік можливостей. Тема домальовує власні маркери спискам, тож глушимо їх:
   єдиний маркер тут — «✓» з ::before. */
.whsp-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 18px;
  margin: 0 0 22px;
  padding: 0 !important;
  list-style: none !important;
}

.whsp-perks li {
  position: relative;
  margin: 0;
  padding-left: 24px;
  color: var(--whsp-muted);
  font-size: 13.5px;
  line-height: 1.5;
  list-style: none !important;
}

.whsp-perks li::marker { content: ""; }

.whsp-perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--whsp-accent);
  font-weight: 900;
}

/* Повідомлення */
.whsp-note {
  display: block;
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid var(--whsp-line);
  border-left-width: 3px;
  border-radius: 12px;
  background: #131a24;
  color: var(--whsp-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.whsp-note a { color: var(--whsp-accent-soft) !important; }
.whsp-note.is-warn { border-left-color: var(--whsp-accent); }
.whsp-note.is-ok { border-left-color: var(--whsp-green); color: var(--whsp-text); }

/* Форма */
.whsp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
}

.whsp-col { display: grid; align-content: start; gap: 16px; min-width: 0; }

.whsp-card {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--whsp-line-soft);
  border-radius: 16px;
  background: #131a24;
}

.whsp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.whsp-card > p { margin: 0 0 14px; color: var(--whsp-muted); font-size: 13px; line-height: 1.5; }
.whsp-card > p:last-child { margin-bottom: 0; }

.whsp-tag {
  padding: 3px 9px;
  border: 1px solid var(--whsp-line);
  border-radius: 999px;
  color: var(--whsp-muted);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.whsp-tag.is-locked { color: var(--whsp-accent); border-color: rgba(240, 180, 41, .4); background: rgba(240, 180, 41, .08); }

.whsp-card.is-locked { opacity: .62; }
.whsp-card.is-locked :is(input, textarea, select, button) { pointer-events: none; }

/* Поля */
.whsp-field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 13px; font-weight: 700; }
.whsp-field:last-child { margin-bottom: 0; }
.whsp-field small { color: var(--whsp-muted); font-size: 12px; font-weight: 400; }

.whsp-section input[type=text],
.whsp-section input[type=url],
.whsp-section textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #354158;
  border-radius: 10px;
  outline: none;
  background: #0d1219;
  color: var(--whsp-text);
  font: inherit;
  font-weight: 400;
  transition: .15s;
}

.whsp-section input:focus,
.whsp-section textarea:focus {
  border-color: var(--whsp-accent);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, .14);
}

.whsp-section textarea { min-height: 84px; resize: vertical; }

/* Перемикач */
.whsp-switch {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
}

.whsp-switch:last-of-type { margin-bottom: 0; }
.whsp-switch input { position: absolute; width: 0; height: 0; opacity: 0; }

.whsp-switch i {
  position: relative;
  flex: none;
  width: 40px;
  height: 23px;
  margin-top: 1px;
  border: 1px solid var(--whsp-line);
  border-radius: 999px;
  background: #0d1219;
  transition: .15s;
}

.whsp-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--whsp-muted);
  transition: .15s;
}

.whsp-switch input:checked + i { border-color: var(--whsp-accent); background: rgba(240, 180, 41, .18); }
.whsp-switch input:checked + i::after { left: 20px; background: var(--whsp-accent); }
.whsp-switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(240, 180, 41, .2); }
.whsp-switch span { display: grid; gap: 3px; }
.whsp-switch small { color: var(--whsp-muted); font-size: 12px; font-weight: 400; }

/* Адреса публічної сторінки */
.whsp-url {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--whsp-line);
  border-radius: 12px;
  background: #0d1219;
}

.whsp-url code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: none;
  color: var(--whsp-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Посилання-репітер */
.whsp-links { display: grid; gap: 10px; margin-bottom: 12px; }

.whsp-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.6fr) auto;
  gap: 8px;
  align-items: center;
}

/* Кружечок показує, чи розпізнано соцмережу за адресою. */
.whsp-link-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--whsp-line);
  border-radius: 50%;
  background: #0d1219;
  transition: .15s;
}

.whsp-link-dot.is-known { border-color: transparent; box-shadow: 0 0 0 3px rgba(255, 255, 255, .07); }

.whsp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--whsp-line);
  border-radius: 10px;
  background: #0d1219;
  color: var(--whsp-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: .15s;
}

.whsp-icon-btn:hover { color: var(--whsp-text); border-color: #45536b; }
.whsp-icon-btn.is-danger:hover { color: #ef6572; border-color: rgba(239, 101, 114, .5); }

/* Кольори */
.whsp-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.whsp-color { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }

.whsp-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--whsp-line);
  border-radius: 10px;
  background: #0d1219;
}

.whsp-color input[type=color] {
  flex: none;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--whsp-line);
  border-radius: 7px;
  background: none;
  cursor: pointer;
}

.whsp-color input[type=text] {
  border: 0 !important;
  padding: 0 !important;
  background: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  text-transform: uppercase;
}

.whsp-color input[type=text]:focus { box-shadow: none !important; }

/* Пресети */
.whsp-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

.whsp-preset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--whsp-line);
  border-radius: 999px;
  background: #0d1219;
  color: var(--whsp-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
}

.whsp-preset:hover { color: var(--whsp-text); border-color: #45536b; }
.whsp-preset b { display: flex; gap: 3px; }
.whsp-preset b i { width: 11px; height: 11px; border-radius: 50%; }

/* Прев’ю */
.whsp-preview { min-width: 0; }

/* Липкий блок має бути всередині розтягнутої колонки, інакше йому нікуди рухатися. */
.whsp-preview-inner { position: sticky; top: 24px; display: grid; align-content: start; gap: 12px; }

.whsp-preview-box {
  padding: 16px;
  border: 1px solid var(--whsp-line-soft);
  border-radius: 16px;
  background: #131a24;
}

.whsp-preview-box > h3 {
  margin: 0 0 10px !important;
  color: var(--whsp-muted) !important;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.whsp-preview-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--whsp-line);
  border-radius: 10px;
  background: #0d1219;
  line-height: 0;
}

.whsp-preview-badge svg { animation: whsp-twitch-blink 2.6s ease-in-out infinite; }

.whsp-preview-page {
  display: grid;
  gap: 9px;
  padding: 18px 14px;
  border-radius: 14px;
  text-align: center;
}

.whsp-preview-page i { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; background: currentColor; opacity: .3; }
.whsp-preview-page b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whsp-preview-page u { width: 60%; height: 8px; margin: 0 auto 2px; border-radius: 4px; background: currentColor; opacity: .18; }
.whsp-preview-page s { display: block; height: 30px; border-radius: 10px; text-decoration: none; }
.whsp-preview-page s + s { opacity: .28; }

/* Кнопки */
.whsp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.whsp-actions p { color: var(--whsp-muted); font-size: 12.5px; }

.whsp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--whsp-line, #283241);
  border-radius: 11px;
  background: #182030;
  color: var(--whsp-text, #f3f6fa) !important;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
  transition: .15s;
}

.whsp-btn:hover { border-color: #45536b; background: #1d2637; }

.whsp-btn.is-primary {
  border-color: #f4c651;
  background: linear-gradient(135deg, var(--whsp-accent-soft, #ffd166), var(--whsp-accent, #f0b429));
  color: #161109 !important;
  box-shadow: 0 8px 22px rgba(240, 180, 41, .18);
}

.whsp-btn.is-primary:hover { filter: brightness(1.06); }

@media (max-width: 980px) {
  .whsp-layout { grid-template-columns: minmax(0, 1fr); }
  .whsp-preview-inner { position: static; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 600px) {
  .whsp-panel { grid-template-columns: minmax(0, 1fr); }
  .whsp-panel-cta { justify-items: start; }
  .whsp-link { grid-template-columns: auto minmax(0, 1fr) auto; }
  .whsp-link input[type=url] { grid-column: 1 / -1; }
}
