/* Tropa — «кинотеатр» в казахской гамме, для молодёжи.
   Встреча — сеанс, запись — билет, места — кресла зала.
   Цвета Дархана: почти чёрный с зелёным отливом, зелёный (бархат занавеса), золото (лампочки вывески, тиснение).
   Формы: вывеска с рамкой из лампочек и фестонами занавеса (шапка страницы), билеты с корешком,
   перфорацией и вырезами, схема зала, кнопки-«таблетки». Орнамент «қошқар мүйіз» (static/ornament.svg, mask) —
   как тиснение. Шрифт — Onest (OFL, static/fonts, с казахскими буквами). Цвета — только через переменные. */

@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap; src: url(fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap; src: url(fonts/onest-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap; src: url(fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* тёмное: зал, вывеска, билеты */
  --ink: #0d1411;
  --ink-2: #15201b;
  --ink-3: #213028;
  --on-ink: #f1f5f2;
  --on-ink-muted: #a3b8ab;
  /* бархат занавеса */
  --velvet: #14532d;
  --green: #1f8a5b;
  --green-hover: #187049;
  --mint: #8fe0b4;
  /* золото */
  --gold: #d9a521;
  --gold-hover: #e9b838;
  --gold-light: #ffe7a3;
  --on-gold: #0d1411;
  --gold-soft: #f6ebc8;
  /* светлое: фойе */
  --bg: #edf1ee;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --text: #0d1411;
  --muted: #55625b;
  --line: #d6ded9;
  --accent: #137a4d;
  --accent-hover: #0f5c3a;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --focus: #1f8a5b;
  --cat-nature: #1f9d63;
  --cat-active: #2a86c0;
  --cat-indoor: #dd8a17;
  --cat-culture: #c04f80;
  --on-cat: #ffffff;
  --r-card: 18px;
  --r-field: 12px;
  --header-h: 62px;
  color-scheme: light dark;
}
/* Тема: «как в системе» (по умолчанию) или выбранная в настройках — <html data-scheme="light|dark">. */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #0a100d;
    --surface: #121b16;
    --surface-2: #18231d;
    --text: #e8efea;
    --muted: #9fb2a6;
    --line: #26352d;
    --accent: #8fe0b4;
    --accent-hover: #b3ecca;
    --gold-soft: #33290f;
    --danger: #f2948c;
    --danger-soft: #3a1f1d;
    --focus: #d9a521;
    --ink-2: #17241e;
    --cat-nature: #3cc185;
    --cat-active: #5aaee6;
    --cat-indoor: #f0a243;
    --cat-culture: #e07aa6;
    --on-cat: #0d1411;
  }
}
:root[data-scheme="dark"] {
  --bg: #0a100d;
  --surface: #121b16;
  --surface-2: #18231d;
  --text: #e8efea;
  --muted: #9fb2a6;
  --line: #26352d;
  --accent: #8fe0b4;
  --accent-hover: #b3ecca;
  --gold-soft: #33290f;
  --danger: #f2948c;
  --danger-soft: #3a1f1d;
  --focus: #d9a521;
  --ink-2: #17241e;
  --cat-nature: #3cc185;
  --cat-active: #5aaee6;
  --cat-indoor: #f0a243;
  --cat-culture: #e07aa6;
  --on-cat: #0d1411;
  color-scheme: dark;
}
:root[data-scheme="light"] { color-scheme: light; }

/* Стиль «Хэллоуин» (<html data-style="halloween">): чёрный, белый и оранжевый вместо золота,
   фиолетовый бархат, паутина и летучие мыши на вывеске. */
