/* ── Палитра бренда (Herbalife НП), светлая тема «как упаковка» ───────────
   Garden #266431 · Lake #3B9187 · Succulent #E5FFC5 · White #FFFFFF
   Белый фон + тёмно-зелёная типографика + переливающийся халфтон из точек. */
:root {
  --garden:    #266431;
  --lake:      #3b9187;
  --succulent: #e5ffc5;

  --bg:      #ffffff;
  --bg-soft: #f4f8f0;       /* лёгкий зелёно-белый для глубины */
  --surface: #ffffff;
  --line:    #e4ece1;
  --line-strong: #d3e0cf;

  --ink:   #16271c;          /* почти чёрный с зеленцой — основной текст */
  --muted: #5f7568;
  --muted-2: #9bab9f;

  --radius: 18px;
  --radius-sm: 12px;
  --chat-w: 384px;
  --max-w:  1480px;
  --gap:    18px;

  --shadow: 0 22px 50px -28px rgba(20, 50, 28, 0.28);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Onest", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Выделение текста — в фирменной гамме (Succulent + тёмно-зелёный) */
::selection      { background: var(--succulent); color: var(--garden); }
::-moz-selection { background: var(--succulent); color: var(--garden); }

/* Скролл невидим по всему сайту (прокрутка работает) — и на десктопе, и на мобиле */
* { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ── Поле точек (canvas) + мягкая засветка ──────────────────────────────── */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      #ffffff 0%,
      #ffffff 44px,
      rgba(255,255,255,0.78) 74px,
      rgba(255,255,255,0.38) 116px,
      rgba(255,255,255,0.12) 158px,
      rgba(255,255,255,0) 196px),
    radial-gradient(125% 110% at 50% 0%, rgba(255,255,255,0) 55%, rgba(244,248,240,0.9) 100%);
}
.header, .layout { position: relative; z-index: 2; }

/* ── Хедер ──────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 22px 28px 14px;
  flex: 0 0 auto;
}
.header__brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header__status { display: flex; align-items: center; gap: 10px; }

/* Чип «сейчас онлайн» (счётчик присутствия) */
.viewers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--garden);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);  /* мягкий верхний блик */
}
.viewers[hidden] { display: none; }
/* Два варианта текста: десктоп — полный («1404 просмотра»), мобила — короткий («1.4к»). */
.viewers__short { display: none; }
.viewers::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--garden);
  box-shadow: 0 0 0 0 rgba(38, 100, 49, 0.35);
  animation: breathe 2.4s var(--ease) infinite;   /* спокойное «дыхание», не резкий пульс */
}
@keyframes breathe {
  0%, 100% { opacity: .5;  transform: scale(.8);  box-shadow: 0 0 0 0   rgba(38,100,49,0.30); }
  50%      { opacity: 1;   transform: scale(1);   box-shadow: 0 0 0 4px rgba(38,100,49,0.00); }
}
@media (max-width: 560px) {
  .viewers { padding: 8px 11px; }
  .viewers__full { display: none; }
  .viewers__short { display: inline; }
}
.header__logo { height: 30px; width: auto; display: block; }   /* родной зелёный логотип */
.header__logo:not([src]), .header__logo[src=""] { display: none; }
.header__divider { width: 1px; height: 26px; background: var(--line-strong); }
.header__divider:first-child { display: none; }
.header__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Статус-пилюля ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: var(--radius-sm);   /* как у карточек — скруглённый прямоугольник, не «капсула» */
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);  /* мягкий верхний блик (премиум) */
}
/* «Скоро» — точка спокойно «дышит» (ожидание), без резкого моргания */
.pill[data-state="soon"]::before { animation: soon-breathe 2.6s var(--ease) infinite; }
@keyframes soon-breathe {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}
.pill::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted-2);
}
.pill[data-state="replay"] { color: var(--lake); border-color: rgba(59,145,135,0.45); background: rgba(59,145,135,0.08); }
.pill[data-state="replay"]::before { background: var(--lake); }
.pill[data-state="live"] {
  color: #fff;
  border-color: transparent;
  /* мягкий градиент вместо плоской заливки → глубина */
  background: linear-gradient(180deg, #2c6b37 0%, #20532a 100%);
  /* зелёная тень + внутренний верхний блик = премиальный объём */
  box-shadow:
    0 6px 16px -8px rgba(38, 100, 49, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
/* у live точку-маркер заменяет эквалайзер */
.pill[data-state="live"]::before { display: none; }

/* «on air» эквалайзер */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
  margin-right: 1px;
}
.eq i {
  width: 2.5px;
  height: 30%;
  border-radius: 1.5px;
  background: var(--succulent);
  animation: eq-bounce 1s var(--ease) infinite;
}
.eq i:nth-child(1) { animation-delay: 0s;    }
.eq i:nth-child(2) { animation-delay: .28s;  }
.eq i:nth-child(3) { animation-delay: .12s;  }
.eq i:nth-child(4) { animation-delay: .42s;  }
@keyframes eq-bounce {
  0%, 100% { height: 26%; }
  50%      { height: 100%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .eq i, .viewers::before, .pill[data-state="soon"]::before { animation: none; }
  .eq i { height: 64%; }
  .eq i:nth-child(2) { height: 100%; }
  .eq i:nth-child(4) { height: 42%; }
}

/* ── Раскладка ──────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--chat-w);
  gap: var(--gap);
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 8px 28px 40px;
  align-items: stretch;
  flex: 1 1 auto;
  align-content: center;        /* десктоп: блок таймер+чат по центру свободной высоты */
}
.stage, .chat {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateZ(0);          /* форсит подрезку iframe по радиусу (iOS/Safari) */
}
/* рамка — отдельным кольцом поверх: CSS-border всегда идеально скругляется в углах */
.stage::after, .chat::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 4;
}

.stage {
  position: relative;
  width: 100%;
  padding-top: 56.25%;            /* 16:9 */
  overflow: hidden;
}
.stage > iframe,
.stage > .countdown {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* до эфира сцена прозрачная — отсчёт парит над полем точек */
body[data-state="soon"] .stage {
  background: transparent;
  box-shadow: none;
}
body[data-state="soon"] .stage::after { border-color: transparent; }
/* в эфире/записи фон сцены тёмный — чтобы скруглённые углы и letterbox видео
   сливались с чёрным плеером, без белых уголков по периметру */
body:not([data-state="soon"]) .stage { background: #0c0d0c; }
body:not([data-state="soon"]) .stage::after { border-color: rgba(255,255,255,0.10); }

.chat {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat > iframe { flex: 1 1 auto; width: 100%; border: 0; }
.chat__placeholder {
  margin: auto;
  padding: 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.chat__placeholder code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--garden);
  font-size: 13px;
}

/* ── Обратный отсчёт ────────────────────────────────────────────────────── */
.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 24px;
  text-align: center;
  /* мягкая белая «поляна» за отсчётом — цифры читаются над точками */
  background: radial-gradient(54% 44% at 50% 47%,
    rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.6) 42%, rgba(255,255,255,0) 74%);
}
.countdown__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--lake);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.countdown__eyebrow::before,
.countdown__eyebrow::after {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lake));
}
.countdown__eyebrow::after { transform: scaleX(-1); }

