/* КиноМэтч: одна тёмная тема «ночной кинотеатр».
   Два фирменных цвета — голубой (подсветки, кнопки) и бордо (логотип, акценты «мэтча»).
   Akony — название и крупные кнопки, Inter — всё остальное. */
@font-face {
  font-family: 'Akony';
  src: url('fonts/akony.woff2') format('woff2');
  font-display: swap;
}

:root {
  --blue: #5FB8FF;
  --wine: #A3122E;
  --bg: #05070D;
  --bg-glow:
    radial-gradient(90% 45% at 50% 0%, rgba(95,184,255,0.16), transparent 70%),
    radial-gradient(80% 45% at 100% 100%, rgba(163,18,46,0.2), transparent 70%);
  --card: #0E1420;
  --info: #0B1019;
  --chip: rgba(255,255,255,0.08);
  --text: #EEF4FF;
  --text-soft: #A9B9D0;
  --accent-p: var(--blue);
  --accent-y: var(--blue);
  --accent-grad: linear-gradient(var(--blue), var(--blue));
  --on-accent: var(--wine);
  --line: rgba(255,255,255,0.1);
  --glass: rgba(255,255,255,0.05);
  --sheet: #0E1420;
  --tabbar: rgba(14,20,32,0.88);
  --tab-active: rgba(163,18,46,0.25);
  --tab-active-fg: #F1DADD;
  --overlay: rgba(0,0,0,0.6);
  --shadow-soft: rgba(0,0,0,0.3);
  --shadow-mid: rgba(0,0,0,0.45);
  --shadow-strong: rgba(0,0,0,0.6);
  --good: #6EE6B4;
  --font-brand: 'Akony', 'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Совместимость со старыми именами переменных */
  --ink: var(--bg);
  --ink-soft: var(--card);
  --cream: var(--text);
  --gold: var(--accent-y);
  --coral: var(--accent-p);
  --sage: var(--wine);

  color-scheme: dark;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-glow);
  pointer-events: none;
  z-index: 0;
}

.title-xl, .title-md {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.05;
  margin: 0;
}
.title-xl { font-size: clamp(2.1rem, 8vw, 2.9rem); }
.title-md { font-size: 1.5rem; margin-bottom: 0.4rem; }

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-p);
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.lede {
  color: var(--text-soft);
  line-height: 1.5;
  max-width: 34ch;
  margin: 0.9rem 0 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}
.screen.active { display: flex; }

/* --- профиль --- */
.screen-profile { align-items: center; overflow-y: auto; }
.profile-scroll {
  width: 100%;
  max-width: 460px;
  padding-bottom: 1rem;
}

/* герой: кольцо + аватар + имя */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 1.2rem 1.6rem;
  text-align: center;
}
.ring-wrap { position: relative; width: 92px; height: 92px; margin-bottom: 0.9rem; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 5; }
.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
}
.avatar {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.7rem;
}
.ring-pct {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--text);
  color: var(--card);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 2px solid var(--bg);
}
.hero h1 { font-family: var(--font-display); font-weight: 650; font-size: 1.35rem; margin: 0 0 0.15rem; }
.hero .username { color: var(--text-soft); font-size: 0.85rem; margin: 0; }

/* сетка статистики */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; padding: 0 1.2rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0.85rem 0.9rem; }
.stat-card .stat-icon { font-size: 1.1rem; }
.stat-card .stat-value { font-family: var(--font-display); font-weight: 650; font-size: 1.4rem; margin: 0.3rem 0 0.1rem; }
.stat-card .stat-label { font-size: 0.72rem; color: var(--text-soft); }
.stat-card.partner { background: rgba(163,18,46,0.14); border-color: rgba(163,18,46,0.4); }
.stat-card.partner .stat-value { color: var(--wine); text-shadow: 0 0 12px rgba(163,18,46,0.6); }

/* строки-навигация */
.nav-list { padding: 1.4rem 1.2rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.nav-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  width: 100%;
}
.nav-row .nav-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--chip);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.nav-row .nav-text { flex: 1; min-width: 0; }
.nav-row .nav-title { font-weight: 600; font-size: 0.92rem; }
.nav-row .nav-sub {
  font-size: 0.76rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-row .chevron { color: var(--text-soft); font-size: 0.85rem; transition: transform 0.2s ease; flex-shrink: 0; }
.nav-row[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.nav-row.admin-row .nav-icon { background: var(--accent-grad); }
.nav-row[hidden] { display: none; }

/* разворачивающийся блок жанров внутри профиля */
.genre-panel { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.genre-panel.open { max-height: 420px; }
.genre-panel-inner {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 16px 16px;
  margin-top: -0.6rem;
  padding: 0.2rem 1rem 1rem;
}

.logout-row {
  display: block;
  margin: 1.6rem auto 0.6rem;
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* --- админка --- */
.screen-admin { align-items: center; overflow-y: auto; }
.admin-wrap {
  width: 100%;
  max-width: 520px;
  padding: 1rem 1.2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-couple-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}
.admin-couple-card .title-md { margin: 0 0 0.2rem; font-size: 1rem; }
.admin-couple-summary { font-size: 0.8rem; color: var(--text-soft); margin: 0 0 0.8rem; }
.admin-member-row {
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}
.admin-member-row:first-of-type { border-top: none; }
.admin-member-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.admin-username { font-family: 'Inter', sans-serif; font-weight: 400; font-size: 0.75rem; color: var(--text-soft); }
.admin-member-stats {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}
.admin-delete-btn {
  margin-top: 0.5rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  color: var(--accent-p);
  cursor: pointer;
  font-family: inherit;
}
.admin-create-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 2rem;
  padding: 0 1.2rem;
  box-sizing: border-box;
}
.admin-create-card .title-md { font-size: 1rem; margin-bottom: 0.6rem; }
.admin-create-card form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.admin-create-card .primary-btn { margin-top: 0.2rem; }

.ghost-link {
  margin-top: 2rem;
  background: none;
  border: none;
  color: var(--accent-p);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem;
  font-family: inherit;
}

/* --- шапка --- */
.swipe-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  flex-shrink: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.swipe-role-label {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-p);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.header-icon { width: 19px; height: 19px; }
.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-p);
  color: var(--on-accent);
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.icon-btn .badge[hidden] { display: none; }

/* --- полоска текущего жанра --- */
.genre-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: calc(100% - 2.4rem);
  max-width: 380px;
  margin: 0 auto 0.6rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.genre-bar #genre-bar-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.genre-bar.warn {
  border-color: var(--accent-p);
  color: var(--accent-p);
}
.genre-bar-edit {
  color: var(--accent-p);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* --- стопка карточек --- */
.screen-swipe { align-items: center; }
.card-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 480px;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.movie-card {
  position: absolute;
  width: calc(100% - 2.4rem);
  max-width: 380px;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px var(--shadow-mid);
  display: flex;
  flex-direction: column;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
}
.movie-card:active { cursor: grabbing; }
.movie-card .poster {
  flex: 1;
  min-height: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--chip);
}
.movie-card .info {
  padding: 1rem 1.1rem 1.1rem;
  background: var(--info);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  max-height: 55%;
  display: flex;
  flex-direction: column;
}
.movie-card .info h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.3rem;
  line-height: 1.15;
  color: var(--text);
}
.movie-card .meta {
  font-size: 0.8rem;
  color: var(--accent-y);
  margin-bottom: 0.5rem;
}
.movie-card .overview {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  transition: color 0.15s ease;
}
.movie-card .overview:hover {
  color: var(--text);
}
.movie-card .overview.expanded {
  -webkit-line-clamp: unset;
  display: block;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 0.3rem;
}
.movie-card .overview.expanded::-webkit-scrollbar {
  width: 4px;
}
.movie-card .overview.expanded::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}