:root[data-style="halloween"] {
  --ink: #0b0b0c; --ink-2: #17171a; --ink-3: #2a2a2f; --on-ink: #f5f5f4; --on-ink-muted: #b5b5bb;
  --velvet: #3b1f52; --green: #1c1c1f; --green-hover: #000000; --mint: #ffb066;
  --gold: #f07a1a; --gold-hover: #ff8f33; --gold-light: #ffd9b3; --on-gold: #0b0b0c; --gold-soft: #fde3cc;
  --bg: #f3f3f1; --surface-2: #f6f6f5; --text: #0b0b0c; --muted: #5d5d63; --line: #deded9;
  --accent: #c2500a; --accent-hover: #9a3f08; --focus: #f07a1a;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="halloween"]:not([data-scheme="light"]) {
    --bg: #0b0b0c; --surface: #151517; --surface-2: #1c1c1f; --text: #f1f1f0; --muted: #a8a8ae; --line: #2b2b30;
    --accent: #ff9a3c; --accent-hover: #ffb873; --gold-soft: #3a240f; --green: #3a3a40; --green-hover: #4a4a52; --ink-2: #19191c;
  }
}
:root[data-style="halloween"][data-scheme="dark"] {
  --bg: #0b0b0c; --surface: #151517; --surface-2: #1c1c1f; --text: #f1f1f0; --muted: #a8a8ae; --line: #2b2b30;
  --accent: #ff9a3c; --accent-hover: #ffb873; --gold-soft: #3a240f; --green: #3a3a40; --green-hover: #4a4a52; --ink-2: #19191c;
}

/* База */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: color-mix(in srgb, var(--green) 60%, var(--line)) transparent; accent-color: var(--green); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { text-wrap: balance; }
h1 { font: 800 clamp(34px, 6vw, 60px)/1.02 var(--font); letter-spacing: -0.035em; margin: 0 0 16px; }
h2 { font: 800 26px/1.15 var(--font); letter-spacing: -0.02em; margin: 48px 0 18px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 36px 20px 80px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--gold); color: var(--on-gold); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.err { color: var(--danger); font-size: 14px; font-weight: 500; margin: 0; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 2000; padding: 8px 16px;
  background: var(--gold); color: var(--on-gold); border-radius: 999px; font-weight: 700;
}
.skip:focus { top: 8px; color: var(--on-gold); }

/* Шапка сайта */
.top {
  position: relative; z-index: 1100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--header-h); padding: 10px 24px;
  background: var(--ink); color: var(--on-ink);
}
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav > a:not(.btn), .top .link { color: var(--on-ink); text-decoration: none; font-weight: 600; }
.top nav > a:not(.btn):hover, .top .link:hover { color: var(--gold); }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 24px/1 var(--font); letter-spacing: -0.04em; text-decoration: none; color: var(--on-ink); }
.logo:hover { color: var(--on-ink); }
.logo-mark { width: 30px; height: 30px; flex: none; background: var(--gold);
  -webkit-mask: url(ornament.svg) center / contain no-repeat; mask: url(ornament.svg) center / contain no-repeat; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; }

