/* ---------- цвета: светлая и тёмная тема ----------
   По умолчанию — как в системе; кнопка в шапке закрепляет выбор (data-theme на <html>). */
:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --panel-2: #efede8;
  --line: #e3e0d9;
  --line-strong: #cfcbc2;
  --text: #1d1c1a;
  --muted: #6e6a64;
  --accent: #a8264a;
  --accent-hover: #8f1f3f;
  --on-accent: #ffffff;
  --accent-soft: rgba(168, 38, 74, .08);
  --ok: #2f7a4d;
  --ok-soft: rgba(47, 122, 77, .1);
  --danger: #b83a3a;
  --danger-soft: rgba(184, 58, 58, .09);
  --warn: #9a6200;
  --shadow: 0 1px 2px rgba(30, 25, 20, .05), 0 1px 1px rgba(30, 25, 20, .03);
  --shadow-lg: 0 12px 32px rgba(30, 25, 20, .12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --topbar-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151517; --panel: #1d1d20; --panel-2: #26262a; --line: #2e2e33; --line-strong: #3d3d44;
    --text: #ececef; --muted: #9b9ba3; --accent: #e06486; --accent-hover: #ea7a98; --on-accent: #1a0a10;
    --accent-soft: rgba(224, 100, 134, .12); --ok: #7cc995; --ok-soft: rgba(124, 201, 149, .12);
    --danger: #f08a8a; --danger-soft: rgba(240, 138, 138, .12); --warn: #e0a64a;
    --shadow: none; --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151517; --panel: #1d1d20; --panel-2: #26262a; --line: #2e2e33; --line-strong: #3d3d44;
  --text: #ececef; --muted: #9b9ba3; --accent: #e06486; --accent-hover: #ea7a98; --on-accent: #1a0a10;
  --accent-soft: rgba(224, 100, 134, .12); --ok: #7cc995; --ok-soft: rgba(124, 201, 149, .12);
  --danger: #f08a8a; --danger-soft: rgba(240, 138, 138, .12); --warn: #e0a64a;
  --shadow: none; --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
}

/* ---------- цвет акцента пары (выбирается в «Мы → Оформление») ----------
   Для каждого цвета — оттенок для светлой и для тёмной темы. «rose» — стандартный, правил не нужно. */