/* --- кнопки действий --- */
.swipe-actions {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 1rem 0 1.4rem;
  flex-shrink: 0;
}
.round-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.round-btn.dislike {
  background: var(--card);
  color: var(--accent-p);
  border: 1px solid var(--line);
}
.round-btn.like {
  background: var(--accent-grad);
  color: var(--on-accent);
}
.round-btn.undo {
  width: 44px; height: 44px;
  font-size: 1.1rem;
  background: var(--card);
  color: var(--text-soft);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px var(--shadow-soft);
}
.round-btn.undo:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

/* --- пусто --- */
.empty-state {
  max-width: 320px;
  text-align: center;
  margin: auto;
  padding: 2rem;
}
.primary-btn {
  margin-top: 1.2rem;
  background: var(--accent-grad);
  color: var(--on-accent);
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 650;
  cursor: pointer;
}

/* --- список совпадений --- */
.screen-matches { align-items: center; }
.matches-tabs {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 460px;
  padding: 0 1.2rem;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 auto 0.9rem;
  padding: 0.35rem;
  box-sizing: border-box;
}
.matches-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text-soft);
  border-radius: 12px;
  padding: 0.55rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.matches-tab .tab-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--shadow-soft);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.matches-tab.active {
  background: var(--accent-grad);
  color: var(--on-accent);
}
.matches-tab.active .tab-count {
  background: rgba(255,255,255,0.25);
  color: var(--on-accent);
}
.sort-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 460px;
  margin: 0 auto 0.9rem;
  padding: 0.55rem 0.8rem;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-sizing: border-box;
}
.sort-row .sort-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--chip);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sort-row select {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
}
.sort-row .sort-chevron { color: var(--text-soft); font-size: 0.8rem; }
.matches-list {
  width: 100%;
  max-width: 460px;
  overflow-y: auto;
  padding: 0 1.2rem 1.5rem;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}
.match-row {
  display: flex;
  gap: 0.9rem;
  padding: 0.75rem;
  margin-bottom: 0.7rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.match-row .poster-thumb {
  width: 64px; height: 96px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--chip);
  flex-shrink: 0;
}
.match-row .match-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.match-row h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.match-row .match-meta { font-size: 0.76rem; color: var(--text-soft); }
.match-row button {
  align-self: flex-start;
  margin-top: 0.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.match-row button:hover { border-color: var(--accent-p); color: var(--accent-p); }
.rating-wrap { flex-shrink: 0; text-align: left; }
.rating-stars { display: flex; gap: 0.15rem; }
.rating-star {
  background: none;
  border: none;
  color: var(--accent-y);
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.1rem;
  line-height: 1;
}
.rating-partner-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  background: rgba(163,18,46,0.14);
  border: 1px solid rgba(163,18,46,0.4);
  color: var(--sage);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  width: fit-content;
}
.empty-icon {
  width: 68px; height: 68px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* --- тост совпадения --- */
.match-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  background: var(--accent-grad);
  color: var(--on-accent);
  padding: 0.9rem 1.4rem;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 12px 30px var(--shadow-strong);
  z-index: 50;
}
.match-toast p { margin: 0; }
.match-toast .title-md { font-size: 1.1rem; margin-bottom: 0.1rem; }

/* --- модалка выбора жанров --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}
.modal-overlay[hidden] { display: none; }
.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 1.2rem 1.2rem 1.6rem;
  box-shadow: 0 -12px 40px var(--shadow-strong);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.modal-head .title-md { margin: 0; }
.genre-partner-note {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0.4rem 0 0.9rem;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.modal-actions .ghost-link { margin: 0; padding: 0.4rem 0; font-size: 0.82rem; }
.modal-actions .primary-btn { margin: 0; }

@media (min-width: 640px) {
  html, body { overflow: auto; }
}

/* --- карточка фильма кликабельна, открывает описание --- */
.match-row { cursor: pointer; }
.match-row:focus-visible { outline: 2px solid var(--accent-p); outline-offset: 2px; }
.match-row button,
.match-row .rating-wrap { cursor: default; }

.movie-detail-sheet { max-height: 78vh; }
.movie-detail-body {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.3rem;
}
.movie-detail-poster {
  width: 108px;
  height: 160px;
  flex-shrink: 0;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  background-color: var(--chip);
}
.movie-detail-main { min-width: 0; }
.movie-detail-main h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
  color: var(--text);
}
.movie-detail-meta { font-size: 0.8rem; color: var(--text-soft); margin-bottom: 0.4rem; }
.movie-detail-cast { font-size: 0.78rem; color: var(--text-soft); line-height: 1.4; }
.movie-detail-overview {
  margin-top: 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}
.movie-detail-overview:empty::after {
  content: 'Описание пока не подгружено.';
  color: var(--text-soft);
  font-style: italic;
}

/* --- вход --- */
.login-overlay { z-index: 100; align-items: center; }
.login-sheet { border-radius: 22px; max-width: 360px; }
.login-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0.9rem 0 0.3rem;
}
.login-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  font-size: 0.95rem;
}
.login-error {
  color: var(--accent-p);
  font-size: 0.82rem;
  margin: 0.7rem 0 0;
}
.login-submit { width: 100%; margin-top: 1.3rem; }