/* Шапка страницы — вывеска кинотеатра: рамка из лампочек, тиснёный орнамент, снизу фестоны занавеса */
.masthead {
  --bulbs: radial-gradient(circle, var(--gold-light) 0 2px, var(--gold) 2.5px 4px, color-mix(in srgb, var(--gold) 30%, transparent) 4.5px 7px, transparent 7.5px);
  position: relative; isolation: isolate; margin-bottom: 22px;
  background: var(--ink); color: var(--on-ink);
}
/* лампочки сверху и снизу */
.masthead::before {
  content: ""; position: absolute; inset: 12px 0 auto; height: 16px; z-index: -1;
  background: var(--bulbs) center / 26px 16px repeat-x;
}
.masthead-in::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 12px; height: 16px;
  background: var(--bulbs) center / 26px 16px repeat-x;
}
/* фестоны занавеса под вывеской */
.masthead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 22px;
  background: radial-gradient(circle at 50% 0, var(--velvet) 0 17px, transparent 17.5px) center top / 36px 22px repeat-x;
}
.masthead-in { position: relative; overflow: hidden; max-width: none; padding: 52px max(20px, calc((100vw - 1040px) / 2 + 20px)) 60px; }
/* тиснёный орнамент справа, уходит за край */
.masthead-in::before {
  content: ""; position: absolute; z-index: -1; right: -90px; top: 50%; width: 400px; height: 400px; transform: translateY(-50%);
  background: var(--velvet);
  -webkit-mask: url(ornament.svg) center / contain no-repeat; mask: url(ornament.svg) center / contain no-repeat;
}
.masthead h1 { color: var(--on-ink); max-width: 16ch; }
.masthead .lead { color: var(--on-ink-muted); font-size: 18px; max-width: 46ch; margin: 0 0 26px; }
.masthead .lead:last-child { margin-bottom: 0; }
.masthead .lead a { color: var(--on-ink); }
.masthead .back { color: var(--mint); }
.back { display: inline-block; margin: 0 0 18px; font-size: 15px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.tally span { padding: 6px 14px; border-radius: 999px; background: var(--ink-3); color: var(--on-ink-muted); font-size: 15px; }
.tally strong { color: var(--gold); font-weight: 800; margin-left: 4px; }

/* Подвал */
.foot { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink-muted); }
.foot::after {
  content: ""; position: absolute; right: -60px; bottom: -90px; width: 220px; height: 220px; background: var(--velvet);
  -webkit-mask: url(ornament.svg) center / contain no-repeat; mask: url(ornament.svg) center / contain no-repeat;
}
.foot-in { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 28px 20px 32px; font-size: 14px; display: grid; gap: 8px; }
.foot p { margin: 0; }
.foot p + p { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot strong { color: var(--on-ink); font-weight: 800; font-size: 16px; letter-spacing: -0.03em; }
.foot a { color: var(--on-ink); }
.map-body .foot { display: none; }

/* Кнопки — «таблетки» */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 12px 22px; background: var(--green); color: #ffffff;
  font: 700 15px/1.2 var(--font); text-decoration: none;
  transition: background-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--green-hover); color: #ffffff; }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn.accent { background: var(--gold); color: var(--on-gold); }
.btn.accent:hover { background: var(--gold-hover); color: var(--on-gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 30%, transparent); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--green); color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.light { background: var(--on-ink); color: var(--ink); }
.btn.light:hover { background: #ffffff; color: var(--ink); }
.btn.light.ghost { background: transparent; color: var(--on-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-ink) 40%, transparent); }
.btn.light.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Поверхности и формы */
.card { background: var(--surface); border-radius: var(--r-card); padding: 26px; }
.form { max-width: 460px; margin: 8px auto 0; display: grid; gap: 16px; }
.form.wide { max-width: 680px; }
.form h1 { font-size: 30px; margin: 0; }
.form h2 { margin: 0; font-size: 21px; }
.form + .form { margin-top: 20px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
input, select, textarea {
  font: 400 16px/1.4 var(--font); color: var(--text); background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: var(--r-field); padding: 11px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 20%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { resize: vertical; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice legend { font-weight: 600; margin-bottom: 6px; }
.flash { margin: 0 0 24px; padding: 13px 20px; border-radius: 999px; background: var(--gold-soft); color: var(--text); font-weight: 600; }
.note { margin: 0 0 8px; padding: 14px 18px; border-radius: var(--r-card); background: var(--surface); color: var(--muted); font-size: 15px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 48px 0 18px; }
.page-head h2 { margin: 0; }
.page-head.first { margin-top: 8px; }

/* Друзья */
.friend-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.friend-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); }
.friend-list a { font-weight: 700; color: var(--text); text-decoration: none; }
.friend-requests { margin-bottom: 8px; }
.friend-requests h2 { margin-top: 0; }
.friend-requests .friend-list li { background: var(--surface-2); }
.friend-actions { display: flex; gap: 6px; margin-left: auto; }
.friend-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--text); }

