/* «Что смотреть?» — оформление «Ночной сеанс»: тёмный зал, янтарный акцент, мотив кинобилета.
   Тёмная тема по умолчанию, светлая — по выбору в профиле. */

:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1016;
  --bg-2: #171923;
  --card: #1a1c27;
  --card-2: #1f2230;
  --pill: #262a3a;
  --seg-on: #2c3043;
  --line: #2a2e3e;
  --line-2: #343850;
  --rule: #1e2130;
  --text: #f4efe6;
  --text-2: #e4ded3;
  --muted: #a8a7b3;
  --faint: #8a8c9b;
  --accent: #f2b441;
  --accent-ink: #1a1204;
  --accent-text: #f2b441;
  --accent-soft: rgba(242, 180, 65, 0.13);
  --good: #5bc489;
  --bad: #ef6461;
  --new: #c63b34;
  --danger: #ff7a73;
  --tabbar: #14151d;
  --tabbar-line: #23263a;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  --backdrop: rgba(5, 6, 10, 0.62);
  --skeleton: #23273a;
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f2ec;
  --bg-2: #ece8df;
  --card: #ffffff;
  --card-2: #f7f4ee;
  --pill: #efebe3;
  --seg-on: #ffffff;
  --line: #e0dacd;
  --line-2: #d3ccbd;
  --rule: #e6e0d4;
  --text: #191a22;
  --text-2: #2c2d36;
  --muted: #5f6170;
  --faint: #6f7181;
  --accent: #f2b441;
  --accent-ink: #1a1204;
  --accent-text: #8f5c00;
  --accent-soft: rgba(242, 180, 65, 0.2);
  --good: #1d8a54;
  --bad: #c9403b;
  --new: #c63b34;
  --danger: #c93a34;
  --tabbar: #fbf9f5;
  --tabbar-line: #e0dacd;
  --shadow: 0 14px 30px rgba(40, 32, 10, 0.16);
  --backdrop: rgba(20, 18, 12, 0.45);
  --skeleton: #e6e0d4;
}