/* --- фильтр: настроения и годы --- */
.filter-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 1rem 0 0.5rem;
}
.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0 0 0.4rem;
}
.mood-grid.compact { gap: 0.5rem; }
.mood-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.mood-tile:hover { transform: translateY(-2px); border-color: var(--accent-p); }
.mood-tile.selected {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--on-accent);
}
.mood-icon { width: 24px; height: 24px; flex-shrink: 0; }
.mood-tile .mood-label { font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.mood-tile .mood-hint { font-size: 0.68rem; color: var(--text-soft); line-height: 1.25; }
.mood-tile.selected .mood-hint { color: var(--on-accent); opacity: 0.8; }
.mood-grid.compact .mood-hint { display: none; }

.year-chip-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}
.year-chip-row::-webkit-scrollbar { display: none; }
.year-chip-row.wrap { flex-wrap: wrap; overflow-x: visible; }
.year-chip {
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.year-chip.selected {
  background: var(--accent-grad);
  color: var(--on-accent);
  border-color: transparent;
}
#profile-filter-icon .mood-icon { width: 20px; height: 20px; }

/* --- рейтинг и актёры на карточке --- */
.rating-badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: rgba(0,0,0,0.72);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  backdrop-filter: blur(4px);
}
.rating-badge-src { font-size: 0.6rem; opacity: 0.75; letter-spacing: 0.04em; }
.movie-card .poster { position: relative; }
.cast-line {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-rating { font-weight: 600; color: var(--accent-y); }
.match-cast {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- подборки по настроению на экране совпадений --- */
.mood-filter-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.7rem 1.2rem 0;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  scrollbar-width: none;
}
.mood-filter-row::-webkit-scrollbar { display: none; }
.mood-filter-row[hidden] { display: none; }
.mood-chip {
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mood-chip .mood-icon { width: 15px; height: 15px; }
.mood-chip.selected {
  background: var(--accent-grad);
  color: var(--on-accent);
  border-color: transparent;
}

/* --- стартовая страница --- */
.landing-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  background: var(--bg);
}
.landing-screen[hidden] { display: none; }
.landing-inner { max-width: 380px; text-align: center; }
.landing-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.8rem;
  color: var(--text);
  opacity: 0;
  animation: landingRiseIn 0.7s ease forwards;
}
.landing-cta { opacity: 0; animation: landingRiseIn 0.7s ease 0.3s forwards; }
@keyframes landingRiseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- онбординг --- */
.onboard-screen {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
  box-sizing: border-box;
  background: var(--bg);
  overflow-y: auto;
}
.onboard-screen[hidden] { display: none; }
.onboard-inner { width: 100%; max-width: 420px; margin: auto; }
.onboard-inner .mood-grid { margin: 1.2rem 0 1.4rem; }
.onboard-inner .year-chip-row { margin: 1rem 0 1.4rem; }
.onboard-inner .primary-btn:disabled { opacity: 0.45; cursor: default; }

/* --- регистрация и пара --- */
.auth-invite-note {
  font-size: 0.85rem;
  color: var(--text-soft);
  background: var(--chip);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin: 0.6rem 0 0;
}
.auth-invite-note[hidden], #register-form[hidden], #login-form[hidden] { display: none; }
.auth-switch { display: block; margin: 0.9rem auto 0; font-size: 0.85rem; }
.auth-switch[hidden] { display: none; }
.invite-input { text-transform: uppercase; letter-spacing: 0.12em; }
.invite-input::placeholder { text-transform: none; letter-spacing: normal; }
#profile-couple-panel.open { max-height: 520px; }
.invite-code {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.7rem;
  letter-spacing: 0.14em;
  color: var(--accent-p);
  user-select: all;
}
.couple-hint { font-size: 0.8rem; color: var(--text-soft); margin: 0.5rem 0 0; line-height: 1.4; }
.couple-join-row { display: flex; gap: 0.5rem; align-items: stretch; }
.couple-join-row .login-input { flex: 1; min-width: 0; }
.couple-join-row .primary-btn { margin: 0; white-space: nowrap; }
#couple-solo[hidden], #couple-paired[hidden] { display: none; }

/* =====================================================================
   Новый дизайн: главное меню, нижняя панель, совместный режим, анимации
   ===================================================================== */

.ic {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.ic.filled { fill: currentColor; stroke-width: 1.2; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-p);
  outline-offset: 2px;
}

.ring-stop-a { stop-color: #A3122E; }
.ring-stop-b { stop-color: #5FB8FF; }

/* --- переходы между экранами --- */
.screen { transition: none; }
.screen.active { animation: screenIn .42s cubic-bezier(.2,.8,.2,1) both; }
.screen.leaving {
  display: flex;
  animation: screenOut .24s ease both;
  pointer-events: none;
  z-index: 0;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes screenOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: scale(.985); }
}
body.signed-in .screen { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

/* --- шапка экранов --- */
.top-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: calc(0.8rem + env(safe-area-inset-top)) 1.2rem 0.7rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  flex-shrink: 0;
  min-height: 64px;
}
.top-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-title.big { text-align: left; font-size: 1.6rem; font-weight: 700; }
.top-title.big { font-weight: 800; }
.top-title-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.top-title-stack .top-title { flex: none; max-width: 100%; }
.top-sub { font-size: 0.74rem; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.top-spacer { width: 44px; flex-shrink: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .15s ease, background .2s ease; }
.icon-btn:active { transform: scale(.94); }
.avatar-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-p);
  background: var(--accent-grad);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.avatar-btn:active { transform: scale(.94); }

/* --- главное меню --- */
.screen-home { align-items: center; }
.home-scroll {
  width: 100%;
  max-width: 480px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.4rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}
.home-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; }
.home-ring {
  --p: 0;
  width: 148px; height: 148px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent-p) calc(var(--p) * 1%), var(--line) 0);
  margin-bottom: 0.5rem;
  transition: --p 1.2s cubic-bezier(.3,.9,.4,1);
  animation: ringPop .7s cubic-bezier(.2,.9,.3,1.2) both;
}
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
@keyframes ringPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.home-ring-inner {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.home-ring-value { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; line-height: 1; }
.home-ring-label { font-size: 0.75rem; color: var(--text-soft); margin-top: 0.25rem; }
.home-greeting { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; margin: 0; }
.home-partner { margin: 0; font-size: 0.88rem; color: var(--text-soft); }
.home-partner.online::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); margin-right: 6px; vertical-align: 1px;
}