/* Админка */
.page-head h1 { margin: 0; }
.admin-tabs { display: flex; gap: 6px; }
.admin-tabs a { padding: 7px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; color: var(--text); background: var(--surface); }
.admin-tabs a[aria-current="page"] { background: var(--green); color: #ffffff; }
.admin-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 16px; }
.admin-search input { flex: 1 1 260px; width: auto; border-radius: 999px; }
.admin-reset { display: grid; gap: 10px; margin: 0 0 18px; border: 2px solid var(--gold); }
.admin-reset p { margin: 0; }
.admin-reset input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.admin-table-wrap { overflow-x: auto; border-radius: var(--r-card); background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.admin-table th { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td:nth-child(n+3):not(.admin-actions) { white-space: nowrap; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty {
  display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--muted);
  padding: 32px 22px; border-radius: var(--r-card); background: var(--surface);
}
.empty::before {
  content: ""; width: 44px; height: 44px; background: var(--gold);
  -webkit-mask: url(ornament.svg) center / contain no-repeat; mask: url(ornament.svg) center / contain no-repeat;
}
.empty p { margin: 0; max-width: 50ch; }
.empty strong { color: var(--text); }

/* Цвета групп мест */
.cat-nature { --c: var(--cat-nature); }
.cat-active { --c: var(--cat-active); }
.cat-indoor { --c: var(--cat-indoor); }
.cat-culture { --c: var(--cat-culture); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
}
.masthead .badge { background: var(--ink-3); color: var(--on-ink); }
.badge.open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.badge.cancelled, .masthead .badge.cancelled { background: var(--danger-soft); color: var(--danger); }
.badge.closed, .badge.past { color: var(--muted); }
.masthead .badge.closed, .masthead .badge.past { color: var(--on-ink-muted); }

/* Билеты: золотой корешок с датой, перфорация, вырезы, тиснёный орнамент */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.ticket {
  --notch: radial-gradient(circle at 96px 0, transparent 0 10px, #000 10.5px), radial-gradient(circle at 96px 100%, transparent 0 10px, #000 10.5px);
  position: relative; display: grid; grid-template-columns: 96px 1fr;
  background: var(--ink-2); color: var(--on-ink); border-radius: 14px; text-decoration: none;
  -webkit-mask: var(--notch); -webkit-mask-composite: source-in; mask: var(--notch); mask-composite: intersect;
  transition: background-color .15s;
}
.ticket:hover { color: var(--on-ink); background: var(--ink-3); }
.stub {
  display: grid; align-content: center; justify-items: center; gap: 2px; padding: 18px 6px; text-align: center;
  background: var(--gold); color: var(--on-gold); border-radius: 14px 0 0 14px;
  border-right: 2px dashed color-mix(in srgb, var(--on-gold) 35%, transparent);
}
.stub-day { font: 800 40px/1 var(--font); letter-spacing: -0.04em; }
.stub-month { font-size: 13px; font-weight: 600; }
.stub-time { font: 800 16px/1.2 var(--font); margin-top: 4px; }
.ticket-body { position: relative; overflow: hidden; display: grid; align-content: center; gap: 4px; padding: 16px 20px 16px 18px; min-width: 0; }
/* тиснение */
.ticket-body::after {
  content: ""; position: absolute; right: -28px; bottom: -28px; width: 96px; height: 96px; background: var(--ink-3);
  -webkit-mask: url(ornament.svg) center / contain no-repeat; mask: url(ornament.svg) center / contain no-repeat;
}
.ticket:hover .ticket-body::after { background: color-mix(in srgb, var(--gold) 45%, var(--ink-3)); }
.ticket-place { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--on-ink-muted); }
.ticket-place .pin { flex: none; }
.ticket-title { position: relative; z-index: 1; font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.ticket-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 14px; color: var(--on-ink-muted); }
.ticket .pin { width: 8px; height: 8px; border-width: 0; box-shadow: none; }
.ticket .badge { background: var(--ink-3); color: var(--on-ink); }
.ticket .badge.cancelled { background: var(--danger-soft); color: var(--danger); }

/* Список встреч */
.filters { display: grid; grid-template-columns: 2fr 1fr auto; gap: 14px; align-items: end; margin: 0 0 8px; padding: 20px; border-radius: var(--r-card); background: var(--surface); }
.filter-actions { display: flex; align-items: center; gap: 14px; }
.count { color: var(--muted); margin: 18px 0 16px; min-height: 1em; font-weight: 600; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 28px 0; }

/* Страница встречи: большой билет-корешок в вывеске, схема зала */
.masthead-meetup { display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center; }
.stub.big {
  --cut: radial-gradient(circle at 0 50%, transparent 0 12px, #000 12.5px) left / 51% 100% no-repeat,
         radial-gradient(circle at 100% 50%, transparent 0 12px, #000 12.5px) right / 51% 100% no-repeat;
  min-width: 140px; padding: 22px 26px; border: 0; border-radius: 12px;
  -webkit-mask: var(--cut); mask: var(--cut);
}
.stub.big .stub-day { font-size: 64px; }
.stub.big .stub-month { font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 28px; }
.facts div { padding: 16px 18px; border-radius: var(--r-card); background: var(--surface); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 2px 0 0; font: 800 24px/1.2 var(--font); letter-spacing: -0.02em; }
.facts dd a { text-decoration: none; }
.hall { margin: 0 0 28px; padding: 22px 24px 20px; border-radius: var(--r-card); background: var(--ink-2); color: var(--on-ink); }
.screen {
  height: 10px; margin: 0 auto 22px; width: 70%; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: linear-gradient(var(--gold), color-mix(in srgb, var(--gold) 20%, transparent));
}
.seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; max-width: 520px; margin: 0 auto; padding: 0; list-style: none; }
.seat { width: 26px; height: 22px; border-radius: 8px 8px 4px 4px; background: transparent; box-shadow: inset 0 0 0 2px var(--ink-3); position: relative; }
.seat::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: -5px; height: 3px; border-radius: 2px; background: var(--ink-3); }
.seat.taken { background: var(--gold); box-shadow: none; }
.seat.taken::after { background: color-mix(in srgb, var(--gold) 60%, var(--ink)); }
.hall-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 18px 0 0; font-size: 14px; color: var(--on-ink-muted); }
.hall-legend span { display: inline-flex; align-items: center; gap: 8px; }
.hall-legend span::before { content: ""; width: 12px; height: 10px; border-radius: 4px 4px 2px 2px; box-shadow: inset 0 0 0 2px var(--ink-3); }
.hall-legend .taken::before { background: var(--gold); box-shadow: none; }
.description { white-space: pre-line; max-width: 66ch; margin: 0 0 24px; font-size: 17px; }
.join { margin: 0 0 8px; padding: 22px 24px; border-radius: var(--r-card); background: var(--surface); }
.join p { margin: 0 0 14px; }
.join p:last-child, .join form:last-child { margin-bottom: 0; }
.people { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.people li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); }
.people a { font-weight: 700; text-decoration: none; color: var(--text); }
.people a:hover { color: var(--accent); }

