/*
 * Оформление мини-аппа Reelo. Снято с приложения Brandly:
 * workspace/_debug/brandly/app/*.png, палитра — workspace/brandly/palette.json.
 *
 * Без сборки и без зависимостей — как весь сервис бота. Переменные вместо
 * препроцессора: тем две, и обе описываются одним набором значений.
 */

:root {
  --bg: #f1f1f5;
  --card: #ffffff;
  --ink: #16161d;
  --ink-soft: #8a8a96;
  --line: #e6e6ec;
  --dark: #23232e;
  --shadow: 0 2px 10px rgba(20, 20, 35, .06);
  --radius: 22px;
  --radius-pill: 999px;
  /* Градиент кнопки и центральной вкладки: у них оранжевый → розовый → фиолет. */
  --grad: linear-gradient(90deg, #ff9f43 0%, #ff3d8b 50%, #a43cff 100%);
  --nav-h: 78px;
}

[data-theme="dark"] {
  --bg: #14141a;
  --card: #1e1e27;
  --ink: #f2f2f6;
  --ink-soft: #8f8f9d;
  --line: #2c2c38;
  --dark: #f2f2f6;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + 18px);
}

/* ── шапка ────────────────────────────────────────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}
.logo { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
/* Точка в логотипе — их приём: имя, потом акцентная точка. */
.logo span { color: #ff3d8b; }
.top-right { display: flex; gap: 10px; }
.chip-round {
  display: flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 16px;
  background: var(--card); border: none; border-radius: var(--radius-pill);
  color: var(--ink); font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow); cursor: pointer;
}

/* ── экраны ───────────────────────────────────────────────────────────────── */
.screen { display: none; padding: 0 18px; }
.screen.on { display: block; }

h2.section {
  margin: 22px 0 12px;
  font-size: 19px; font-weight: 800; letter-spacing: -.01em;
}
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.link-dashed {
  border: none; background: none; padding: 0;
  color: var(--ink-soft); font-size: 15px; font-family: inherit;
  border-bottom: 1px dashed var(--ink-soft); cursor: pointer;
}

/* ── превью стиля ─────────────────────────────────────────────────────────── */
.preview {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 58vh;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d0d12;
  box-shadow: var(--shadow);
}
.preview video, .preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .play {
  position: absolute; top: 14px; right: 14px;
  width: 52px; height: 52px; border: none; border-radius: 50%;
  background: #fff; color: #16161d; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
/* Пауза показывается той же кнопкой: две палочки поверх треугольника рисовать
   незачем, достаточно поменять фон и убрать иконку в прозрачность. */
.preview .play.paused svg { opacity: .35; }

/* ── ленты чипов ──────────────────────────────────────────────────────────── */
/* Горизонтальная прокрутка, как у них: цвета в одну строку и уезжают за край. */
.chips {
  display: flex; gap: 10px;
  margin: 16px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 9px;
  flex: 0 0 auto;
  height: 52px; padding: 0 24px;
  background: var(--card); border: none; border-radius: var(--radius-pill);
  color: var(--ink); font-size: 17px; font-weight: 600; font-family: inherit;
  box-shadow: var(--shadow); cursor: pointer;
  position: relative;
}
.chip.active { background: var(--dark); color: var(--card); font-weight: 700; }
[data-theme="dark"] .chip.active { color: #14141a; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* ── зона загрузки ────────────────────────────────────────────────────────── */
.drop {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 12px; padding: 22px 20px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: transparent;
}
.drop .title { font-size: 18px; font-weight: 700; }
.drop .sub { color: var(--ink-soft); font-size: 15px; margin-top: 4px; }
.drop .plus {
  width: 60px; height: 60px; flex: 0 0 auto;
  border: none; border-radius: 50%;
  background: var(--dark); color: var(--card);
  font-size: 30px; line-height: 1; cursor: pointer;
}
[data-theme="dark"] .drop .plus { color: #14141a; }
.drop.filled { border-style: solid; border-color: var(--line); background: var(--card); }

/* ── переключатели ────────────────────────────────────────────────────────── */
.toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.toggle:last-child { border-bottom: none; }
.toggle .label { font-size: 17px; flex: 1; }
.toggle .hint {
  width: 26px; height: 26px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 50%;
  background: none; color: var(--ink-soft); font-size: 14px; font-family: inherit;
  cursor: pointer;
}
.badge {
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
/* Тумблер: тот же вид, что у них — светлая дорожка, чёрная во включённом. */
.switch { width: 58px; height: 34px; flex: 0 0 auto; border: none; border-radius: var(--radius-pill);
  background: var(--line); position: relative; cursor: pointer; transition: background .18s; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s;
}
.switch.on { background: var(--dark); }
.switch.on::after { transform: translateX(24px); }

/* ── главная кнопка ───────────────────────────────────────────────────────── */
.cta {
  display: block; width: 100%;
  margin: 22px 0 8px; padding: 18px 20px;
  border: none; border-radius: var(--radius-pill);
  background: var(--grad); color: #fff;
  font-size: 19px; font-weight: 800; font-family: inherit;
  cursor: pointer;
}
.cta[disabled] { opacity: .45; cursor: default; }
.cta .sub { display: block; font-size: 14px; font-weight: 600; opacity: .9; margin-top: 3px; }

/* ── карточки списков ─────────────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px 18px; margin-top: 12px; box-shadow: var(--shadow);
}
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .muted { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.btn-small {
  border: none; border-radius: var(--radius-pill);
  padding: 10px 18px; background: var(--dark); color: var(--card);
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
}
[data-theme="dark"] .btn-small { color: #14141a; }
.empty-note { color: var(--ink-soft); text-align: center; padding: 40px 20px; }

/* ── нижние вкладки ───────────────────────────────────────────────────────── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -2px 18px rgba(20, 20, 35, .08);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav button {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-soft); font-size: 13px; font-family: inherit;
}
.nav button.on { color: var(--ink); font-weight: 700; }
.nav .icon { font-size: 21px; line-height: 1; }
/* Центральная вкладка — круг с градиентом, наезжающий на панель сверху. */
.nav button.center .icon {
  width: 74px; height: 74px; margin-top: -46px;
  border-radius: 50%; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; box-shadow: 0 6px 20px rgba(255, 61, 139, .4);
}

/* ── подсказка ────────────────────────────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(10, 10, 18, .45);
  display: none; align-items: flex-end;
}
.sheet.on { display: flex; }
.sheet .box {
  width: 100%; max-height: 80vh; overflow-y: auto;
  background: var(--card); border-radius: 26px 26px 0 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
}
.sheet h3 { margin: 0 0 12px; font-size: 20px; font-weight: 800; }
.sheet p { margin: 0 0 12px; white-space: pre-line; }
