/* Telegram mini app. Same palette as the site; dark/light follows Telegram. */
:root {
  --bg: #FFFFFF;
  --card: #F2F0EC;
  --card-2: #E8E4DE;
  --ink: #2A211D;
  --muted: #6B5E55;
  --line: #E3DED7;
  --accent: #9A3B2E;
  --on-accent: #FFFFFF;
  --plan-bg: #201915;
  --plan-table: #2E2520;
  --plan-line: #4A3C33;
  --plan-seat: #E08A6B;
  --plan-text: #A89B8E;

  --ff-display: "Old Standard TT", "Times New Roman", Georgia, serif;
  --ff-text: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --r-lg: 22px;
  --pad: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --bottom: 0px; /* space for the fallback button outside Telegram */
}
:root[data-theme="dark"] {
  --bg: #1B1613;
  --card: #241D19;
  --card-2: #2E2520;
  --ink: #F2EADF;
  --muted: #A89B8E;
  --line: #3A302A;
  --accent: #E08A6B;
  --on-accent: #1B1613;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--ff-text); font-size: 16px; line-height: 1.5;
  min-height: var(--tg-viewport-height, 100vh);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

#app { padding: 12px var(--pad) calc(28px + var(--bottom) + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.screen { display: grid; gap: 18px; animation: in .35s var(--ease) both; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen, .seat.new { animation: none !important; } }

h1, h2, h3 { font-family: var(--ff-display); font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 34px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; line-height: 1.15; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }
.kicker { font-size: 13px; color: var(--muted); font-weight: 500; }
.num { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }

/* top of home */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card); font-size: 13px; white-space: nowrap; }
.badge b { font-weight: 600; }
.badge .star { color: var(--accent); }

/* big start card */
.start {
  position: relative; overflow: hidden; isolation: isolate;
  border: 0; border-radius: var(--r-lg); padding: 20px; min-height: 230px; width: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: left; cursor: pointer;
  color: #F2EADF; background: #1B1613;
}
.start img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.start::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(27,22,19,.1), rgba(27,22,19,.85)); }
.start h2 { font-size: 30px; color: #F2EADF; }
.start p { color: rgba(242,234,223,.85); font-size: 15px; }
.start .go { margin-top: 10px; display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; background: #E08A6B; color: #1B1613; font-weight: 600; font-size: 15px; }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }

/* horizontal halls */
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 4px; scroll-padding-inline: var(--pad); scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hall { scroll-snap-align: start; border: 0; padding: 0; background: var(--card); border-radius: var(--r); overflow: hidden; text-align: left; cursor: pointer; }
.hall img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--card-2); }
.hall div { padding: 12px 14px 14px; display: grid; gap: 2px; }
.hall h3 { font-size: 24px; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick a, .quick button {
  display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: var(--r);
  background: var(--card); border: 0; text-decoration: none; font-size: 13px; cursor: pointer; text-align: center;
}
.quick svg { width: 22px; height: 22px; color: var(--accent); }

/* steps */
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.step-head { display: grid; gap: 8px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  position: relative; overflow: hidden; isolation: isolate; border: 2px solid transparent;
  aspect-ratio: 1 / 1.1; border-radius: var(--r); padding: 12px; cursor: pointer;
  display: flex; align-items: flex-end; text-align: left; color: #F2EADF; background: #241D19;
  transition: border-color .2s, transform .2s var(--ease);
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(27,22,19,.85)); }
.tile span { font-family: var(--ff-display); font-size: 24px; line-height: 1.05; }
.tile[aria-pressed="true"] { border-color: var(--accent); transform: scale(.98); }
.tile[aria-pressed="true"]::before { content: "✓"; position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 15px; font-weight: 700; }

/* guests */
.counter { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; text-align: center; }
.counter button { height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 26px; line-height: 1; cursor: pointer; }
.counter output { font-family: var(--ff-display); font-size: 72px; line-height: .9; }
.counter small { display: block; font-family: var(--ff-text); font-size: 14px; color: var(--muted); margin-top: 6px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; --p: 30%; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line) var(--p)); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
.range::-moz-range-progress { height: 4px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: var(--bg); border: 6px solid var(--accent); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 6px solid var(--accent); }