/* Чат встречи */
.chat { margin-top: 36px; }
.messages { list-style: none; margin: 0 0 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  max-height: 460px; overflow-y: auto; border-radius: var(--r-card); background: var(--surface); }
.messages:empty { display: none; }
.msg { align-self: flex-start; max-width: min(78%, 560px); display: grid; gap: 2px; padding: 9px 14px 10px;
  border-radius: 18px 18px 18px 6px; background: var(--surface-2); }
.msg.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--gold-soft); }
.msg-head { font-size: 13px; color: var(--muted); }
.msg-head a { font-weight: 700; color: var(--text); text-decoration: none; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.chat-form textarea { min-height: 48px; }
.chat-form .chat-error { grid-column: 1 / -1; margin: 0; }
.chat-empty { margin: 0 0 14px; }
.manage { margin-top: 32px; display: grid; gap: 14px; }
.manage h2 { margin: 0; }
.share { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }

/* Профиль */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 84px; height: 84px; border-radius: 50%;
  background: var(--gold); color: var(--on-gold); font: 800 36px/1 var(--font);
}
.avatar.small { width: 30px; height: 30px; font-size: 14px; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.profile-head h1 { margin: 0 0 4px; }
.profile-head .lead { margin: 0; }
.profile-head > div:nth-child(2) { flex: 1 1 280px; }
.joined { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.joined li { display: grid; gap: 8px; }
.joined-status { margin: 0; padding-left: 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.joined li.offer .joined-status { color: var(--text); }
.joined li.offer .ticket { background: var(--velvet); }
.telegram { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.telegram p { flex: 1 1 320px; margin: 0; }

/* Справка и шаги */
.steps { padding-left: 22px; display: grid; gap: 8px; }
.help { max-width: 66ch; }
.help h2 { margin: 32px 0 10px; font-size: 20px; }
.help h2:first-child { margin-top: 8px; }
.help ul { padding-left: 22px; display: grid; gap: 6px; }
.help code { padding: 1px 8px; border-radius: 999px; background: var(--surface); }

/* Страница места */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.tags li { font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--surface); }
.tags .off-season { color: var(--danger); background: var(--danger-soft); }
.place-map { height: 360px; border-radius: var(--r-card); margin: 28px 0 8px; overflow: hidden; }

/* Карта на главной: шапка + карта на весь остаток экрана */
html, body { overflow-x: hidden; }
.map-body main { max-width: none; padding: 0; }
.map-body .flash { position: absolute; z-index: 1000; top: calc(var(--header-h) + 12px); left: 50%; transform: translateX(-50%); margin: 0; box-shadow: 0 8px 24px rgb(0 0 0 / .2); }
.map-app {
  position: relative; display: grid; grid-template-columns: 380px 1fr;
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
}
.map { height: 100%; width: 100%; background: var(--line); }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.panel-filters { display: grid; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.panel-filters input[type="search"] { border-radius: 999px; padding-left: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1.2 var(--font); cursor: pointer; padding: 8px 14px; border-radius: 999px;
  border: 0; background: var(--surface-2); color: var(--text);
}
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--green)); }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--c, var(--green)); }
.chip[aria-pressed="true"] { background: var(--c); color: var(--on-cat); }
.chip[aria-pressed="true"]::before { background: var(--on-cat); }
.toggles { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; cursor: pointer; }
.panel-count { margin: 0; padding: 12px 18px 4px; font-size: 14px; font-weight: 600; }
.place-list { list-style: none; margin: 0; padding: 0 10px 16px; overflow-y: auto; flex: 1; }
.place-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit;
}
.place-item:hover { background: var(--surface-2); }
.place-item .pin { margin-top: 3px; flex: none; }
.place-text { display: grid; gap: 2px; }
.place-name { font-weight: 700; }
.place-text .muted { font-size: 13px; }
.panel-toggle { display: none; }