.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.home-tile {
  min-height: 150px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.1rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--shadow-soft);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
  animation: tileIn .5s cubic-bezier(.2,.8,.2,1) both;
}
.home-tile:nth-child(2) { animation-delay: .05s; }
.home-tile:nth-child(3) { animation-delay: .1s; }
.home-tile:nth-child(4) { animation-delay: .15s; }
@keyframes tileIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.home-tile:hover { box-shadow: 0 14px 34px var(--shadow-mid); }
.home-tile:active { transform: scale(.97); }
.home-tile .tile-ic { width: 30px; height: 30px; color: var(--accent-p); }
.home-tile.accent { background: var(--accent-grad); border: none; color: var(--on-accent); box-shadow: 0 14px 34px rgba(163,18,46,0.35); }
.home-tile.accent .tile-ic { color: var(--on-accent); }
.home-tile.short { min-height: 100px; }
.tile-title { display: block; font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; }
.tile-sub { display: block; font-size: 0.75rem; margin-top: 0.2rem; opacity: 0.8; }
.tile-count { margin-left: 0.4rem; opacity: 0.6; font-weight: 600; }
.tile-count:empty { display: none; }

.invite-banner {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem 0.9rem 0.85rem 1.1rem;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--accent-p);
  box-shadow: 0 10px 30px var(--shadow-soft);
  animation: bannerIn .5s cubic-bezier(.2,.9,.3,1.15) both;
}
.invite-banner[hidden] { display: none; }
.invite-banner-text { flex: 1; font-size: 0.88rem; font-weight: 600; }
@keyframes bannerIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