:root {
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', var(--font);
  --gutter: 16px;
  --tabbar-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.locked {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-text);
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.small {
  font-size: 0.875rem;
}

svg.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.i.solid {
  fill: currentColor;
  stroke: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.18;
  margin: 0;
}

h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

.eyebrow {
  display: block;
  margin: 0;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.eyebrow.dim {
  color: var(--muted);
}

/* ---------- шапка и нижнее меню ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) var(--gutter) 8px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 600 16px var(--font-display);
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 0;
  text-decoration: none;
}

.icon-btn:active,
.btn:active,
.act:active,
.round-btn:active {
  transform: scale(0.97);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--tabbar) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--tabbar-line);
}

.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--faint);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.tabbar a[aria-current='page'] {
  color: var(--accent-text);
}

.tabbar .tab-icon svg {
  width: 24px;
  height: 24px;
}

.badge {
  position: absolute;
  top: 10px;
  left: calc(50% + 8px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--new);
  color: #fff;
  font: 700 11px/18px var(--font);
  text-align: center;
}

.view {
  display: block;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 28px);
}

.demo-banner {
  max-width: 640px;
  width: calc(100% - 2 * var(--gutter));
  margin: 6px auto 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.85rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.caption {
  font-size: 13px;
  color: var(--faint);
}

.label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- кнопки, чипы, поля ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--danger);
}

.btn.xl {
  min-height: 56px;
  font-size: 17px;
  width: 100%;
}

.btn.wide {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.btn.sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  scrollbar-width: none;
}

.chips.scroll::-webkit-scrollbar,
.hscroll::-webkit-scrollbar,
.presets::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}

.chip[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.chip.outline[aria-pressed='true'] {
  background: transparent;
}

.chip.drop {
  padding-right: 12px;
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
}

.chip.drop[aria-pressed='true'] {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip.drop svg.i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--card-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.tag-new {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--new);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tag-date {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--pill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.field:focus {
  border-color: var(--accent);
}

textarea.field {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.segmented {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 44px;
  padding: 0 4px;
  white-space: nowrap;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.segmented button[aria-pressed='true'] {
  background: var(--seg-on);
  color: var(--text);
}

#list-tabs button {
  font-size: 14px;
}

.segmented .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.segmented .row-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.segmented .dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: #e5534b;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.card h2 + p {
  margin-top: 6px;
}

/* ---------- подбор: форма ---------- */

.presets {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  scrollbar-width: none;
}

.preset {
  flex: none;
  width: 128px;
  height: 100px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
}

.preset svg.i {
  width: 22px;
  height: 22px;
  color: var(--accent-text);
}

.preset span {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.last-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  text-align: left;
}

.last-pick .grow {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.last-pick b {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ---------- подборка: билеты ---------- */

.screen-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 14px;
}

.screen-top .title {
  font-size: 16px;
  font-weight: 600;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  color: var(--text);
}

.error-box .btn {
  margin-top: 10px;
}

.tickets {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ticket,
.stub-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  animation: rise 0.35s ease both;
}

.ticket {
  border-radius: 22px;
}

.ticket.leaving,
.stub-card.leaving {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.22s, transform 0.22s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.ticket-top {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.ticket-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

.seance {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.perf {
  position: relative;
  height: 22px;
}

.perf::before,
.perf::after {
  content: '';
  position: absolute;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}

.perf::before {
  left: -12px;
}

.perf::after {
  right: -12px;
}

.perf i {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 10px;
  border-top: 2px dashed var(--line-2);
}

.ticket-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 16px 16px;
}

.ticket-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stub-card {
  display: flex;
  border-radius: 18px;
}

.stub-card::before,
.stub-card::after {
  content: '';
  position: absolute;
  left: 34px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}

.stub-card::before {
  top: -10px;
}

.stub-card::after {
  bottom: -10px;
}

.stub {
  flex: none;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px dashed var(--line-2);
}

.stub span {
  font: 600 13px var(--font-display);
  letter-spacing: 0.1em;
  color: var(--accent-text);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.stub-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.stub-head {
  display: flex;
  gap: 12px;
}

.film-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.film-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--text);
  font: 600 16px/1.25 var(--font-display);
}

.film-title.xl {
  font-size: 20px;
  line-height: 1.2;
}

.film-sub {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.why {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}

.ticket .why {
  font-size: 15px;
  line-height: 1.5;
}

.icon-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* постеры */
.poster {
  position: relative;
  flex: none;
  width: 56px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-2);
  border: 0;
  padding: 0;
}

.poster.md {
  width: 68px;
  border-radius: 9px;
}

.poster.lg {
  width: 120px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.poster.xl {
  width: 132px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.poster img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 7px;
  color: var(--text);
  font: 600 10px/1.15 var(--font-display);
  text-align: left;
}

/* рейтинги */
.ratings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.r {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--pill);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.r.has-tag {
  padding-left: 4px;
}

.imdb-tag {
  background: #f5c518;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 4px;
  letter-spacing: -0.01em;
}

.r .lbl {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.r .good {
  color: var(--good);
}

.r .bad {
  color: var(--bad);
}

.r.mine {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.r.mine .lbl {
  color: var(--accent-text);
}

.r.none {
  color: var(--faint);
  font-weight: 500;
}

/* кнопки отметок */
.act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 10px;
  border-radius: 23px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.act svg.i {
  width: 18px;
  height: 18px;
}

.act.skip {
  color: var(--muted);
}

.act[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.act.skip[aria-pressed='true'] {
  border-color: var(--line-2);
  background: var(--pill);
  color: var(--text);
}

.round-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  padding: 0;
}

.round-btn svg.i {
  width: 18px;
  height: 18px;
}

.round-btn.skip {
  color: var(--muted);
}

.round-btn[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* скелетон загрузки */
.skeleton {
  cursor: default;
}

.skeleton .poster,
.skeleton .sk {
  background: var(--skeleton);
  border-radius: 8px;
  animation: pulse 1.2s ease-in-out infinite;
}

.skeleton .sk {
  height: 14px;
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

/* ---------- строки списков ---------- */

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}

.row:last-child {
  border-bottom: 0;
}

.rank {
  flex: none;
  width: 30px;
  font: 600 16px var(--font-display);
  color: var(--faint);
}

.rank.hot {
  color: var(--accent-text);
}

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.row-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.row-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .ratings .r {
  height: 24px;
}

.section-label {
  margin: 8px 0 2px;
}

.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
}

.empty .big {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--card-2);
  color: var(--accent-text);
  margin-bottom: 12px;
}

.empty .big svg.i {
  width: 26px;
  height: 26px;
}

.empty p {
  margin: 4px 0;
}

.roulette-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: var(--accent-soft);
}

.roulette-card .die {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
}

.roulette-card .die svg.i {
  width: 26px;
  height: 26px;
}

.roulette-card .grow {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.roulette-card .grow span {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}

/* ---------- слои: карточка фильма и поиск ---------- */

.layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slide-up 0.24s ease both;
}

#layer-film {
  z-index: 60; /* карточка фильма открывается и поверх поиска */
}

@keyframes slide-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

.layer-top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + var(--safe-t)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.layer-body {
  max-width: 640px;
  margin: 0 auto;
  padding: 4px var(--gutter) calc(32px + var(--safe-b));
}

/* карточка фильма: кнопки «назад» и «поделиться» висят поверх шапки и не уезжают при прокрутке */
.film-layer .layer-top {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.film-layer .layer-top .bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  padding: calc(12px + var(--safe-t)) var(--gutter) 0;
}

.film-layer .layer-top .icon-btn {
  border: 0;
  background: rgba(15, 16, 22, 0.62);
  color: #f4efe6;
}

.film-band {
  position: relative;
  height: calc(220px + var(--safe-t));
  overflow: hidden;
  background: var(--card-2);
}

.film-band .blur {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center 30%;
  filter: blur(26px) saturate(1.2) brightness(0.55);
}

.film-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(36px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.film-head {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-top: -112px;
}

.film-head .grow {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 4px;
}

.film-head h1 {
  font-size: 22px;
  line-height: 1.18;
}

.film-head .orig {
  font-size: 14px;
  color: var(--muted);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tile {
  height: 96px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--text);
  text-align: left;
}

.tile .k {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.tile .v {
  font: 600 28px/1 var(--font-display);
}

.tile .v.good {
  color: var(--good);
}

.tile .votes {
  font-size: 11px;
  color: var(--faint);
  font-weight: 500;
}

.tile.mine {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-2);
}

.tile.mine .v {
  color: var(--accent-text);
}

.tile.mine .cta {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-text);
}

.why-box {
  border-radius: 18px;
  background: var(--accent-soft);
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.why-box .q {
  font: 700 36px/0.8 var(--font-display);
  color: var(--accent-text);
}

.why-box p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-row .act {
  flex-direction: column;
  height: 68px;
  border-radius: 16px;
  gap: 5px;
  font-size: 13px;
  white-space: normal;
  line-height: 1.15;
}

.status-row .act svg.i {
  width: 22px;
  height: 22px;
}

.status-row .act[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.status-row .act.skip[aria-pressed='true'] {
  background: var(--pill);
  color: var(--text);
}

.desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
}

.seasons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.seasons div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.seasons b {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: var(--pill);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.seasons span {
  font-size: 12px;
  color: var(--faint);
}

.facts {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.facts b {
  color: var(--text);
  font-weight: 600;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pair .btn {
  min-height: 50px;
}

.watch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watch-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.watch-list img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.watch-list .grow {
  flex: 1;
}

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 4px;
  scrollbar-width: none;
}

.mini-card {
  flex: none;
  width: 108px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.mini-card .poster {
  width: 108px;
  border-radius: 12px;
}

.mini-card .name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-box {
  flex: 1;
}

.search-box .field {
  min-height: 44px;
  border-radius: 22px;
  padding: 0 16px;
}

/* ---------- всплывающее окно (оценка, рулетка, выбор) ---------- */

.popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--backdrop);
  animation: fade 0.18s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.popup-panel {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 22px var(--gutter) calc(20px + var(--safe-b));
  animation: slide-up 0.22s ease both;
}

@media (min-width: 600px) {
  .popup {
    align-items: center;
  }

  .popup-panel {
    border-radius: 24px;
  }
}

.popup-panel h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.popup-actions .btn {
  flex: 1;
  min-height: 48px;
}

.rating-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

@media (min-width: 520px) {
  .rating-picker {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
  }
}

.rating-picker button {
  height: 48px;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0;
}

.rating-picker button[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.roulette {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.roulette .poster {
  width: 160px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.roulette .spin img {
  animation: flick 0.12s steps(1) infinite;
}

@keyframes flick {
  50% {
    opacity: 0.7;
  }
}

/* ---------- профиль ---------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font: 600 22px var(--font-display);
  flex: none;
}

.avatar.sm {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
}

.stats b {
  display: block;
  font: 600 24px var(--font-display);
}

.stats span {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--pill);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.user-row:first-child {
  border-top: 0;
}

.user-row .grow {
  flex: 1;
  min-width: 0;
}

.user-row .actions {
  display: flex;
  gap: 6px;
}

.link-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  word-break: break-all;
  font-size: 14px;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 14px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

details.more summary {
  list-style: none;
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

details.more summary::-webkit-details-marker {
  display: none;
}

/* ---------- уведомление снизу ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: rise 0.2s ease both;
}

/* уведомление контрастно теме: в тёмной оно светлое, в светлой — тёмное */
.toast button {
  border: 0;
  background: none;
  color: #8a5300;
  font-weight: 700;
  padding: 4px;
  min-height: 36px;
}

[data-theme='light'] .toast button {
  color: #f2b441;
}

/* ---------- страницы входа и приглашения ---------- */

.gate-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--gutter);
}

.gate-card {
  width: min(420px, 100%);
  padding: 28px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.gate-card .brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.gate-card h1 {
  margin: 18px 0 8px;
  font-size: 26px;
}

.gate-card p {
  margin: 0 0 6px;
}

.gate-form {
  display: grid;
  gap: 8px;
  margin: 20px 0 14px;
}

.gate-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

.gate-form .btn {
  margin-top: 10px;
}

.gate-error {
  color: var(--danger);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.noscript {
  padding: 24px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