/* Маркеры */
.pin-wrap { background: none; border: 0; }
.pin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  background: var(--c, var(--green)); border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .45);
  box-sizing: content-box;
}
.marker-cluster { background: none; }
.marker-cluster div {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #0d1411; color: #d9a521; font: 800 14px/1 var(--font);
  border: 3px solid #d9a521; box-shadow: 0 2px 8px rgb(0 0 0 / .35); box-sizing: border-box;
}
.marker-cluster span { line-height: 1; }
.popup { display: grid; gap: 4px; min-width: 170px; font: 14px/1.45 var(--font); }
.popup strong { font-size: 15px; }
.popup-meetups { font-weight: 700; }
.leaflet-container { font-family: var(--font); }
.leaflet-container a { color: var(--accent); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: 16px; }
.leaflet-container .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--line); }
.leaflet-container .leaflet-bar a:hover { background: var(--surface-2); }
/* Плитки OSM светлые: в тёмной теме приглушаем их фильтром */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7); }
  :root:not([data-scheme="light"]) .leaflet-control-attribution { background: rgb(18 27 22 / .85) !important; color: var(--muted); }
}
:root[data-scheme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7); }
:root[data-scheme="dark"] .leaflet-control-attribution { background: rgb(18 27 22 / .85) !important; color: var(--muted); }

/* Плашка непогоды над картой */
.weather {
  position: absolute; z-index: 1000; top: 14px; left: calc(380px + 14px); max-width: calc(100% - 380px - 76px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--ink); color: var(--on-ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / .2); font-size: 14px;
}
.weather-now { font-weight: 700; }
.weather-go {
  font: 700 14px/1.2 var(--font); cursor: pointer; border: 0; padding: 7px 14px; border-radius: 999px;
  background: var(--gold); color: var(--on-gold);
}
.weather-src { font-size: 12px; color: var(--on-ink-muted); }