/* --- кнопки --- */
.primary-btn { border-radius: 999px; padding: 0.8rem 1.5rem; font-size: 0.95rem; transition: transform .15s ease, filter .2s ease, opacity .2s; }
.primary-btn { box-shadow: 0 0 24px rgba(95,184,255,0.45); }
.primary-btn:active { transform: scale(.97); }
.primary-btn:disabled { opacity: .5; cursor: default; }
.primary-btn.small { margin: 0; padding: 0.55rem 1rem; font-size: 0.82rem; flex-shrink: 0; }
.primary-btn.wide, .secondary-btn.wide { width: 100%; margin: 0; }
.secondary-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform .15s ease;
}
.secondary-btn:active { transform: scale(.97); }
.secondary-btn.on-dark { color: #fff; border-color: rgba(255,255,255,0.35); }

/* --- нижняя панель --- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 440px;
  height: 64px;
  padding: 0 8px;
  border-radius: 32px;
  background: var(--tabbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px var(--shadow-mid);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  animation: tabbarIn .5s cubic-bezier(.2,.8,.2,1) both;
}
.tabbar[hidden] { display: none; }
@keyframes tabbarIn { from { opacity: 0; transform: translate(-50%, 30px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 48px;
  border: none;
  background: none;
  border-radius: 24px;
  color: #7D8BA0;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: color .3s ease;
}
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--tab-active-fg); }
.tab-indicator {
  position: absolute;
  left: 0; top: 8px;
  height: 48px;
  border-radius: 24px;
  background: var(--tab-active);
  transition: transform .45s cubic-bezier(.3,1.3,.5,1), width .45s cubic-bezier(.3,1.3,.5,1);
}
.tab-badge {
  position: absolute;
  top: 3px; left: calc(50% + 6px);
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-p);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tab-badge[hidden] { display: none; }
@media (max-width: 360px) { .tab span:not(.tab-badge) { display: none; } }

/* --- карточки --- */
.movie-card { border-radius: 26px; }
.movie-card.card-enter { animation: cardEnter .45s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes cardEnter { from { opacity: 0; transform: translateY(26px) scale(.94); } to { opacity: 1; transform: none; } }
.card-fav {
  position: absolute;
  top: 12px; right: 12px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.card-fav .ic { width: 22px; height: 22px; }
.card-fav.on { color: #5FB8FF; }
.card-fav.on .ic { fill: currentColor; }
.card-fav.pop { animation: favPop .45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes favPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.match-row .card-fav.inline {
  position: static;
  align-self: center;
  margin: 0;
  padding: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--chip);
  border: none;
  color: var(--accent-y);
}
.match-row .card-fav.inline { color: #5FB8FF; }
.round-btn { transition: transform .15s ease, opacity .2s ease; }
.round-btn:active { transform: scale(.92); }
.round-btn .ic { width: 26px; height: 26px; }
.round-btn.undo .ic { width: 20px; height: 20px; }
.round-btn:disabled { opacity: .4; cursor: default; }
.genre-bar { border-radius: 999px; background: var(--glass); }

/* --- списки --- */
.match-row { animation: rowIn .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms); border-radius: 20px; }
.match-row.removing { animation: rowOut .28s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rowOut { to { opacity: 0; transform: translateX(40px); height: 0; margin: 0; padding: 0; } }
.match-row .watched-btn { white-space: nowrap; }
.screen-favorites { align-items: center; }
.matches-tabs, .sort-row { background: var(--glass); }

/* --- профиль и настройки --- */
.screen-settings { align-items: center; overflow-y: auto; }
.screen-settings .profile-scroll { padding: 0 1.2rem 1rem; }
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 1.4rem;
}
.segmented button {
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text-soft);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.segmented button[aria-checked="true"] { background: var(--accent-grad); color: var(--on-accent); }
.settings-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1rem; }
.settings-hint { margin: 0 0 0.4rem; font-weight: 600; }
.filter-section-label.inner { margin-top: 1rem; }
.nav-row .nav-icon .ic { width: 20px; height: 20px; }
.nav-row .chevron { width: 18px; height: 18px; color: var(--text-soft); transition: transform .25s ease; }
.nav-row[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.stat-card, .nav-row { border-radius: 18px; }

/* --- совместный режим --- */
.screen-live { align-items: center; }
.partner-dot {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.partner-dot::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: var(--line);
  transition: background .3s ease, box-shadow .3s ease;
}
.partner-dot.online::after { background: var(--good); box-shadow: 0 0 0 4px rgba(142,240,193,0.2); }
.live-view {
  width: 100%;
  max-width: 480px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.4rem 1.4rem 1rem;
  gap: 1.2rem;
  overflow-y: auto;
}
.live-view[hidden] { display: none; }
.live-view.view-in { animation: screenIn .4s cubic-bezier(.2,.8,.2,1) both; }
.live-heading { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1.15; margin: 0; }
.live-heading.center, .lede.center { text-align: center; margin-left: auto; margin-right: auto; }
.live-heading.small { font-size: 1.1rem; }
.live-copy .lede { margin-top: 0.6rem; }
.live-actions { margin-top: auto; display: flex; flex-direction: column; gap: 0.7rem; }
.live-actions.row { flex-direction: row; }
.live-actions.row .secondary-btn { flex: 1; }
.live-actions.row .primary-btn { flex: 2; margin: 0; }
.live-note { margin: 0; font-size: 0.88rem; color: var(--text-soft); line-height: 1.5; text-align: center; }
.live-note:empty { display: none; }

.pair-visual { position: relative; display: flex; justify-content: space-between; align-items: flex-start; padding: 1.2rem 0.6rem; }
.pair-line {
  position: absolute; left: 25%; right: 25%; top: calc(1.2rem + 56px); height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent-p) 0 8px, transparent 8px 16px);
  background-size: 32px 2px;
  animation: lineFlow 1s linear infinite;
  opacity: .7;
}
@keyframes lineFlow { to { background-position: 32px 0; } }
.pair-person { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; width: 45%; }
.pair-ring {
  width: 112px; height: 112px; border-radius: 50%;
  border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .3s ease;
}
.pair-person:not(.ready) .pair-ring { animation: pulseRing 1.8s ease-in-out infinite; }
.pair-person.ready .pair-ring { border: 2px solid var(--good); }
@keyframes pulseRing { 0%, 100% { box-shadow: 0 0 0 0 rgba(163,18,46,0.35); } 50% { box-shadow: 0 0 0 12px rgba(163,18,46,0); } }
.pair-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.9rem;
  color: #fff;
}
.pair-avatar.me { background: #5FB8FF; }
.pair-avatar.partner { background: #A3122E; }
.pair-name { font-weight: 700; font-size: 0.95rem; }
.pair-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-soft); min-height: 1.2em; text-align: center; }
.pair-person.ready .pair-status { color: var(--good); }
.pair-status .ic { width: 14px; height: 14px; stroke-width: 2.4; }

.quiz-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.quiz-seg { height: 6px; border: none; padding: 0; border-radius: 3px; background: var(--line); cursor: pointer; transition: background .3s ease; }
.quiz-seg.done { background: var(--accent-p); }
.quiz-seg:disabled { cursor: default; }
.quiz-body { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-body.step-in { animation: stepIn .38s cubic-bezier(.2,.8,.2,1) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.quiz-step { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-p); }
.quiz-hint { margin: 0 0 0.6rem; font-size: 0.86rem; color: var(--text-soft); }
.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-option {
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  padding: 0.7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
  animation: rowIn .35s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.quiz-option:active { transform: scale(.98); }
.quiz-option .check { opacity: 0; transform: scale(.5); transition: opacity .2s ease, transform .25s cubic-bezier(.2,.9,.3,1.4); color: var(--accent-p); stroke-width: 2.4; }
.quiz-option.selected { border: 2px solid var(--accent-p); background: rgba(95,184,255,0.1); padding: calc(0.7rem - 1px) calc(1rem - 1px); }
.quiz-option.selected .check { opacity: 1; transform: none; }
.quiz-option-label { display: block; }
.quiz-option-hint { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-soft); margin-top: 2px; }

.wait-pulse {
  width: 140px; height: 140px; margin: 2rem auto 0.5rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: pulseRing 1.8s ease-in-out infinite;
  border: 1px dashed var(--line);
}
.live-swipe { padding-left: 0; padding-right: 0; gap: 0.3rem; align-items: center; }
.live-swipe .card-stack { flex: 1; }
.live-waiting {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  animation: screenIn .4s cubic-bezier(.2,.8,.2,1) .15s both;
}
.live-waiting .wait-pulse { margin: 0; width: 120px; height: 120px; }
.live-vote-note { margin: 0; min-height: 1.2em; font-size: 0.82rem; color: var(--good); font-weight: 600; text-align: center; }
.live-swipe .swipe-actions { padding-bottom: 0.4rem; }

/* --- экран совпадения --- */
.match-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: #05070D;
  color: #EEF4FF;
  overflow: hidden;
}
.match-overlay[hidden] { display: none; }
.match-poster {
  position: absolute; left: 0; right: 0; top: 0; height: 68%;
  background-size: cover; background-position: center top;
  background-color: #141B2B;
}
.match-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,7,13,0) 30%, rgba(5,7,13,0.85) 58%, #05070D 72%); }
.match-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; z-index: 2; background: rgba(0,0,0,0.35); border: none; color: #fff; border-radius: 50%; }
.match-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 520px; margin: 0 auto;
  padding: 0 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 0.7rem;
  max-height: 70%;
  overflow-y: auto;
}
.match-pill {
  align-self: flex-start;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; background: linear-gradient(150deg, #A3122E, #A3122E);
  border-radius: 14px; padding: 0.4rem 0.85rem;
  font-family: 'Manrope', var(--font-body);
}
.match-title { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1.08; }
.match-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { font-size: 0.78rem; background: rgba(255,255,255,0.12); border-radius: 12px; padding: 0.3rem 0.6rem; }
.chip.strong { font-weight: 700; }
.match-overview { margin: 0; font-size: 0.9rem; line-height: 1.55; color: #C9D6E8; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.match-cast-line { margin: 0; font-size: 0.8rem; color: #A9B9D0; }
.match-cast-line:empty { display: none; }
.match-actions { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }
.match-actions-row { display: flex; gap: 0.7rem; }
.match-actions-row[hidden] { display: none; }
.match-actions-row > * { flex: 1; margin: 0; }
.trailer-btn {
  min-height: 54px;
  border-radius: 999px; border: none;
  background: #fff; color: #05070D;
  font-family: 'Manrope', var(--font-body); font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  cursor: pointer;
  transition: transform .15s ease;
}
.trailer-btn[hidden] { display: none; }
.trailer-btn:active { transform: scale(.97); }
.trailer-btn .ic { width: 22px; height: 22px; }
.match-overlay.show .match-poster { animation: posterZoom 1.2s cubic-bezier(.2,.8,.2,1) both; }
.match-overlay.show { animation: fadeIn .3s ease both; }
.match-overlay.show .match-content > * { animation: rowIn .5s cubic-bezier(.2,.8,.2,1) both; }
.match-overlay.show .match-content > :nth-child(2) { animation-delay: .08s; }
.match-overlay.show .match-content > :nth-child(3) { animation-delay: .14s; }
.match-overlay.show .match-content > :nth-child(4) { animation-delay: .2s; }
.match-overlay.show .match-content > :nth-child(n+5) { animation-delay: .26s; }
.match-overlay.show .match-pill { animation: pillPop .6s cubic-bezier(.2,.9,.3,1.5) both; }
.match-overlay.hiding { animation: fadeOut .26s ease both; }
@keyframes posterZoom { from { transform: scale(1.12); filter: blur(6px); } to { transform: none; filter: none; } }
@keyframes pillPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

/* --- трейлер --- */
.trailer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(2,4,8,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.trailer-overlay[hidden] { display: none; }
.trailer-overlay.show { animation: fadeIn .25s ease both; }
.trailer-overlay.show .trailer-box { animation: cardEnter .4s cubic-bezier(.2,.9,.3,1.1) both; }
.trailer-box { width: 100%; max-width: 900px; }
.trailer-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.trailer-frame iframe, .trailer-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.trailer-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem; padding: 1rem; text-align: center; color: #A9B9D0; font-size: 0.95rem; }
.trailer-msg p { margin: 0; }
.trailer-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(95,184,255,0.25); border-top-color: #5FB8FF; animation: trailerSpin .9s linear infinite; }
@keyframes trailerSpin { to { transform: rotate(360deg); } }
.trailer-fallback { text-align: center; color: #A9B9D0; font-size: 0.85rem; margin: 1rem 0 0; }
.trailer-fallback p { margin: 0 0 0.6rem; }
.trailer-open {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.4rem; border-radius: 999px;
  background: var(--wine, #A3122E); color: #fff; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 0 18px rgba(163,18,46,0.5);
}
.trailer-open:active { transform: scale(.97); }
.trailer-open .ic { width: 18px; height: 18px; }
.trailer-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; background: rgba(255,255,255,0.12); border: none; color: #fff; border-radius: 50%; }

/* --- модалки --- */
.modal-overlay:not([hidden]) { animation: fadeIn .22s ease both; }
.modal-overlay:not([hidden]) .modal-sheet { animation: sheetUp .38s cubic-bezier(.2,.8,.2,1) both; }
.login-overlay:not([hidden]) .modal-sheet { animation: cardEnter .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-sheet { background: var(--sheet); border-radius: 26px 26px 0 0; }
.login-sheet { border-radius: 26px; }
.detail-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.1rem; }
.detail-actions .trailer-btn { background: var(--accent-grad); color: var(--on-accent); }
.fav-toggle {
  min-height: 48px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-family: inherit; font-weight: 600; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  cursor: pointer;
}
.fav-toggle.on { color: var(--accent-y); border-color: var(--accent-y); }
.fav-toggle.on .ic { fill: currentColor; }
.fav-toggle.on { color: #5FB8FF; border-color: #5FB8FF; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  width: max-content;
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 30px var(--shadow-strong);
  z-index: 120;
  pointer-events: none;
}
.toast[hidden] { display: none; }
.toast.show { animation: toastIn 2.6s ease both; }
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, 16px); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 8px); }
}

/* --- админка --- */
.screen-admin { align-items: center; }
.admin-scroll { width: 100%; max-width: 640px; flex: 1; min-height: 0; overflow-y: auto; padding: 0 1rem 1rem; }
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 2px; }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
.kpi-label { font-size: 0.72rem; color: var(--text-soft); }
.admin-search {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 0.8rem; margin-bottom: 0.9rem; color: var(--text-soft);
}
.admin-search input { flex: 1; min-height: 44px; border: none; background: none; color: var(--text); font-family: inherit; font-size: 0.92rem; }
.admin-search input:focus { outline: none; }
.admin-wrap { padding: 0; max-width: none; width: 100%; }
.admin-couple-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 0.9rem; margin-bottom: 0.8rem;
  animation: rowIn .4s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.admin-couple-head { display: flex; align-items: center; gap: 0.7rem; }