:root[data-accent="coral"] { --accent: #b4472c; --accent-hover: #983a23; --accent-soft: rgba(180, 71, 44, .09); }
:root[data-accent="amber"] { --accent: #9a6200; --accent-hover: #7f5100; --accent-soft: rgba(154, 98, 0, .1); }
:root[data-accent="green"] { --accent: #2f7a4d; --accent-hover: #25633e; --accent-soft: rgba(47, 122, 77, .1); }
:root[data-accent="teal"] { --accent: #12766f; --accent-hover: #0d5f59; --accent-soft: rgba(18, 118, 111, .1); }
:root[data-accent="blue"] { --accent: #2958b8; --accent-hover: #21479a; --accent-soft: rgba(41, 88, 184, .09); }
:root[data-accent="violet"] { --accent: #6b3fb5; --accent-hover: #583398; --accent-soft: rgba(107, 63, 181, .09); }
:root[data-accent="graphite"] { --accent: #3d3d44; --accent-hover: #2a2a30; --accent-soft: rgba(61, 61, 68, .09); }
@media (prefers-color-scheme: dark) {
  :root[data-accent="coral"]:not([data-theme="light"]) { --accent: #ef8466; --accent-hover: #f49a80; --accent-soft: rgba(239, 132, 102, .13); }
  :root[data-accent="amber"]:not([data-theme="light"]) { --accent: #e0a64a; --accent-hover: #e9b867; --accent-soft: rgba(224, 166, 74, .13); }
  :root[data-accent="green"]:not([data-theme="light"]) { --accent: #6fc58d; --accent-hover: #88d2a1; --accent-soft: rgba(111, 197, 141, .13); }
  :root[data-accent="teal"]:not([data-theme="light"]) { --accent: #4fc2b7; --accent-hover: #6dcfc6; --accent-soft: rgba(79, 194, 183, .13); }
  :root[data-accent="blue"]:not([data-theme="light"]) { --accent: #7aa2f2; --accent-hover: #93b4f5; --accent-soft: rgba(122, 162, 242, .13); }
  :root[data-accent="violet"]:not([data-theme="light"]) { --accent: #a98bf0; --accent-hover: #bba2f4; --accent-soft: rgba(169, 139, 240, .13); }
  :root[data-accent="graphite"]:not([data-theme="light"]) { --accent: #c9c9d1; --accent-hover: #dcdce2; --accent-soft: rgba(201, 201, 209, .12); }
}
:root[data-theme="dark"][data-accent="coral"] { --accent: #ef8466; --accent-hover: #f49a80; --accent-soft: rgba(239, 132, 102, .13); }
:root[data-theme="dark"][data-accent="amber"] { --accent: #e0a64a; --accent-hover: #e9b867; --accent-soft: rgba(224, 166, 74, .13); }
:root[data-theme="dark"][data-accent="green"] { --accent: #6fc58d; --accent-hover: #88d2a1; --accent-soft: rgba(111, 197, 141, .13); }
:root[data-theme="dark"][data-accent="teal"] { --accent: #4fc2b7; --accent-hover: #6dcfc6; --accent-soft: rgba(79, 194, 183, .13); }
:root[data-theme="dark"][data-accent="blue"] { --accent: #7aa2f2; --accent-hover: #93b4f5; --accent-soft: rgba(122, 162, 242, .13); }
:root[data-theme="dark"][data-accent="violet"] { --accent: #a98bf0; --accent-hover: #bba2f4; --accent-soft: rgba(169, 139, 240, .13); }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #c9c9d1; --accent-hover: #dcdce2; --accent-soft: rgba(201, 201, 209, .12); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1 { margin: 0; font-weight: 650; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.ico.fill { fill: currentColor; stroke: none; }

/* верхняя панель: логотип, вкладки разделов, тема, выход */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 max(20px, calc((100vw - 1100px) / 2));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); }
.brand-mark svg.ico { width: 16px; height: 16px; stroke-width: 2.2; }
.tabs { display: flex; gap: 2px; margin: 0 auto; }
.tabs a {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14.5px; transition: color .15s, background .15s;
}
.tabs a:hover { color: var(--text); background: var(--panel-2); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--panel-2); font-weight: 600; }
.tabs a[aria-current="page"] .tab-ico { color: var(--accent); }
.tab-ico { display: inline-flex; }
.icon-btn {
  display: inline-grid; place-items: center; padding: 0;
  font: inherit; font-size: 16px; color: var(--muted); background: none; cursor: pointer; flex: none;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; transition: .15s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small svg.ico { width: 16px; height: 16px; }
body.guest .topbar, body.guest main { display: none; }

/* раздел: заголовок, кнопки, содержимое */
.panel { display: grid; gap: 20px; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-top: 32px; }
.panel-head .eyebrow { margin: 0 0 4px; }
.stats { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters:empty, .filters[hidden] { display: none; }
.empty-state {
  display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--muted);
  padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: 14px;
}
.empty-state p { margin: 0; max-width: 420px; }
.empty-emoji { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--panel-2); color: var(--muted); }
.empty-emoji svg.ico { width: 22px; height: 22px; }

/* плитки открыток и приглашений */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tiles:empty { display: none; }
.tile {
  display: grid; grid-template-rows: auto 1fr auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: border-color .15s;
}
.tile:hover { border-color: var(--line-strong); }
.tile-cover { position: relative; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.tile-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover .play-badge, .tile-cover:focus-visible .play-badge { opacity: 1; }
.tile-body { padding: 14px 16px 4px; display: grid; gap: 4px; align-content: start; }
.tile-body h3 { margin: 0; font-weight: 600; font-size: 17px; line-height: 1.3; }
.tile-body .meta { margin: 0; }
.tile-quote { margin: 4px 0 0; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-actions { display: flex; gap: 8px; align-items: center; padding: 12px 16px 14px; }
.tile-actions .icon-btn { margin-left: auto; }
.invite-tile { grid-template-rows: 1fr auto; }
.invite-tile .tile-body { padding-top: 16px; }
.badge { justify-self: start; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.badge.yes { background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--danger-soft); color: var(--danger); }

/* ---------- «Мы» ---------- */
.us-strip { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 24px; margin-bottom: -8px; }
.us-chip {
  color: var(--text); text-decoration: none; font-size: 13.5px; white-space: nowrap;
  padding: 6px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); transition: border-color .15s;
}
.us-chip b { font-weight: 600; }
.us-chip:hover { border-color: var(--line-strong); }
.us-chip.add { color: var(--muted); border-style: dashed; white-space: normal; }
.us-chip.cta { color: var(--accent); border-color: var(--accent); }
.us-view { display: grid; gap: 16px; padding-top: 32px; }
.us-hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 12px 0 8px; }
.us-names { font-size: clamp(24px, 4vw, 30px); }
/* Фото пары. На компьютере — слева целиком, без обрезки (своя пропорция), а имена и счётчик — справа.
   На телефоне — сверху на всю ширину. */
.us-photo { display: block; width: 100%; height: auto; max-height: 380px; object-fit: contain; border-radius: 16px;
  border: 1px solid var(--line); background: var(--panel); }
.us-hero-text { display: grid; justify-items: center; gap: 8px; }
@media (min-width: 721px) {
  .us-hero.with-photo { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); column-gap: 40px; align-items: center;
    justify-items: stretch; text-align: left; }
  .us-hero.with-photo .us-photo { justify-self: stretch; }
  .us-hero.with-photo .us-hero-text { justify-items: start; }
  .us-hero.with-photo .us-hero-actions { justify-content: flex-start; }
}
@media (max-width: 720px) { .us-photo { aspect-ratio: 4 / 3; object-fit: cover; max-height: none; margin-bottom: 6px; } }
.us-style { display: grid; gap: 12px; }
.us-style .hint { margin: 0; }
.us-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.us-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--panel); background: var(--sw); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); padding: 0; transition: box-shadow .15s; }
.us-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--text); }
.us-style-photo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.us-style-photo label.btn { cursor: pointer; }
.us-counter { display: flex; align-items: baseline; gap: 10px; }
.us-big { font-weight: 650; font-size: clamp(56px, 12vw, 96px); line-height: 1; letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.us-big-label { font-size: 18px; color: var(--muted); }
.us-hero .hint { margin: 0; }
.us-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.us-card { display: grid; gap: 12px; align-content: start; justify-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.us-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.us-card h3 svg.ico { width: 16px; height: 16px; }
.us-card .meta, .us-card .hint { margin: 0; }
.us-countdown { display: flex; gap: 8px; }
.cd { display: grid; justify-items: center; min-width: 58px; padding: 8px 6px; border-radius: 10px; background: var(--panel-2); }
.cd b { font-weight: 600; font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd small { color: var(--muted); font-size: 12px; }
.us-clocks { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.us-clock { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.us-clock-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-clock b { font-weight: 600; font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.us-dates { justify-items: stretch; }
.us-date-list { display: grid; gap: 2px; }
.us-date { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.us-date:hover { background: var(--panel-2); }
.us-date.soon .us-date-left { color: var(--accent); font-weight: 600; }
.us-date.past { opacity: .5; }
.us-date-emoji { font-size: 20px; width: 28px; text-align: center; }
.us-date-body { flex: 1; min-width: 0; display: grid; }
.us-date-left { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.us-date .icon-btn { width: 28px; height: 28px; }
.us-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.us-add input:not([type="checkbox"]) { flex: 1 1 160px; width: auto; }
.us-add select { width: auto; }
.us-dlg form { padding: 24px; display: grid; gap: 16px; }
.city-field { display: grid; gap: 6px; }
.city-results { display: grid; gap: 4px; }
.city-results:empty { display: none; }
.city-opt { font: inherit; font-size: 14px; text-align: left; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.city-opt:hover { border-color: var(--accent); }
@media (max-width: 720px) {
  .tabs a { padding: 6px 6px; }
  /* на телефоне — одна строка, листается вбок */
  .us-strip { padding: 16px 20px 2px; margin: 0 -20px -8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .us-strip::-webkit-scrollbar { display: none; }
  .us-chip.add { white-space: nowrap; }
  .cd { min-width: 0; flex: 1; }
  .cd b { font-size: 24px; }
}

/* всплывающее уведомление */
.toast {
  /* по центру без transform: анимация появления (rise) меняет transform и раньше сдвигала уведомление вправо */
  position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: 24px; z-index: 80;
  max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 14px; line-height: 1.45;
  box-shadow: var(--shadow-lg); animation: rise .2s both;
}
.toast.out { opacity: 0; transition: opacity .3s; }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-action { font: inherit; font-weight: 600; color: var(--bg); background: none; border: 1px solid currentColor; border-radius: 8px;
  padding: 5px 10px; cursor: pointer; white-space: nowrap; flex: none; }

/* узкий компьютер или планшет: от логотипа остаётся значок, чтобы вкладки поместились */
@media (min-width: 721px) and (max-width: 1000px) {
  .brand > span:last-child { display: none; }
  .topbar { gap: 4px; }
}

/* телефон: вкладки уезжают вниз, как в приложении */
@media (max-width: 720px) {
  :root { --topbar-h: 54px; }
  .topbar { padding: 0 max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .brand { margin-right: auto; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line);
  }
  .tabs a { flex-direction: column; gap: 3px; padding: 5px 4px; font-size: 11px; border-radius: 8px; min-width: 52px; }
  .tabs a[aria-current="page"] { background: none; color: var(--accent); }
  .tab-ico svg.ico { width: 21px; height: 21px; }
  main { overflow-x: clip; } /* уезжающий при свайпе раздел не даёт горизонтальной прокрутки */
  /* на iPhone под меню остаётся «безопасная зона» (плавающая панель Safari, полоска жестов) — учитываем её */
  main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .panel-head { padding-top: 22px; }
  .panel-actions { width: 100%; }
  .panel-actions .btn { flex: 1; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text); cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--panel);
  padding: 9px 16px; border-radius: 9px; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--panel-2); }
.btn:focus-visible, .card:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .icon-btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.small { padding: 6px 12px; font-size: 13.5px; }
.btn.small svg.ico { width: 15px; height: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.clip-helper { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; } /* скрытое поле для копирования ссылок */
/* кнопка ждёт сервер: крутилка слева от текста */
.btn.busy { cursor: progress; opacity: .85; }
.btn.busy::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }

.card {
  position: relative; border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow);
  border: 1px solid var(--line); cursor: pointer; text-align: left; padding: 0; color: inherit; font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; }
/* заглушки ленты, пока грузятся моменты */
.card.skel { cursor: default; box-shadow: none; }
.card.skel .cover { background: var(--panel-2); animation: skel 1.2s ease-in-out infinite; }
.card.skel .card-body { display: grid; gap: 8px; }
.card.skel .card-body i { display: block; height: 11px; width: 40%; border-radius: 6px; background: var(--panel-2); animation: skel 1.2s ease-in-out infinite; }
.card.skel .card-body i + i { height: 14px; width: 75%; }
@media (prefers-reduced-motion: reduce) { .card.skel .cover, .card.skel .card-body i { animation: none; } }
.cover img, .cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .big-emoji { font-size: 44px; }
.cover:has(img, video)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent 40%); }
.play-badge {
  position: absolute; z-index: 2; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); color: #1d1c1a; display: grid; place-items: center; padding-left: 2px;
  opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.play-badge svg.ico { width: 14px; height: 14px; }
.card:hover .play-badge, .card:focus-visible .play-badge { opacity: 1; }
.count { position: absolute; z-index: 2; left: 12px; bottom: 12px; font-size: 12px; color: #fff; }
.cover:not(:has(img, video)) .count { color: var(--muted); }
.card-body { padding: 12px 14px 14px; }
.meta { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.card h3 { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.3; }
.card-tools { position: absolute; z-index: 3; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: .15s; }
.card:hover .card-tools, .card:focus-within .card-tools { opacity: 1; }
.tool {
  display: inline-grid; place-items: center; padding: 0;
  width: 32px; height: 32px; border-radius: 8px; border: 0; cursor: pointer; font-size: 13px;
  background: rgba(20, 20, 22, .72); color: #fff;
}
.tool svg.ico { width: 15px; height: 15px; }
.tool:hover { background: var(--accent); color: var(--on-accent); }
@media (hover: none) { .card-tools, .play-badge { opacity: 1; } }

/* обложки без картинки — спокойный оттенок категории */
.g-movie { --c: #c2456b; } .g-game { --c: #3f9a5c; } .g-call { --c: #4f74c9; } .g-music { --c: #b8528e; }
.g-gift { --c: #c98632; } .g-meet { --c: #a8264a; } .g-other { --c: #7a6ac6; }
[class*="g-"]:is(.cover, .tile-cover) { background: color-mix(in srgb, var(--c) 14%, var(--panel-2)); }

/* формы */
.dlg {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0;
}
.dlg::backdrop { background: rgba(10, 10, 12, .45); }
.dlg form { padding: 24px; display: grid; gap: 16px; }
.dlg h2 { margin: 0; font-weight: 650; font-size: 21px; letter-spacing: -.01em; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 9px 12px; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
legend { color: var(--muted); font-size: 13px; font-weight: 500; padding: 0 6px; }
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.media-list:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 6px; border: 0; cursor: pointer;
  display: grid; place-items: center; padding: 0; background: rgba(20, 20, 22, .75); color: #fff; font-size: 12px;
}
.thumb button svg.ico { width: 13px; height: 13px; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; font-size: 10px; color: #fff; background: rgba(20, 20, 22, .75); padding: 2px 6px; border-radius: 5px; }
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search { display: grid; gap: 10px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 230px; overflow: auto; }
.search-res:empty { display: none; }
.search-res button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--panel-2); }
.search-res button:hover { border-color: var(--accent); }
.search-res img { width: 100%; height: 100%; object-fit: cover; display: block; }
.paste-tip { font-size: 13px; line-height: 1.5; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.paste-tip strong { color: var(--text); font-weight: 600; }
.paste-tip a { color: var(--accent); }
kbd { font: inherit; font-size: 12px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 5px; background: var(--panel); color: var(--text); }
.dlg.drop { outline: 2px dashed var(--accent); outline-offset: -8px; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hint a { color: var(--accent); }
.hint code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.state { color: var(--ok); }
.hint { margin: 0; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.err { margin: 0; color: var(--danger); font-size: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* окно момента: кнопки прилипают к низу — на телефоне до «Сохранить» не надо листать */
#formDlg .dlg-actions {
  position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap;
  margin: 0 -24px -24px; padding: 14px 24px max(14px, env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line);
}
#momentUploadProgress { width: 100%; accent-color: var(--accent); }
@media (max-width: 480px) {
  #formDlg .dlg-actions { margin: 0 -18px -18px; padding-left: 18px; padding-right: 18px; }
  #formDlg .dlg-actions .btn { flex: 1; }
}
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } .dlg form { padding: 18px; } }

/* плеер — всегда тёмный, это «кино» */
.player { position: fixed; inset: 0; z-index: 50; background: #000; color: #f2f2f2; overflow: hidden; }
.bars { position: absolute; z-index: 5; top: 12px; left: 12px; right: 56px; display: flex; gap: 4px; }
.bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: #fff; }
.p-close {
  position: absolute; z-index: 6; top: 6px; right: 10px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; padding: 0;
  border: 0; background: rgba(0, 0, 0, .4); color: #fff; font-size: 18px; cursor: pointer;
}
.nav { position: absolute; z-index: 4; top: 60px; bottom: 0; width: 30%; border: 0; background: transparent; cursor: pointer; }
.nav.prev { left: 0; } .nav.next { right: 0; width: 70%; }
.p-hint { position: absolute; z-index: 5; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .45); pointer-events: none; }
@media (hover: none) { .p-hint { display: none; } }
.player.paused .bars::after { content: "пауза"; position: absolute; top: 14px; left: 0; font-size: 12px; color: rgba(255, 255, 255, .7); letter-spacing: .1em; }

.stage { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; display: grid; place-items: center; animation: fadeIn .7s both; overflow: hidden; }
.slide.out { animation: fadeOut .6s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.slide .backdrop {
  position: absolute; inset: -60px; background-size: cover; background-position: center;
  filter: blur(40px) brightness(.4); animation: drift 9s ease-out both;
}
/* кадр целиком помещается в рамку и никогда не обрезается */
.slide .frame { position: absolute; inset: 44px 5vw 40px; display: flex; align-items: center; justify-content: center; }
.slide .shot {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); background: #000;
}
.slide img.shot { animation: kenburns 8s ease-out both; }
@keyframes kenburns { from { transform: scale(.98); opacity: 0; } 12% { opacity: 1; } to { transform: scale(1.02); opacity: 1; } }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.1); } }
.p-hint { animation: hintOut 1s 4s forwards; }
@keyframes hintOut { to { opacity: 0; } }
.caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 24px 44px; text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent); font-size: clamp(16px, 2.4vw, 22px);
  animation: rise .8s .3s both;
}

/* текстовые слайды: тёмный фон с лёгким оттенком категории */
.c-movie { --c: #c2456b; } .c-game { --c: #3f9a5c; } .c-call { --c: #4f74c9; } .c-music { --c: #b8528e; }
.c-gift { --c: #c98632; } .c-meet { --c: #c43a62; } .c-other { --c: #7a6ac6; }
.slide.text { padding: 32px; text-align: center; background: color-mix(in srgb, var(--c) 10%, #111113); }
.slide .shade { position: absolute; inset: 0; background: rgba(12, 12, 14, .7); }
.slide.text .date { color: color-mix(in srgb, var(--c) 45%, #fff); }

/* во время записи видео прячем всё служебное */
.player.rec { cursor: none; }
.player.rec .bars, .player.rec .p-close, .player.rec .p-hint, .player.rec .p-vol { display: none; }
.p-mute { right: 58px; font-size: 16px; }
/* полоски прогресса — во всю ширину сверху, кнопки и громкость — строкой под ними, не налезая */
.bars { right: 12px; }
.p-close { top: 24px; }
.nav { top: 72px; }
.music { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.music-name { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.music-name.none { color: var(--muted); }
.music-search { flex-basis: 100%; display: grid; gap: 10px; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-btn { font: inherit; font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; cursor: pointer; }
.tag-btn:hover { color: var(--text); border-color: var(--line-strong); }
.tracks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: 240px; overflow: hidden auto; }
.track > .btn { flex: none; }
.vol-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.vol-row input[type=range] { flex: 1; max-width: 220px; }
.vol-pct { min-width: 3.2em; font-size: 12px; font-variant-numeric: tabular-nums; }
/* Ползунок громкости: залитая часть = уровень (--p ставит JS) */
input.vol { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; --fill: var(--accent); --rest: var(--line);
  border: 0; border-radius: 0; padding: 0; box-shadow: none; } /* без рамки и отступов обычных полей ввода — только тонкая линия */
input.vol::-webkit-slider-runnable-track { height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--fill) var(--p, 35%), var(--rest) var(--p, 35%)); }
input.vol::-moz-range-track { height: 4px; border-radius: 4px; background: var(--rest); }
input.vol::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--fill); }
input.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--fill); border: 0; }
input.vol::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--fill); border: 0; }
.p-vol { position: absolute; z-index: 6; top: 24px; right: 106px; height: 40px; padding: 0 12px; border-radius: 20px;
  display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .4); color: #fff; }
.p-vol input.vol { width: 90px; --fill: #fff; --rest: rgba(255, 255, 255, .3); }
.p-vol .vol-pct { color: rgba(255, 255, 255, .85); }
.p-vol[hidden] { display: none; }
@media (max-width: 520px) { .p-vol input.vol { width: 64px; } }
/* Кусок трека: «Начало ▶ ——o—— 0:42 / 3:10» */
.music-start { flex-basis: 100%; display: flex; align-items: center; gap: 10px; min-width: 0; }
.music-start[hidden] { display: none; }
.music-start-l { font-size: 13px; color: var(--muted); }
.music-start input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); border: 0; padding: 0; background: transparent; }
.music-start-t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.music-start .tool { flex: none; position: static; background: var(--panel-2); color: var(--text); }
.tracks:empty { display: none; }
.track { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 9px; padding: 6px 8px; }
.track .tool { flex: none; position: static; background: var(--panel); color: var(--text); }
.track .tool:hover { background: var(--accent); color: var(--on-accent); }
.track-name { flex: 1; min-width: 0; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-dur { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* открытки */
.cards-wrap { margin-bottom: 26px; }
.section-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.chip a { color: var(--text); text-decoration: none; padding: 7px 6px 7px 12px; font-size: 14px; }
.chip a:hover { color: var(--accent); }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 7px 10px 7px 6px; }
.chip button:hover { color: var(--accent); }
.picks { display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.pick { display: flex; grid-template-columns: none; align-items: center; gap: 10px; color: var(--text); font-size: 14px; font-weight: 400; cursor: pointer; }
.pick input { width: 17px; height: 17px; flex: none; padding: 0; accent-color: var(--accent); }

/* страницы по ссылке: открытка, вход */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; overflow: auto; background: var(--bg); }
.cover-card { text-align: center; max-width: 520px; display: grid; gap: 14px; justify-items: center; animation: rise .4s both; }
.cover-emoji { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.cover-emoji svg.ico { width: 28px; height: 28px; stroke-width: 1.6; }
.cover-card h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 6vw, 42px); line-height: 1.15; letter-spacing: -.01em; }
.cover-from { margin: 0; color: var(--muted); font-size: 15px; min-height: 1em; }
.btn.big { padding: 12px 30px; font-size: 16px; margin-top: 6px; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.overlay .hint { min-height: 2.6em; max-width: 420px; }
.cover-back { color: var(--muted); font-size: 13px; }
/* «← К открыткам»: заметная кнопка в левом верхнем углу страницы открытки */
.back-btn { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; gap: 6px; text-decoration: none; }
.back-btn svg.ico { width: 18px; height: 18px; }
@media (max-width: 520px) { .overlay:has(.back-btn) { padding-top: 72px; } }
body.guest .back-btn { display: none; }
body.guest .cover-back { display: none; } /* гостю по ссылке незачем идти на закрытую главную */
.overlay.login { z-index: 60; }
.login .cover-card { width: min(360px, 100%); gap: 10px; }
.login .cover-card h2 { font-family: var(--sans); font-weight: 650; font-size: 26px; letter-spacing: -.02em; }
.login .hint { min-height: 0; font-size: 14px; margin-bottom: 6px; }
.login .btn.big { width: 100%; }
.login-switch { font-size: 14px; margin-top: 4px; }
.login-switch[hidden] { display: none; }

/* пара: приглашение партнёра */
.us-pair { margin-bottom: 16px; margin-top: 16px; }
.us-pair.invite { border-color: var(--accent); }
.us-pair p { margin: 0; }
.us-card .tile-actions { padding: 0; flex-wrap: wrap; }
.us-code { display: flex; align-items: baseline; gap: 10px; }
.us-code b { font-size: 22px; font-weight: 600; letter-spacing: .14em; font-family: ui-monospace, Consolas, monospace; }

/* «Для тебя»: присланное партнёром */
.inbox { margin-bottom: 8px; }
.inbox-title { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--muted); }
.inbox-list { display: grid; gap: 8px; }
.inbox-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.inbox-item:hover { border-color: var(--line-strong); }
.inbox-item.fresh { border-color: var(--accent); }
.inbox-emoji { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.inbox-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.inbox-body b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-body small { margin: 0; }

/* приглашения: конструктор */
.chip-btn { font: inherit; font-size: 14px; color: var(--text); padding: 8px 14px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); }
.q-list { display: grid; gap: 6px; }
.q-list:empty { display: none; }
.q-item { display: flex; align-items: flex-start; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 9px 10px 9px 12px; }
.q-text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 14px; font-weight: 400; color: var(--text); }
.q-text strong { font-weight: 600; }
.q-item .tool { position: static; flex: none; width: 28px; height: 28px; background: var(--panel); color: var(--muted); }
.q-item .tool:hover { color: var(--on-accent); }
.q-add { display: grid; gap: 8px; }
.q-add select { width: auto; flex: none; }
.dlg-body { padding: 24px; display: grid; gap: 14px; }
.dlg-actions.wrap { flex-wrap: wrap; }

/* колокольчик: новое от партнёра */
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; }
.bell-dlg { width: min(460px, calc(100vw - 24px)); }
.bell-dlg .dlg-body { padding: 16px 18px 18px; display: grid; gap: 12px; }
.bell-head { display: flex; align-items: center; gap: 10px; }
.bell-head h2 { margin: 0; font-size: 18px; flex: 1; }
.bell-sep { margin: 6px 0 0; font-size: 12.5px; }
.today-item.seen { opacity: .6; }
.today-list { display: grid; gap: 6px; max-height: 65vh; overflow: auto; }
.today-item, .today-idea { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.today-item { cursor: pointer; }
.today-item:hover { border-color: var(--line-strong); }
.today-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--panel-2); color: var(--accent); flex: none; }
.today-ico svg.ico { width: 17px; height: 17px; }
.today-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.today-text b { font-weight: 600; font-size: 14.5px; }
.today-text .hint { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
/* желания */
.us-wish, .us-stats { display: grid; gap: 10px; align-content: start; }
.us-wish .hint { margin: 0; }
.us-wish > .link { justify-self: start; font-size: 13.5px; }
.us-wish .wish-list { max-height: none; }
.us-wish .wish-list, .us-wish .wish-quick, .us-wish .wish-partner { justify-self: stretch; width: 100%; }
.wish-quick input { min-width: 0; }
.wish-partner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
/* форма правки желания — в две строки (у .wish-item свой flex, поэтому селектор посильнее) */
.wish-item.wish-edit { display: grid; gap: 8px; align-items: stretch; width: 100%; justify-self: stretch; }
.wish-item.wish-edit input { width: 100%; min-width: 0; }
.wish-item.wish-edit .row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
.wish-item.wish-edit .wish-actions { justify-content: flex-end; width: auto; }
@media (max-width: 480px) { .wish-item.wish-edit .row { grid-template-columns: 1fr; } }
.wish-dlg { width: min(560px, calc(100vw - 24px)); }
.wish-body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.wish-body > .seg { justify-self: start; }
.wish-form { display: grid; gap: 8px; }
.wish-form .row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.wish-form .btn { justify-self: start; }
.wish-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.wish-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.wish-item.done { opacity: .6; }
.wish-text { display: grid; gap: 2px; min-width: 0; }
.wish-text a { color: var(--text); font-weight: 600; text-decoration-color: var(--line-strong); overflow-wrap: anywhere; }
.wish-text .hint { margin: 0; font-size: 12.5px; }
.wish-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.wish-item .tool { background: none; color: var(--muted); }
.wish-item .tool:hover { background: var(--panel-2); color: var(--text); }
@media (max-width: 480px) { .wish-item { flex-wrap: wrap; } .wish-actions { width: 100%; justify-content: flex-start; } }

/* аккаунт */
.us-account { display: grid; gap: 10px; }
.us-account .hint, .us-account .err { margin: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-form { display: grid; gap: 8px; max-width: 360px; }

/* статистика пары */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; justify-self: stretch; width: 100%; }
@media (max-width: 480px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-cell { display: grid; gap: 1px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.stat-cell b { font-size: 20px; font-weight: 650; }
.stat-cell span { font-size: 12.5px; color: var(--muted); }
.us-stats .hint { margin: 0; }

/* «Скучаю»: кнопка и летящие сердечки */
.miss-btn svg.ico, .miss-chip svg.ico { color: var(--accent); width: 15px; height: 15px; }
.us-chip.miss-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; cursor: pointer; }
.us-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.us-chip.date-chip { display: inline-flex; align-items: center; gap: 4px; }
.us-chip.date-chip svg.ico { width: 14px; height: 14px; color: var(--accent); }
.us-chip.date-chip.soon { border-color: var(--accent); background: var(--accent-soft); }
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
/* пасхалка в логотипе: фото пары всплывает кружком по центру и тает */
.egg-photo { position: fixed; z-index: 91; left: 50%; top: 42%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
  overflow: hidden; pointer-events: none; box-shadow: 0 0 0 4px var(--accent), 0 18px 50px rgba(0, 0, 0, .35); animation: egg-pop 2.6s ease both; }
.egg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes egg-pop { 0% { opacity: 0; transform: scale(.3); } 15% { opacity: 1; transform: scale(1.08); } 25% { transform: scale(1); }
  80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.9) translateY(-20px); } }
@media (prefers-reduced-motion: reduce) { .egg-photo { animation-duration: 1.5s; } }
.heart-fly { position: absolute; bottom: -40px; color: var(--accent); transform: scale(var(--s));
  animation: heart-up 2.6s cubic-bezier(.2, .7, .3, 1) var(--d) both; }
.heart-fly svg.ico { width: 30px; height: 30px; }
@keyframes heart-up {
  0% { opacity: 0; transform: translate(0, 0) scale(var(--s)); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), -85vh) scale(var(--s)) rotate(12deg); }
}
@media (max-width: 420px) { .brand > span:last-child { display: none; } } /* на узком телефоне в шапке остаётся значок — место для колокольчика */

/* идеи */
.ideas { display: grid; gap: 22px; }
.idea-modes .seg { display: flex; width: fit-content; max-width: 100%; }
.idea-modes .seg button { font-size: 15px; padding: 8px 16px; }
@media (max-width: 480px) { .idea-modes .seg { width: 100%; } .idea-modes .seg button { flex: 1; padding: 8px 6px; font-size: 14px; } }
.idea-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.idea-side { display: grid; gap: 16px; }
.idea-filters { display: grid; gap: 16px; }
.idea-filters-toggle { display: none; justify-content: space-between; width: 100%; }
.idea-filters-arrow { color: var(--muted); }
.idea-side .hint { margin: 0; }
.idea-main { display: grid; gap: 12px; position: sticky; top: calc(var(--topbar-h, 60px) + 16px); }
.idea-card {
  min-height: 260px; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 26px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
}
.idea-card.empty { align-items: center; text-align: center; color: var(--muted); }
.idea-card.empty .hint { margin: 0; }
.idea-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--panel-2); color: var(--accent); }
.idea-ico svg.ico { width: 26px; height: 26px; }
.idea-eyebrow { margin: 0; font-size: 13px; color: var(--muted); }
.idea-title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
.idea-card.rolling .idea-title { color: var(--muted); }
.idea-tip { margin: 0; font-size: 14.5px; color: var(--text); background: var(--panel-2); border-radius: 9px; padding: 10px 12px; }
.idea-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.idea-actions .btn { text-decoration: none; }
.idea-saved { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.idea-saved svg.ico { color: var(--accent); width: 16px; height: 16px; }
.idea-spin { width: 100%; }
.idea-foot { margin: 2px 0 0; font-size: 12.5px; }
.idea-years { display: flex; align-items: center; gap: 8px; }
.idea-years .hint { margin: 0; }
.idea-year { width: 92px; padding: 7px 10px; font-size: 14px; }
.idea-year::-webkit-inner-spin-button { opacity: .4; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.idea-chips .chip { font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.idea-chips .chip:hover { color: var(--text); border-color: var(--line-strong); }
.idea-chips .chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.idea-extra:empty, .idea-card .hint[role="status"]:empty { display: none; }
.idea-movie { display: flex; gap: 14px; align-items: flex-start; }
.idea-movie img { width: 96px; border-radius: 8px; flex: none; }
.idea-movie.wide img { width: 150px; aspect-ratio: 3 / 2; object-fit: cover; }
.idea-movie.loading { align-items: stretch; }
.idea-skel { width: 96px; height: 140px; border-radius: 8px; background: var(--panel-2); flex: none; animation: skel 1.2s ease-in-out infinite; }
.idea-skel-lines { flex: 1; display: grid; gap: 8px; align-content: start; }
.idea-skel-lines span { height: 12px; border-radius: 6px; background: var(--panel-2); animation: skel 1.2s ease-in-out infinite; }
.idea-skel-lines span:nth-child(2) { width: 85%; }
.idea-skel-lines span:nth-child(3) { width: 60%; }
@keyframes skel { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .idea-skel, .idea-skel-lines span { animation: none; } }
.idea-movie .meta { margin: 0 0 6px; }
.idea-overview { margin: 0 0 6px; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.small-link { font-size: 13px; }
.idea-list { border-top: 1px solid var(--line); padding-top: 20px; }
.idea-list > .hint { margin: -4px 0 0; }
.idea-add { max-width: 560px; }
/* подсказки при вводе названия фильма или игры */
.idea-add-wrap { position: relative; max-width: 560px; }
.idea-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); display: grid; gap: 2px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 340px; overflow: auto; }
.idea-suggest-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: none;
  font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.idea-suggest-item:hover, .idea-suggest-item:focus-visible { background: var(--panel-2); }
.idea-suggest-item img { width: 34px; height: 48px; object-fit: cover; border-radius: 5px; flex: none; background: var(--panel-2); }
.idea-suggest-ph { display: inline-grid; place-items: center; width: 34px; height: 48px; border-radius: 5px; background: var(--panel-2); color: var(--muted); flex: none; }
.idea-suggest-text { display: grid; gap: 1px; min-width: 0; }
.idea-suggest-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-suggest-text .hint { margin: 0; font-size: 12.5px; }
.idea-items { display: grid; gap: 6px; }
.idea-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.idea-item .check { align-items: flex-start; }
.idea-item .check input { margin-top: 2px; flex: none; }
.idea-item-text { display: grid; gap: 2px; }
.idea-item-text .hint { font-size: 12.5px; margin: 0; }
.idea-item.done .idea-item-text > span:first-child { text-decoration: line-through; color: var(--muted); }
.idea-item .tool { background: none; color: var(--muted); flex: none; }
.idea-item .tool:hover { background: var(--panel-2); color: var(--text); }
@media (max-width: 860px) {
  .idea-filters-toggle { display: flex; }
  .idea-filters:not(.open) { display: none; }
  .idea-layout { grid-template-columns: 1fr; }
  .idea-main { position: static; order: -1; }
  .idea-card { min-height: 200px; padding: 20px; }
  .idea-title { font-size: 22px; }
}

/* админ-панель */
.icon-btn.on { color: var(--accent); background: var(--panel-2); }
.admin { display: grid; gap: 16px; max-width: 900px; }
.admin-card { display: grid; gap: 12px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.admin-card > h2 { margin: 0; font-size: 18px; font-weight: 650; }
.admin-card .hint { margin: 0; }
.admin-key { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.admin-key-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.admin-key-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.admin-badge { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.admin-badge.on { color: var(--accent); }
.admin-key-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-key-row input { flex: 1 1 260px; min-width: 0; }
.admin-result { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: start; font-size: 14px; }
.admin-result:empty { display: none; }
.admin-result > .hint { grid-column: 2; }
.admin-result.ok > span:first-child { color: #2e8b57; }
.admin-result.bad > span:first-child, .admin-result.bad > span:nth-child(2) { color: var(--danger, #c0392b); }
.admin-result svg.ico { width: 16px; height: 16px; margin-top: 2px; }
.admin-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-size: 14px; }
.admin-line a { word-break: break-all; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-backups { display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.admin-backup { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.admin-backup .hint { font-size: 12.5px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.admin-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.admin-stat b { font-size: 20px; font-weight: 650; }
.admin-stat span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) { .admin-card { padding: 16px; } }

/* баг-репорт */
#bugForm textarea { width: 100%; resize: vertical; }
.bug-shot-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.bug-shot-row label.btn { cursor: pointer; }
.bug-shot { display: block; max-width: 100%; max-height: 220px; border-radius: 9px; border: 1px solid var(--line); margin: 0 0 10px; }
.bug-ctx { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.bug-ctx summary { cursor: pointer; }
.bug-ctx pre { margin: 8px 0 0; padding: 10px; max-height: 200px; overflow: auto; background: var(--bg); border-radius: 9px;
  font-size: 12px; white-space: pre-wrap; word-break: break-word; }
#bugListBtn { margin-right: auto; }
.bugs-list { display: grid; gap: 12px; max-height: 65vh; overflow: auto; margin-bottom: 12px; }
.bug-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bug-item.done { opacity: .6; }
.bug-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.bug-head .meta { margin: 0; }
.bug-num { font-size: 16px; font-weight: 650; color: var(--accent); }
.admin-reports-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bug-item .dlg-actions { justify-content: flex-start; }
.bug-text { margin: 0 0 10px; white-space: pre-wrap; }
.res-body { display: grid; gap: 12px; }
.res-body .meta { margin: 0; }
.res-status { margin: 0; font-size: 17px; font-weight: 500; }
.hint.warn { color: var(--warn); }

/* приглашения: страница для половинки */
.inv-page { position: fixed; inset: 0; z-index: 45; overflow: auto; display: grid; place-items: center; padding: 28px 16px; background: var(--bg); }
.inv-stage { position: relative; z-index: 1; width: min(640px, 100%); }
.inv-home { position: fixed; z-index: 3; top: calc(14px + env(safe-area-inset-top)); left: 16px; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); text-decoration: none; background: var(--panel); border: 1px solid var(--line); }
.inv-home:hover { color: var(--text); border-color: var(--line-strong); }
.inv-card { text-align: center; display: grid; gap: 16px; justify-items: center; animation: rise .4s both; }
.inv-card .emoji { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.inv-card .emoji svg.ico { width: 28px; height: 28px; stroke-width: 1.6; }
.inv-card .date { margin: 0; font-size: 14px; font-weight: 500; color: var(--accent); }
.inv-card h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 6vw, 44px); line-height: 1.15; }
.inv-what { margin: 0; font-size: clamp(17px, 3vw, 20px); color: var(--text); }
.inv-details { display: grid; gap: 4px; color: var(--muted); font-size: 15px; }
.inv-details span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.inv-details:empty { display: none; }
.inv-msg { margin: 0; max-width: 520px; font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.55; white-space: pre-wrap; }
.inv-answer { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 100px; margin-top: 4px; }
.yes-btn { transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.no-btn { transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.inv-progress { display: flex; gap: 6px; width: min(320px, 100%); }
.inv-progress i { flex: 1; height: 3px; border-radius: 3px; background: var(--line-strong); }
.inv-progress i.on { background: var(--accent); }
.inv-options { display: grid; gap: 8px; width: min(420px, 100%); }
.opt {
  font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 13px 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--accent); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.inv-text { display: grid; gap: 10px; width: min(460px, 100%); }
.answers {
  margin: 0; display: grid; gap: 10px; text-align: left; width: min(460px, 100%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.answers dt { color: var(--muted); font-size: 13px; }
.answers dd { margin: 2px 0 0; font-size: 15.5px; color: var(--text); white-space: pre-wrap; }
.dlg .answers { width: 100%; background: var(--panel-2); border: 0; }
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.burst span { position: absolute; bottom: -50px; opacity: 0; animation: burstUp 2.8s ease-out forwards; }
@keyframes burstUp {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), -110vh) rotate(var(--r)) scale(1.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .burst { display: none; } }

/* снег: позади карточек (у main свой слой выше), не ловит клики */
.snow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
main { position: relative; z-index: 1; }
.snow i { position: absolute; top: -12px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(255, 255, 255, .6);
  animation-name: snow-fall, snow-sway; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite, infinite;
  animation-direction: normal, alternate; }
:root[data-theme="light"] .snow i { background: #b9c7d8; box-shadow: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .snow i { background: #b9c7d8; box-shadow: none; } }
@keyframes snow-fall { to { transform: translateY(105vh); } }
@keyframes snow-sway { from { margin-left: -12px; } to { margin-left: 12px; } }

/* ---------- зимнее оформление (класс .winter на <html>) ---------- */
/* гирлянда: провод вдоль нижнего края шапки и мигающие огоньки */
.garland { position: absolute; left: 0; right: 0; bottom: -12px; height: 16px; display: flex; justify-content: space-around;
  pointer-events: none; z-index: 1; padding: 0 10px;
  background: radial-gradient(120% 14px at 50% -6px, transparent 9px, rgba(120, 120, 130, .55) 9.5px, rgba(120, 120, 130, .55) 10.5px, transparent 11px) 0 0 / 46px 16px repeat-x; }
.garland .bulb { position: relative; top: 5px; width: 7px; height: 11px; border-radius: 50% 50% 45% 45%; background: var(--b);
  box-shadow: 0 0 8px 2px var(--b); animation: twinkle 1.8s ease-in-out infinite; }
.garland .bulb::before { content: ''; position: absolute; top: -3px; left: 1.5px; width: 4px; height: 4px; border-radius: 1px; background: #6b6b74; }
.garland .c0 { --b: #ff5d73; } .garland .c1 { --b: #ffd166; animation-delay: .35s; } .garland .c2 { --b: #4cd6a5; animation-delay: .7s; }
.garland .c3 { --b: #5aa9ff; animation-delay: 1.05s; } .garland .c4 { --b: #c084fc; animation-delay: 1.4s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; box-shadow: 0 0 2px 0 var(--b); } }
@media (prefers-reduced-motion: reduce) { .garland .bulb { animation: none; } }
@media (max-width: 720px) { .garland { bottom: -11px; } }

/* пара небольших гроздьев сосулек по верхнему краю шапки (не по всей ширине) */
.winter .topbar::before, .winter .topbar::after { content: ''; position: absolute; top: 0; width: 46px; height: 11px;
  pointer-events: none; z-index: 1; opacity: .85;
  background: linear-gradient(180deg, #f4fbff 0%, #cfe9fb 70%, rgba(207, 233, 251, .4) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 15%, 94% 15%, 89% 55%, 84% 15%, 70% 15%, 62% 100%, 54% 15%, 42% 15%, 36% 70%, 30% 15%,
    18% 15%, 11% 85%, 4% 15%, 0 15%); }
.winter .topbar::before { left: 3%; }
.winter .topbar::after { right: 4%; width: 38px; transform: scaleX(-1); }

/* праздник: открытка-баннер поверх сайта + конфетти */
.celebrate-burst { z-index: 96; }
.celebrate { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px); animation: rise .3s both; }
.celebrate-card { width: min(420px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; padding: 22px 22px 20px;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .4s both; }
.celebrate-card h2 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.01em; }
.celebrate-card .hint { margin: 0; }
.celebrate-photo { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: var(--bg); }
.celebrate-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.celebrate-ico svg.ico { width: 30px; height: 30px; }
.celebrate-actions { justify-content: center; margin-top: 4px; }

/* ---------- вопросы для двоих ---------- */
/* во вкладке — обычный блок страницы; по ссылке игры (.standalone) — поверх всего */
.q-page:not(.standalone) { margin: 20px -20px 0; }
.q-page:not(.standalone) .q-top { top: var(--topbar-h); }
.q-page:not(.standalone) .q-view { padding-bottom: 24px; }
.q-page.standalone { position: fixed; inset: 0; z-index: 44; overflow: auto; background: var(--bg); }
.q-top {
  position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.q-top-title { font-weight: 600; font-size: 16px; text-align: center; white-space: nowrap; }
.q-top .btn { justify-self: start; }
.q-view { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 22px; }
.q-section { display: grid; gap: 10px; }
.q-section .section-title { margin: 0; }
.q-label { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; }
.link.small { font-size: 13px; }
.link.danger { color: var(--danger); font-size: 13px; justify-self: center; }

.fmt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tod-pick { width: min(520px, 100%); }
.tod-pick .q-opt { min-height: 120px; font-size: 22px; }
.tod-card { min-height: min(40vh, 320px); width: min(640px, 100%); padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.fmt-card {
  font: inherit; color: var(--text); text-align: left; cursor: pointer; display: grid; gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; transition: border-color .15s, background .15s;
  box-shadow: var(--shadow);
}
.fmt-card:hover { border-color: var(--line-strong); }
.fmt-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.fmt-card strong { font-size: 16px; font-weight: 600; }
.fmt-emoji { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); color: var(--accent); margin-bottom: 4px; }
.fmt-card[aria-pressed="true"] .fmt-emoji { background: var(--panel); }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-toggle {
  font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; transition: .15s;
}
.chip-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.chip-toggle[aria-pressed="true"] { color: var(--text); border-color: var(--text); background: var(--panel); font-weight: 500; }

.seg { display: inline-flex; background: var(--panel-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: 0; border-radius: 7px; padding: 6px 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.q-settings { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.q-field { display: grid; gap: 8px; }
.q-mine-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; font-weight: 400; cursor: pointer; }
.check input { width: 17px; height: 17px; padding: 0; accent-color: var(--accent); }
.q-total { margin: -6px 0 0; }
.q-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.q-actions .btn.big { flex: 1 1 240px; }
.btn.big { padding: 12px 26px; font-size: 16px; }

.q-games { display: grid; gap: 8px; }
.q-game {
  font: inherit; color: var(--text); text-align: left; cursor: pointer; display: grid; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow);
}
.q-game:hover { border-color: var(--line-strong); }
.q-game-title { font-size: 15px; font-weight: 500; }

.q-mine { display: grid; gap: 6px; }
.q-mine-item { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px 7px 14px; }
.q-mine-text { flex: 1; min-width: 0; font-size: 14.5px; }
.q-mine-item .tool { position: static; flex: none; width: 28px; height: 28px; background: var(--panel-2); color: var(--muted); }
.q-mine-item .tool:hover { color: var(--on-accent); }
.q-add-form { display: grid; gap: 12px; justify-items: start; }
.q-add-row { display: flex; gap: 8px; width: 100%; align-items: center; flex-wrap: wrap; }
.q-add-row select { width: auto; flex: none; }
.q-add-row input { flex: 1 1 180px; min-width: 0; }

/* экран вопроса */
.q-play { display: grid; gap: 16px; }
.q-progress { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.q-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.q-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.q-cat { color: var(--text); }
/* тема вопроса: свой цвет у каждой — плашка сверху и полоска на вариантах ответа */
.q-play { --cat: #3d8bd6; }
.q-play[data-cat="byt"] { --cat: #c48a1c; }
.q-play[data-cat="tricky"] { --cat: #8457d0; }
.q-play[data-cat="serious"] { --cat: #1f9a90; }
.q-play[data-cat="spicy"] { --cat: #d04a5a; }
.q-cat-row { display: flex; justify-content: center; margin-bottom: -4px; }
.q-cat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 99px; font-size: 15px; font-weight: 600;
  color: var(--text); background: color-mix(in srgb, var(--cat) 22%, transparent); border: 1px solid color-mix(in srgb, var(--cat) 55%, transparent); }
.q-cat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat) 25%, transparent); }
.q-play .q-opt { border-top: 4px solid var(--cat); }
.q-timer { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.q-timer i { display: block; height: 100%; width: 100%; background: var(--text); }
.q-timer.low i { background: var(--danger); }
.q-card { min-height: min(52vh, 420px); display: grid; place-items: center; animation: rise .25s both; }
.q-card.timeout { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-ili { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.q-or { align-self: center; color: var(--muted); font-size: 15px; }
.q-or.small { font-size: 14px; }
.q-opt {
  font: inherit; color: var(--text); cursor: pointer; min-height: 180px; padding: 22px;
  font-size: clamp(20px, 3.4vw, 26px); font-weight: 500; line-height: 1.25; letter-spacing: -.01em;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow);
  transition: border-color .15s, background .15s;
}
.q-opt:hover { border-color: var(--accent); }
.q-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.q-norm-wrap { width: 100%; display: grid; gap: 26px; justify-items: center; }
.q-statement { margin: 0; text-align: center; font-size: clamp(24px, 4.4vw, 34px); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; max-width: 640px; }
.q-norm { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.q-norm .q-opt { min-height: 88px; font-size: 19px; }
.q-opt.good.sel { background: var(--ok-soft); border-color: var(--ok); }
.q-opt.bad.sel { background: var(--danger-soft); border-color: var(--danger); }
.q-nav { display: flex; justify-content: space-between; min-height: 22px; }
.q-keys { text-align: center; margin: 0; }
@media (hover: none) { .q-keys { display: none; } }
@media (max-width: 560px) {
  .q-ili { grid-template-columns: 1fr; }
  .q-opt { min-height: 120px; }
  .fmt-cards { grid-template-columns: 1fr; }
}

/* экраны по центру: вступление, ожидание, итог */
.q-center { display: grid; gap: 14px; justify-items: center; text-align: center; }
.q-center h2 { margin: 0; font-weight: 650; font-size: clamp(24px, 4.4vw, 32px); line-height: 1.2; letter-spacing: -.02em; }
.q-center .hint { max-width: 480px; margin: 0; font-size: 14px; }
.q-center .row { width: min(460px, 100%); }
.q-big-emoji { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.q-big-emoji svg.ico { width: 28px; height: 28px; stroke-width: 1.6; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.eyebrow { margin: 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.q-status { display: grid; gap: 4px; color: var(--muted); }
.q-link { width: min(520px, 100%); display: grid; gap: 8px; text-align: left; }
.q-link .hint { max-width: none; }
.score {
  --p: 0; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
}
.score span { width: 120px; height: 120px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 34px; font-weight: 650; letter-spacing: -.02em; }
.q-filter { display: flex; justify-content: center; }
.q-results { display: grid; gap: 6px; }
.q-row { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.q-row.same { border-color: var(--accent); }
.q-row-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; flex: none; margin-top: 1px; background: var(--panel-2); color: var(--muted); }
.q-row.same .q-row-mark { background: var(--accent-soft); color: var(--accent); }
.q-row-mark svg.ico { width: 14px; height: 14px; stroke-width: 2.2; }
.q-row-body { display: grid; gap: 4px; min-width: 0; }
.q-row-q { margin: 0; font-size: 15.5px; }
.q-row-a { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 14px; }
body.guest .q-top .btn { visibility: hidden; }
.slide.text .inner { position: relative; max-width: 820px; }
.slide.text .emoji { display: none; }
.slide.text .date { margin: 0 0 14px; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; animation: rise .8s .25s both; }
.slide.text h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 6vw, 60px); line-height: 1.12; animation: rise .9s .4s both; }
.slide.text p.quote { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3.6vw, 36px); line-height: 1.4; white-space: pre-wrap; animation: rise 1s .2s both; }
.slide.text .sig { margin-top: 24px; font-size: 18px; opacity: .8; animation: rise .8s .9s both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* плавающие значки на слайдах и в приглашении убраны — спокойнее */
.floaters { display: none; }
.player.paused .slide *, .player.paused .slide { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .slide img.shot { animation: none; }
}