/* Украшения Хэллоуина: паутина в левом углу вывески, летучие мыши над орнаментом */
:root[data-style="halloween"] .masthead { background: url(web.svg) left -4px top 26px / 230px 230px no-repeat, var(--ink); }
:root[data-style="halloween"] .masthead-in { background: url(bats.svg) right max(24px, calc((100vw - 1040px) / 2 + 220px)) top 34px / 230px auto no-repeat; }
:root[data-style="halloween"] .marker-cluster div { color: #f07a1a; border-color: #f07a1a; background: #0b0b0c; }

/* Настройки: выбор оформления */
.looks, .segmented { border: 0; padding: 0; margin: 0; min-width: 0; }
.looks legend, .segmented legend { font-weight: 600; margin-bottom: 8px; }
.looks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.look {
  position: relative; display: grid; gap: 10px; padding: 12px; border-radius: 16px; cursor: pointer;
  background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700;
}
.look input { position: absolute; opacity: 0; pointer-events: none; }
.look:has(input:checked) { box-shadow: inset 0 0 0 2.5px var(--gold); }
.look:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.look-preview { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; height: 56px; }
.look-preview i { border-radius: 10px; }
.look-base .look-preview i:nth-child(1) { background: #0d1411; }
.look-base .look-preview i:nth-child(2) { background: #1f8a5b; }
.look-base .look-preview i:nth-child(3) { background: #d9a521; }
.look-halloween .look-preview i:nth-child(1) { background: #0b0b0c; }
.look-halloween .look-preview i:nth-child(2) { background: #3b1f52; }
.look-halloween .look-preview i:nth-child(3) { background: #f07a1a; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented legend { width: 100%; }
.segmented label { position: relative; display: inline-flex; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { padding: 9px 16px; border-radius: 999px; background: var(--surface-2); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--line); }
.segmented input:checked + span { background: var(--gold); color: var(--on-gold); box-shadow: none; }
.segmented input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }

/* Телефон */
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  main { padding: 28px 16px 56px; }
  .top { padding: 8px 14px; gap: 8px; }
  .top nav { gap: 12px; font-size: 14px; }
  .top .btn.small { padding: 6px 12px; }
  .nav-name { display: none; }
  .logo { font-size: 21px; }
  .logo-mark { width: 26px; height: 26px; }
  .masthead-in { padding: 44px 16px 50px; }
  .masthead-in::before { width: 230px; height: 230px; right: -80px; }
  :root[data-style="halloween"] .masthead-in { background-position: right 16px top 30px; background-size: 140px auto; }
  .masthead .lead { font-size: 16px; }
  .masthead-meetup { grid-template-columns: 1fr; gap: 18px; }
  .stub.big { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; min-width: 0; padding: 12px 28px; justify-self: start; }
  .stub.big .stub-day { font-size: 32px; }
  .card { padding: 20px; }
  .filters { grid-template-columns: 1fr; }
  .tickets, .joined { grid-template-columns: 1fr; }
  .ticket { grid-template-columns: 84px 1fr; --notch: radial-gradient(circle at 84px 0, transparent 0 10px, #000 10.5px), radial-gradient(circle at 84px 100%, transparent 0 10px, #000 10.5px); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .avatar { width: 64px; height: 64px; font-size: 28px; }
  .map-app { grid-template-columns: 1fr; }
  .panel {
    position: absolute; z-index: 1001; left: 0; right: 0; bottom: 0; height: 72%;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -6px 24px rgb(0 0 0 / .22); transform: translateY(calc(100% - 68px));
    transition: transform .25s ease;
  }
  .panel::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--line); }
  .panel.open { transform: none; }
  .panel-toggle {
    display: inline-flex; position: absolute; z-index: 1002; left: 50%; bottom: 80px; transform: translateX(-50%);
    box-shadow: 0 6px 18px rgb(0 0 0 / .3);
  }
  .panel.open ~ .panel-toggle { bottom: auto; top: calc(28% - 56px); }
  .map .leaflet-bottom { bottom: 72px; }
  .weather { left: 12px; right: 12px; max-width: none; border-radius: 22px; }
}
/* узкий телефон: «Встречи» остаются в шапке; «Админка» и «Выйти» — в профиле, «Регистрация» — со страницы входа */
@media (max-width: 420px) { .nav-secondary { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