.admin-avatars { display: flex; flex-shrink: 0; }
.admin-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-grad); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 2px solid var(--card);
}
.admin-av + .admin-av { margin-left: -12px; background: #5FB8FF; color: #fff; }
.admin-couple-title { min-width: 0; }
.admin-couple-names { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-couple-id { font-size: 0.74rem; color: var(--text-soft); font-family: ui-monospace, monospace; }
.admin-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.7rem 0 0.4rem; }
.admin-chips .chip { background: var(--chip); color: var(--text); }
.admin-member { border-top: 1px solid var(--line); }
.admin-member summary {
  list-style: none;
  display: flex; align-items: center; gap: 0.6rem;
  min-height: 52px; padding: 0.4rem 0;
  cursor: pointer;
}
.admin-member summary::-webkit-details-marker { display: none; }
.admin-member[open] .chevron { transform: rotate(90deg); }
.admin-member .chevron { width: 18px; height: 18px; color: var(--text-soft); transition: transform .25s ease; }
.admin-member-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-member-name { font-weight: 600; font-size: 0.92rem; }
.admin-tag { font-size: 0.66rem; font-weight: 700; color: var(--accent-p); border: 1px solid var(--accent-p); border-radius: 6px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.admin-username { font-size: 0.74rem; color: var(--text-soft); font-family: inherit; }
.admin-progress {
  --p: 0;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 700;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 78%), conic-gradient(var(--accent-p) calc(var(--p) * 1%), var(--line) 0);
}
.admin-member-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; padding: 0 0 0.7rem; }
.admin-member-grid > div { background: var(--chip); border-radius: 12px; padding: 0.5rem 0.65rem; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.admin-member-grid > div.wide { grid-column: 1 / -1; }
.admin-member-grid span { font-size: 0.7rem; color: var(--text-soft); }
.admin-member-grid b { font-size: 0.86rem; font-weight: 600; overflow-wrap: anywhere; }
.admin-member .admin-delete-btn { width: 100%; min-height: 44px; margin: 0 0 0.7rem; border-radius: 12px; }
.admin-form .primary-btn { margin-top: 1rem; }
@media (min-width: 720px) {
  .admin-member-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-member-grid > div.wide { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
.screen-admin { overflow: hidden; }
.admin-member-name { margin: 0; font-family: var(--font-body); }
:root .tab.active { color: var(--tab-active-fg); }
.card-fav { right: auto; left: 12px; }
#live-quiz { overflow: hidden; }
#live-quiz .quiz-body { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -0.3rem; padding: 0 0.3rem 0.5rem; }
.toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); }
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, -16px); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

/* --- правки 28.10: прокрутка, панель совпадений, оценки --- */
/* Прокручивается внутренний блок, а не сам экран: так надёжнее на iPhone */
.screen-profile, .screen-settings { overflow: hidden; }
.screen-profile .profile-scroll, .screen-settings .profile-scroll, .home-scroll, .admin-scroll, .matches-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.screen-profile .profile-scroll { padding: 0 1.2rem 1.2rem; }
.screen-profile .hero { padding-top: 0.2rem; }
.screen-profile .stat-grid, .screen-profile .nav-list { padding-left: 0; padding-right: 0; }

