/* ============================================================
   totem-edm · чёрно-белая (монохромная) дизайн-система.
   Без внешних шрифтов — максимум скорости.
   ============================================================ */

:root {
  /* поверхности */
  --bg-0: #000000;
  --bg-1: #0b0b0b;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .12);
  --border-strong: rgba(255, 255, 255, .24);

  /* текст */
  --fg: #f4f4f4;
  --muted: #9a9a9a;
  --faint: #5e5e5e;

  /* акцент — белый */
  --ink: #ffffff;
  --danger: #d4d4d4;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
/* Атрибут hidden сильнее любых display-правил (иначе .legend{display:flex} и т.п. его перебивают). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

/* ---------- Переключатель языка EN/ID ---------- */
.lang-switch {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 100;
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lang-switch button {
  border: 0; background: transparent; color: #9a9a9a;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.lang-switch button:hover { color: #f4f4f4; }
.lang-switch button.is-active { background: #fff; color: #000; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(255, 255, 255, .07), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(255, 255, 255, .04), transparent 55%),
    linear-gradient(170deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
}

/* Брендирование лендинга под спонсора: его изображение на фоне + затемняющий
   оверлей, чтобы колесо и текст карточки оставались читаемыми. --sponsor-bg ставит a.js. */
body.has-sponsor::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background-image: var(--sponsor-bg);
  background-size: cover; background-position: center;
  filter: saturate(1.05);
}
body.has-sponsor::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 520px at 50% 30%, rgba(0,0,0,.45), transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,.82));
}

/* ---------- Карточка ---------- */
.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-width: 0;                 /* flex-элемент должен сжиматься под вьюпорт, а не растягиваться под контент */
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 26px 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  text-align: center;
  animation: rise .5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Бренд ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 auto 18px; padding: 6px 14px 6px 8px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.brand__dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 16px rgba(255, 255, 255, .35);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; filter: grayscale(1);
}

/* ---------- Типографика ---------- */
h1 {
  font-size: clamp(24px, 6vw, 30px); line-height: 1.15; letter-spacing: -.02em;
  margin: 0 0 8px; font-weight: 800;
}
.sub { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.hint { color: var(--faint); font-size: 13px; margin: 20px 0 0; }
/* Подпись заведения на индивидуальной странице гашения (/visit?v=<ключ>) */
.venue-tag {
  display: inline-block; margin: 0 0 18px; padding: 5px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--fg);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
}