.plan-card { border-radius: var(--r); overflow: hidden; background: var(--plan-bg); }
.plan { display: block; width: 100%; height: auto; }
.plan .floor { fill: var(--plan-bg); }
.plan .stage { fill: none; stroke: var(--plan-line); stroke-dasharray: 4 6; }
.plan .stage-label, .plan .plan-label { fill: var(--plan-text); font-family: var(--ff-text); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.plan .plan-label { text-transform: none; letter-spacing: .02em; }
.plan .table { fill: var(--plan-table); stroke: var(--plan-line); }
.plan .seat { fill: transparent; stroke: var(--plan-line); stroke-width: 1.5; }
.plan .seat.on { fill: var(--plan-seat); stroke: var(--plan-seat); }
.plan .seat.new { transform-box: fill-box; transform-origin: center; animation: seat .45s var(--ease) both; }
@keyframes seat { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.plan-hall { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; color: #F2EADF; border-top: 1px solid #3A302A; font-size: 14px; }
.plan-hall b { font-family: var(--ff-display); font-size: 20px; font-weight: 600; }
.warn { color: var(--accent); }

/* options */
.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;
  padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 2px solid transparent; cursor: pointer; text-align: left; width: 100%;
}
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--accent); }
.option b { font-family: var(--ff-display); font-size: 24px; font-weight: 600; line-height: 1.1; }
.option .price { font-weight: 600; white-space: nowrap; }
.option .desc { grid-column: 1 / -1; color: var(--muted); font-size: 14px; line-height: 1.4; }

.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--card); cursor: pointer; border: 0; width: 100%; text-align: left; }
.toggle .sw { flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle[aria-checked="true"] .sw { background: var(--accent); }
.toggle[aria-checked="true"] .sw::after { transform: translateX(18px); }
.toggle small { display: block; color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); }
.input { min-height: 52px; width: 100%; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
:root[data-theme="dark"] .input[type="date"] { color-scheme: dark; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; cursor: pointer; text-align: left; }
.share { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); font-weight: 500; cursor: pointer; width: 100%; }

/* summary */
.total { padding: 18px; border-radius: var(--r-lg); background: var(--card); display: grid; gap: 12px; }
.total .price { font-family: var(--ff-display); font-size: 42px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.rows li span:first-child { color: var(--muted); }
.rows li span:last-child { white-space: nowrap; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.4; }
.consent input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.error { color: var(--accent); font-size: 14px; }

/* done */
.done { text-align: center; justify-items: center; padding-top: 40px; }
.done .check { width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 40px; }
.btn-row { display: grid; gap: 10px; width: 100%; }
.btn { min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 500; cursor: pointer; }

/* hall screen */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r-lg); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { scroll-snap-align: start; aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--card-2); }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.specs div { padding: 12px; border-radius: 14px; background: var(--card); }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { margin: 2px 0 0; font-family: var(--ff-display); font-size: 24px; font-weight: 600; line-height: 1.1; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }

/* faq */
.qa { border-bottom: 1px solid var(--line); }
.qa summary { list-style: none; cursor: pointer; padding: 14px 30px 14px 0; position: relative; font-weight: 500; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font-size: 22px; color: var(--accent); }
.qa[open] summary::after { content: "−"; }
.qa p { padding-bottom: 14px; color: var(--muted); font-size: 15px; }

/* fallback controls outside Telegram (browser preview) */
.nav-back { position: fixed; top: 10px; left: 10px; z-index: 20; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.nav-back[hidden] { display: none; }
body.has-back #app { padding-top: 58px; }
.main-btn-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 30%); }
.main-btn-wrap[hidden] { display: none; }
.main-btn { width: 100%; max-width: 528px; margin: 0 auto; display: block; min-height: 52px; border-radius: 14px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 16px; cursor: pointer; }
.main-btn:disabled { opacity: .45; cursor: default; }
.main-btn.is-loading { opacity: .7; }
body.has-main { --bottom: 76px; }

/* ---------- style «Светлый современный» (SITE.brand.style = "modern") ---------- */
:root[data-style="modern"] {
  --bg: #FFFFFF; --card: #F2F5F2; --card-2: #E6ECE8; --ink: #17201B; --muted: #56655C; --line: #DFE6E1;
  --accent: #2E5A44; --on-accent: #FFFFFF;
  --plan-bg: #F4F7F5; --plan-table: #FFFFFF; --plan-line: #B7C6BC; --plan-seat: #2E5A44; --plan-text: #56655C;
  --ff-display: "Tenor Sans", "Trebuchet MS", sans-serif;
  --ff-text: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 18px; --r-lg: 26px;
}
:root[data-style="modern"][data-theme="dark"] {
  --bg: #121815; --card: #1B2420; --card-2: #24302A; --ink: #E8EEE9; --muted: #9DB0A4; --line: #2E3B34;
  --accent: #8CC3A4; --on-accent: #10261B;
  --plan-bg: #18211D; --plan-table: #22302A; --plan-line: #3A4A41; --plan-seat: #8CC3A4; --plan-text: #9DB0A4;
}
[data-style="modern"] .plan-hall { color: var(--ink); border-top-color: var(--line); }
[data-style="modern"] .start .go, [data-style="modern"] .chip { border-radius: 999px; }
[data-style="modern"] .start .go { background: #FFFFFF; color: #17201B; }
[data-style="modern"] h1, [data-style="modern"] h2, [data-style="modern"] h3 { letter-spacing: -0.01em; }
[data-style="modern"] .start { background: #1B2420; }