.matches-tabs, .sort-seg { width: calc(100% - 2.4rem); max-width: 440px; margin-left: auto; margin-right: auto; }
.matches-tabs { margin-bottom: 0.6rem; }
.sort-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  flex-shrink: 0;
  margin-bottom: 0.7rem;
}
.sort-seg button {
  min-height: 40px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.sort-seg button .ic { width: 17px; height: 17px; }
.sort-seg button[aria-checked="true"] { background: var(--card); color: var(--text); box-shadow: 0 2px 8px var(--shadow-soft); }
.sort-seg button[aria-checked="true"] { background: rgba(255,255,255,0.16); }
.mood-filter-row { padding: 0 1.2rem; margin-bottom: 0.8rem; max-width: 480px; }
.mood-filter-row .mood-chip { min-height: 36px; background: var(--glass); }
.mood-chip.selected { border-color: transparent; }

/* оценки в «Просмотрено» */
.match-row .rating-wrap { margin-top: 0.35rem; }
.match-row .rating-stars { display: flex; gap: 2px; }
.match-row button.rating-star {
  margin: 0; padding: 0;
  width: 32px; height: 32px;
  border: none; background: none;
  border-radius: 50%;
  color: var(--accent-y);
  display: flex; align-items: center; justify-content: center;
}
.match-row button.rating-star { color: #5FB8FF; }
.match-row button.rating-star:hover { color: var(--accent-y); border: none; }
.rating-star .ic { width: 22px; height: 22px; }
.rating-star.on .ic { fill: currentColor; }
.rating-notes { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.rating-note { font-size: 0.7rem; font-weight: 600; border-radius: 999px; padding: 0.15rem 0.5rem; background: var(--chip); color: var(--text-soft); }
.rating-note.partner { background: rgba(163,18,46,0.18); color: var(--good); }
.match-row .match-meta { line-height: 1.4; }

/* рейтинг в описании фильма — в строке, а не в углу поверх крестика */
.movie-detail-meta .rating-badge { position: static; display: inline-flex; vertical-align: middle; margin-left: 0.2rem; }
.mood-filter-row .mood-chip.selected { background: var(--accent-grad); color: var(--on-accent); }

/* --- «Вышла новая версия» (автообновление, см. app.js) --- */
.update-bar {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  width: max-content;
  background: var(--text);
  color: var(--bg);
  border: 0;
  padding: 0.75rem 1.1rem;
  border-radius: 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 30px var(--shadow-strong);
  z-index: 121;
  cursor: pointer;
}
.update-bar[hidden] { display: none; }

/* приглашение в «Смотреть сейчас»: ответы того, кто начал */
.offer-who { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; font-weight: 700; font-size: 0.92rem; }
.pair-avatar.small { width: 40px; height: 40px; font-size: 1.05rem; }
.offer-list { display: flex; flex-direction: column; gap: 0.5rem; }
.offer-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  animation: rowIn .4s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.offer-title { font-size: 0.8rem; color: var(--text-soft); flex-shrink: 0; }
.offer-value { font-weight: 600; font-size: 0.92rem; text-align: right; }
.offer-value.muted { color: var(--text-soft); font-weight: 500; }
#live-invite-join[hidden] { display: none; }

/* =====================================================================
   КиноМэтч: фирменные шрифт, логотип, заставка и подсветки
   ===================================================================== */

/* Akony очень широкий и только прописной — размеры подобраны под экран 360–390 px */
.top-title.big, .top-title.brand, .tile-title, .home-ring-value, .primary-btn, .landing-title {
  font-family: var(--font-brand);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.top-title.big { font-size: 1.05rem; font-weight: 400; }
.top-title.brand { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; font-size: 0.95rem; }
.brand-logo {
  width: 22px; height: 25px;
  fill: none;
  stroke: var(--wine);
  stroke-width: 7;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(163,18,46,0.8));
}
.home-ring-value { font-size: 2.2rem; }
.home-tile.short .tile-title { font-family: var(--font-display); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.home-tile:not(.short) .tile-title { font-size: 0.74rem; line-height: 1.35; }
.primary-btn { font-size: 0.85rem; }
.primary-btn.small { font-family: var(--font-display); font-weight: 700; text-transform: none; letter-spacing: 0; }

/* Аватар и счётчики */
.avatar-btn {
  background: rgba(95,184,255,0.1);
  color: var(--blue);
  border: 1px solid rgba(95,184,255,0.55);
  box-shadow: 0 0 16px rgba(95,184,255,0.4);
  font-family: var(--font-display);
}
.home-ring { background: conic-gradient(var(--wine) calc(var(--p) * 1%), var(--line) 0); filter: drop-shadow(0 0 14px rgba(163,18,46,0.45)); }
.home-ring-inner { background: var(--bg); }
.tab-badge { background: var(--wine); color: #fff; }
.tab.active { color: var(--tab-active-fg); }
.tab-indicator { border: 1px solid rgba(163,18,46,0.6); box-shadow: 0 0 16px rgba(163,18,46,0.4); }

/* Плитки главного меню: стекло со свечением */
.home-tile { position: relative; overflow: hidden; background: rgba(255,255,255,0.04); }
.home-tile > * { position: relative; }
/* Свечение нарисовано градиентом в самом фоне: размытые слои Safari на iPhone не обрезал по скруглённым углам */
.home-tile:not(.short) { backdrop-filter: none; -webkit-backdrop-filter: none; }
.home-tile:not(.short):not(.accent) {
  border-color: rgba(95,184,255,0.3);
  background:
    radial-gradient(70% 60% at 15% 100%, rgba(95,184,255,0.5), transparent 70%),
    linear-gradient(170deg, #0E1A30, #070B14);
}
.home-tile.accent {
  background:
    radial-gradient(75% 65% at 90% 0%, rgba(163,18,46,0.75), transparent 70%),
    linear-gradient(170deg, #2E0A11, #12040A);
  border: 1px solid rgba(163,18,46,0.6);
  color: var(--text);
  box-shadow: 0 0 28px rgba(163,18,46,0.35);
}
.home-tile.accent .tile-ic { color: #F1DADD; }
.home-tile.short:last-child .tile-ic { color: var(--wine); }

/* Кнопки свайпа: голубое «мимо», бордовое «хочу» */
.round-btn.dislike {
  background: rgba(95,184,255,0.1);
  color: var(--blue);
  border: 2px solid var(--blue);
  box-shadow: 0 0 20px rgba(95,184,255,0.5), inset 0 0 12px rgba(95,184,255,0.25);
}
.round-btn.like {
  background: rgba(163,18,46,0.2);
  color: #F1DADD;
  border: 2px solid var(--wine);
  box-shadow: 0 0 22px rgba(163,18,46,0.6), inset 0 0 12px rgba(163,18,46,0.35);
}

/* Экран совпадения */
.match-pill { background: var(--wine); font-family: var(--font-display); box-shadow: 0 0 16px rgba(163,18,46,0.55); }
.trailer-btn {
  background: rgba(95,184,255,0.08);
  color: var(--blue);
  border: 1px solid rgba(95,184,255,0.55);
  font-family: var(--font-display);
  font-weight: 700;
}

/* Заставка: чёрный снизу переходит в голубой, пятна света двигаются как в лава-лампе */
.landing-screen {
  overflow: hidden;
  padding: 0;
  background: linear-gradient(0deg, #010507 0%, #02090D 30%, #0F2C47 60%, #2F6EA6 85%, #3F8CCB 100%);
}
.splash-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--blue);
  filter: blur(55px);
  pointer-events: none;
}
/* лава-лампа: пятна заметно плывут, растягиваются и сжимаются, каждое в своей части экрана */
.splash-blob.b1 { right: -60px; top: 24%; width: 240px; height: 280px; opacity: 0.85; animation: lavaA 9s ease-in-out infinite; }
.splash-blob.b2 { left: -90px; top: 52%; width: 240px; height: 260px; opacity: 0.8; animation: lavaB 11s ease-in-out infinite; }
.splash-blob.b3 { left: 50%; top: -60px; width: 300px; height: 220px; margin-left: -150px; opacity: 0.45; filter: blur(60px); animation: lavaC 8s ease-in-out infinite; }
.splash-blob.b5 { left: 10%; top: 34%; width: 160px; height: 170px; opacity: 0.55; filter: blur(48px); animation: lavaD 13s ease-in-out infinite; }
.splash-blob.b4 { left: 50%; bottom: -40px; width: 340px; height: 240px; margin-left: -170px; background: #000204; opacity: 0.9; filter: blur(50px); animation: lavaC 10s ease-in-out infinite reverse; }
@keyframes lavaA {
  0%, 100% { transform: translate(0, 0) scale(1, 1); }
  25% { transform: translate(-110px, 60px) scale(1.25, 0.85); }
  50% { transform: translate(-60px, 160px) scale(0.85, 1.2); }
  75% { transform: translate(30px, 70px) scale(1.15, 1); }
}
@keyframes lavaB {
  0%, 100% { transform: translate(0, 0) scale(1, 1); }
  30% { transform: translate(130px, -70px) scale(0.85, 1.25); }
  60% { transform: translate(70px, -150px) scale(1.3, 0.9); }
  80% { transform: translate(20px, -40px) scale(0.95, 1.1); }
}
@keyframes lavaC {
  0%, 100% { transform: translate(0, 0) scale(0.9, 1); }
  50% { transform: translate(70px, 50px) scale(1.25, 0.9); }
}
@keyframes lavaD {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(140px, -40px) scale(1.4, 0.8); }
  66% { transform: translate(60px, 90px) scale(0.8, 1.3); }
}
.landing-inner {
  position: absolute;
  left: 0; right: 0; top: 22%;
  max-width: none;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.landing-logo {
  width: 64px; height: 72px;
  fill: none;
  stroke: var(--wine);
  stroke-width: 5;
  overflow: visible;
  animation: neonPulse 1.8s ease-in-out infinite;
}
.landing-logo rect { transform-box: fill-box; transform-origin: center; }
.logo-card-b { transform: rotate(14deg); }
/* фейковая загрузка: карточки дважды расходятся и сходятся */
.logo-card-a { animation: logoCardA 0.55s ease-in-out 4 alternate; }
.logo-card-b { animation: logoCardB 0.55s ease-in-out 4 alternate; }
@keyframes logoCardA { to { transform: translateX(-26px) rotate(-12deg); } }
@keyframes logoCardB { from { transform: rotate(14deg); } to { transform: translateX(26px) rotate(30deg); } }
@keyframes neonPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(163,18,46,0.9)) drop-shadow(0 0 10px rgba(163,18,46,0.5)); opacity: 0.85; }
  50% { filter: drop-shadow(0 0 7px rgba(163,18,46,1)) drop-shadow(0 0 22px rgba(163,18,46,0.85)); opacity: 1; }
}
@keyframes neonPulseText {
  0%, 100% { text-shadow: 0 0 6px rgba(163,18,46,0.8), 0 0 14px rgba(163,18,46,0.45); }
  50% { text-shadow: 0 0 9px rgba(163,18,46,1), 0 0 26px rgba(163,18,46,0.85); }
}
.landing-title {
  font-size: clamp(1.2rem, 6vw, 1.7rem);
  line-height: 1;
  margin: 0;
  color: var(--wine);
  opacity: 1;
  animation: neonPulseText 1.8s ease-in-out infinite;
}
.landing-cta {
  position: absolute;
  left: 50%; bottom: calc(2.5rem + env(safe-area-inset-bottom));
  width: min(320px, calc(100% - 3rem));
  margin: 0;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  animation: none;
  transition: opacity .5s ease, transform .5s ease;
}
.landing-screen.loaded:not(.behind) .landing-cta { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.landing-screen.loaded:not(.behind) .landing-cta:active { transform: translate(-50%, 0) scale(.97); }
.landing-inner { transition: top .5s cubic-bezier(.2,.8,.2,1); }
.landing-screen.behind .landing-inner { top: max(1.5rem, 7%); }
.landing-screen.leaving { animation: fadeOut .4s ease both; }
/* окно входа на фоне заставки */
.login-overlay { background: rgba(2,4,8,0.35); }
@media (prefers-reduced-motion: reduce) {
  .splash-blob, .landing-logo rect, .landing-logo, .landing-title { animation: none; }
}
.match-actions-row { flex-direction: column-reverse; }

/* Масштабирование выключено: без двойного тапа, а поля ввода не меньше 16px — иначе iOS приближает при фокусе */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, button, a, [role="button"] { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; }
/* Akony широкий: длинная надпись на кнопке переносится, а не вылезает за край */
.primary-btn { white-space: normal; line-height: 1.25; max-width: 100%; }

/* Кнопка трейлера на карточке колоды — под описанием */
.movie-card .card-trailer {
  align-self: flex-start;
  flex-shrink: 0;
  margin-top: 0.65rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(95,184,255,0.55);
  background: rgba(95,184,255,0.08);
  color: var(--blue);
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  cursor: pointer;
}
.movie-card .card-trailer[hidden] { display: none; }
.movie-card .card-trailer:active { transform: scale(.97); }
.movie-card .card-trailer .ic { width: 15px; height: 15px; }

/* Личная подборка: вопросы чипами */
.solo-quiz .filter-section-label.inner:first-child { margin-top: 0.4rem; }
.solo-quiz .year-chip-row { margin-bottom: 0.2rem; }
.match-row .card-fav.inline.like-remove { color: var(--text-soft); }