.countdown__clock {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 100%;
  gap: clamp(8px, 2.4vw, 32px);
}
.seg { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; }
.seg__num {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 8vw, 86px);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--garden);
}
.seg--secs .seg__num { color: var(--lake); }
.seg__unit {
  font-size: clamp(9px, 1.4vw, 11px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.seg__sep {
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: clamp(22px, 5vw, 60px);
  line-height: 0.9;
  color: var(--muted-2);
  align-self: flex-start;
  margin-top: 0.08em;
}
.countdown__date {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.countdown__date b { color: var(--garden); font-weight: 600; }

/* Сообщение в сцене (режим «В записи», пока запись готовится) — на тёмном фоне */
.stage-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}
.stage-msg__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lake);
}
.stage-msg__text {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 3.2vw, 34px);
  color: #f3f8ee;
}
/* трилистник Herbalife — отдельным логотипом по центру под текстом прощания */
.farewell-mark {
  height: clamp(34px, 4.6vw, 52px);
  width: auto;
  margin-top: clamp(18px, 2.4vw, 28px);
}

/* ── Адаптив ────────────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .header { padding: 16px 16px 10px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 6px 12px 22px; gap: 12px; align-content: start; }
  .chat   { height: 56vh; min-height: 320px; }
  .header__title { display: none; }
  .header__divider { display: none; }
}
@media (max-width: 560px) {
  .countdown { gap: 18px; padding: 14px 6px; width: 100%; }
  .countdown__clock { gap: 3.2vw; max-width: 100%; }
  .seg { gap: 6px; }
  .seg__num { font-size: 6vw; }
  .seg__sep { display: none; }
  .seg__unit { font-size: 7.5px; letter-spacing: 0.06em; }
  .countdown__eyebrow { font-size: 10px; letter-spacing: 0.2em; }
}

/* ── Доступность ────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--garden); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .pill[data-state="live"]::before { animation: none; }
}

/* --- Плавность заставок --------------------------------------------------- */
@keyframes kf-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes kf-fade-out { from { opacity: 1; } to { opacity: 0; } }
.fade-in  { animation: kf-fade-in  .4s var(--ease) both; }
.fade-out { animation: kf-fade-out .4s var(--ease) both; }

/* --- Входная заставка-оверлей --------------------------------------------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(244, 248, 240, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.splash__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 56px;
  width: min(680px, 92vw);
}
.splash__logo { height: 48px; width: auto; }
.splash__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.splash__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.splash__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 3.4vw, 30px);
  color: var(--garden);
  line-height: 1.15;
}
.splash__date { color: var(--muted); font-size: 15px; }
.splash__btn {
  margin-top: 6px;
  padding: 14px 40px;
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  background: var(--garden);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.splash__btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.splash__btn:active { transform: translateY(0); }

/* Закрывающая плашка: единственная строка-сообщение под логотипом. */
.splash__notice {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  max-width: 34ch;
}
/* В состоянии «закрыто» статус-пилюля не нужна (и она за размытым оверлеем). */
body[data-state="closed"] .pill { display: none; }

/* --- Кнопка mute ---------------------------------------------------------- */