/* ---------- Кнопки-ссылки (вход) ---------- */
.btns { display: grid; gap: 14px; }
.btn {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 17px 20px; border-radius: var(--radius-sm);
  font-size: 17px; font-weight: 700; text-decoration: none;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease), background .2s var(--ease);
}
.btn__ic { flex: 0 0 26px; height: 26px; display: grid; place-items: center; }
.btn__ic svg { width: 24px; height: 24px; }
.btn__tx { flex: 1; text-align: left; }
.btn__arrow { opacity: .55; transition: transform .2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn:active { transform: scale(.985); }
/* основная — белая заливка, чёрный текст */
.btn--restaurant { background: var(--ink); color: #000; box-shadow: 0 10px 26px -12px rgba(255, 255, 255, .35); }
.btn--restaurant:hover { filter: brightness(.92); }
/* вторичная — контур */
.btn--maps { background: transparent; color: var(--fg); border: 1.5px solid var(--border-strong); }
.btn--maps:hover { background: var(--surface-2); }

/* ---------- Визит / купон ---------- */
.visit-no {
  font-size: clamp(56px, 16vw, 76px); font-weight: 900; line-height: 1;
  margin: 14px 0 6px; letter-spacing: -.03em; color: var(--ink);
}
.meta { color: var(--muted); font-size: 15px; }
.meta b { color: var(--fg); }
.visit-time { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.visit-time b { color: var(--fg); }

.coupon-box {
  position: relative; margin: 22px 0 4px; padding: 20px 18px;
  background: var(--surface); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
}
/* «надрезы» билета */
.coupon-box::before, .coupon-box::after {
  content: ""; position: absolute; top: 50%; width: 20px; height: 20px;
  background: var(--bg-0); border-radius: 50%; transform: translateY(-50%);
}
.coupon-box::before { left: -11px; }
.coupon-box::after  { right: -11px; }
.coupon-label { margin: 0 0 6px; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.coupon {
  font-size: clamp(28px, 9vw, 38px); font-weight: 900; letter-spacing: .1em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink); text-shadow: 0 0 22px rgba(255, 255, 255, .25);
}

/* Купон розыгрыша Rp 10 млн — второй «билет» под скидочным: сплошная рамка,
   код мельче скидочного, снизу накопленные купоны и подсказка «как получить ещё». */
.coupon-box--raffle { margin-top: 14px; border-style: solid; background: var(--surface-2); }
.coupon--raffle { font-size: clamp(22px, 7vw, 30px); }
.raffle-have { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.raffle-have b { color: var(--fg); }
.raffle-list {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; letter-spacing: .06em; color: var(--fg);
}
.raffle-more { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- Колесо фортуны (/ — вход) ---------- */
h1 .win-sub {
  display: block; margin-top: 6px;
  font-size: 14px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.wheel-wrap {
  position: relative; width: min(78vw, 320px); aspect-ratio: 1 / 1;
  margin: 22px auto 6px;
}
.wheel {
  width: 100%; height: 100%; display: block;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: 0 0 0 2px #000, 0 16px 40px -12px rgba(0,0,0,.8), inset 0 0 30px rgba(0,0,0,.4);
  background: #000;
}
#wheel-rot { transform-box: fill-box; transform-origin: center; }
.wheel-pointer {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 3;
  border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 22px solid #fff;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.6));
}
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 16%; height: 16%; border-radius: 50%; z-index: 2;
  background: #fff; border: 3px solid #000;
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
}

.result { opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.result.result--show { opacity: 1; transform: none; }
.result-label { margin: 6px 0 2px; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.prize {
  font-size: clamp(40px, 13vw, 60px); font-weight: 900; line-height: 1; letter-spacing: -.02em;
  color: var(--ink); margin: 0 0 10px; text-shadow: 0 0 26px rgba(255,255,255,.25);
}

/* Звания: лестница новичок → … → король (по истории выигрышей) */
.rank { margin: 2px auto 16px; }
.rank__label {
  margin: 0 0 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.rank__ladder { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.rank__step {
  font-size: 12px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.rank__step.is-done { color: var(--fg); border-color: var(--border-strong); }
.rank__step.is-current {
  background: var(--ink); color: #000; border-color: var(--ink);
  box-shadow: 0 0 16px rgba(255, 255, 255, .28);
}
.rank__sep { color: var(--faint); font-size: 11px; }
.rank__next { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.rank__next b { color: var(--fg); }

/* Легенда колеса: какие сегменты к какой площадке (светлые = кафе, тёмные = автомойка) */
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
  margin: 12px auto 2px; font-size: 13px; color: var(--muted);
}
.legend__item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend__item b { color: var(--fg); font-weight: 700; }
.legend__sw { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px; }
.legend__sw--cafe { background: #f4f4f4; border: 1px solid var(--border-strong); }
.legend__sw--wash { background: #161616; border: 1px solid var(--border-strong); }

/* Строка площадки на экране результата («🍴 at Bamboo Garden Cafe») */
.vendor-line { margin: 2px 0 4px; font-size: 17px; color: var(--fg); }
.vendor-line b { font-weight: 800; }

/* Блок ссылок после выигрыша + дисклеймер «используй текущий приз» */
.btns--result { margin-top: 18px; }
.disclaimer {
  margin: 14px auto 4px; max-width: 320px;
  color: var(--muted); font-size: 13px; line-height: 1.45;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px dashed var(--border-strong);
}

/* ---------- Гейт WhatsApp-номера на `/` (перед колесом) ---------- */
.gate { margin: 8px 0 14px; }
.gate__note {
  margin: 0 auto 16px; max-width: 340px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212,175,55,.16), rgba(212,175,55,.06));
  border: 1px solid rgba(212,175,55,.45);
  color: var(--fg); font-size: 14px; font-weight: 700; line-height: 1.45;
}
.gate__note--result { margin-top: 12px; }
.gate__title { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.gate__sub { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.code-input--phone { text-transform: none; letter-spacing: .06em; }
.gate__links {
  margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
}
.gate__resend {
  margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; text-decoration: underline;
}
.gate__links .gate__resend { margin-top: 0; }
.gate__resend:hover { color: var(--fg); }
.gate__err { margin: 10px auto 0; max-width: 320px; color: #ff8a80; font-size: 13px; font-weight: 700; }

/* Согласие с политикой на шаге номера: чекбокс отдельной строкой под полем */
.redeem-form--gate { flex-wrap: wrap; }
.gate__consent {
  flex-basis: 100%; display: flex; gap: 9px; align-items: flex-start;
  max-width: 340px; margin: 8px auto 0; text-align: left;
  color: var(--muted); font-size: 13px; line-height: 1.45; cursor: pointer;
}
.gate__consent input {
  flex: none; width: 17px; height: 17px; margin-top: 1px;
  accent-color: var(--ink); cursor: pointer;
}
.gate__consent a { color: var(--fg); }

/* ---------- Погашение купона (/visit) ---------- */
.redeem-form { display: flex; gap: 10px; justify-content: center; margin: 8px 0 6px; }
.code-input {
  flex: 1; min-width: 0; max-width: 240px;
  font-size: 24px; letter-spacing: .18em; text-align: center; text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  padding: 14px 12px; border-radius: 14px;
  border: 1px solid var(--border-strong); background: rgba(0,0,0,.4); color: var(--fg);
}
.code-input::placeholder { color: var(--faint); letter-spacing: .14em; }
.code-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.redeem-form button {
  padding: 0 22px; border: 0; border-radius: 14px;
  background: var(--ink); color: #000; font-size: 16px; font-weight: 800; cursor: pointer;
}
.redeem-form button:disabled { opacity: .6; cursor: default; }
.used-badge {
  display: inline-block; margin: 4px 0 14px; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: .04em;
  background: var(--ink); color: #000;
}
.used-badge--warn { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); }

/* ---------- Syarat & Ketentuan (/privacy) ---------- */
.policy { text-align: left; }
.policy .brand { justify-content: flex-start; }
.policy__title { margin: 14px 0 6px; font-size: 22px; letter-spacing: .02em; }
.policy__lead { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.policy__list {
  margin: 0; padding-left: 20px; display: grid; gap: 9px;
  font-size: 14px; line-height: 1.55;
}
.policy__divider { margin: 24px 0; border: 0; border-top: 1px solid var(--border-strong); }
.policy__back { margin: 20px 0 4px; }
.policy__back a { color: var(--muted); }

/* ---------- /kiosk: витрина — бегущая строка + колесо призов с QR ---------- */
.kioskw {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(170deg, var(--bg-1), var(--bg-0));
}
.kioskw-marquee {
  flex: 0 0 auto; overflow: hidden; white-space: nowrap;
  background: var(--ink); color: #000;
  font-weight: 900; font-size: clamp(20px, 3.2vw, 56px); letter-spacing: .01em;
  padding: clamp(12px, 1.6vh, 26px) 0; text-transform: uppercase;
}
/* длительность задаётся из JS под постоянную скорость (≈ читаемую) независимо от размера ТВ */
.kioskw-marquee__track { display: inline-block; will-change: transform; animation: kmarquee 40s linear infinite; }
@keyframes kmarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Биржевой тикер скидок: тёмная плашка, зелёные ▲ + название заведения. */
.kioskw-ticker {
  flex: 0 0 auto; overflow: hidden; white-space: nowrap;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,.14);
  padding: clamp(7px, 1.1vh, 16px) 0;
}
.kioskw-ticker__track { display: inline-block; will-change: transform; animation: kmarquee 40s linear infinite; }
.tick {
  display: inline-flex; align-items: baseline; gap: 10px;
  margin: 0 clamp(22px, 2.6vw, 52px);
  font-size: clamp(16px, 2vw, 34px); font-weight: 800; letter-spacing: .02em;
}
.tick__name { color: #f4f4f4; text-transform: uppercase; }
.tick__val { color: #16c784; font-weight: 900; }   /* зелёный «рост» как на бирже */
.tick__arr { color: #16c784; }

/* Сцена-слайд: изображение-креатив спонсора на весь экран + QR-бейдж поверх. */
.kioskw-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.kioskw-creative {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: opacity .22s ease; opacity: 1; background: var(--bg-0);
}
.kioskw-creative.is-fading { opacity: 0; }
/* QR-бейдж в правом нижнем углу (читаемо и не перекрывает центр афиши). */
.kioskw-qr {
  position: absolute; left: clamp(14px, 2.4vw, 44px); bottom: clamp(14px, 2.4vw, 44px);
  z-index: 3; display: flex; flex-direction: column; align-items: center;
  gap: clamp(6px, 1vh, 12px);
  background: #fff; border-radius: 16px; padding: clamp(10px, 1.4vw, 20px);
  box-shadow: 0 10px 32px rgba(0,0,0,.55), 0 0 0 4px rgba(0,0,0,.85);
  transition: opacity .22s ease;
}
.kioskw-qr.is-fading { opacity: .35; }
/* Подпись со скидкой над QR — крупно и контрастно. */
.kioskw-qr__promo {
  max-width: clamp(140px, 18vw, 270px); text-align: center;
  background: #000; color: #fff; border-radius: 999px;
  padding: clamp(5px, .6vw, 10px) clamp(12px, 1.2vw, 22px);
  font-weight: 900; font-size: clamp(13px, 1.3vw, 22px); letter-spacing: .01em;
  line-height: 1.1; text-transform: uppercase; white-space: nowrap;
}
.kioskw-qr__promo:empty { display: none; }
.kioskw-qr img { display: block; width: clamp(120px, 16vw, 240px); aspect-ratio: 1/1; }
.kioskw-qr.is-fading img, .kioskw-qr img.is-fading { opacity: 1; }
.kioskw-qr__cap {
  max-width: clamp(150px, 18vw, 280px); text-align: center; color: #000;
  font-weight: 900; font-size: clamp(17px, 1.7vw, 30px); line-height: 1.12;
}
/* Сцена-колесо: центрируем колесо с QR + легенда спонсоров под ним. */
.kioskw-stage--wheel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(8px, 1.6vh, 22px); padding: clamp(10px, 2vh, 28px) 12px;
}
/* Крупно на ТВ в обеих ориентациях (специфичность перебивает .scan-wheel width). */
.kioskw .kioskw-wheel { width: min(92vw, 66vh); margin: 0 auto; }
.kioskw-legend { font-size: clamp(14px, 1.9vw, 26px); max-width: 94vw; }
@media (prefers-reduced-motion: reduce) {
  .kioskw-marquee__track, .kioskw-ticker__track { animation: none; }
}

/* ---------- /scan: колесо с QR в центре ---------- */
.scan-wheel { position: relative; width: min(78vw, 300px); aspect-ratio: 1 / 1; margin: 20px auto 14px; }
.scan-wheel .wheel { width: 100%; height: 100%; animation: wheelspin 16s linear infinite; transform-origin: center; }
@keyframes wheelspin { to { transform: rotate(360deg); } }
.scan-qr {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3;
  width: 46%; aspect-ratio: 1 / 1; background: #fff; border-radius: 14px; padding: 8px;
  box-shadow: 0 8px 26px rgba(0,0,0,.55), 0 0 0 4px #000;
}
.scan-qr img { display: block; width: 100%; height: 100%; }
.scan-cta { font-size: 16px; font-weight: 700; margin: 4px 0 0; color: var(--fg); }
/* Метка точки (?name=) — для персонала, какая точка настроена на устройстве. */
.scan-point {
  margin: 8px auto 0; display: inline-block; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
/* Чёткое предупреждение: без скана QR приз не получить */
.scan-warn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  margin: 14px auto 0; max-width: 360px; padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface-2);
  color: var(--fg); font-size: 14px; font-weight: 800; line-height: 1.4;
}
.scan-warn__ic {
  flex: 0 0 28px; height: 28px; display: grid; place-items: center;
  font-size: 16px; border-radius: 50%; background: var(--ink); color: #000;
}
@media (prefers-reduced-motion: reduce) { .scan-wheel .wheel { animation: none; } }

/* ---------- Киоск ----------
   Баннер виден целиком (contain). Кадр сохраняет пропорции картинки и масштабируется
   под вьюпорт при любой ориентации; QR позиционируется в % от кадра → всегда на месте.
   Поля по краям белые — сливаются с белым фоном баннера. */
.kiosk {
  position: fixed; inset: 0; background: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.kiosk__frame {
  position: relative;
  aspect-ratio: 1093 / 2175;                          /* пропорции баннера (контент от края до края) */
  width: min(100vw, calc(100vh * 1093 / 2175));       /* vh (НЕ svh): svh не поддержан в WebView киоска → рамка схлопывалась под натуральный размер картинки */
  max-width: 100vw; max-height: 100vh;
}
/* contain: показываем баннер целиком (низ не обрезается). Рамка нормального размера за счёт vh →
   мелкие 514px-баннеры тоже масштабируются на всю рамку, а не висят маленькими по центру. */
.kiosk__media { display: block; width: 100%; height: 100%; object-fit: contain; }
.kiosk__qr {
  position: absolute;
  left: 49.63%; top: 76.02%;         /* центр метки под QR на баннере */
  width: 30.28%;                     /* доля ширины кадра ≈ сторона квадрата-метки */
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: #fff;                  /* белый quiet-zone для сканируемости */
}
.kiosk__qr img, .kiosk__qr svg { display: block; width: 100%; height: 100%; }

/* ---------- QR-карточка (персонал) ---------- */
.qr-wrap {
  background: #fff; border-radius: 18px; padding: 16px; display: inline-block;
  margin: 6px 0 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.7);
}
.qr-wrap img, .qr-wrap svg { display: block; width: 256px; height: 256px; }

/* ---------- Статистика / кабинет ---------- */
/* Длинные дашборды не центрируем по вертикали (иначе на мобиле обрезается верх). */
body:has(.stats) { align-items: flex-start; }
.stats { max-width: 940px; text-align: left; }
.stats .brand { display: inline-flex; }
.stats h1 { text-align: left; }

.pin-form { display: flex; gap: 10px; justify-content: center; margin: 18px 0 6px; }
.pin-form input {
  font-size: 30px; letter-spacing: .5em; text-align: center; width: 180px; padding: 12px 12px 12px 22px;
  border-radius: 14px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.4); color: var(--fg);
}
.pin-form input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.pin-form button { padding: 0 20px; border: 0; border-radius: 14px; background: var(--ink); color: #000; font-size: 16px; font-weight: 800; cursor: pointer; }
.pin-err { color: var(--danger); font-size: 14px; min-height: 20px; text-align: center; }
#gate { text-align: center; }

.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 18px; }
.counter { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 10px; }
.counter b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.counter span { color: var(--muted); font-size: 12px; }
.counter--kiosk b { color: var(--ink); }
.counter--organic b { color: var(--muted); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.visitors { width: 100%; border-collapse: collapse; font-size: 14px; }
table.visitors th, table.visitors td { padding: 11px 12px; text-align: left; white-space: nowrap; }
table.visitors thead th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); position: sticky; top: 0; }
table.visitors th.th-sort { cursor: pointer; user-select: none; -webkit-user-select: none; transition: color .12s var(--ease); }
table.visitors th.th-sort:hover { color: var(--fg); }
table.visitors th.is-sorted { color: var(--ink); }
.sort-ind { display: inline-block; width: 12px; margin-left: 3px; font-size: 10px; color: var(--ink); }
.sort-note { color: var(--faint); font-size: 12px; margin: 0 0 8px; }
table.visitors tbody tr { border-top: 1px solid var(--border); }
table.visitors tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
table.visitors td:nth-child(2) { font-family: ui-monospace, Menlo, monospace; color: var(--fg); }
.src-kiosk { color: var(--fg); font-weight: 700; }
.src-organic { color: var(--muted); }
.section-h { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.mono { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }

/* /me — раскрываемые строки гостей */
tr.g-head { cursor: pointer; }
tr.g-head:hover { background: var(--surface-2); }
tr.g-head .caret { color: var(--muted); font-size: 11px; transition: transform .15s var(--ease); display: inline-block; }
tr.g-head.open .caret { transform: rotate(180deg); }
tr.g-detail td { background: rgba(255,255,255,.04); font-size: 13px; color: var(--muted); white-space: normal; }
.detail-block { padding: 4px 0; }
.detail-block b { color: var(--fg); font-size: 12px; }

.refresh { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.refresh button, .links a, .ghost {
  background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 9px 16px; font-size: 14px; font-weight: 600; text-decoration: none;
  display: inline-block; cursor: pointer; transition: background .15s var(--ease);
}
.refresh button:hover, .links a:hover { background: var(--surface-2); }

.tz-note { color: var(--faint); font-size: 12px; margin-top: 12px; }

/* ---------- Креативы: админка (/kiosk-admin) + ячейка в /stats ---------- */
.upload-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 6px; }
.upload-box input[type="text"], .upload-box input[type="url"] {
  flex: 1; min-width: 160px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: rgba(0,0,0,.4); color: var(--fg); font-size: 14px;
}
.upload-box input[type="file"] { flex: 1; min-width: 160px; color: var(--muted); font-size: 13px; }
.upload-box button {
  padding: 10px 18px; border: 0; border-radius: 12px; background: var(--ink); color: #000;
  font-size: 14px; font-weight: 800; cursor: pointer;
}
.upload-box button:disabled { opacity: .5; cursor: default; }

.cr-list { display: grid; gap: 10px; }
.cr-item {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.cr-item.is-off { opacity: .5; }
.cr-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #fff; flex: 0 0 56px; }
.cr-info { flex: 1; min-width: 0; }
.cr-label { font-weight: 700; font-size: 14px; }
.cr-url { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }
.cr-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.cr-actions .ghost { padding: 6px 12px; font-size: 13px; }

.cr-cell { display: inline-flex; align-items: center; gap: 8px; }
.cr-cell-thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; background: #fff; flex: 0 0 30px; }

@media (max-width: 480px) {
  .card { padding: 28px 18px 24px; }
  .counters { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .card, .kiosk__qr { animation: none; }
  .btn { transition: none; }
}
