/* Друзья! · мини-апп, админка и сканер.
   Все цвета, шрифты, тени и радиусы — из tokens.css. Здесь ни одного hex. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  background-attachment: fixed;
  color: var(--ink);
}

body {
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--gold-deep); text-decoration: none; font-weight: 600; }
h1, h2, h3, p, dl, dd, dt { margin: 0; }

.app {
  max-width: var(--shell-mobile);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ---------- шапка ---------- */

.a-head {
  background: var(--header-black);
  color: var(--header-ink);
  padding: 12px 14px 12px;
  border-radius: 0 0 var(--r-6) var(--r-6);
  box-shadow: 0 8px 22px rgba(26, 18, 9, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
}

.a-head .bar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.a-head .bar-stacked { flex-direction: column; align-items: center; gap: 10px; padding-top: 2px; }
.a-head .bar-stacked .mark {
  width: 100%;
  max-width: 280px;
  height: auto;
  max-height: 94px;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
}
.a-head .bar-stacked .tabs {
  margin-left: 0;
  justify-content: center;
  width: 100%;
  gap: 8px;
}
.a-head .back {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--gold-wash-12);
  color: var(--dark-ink-3);
  font-size: 16px;
  cursor: pointer;
  flex: none;
  transition: background var(--t-base) var(--ease);
}
.a-head .back:hover { background: var(--gold-wash-26); }
.a-head .back::after { inset: -7px; }
.a-head .mark { display: block; height: 44px; width: 132px; object-fit: contain; object-position: left center; }
.a-head .mark.sm { height: 36px; width: 108px; }
.a-head .tabs { display: flex; gap: 4px; margin-left: auto; }
.a-head .tabs button {
  min-height: 32px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: none;
  color: var(--dark-ink-2);
  font: 600 12px var(--body);
  cursor: pointer;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.a-head .tabs button, .a-head .back { position: relative; }
/* Площадь нажатия 44px при визуальных 32/30: растягиваем псевдоэлементом. */
.a-head .tabs button::after, .a-head .back::after {
  content: "";
  position: absolute;
  inset: -6px -4px;
  border-radius: var(--r-pill);
}
.a-head .tabs button:hover { background: var(--gold-wash-14); color: var(--card); }
.a-head .tabs button[aria-current] {
  background: var(--gold-bright);
  color: var(--header-deep);
  font-weight: 700;
  border-color: var(--gold-line-strong);
}
.a-head .where {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dark-ink-soft);
  white-space: nowrap;
}
.a-head .where b { color: var(--gold-bright); }

.progress { display: flex; gap: 5px; margin-top: 9px; }
.progress i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--dark-3);
  transition: background var(--t-slow) var(--ease);
}
.progress i.on { background: var(--gold-bright); }

/* ---------- тело ---------- */

.a-body {
  padding: 14px 15px 142px;
  min-height: 40vh;
}

.a-body h1 {
  font-family: var(--display);
  font-size: 1.44rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 4px 0 6px;
  text-wrap: balance;
}
.a-body h2 {
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.lede { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.55; }
.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 8px;
}
.sec .count { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

#toast {
  margin: 10px 15px 0;
  padding: 10px 12px;
  border-radius: var(--r-4);
  background: var(--hot-bg);
  border: 1px solid var(--hot-line);
  color: var(--danger-ink);
  font-size: 13px;
}
#toast.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--success-ink); }

/* ---------- баннер «можно одному» ---------- */

.solo {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: var(--grad-solo);
  border: 1px solid var(--gold-line-solo);
  border-radius: var(--r-4);
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
  margin: 14px 0;
}
.solo .dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  display: grid; place-items: center;
  font: 700 13px var(--body);
  color: var(--gold-deep);
}
.solo b { font-weight: 700; }

/* ---------- тёмная карточка ближайшего вечера ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, var(--dark-panel) 0%, var(--dark-panel-2) 60%, var(--dark-panel-3) 100%);
  border: 1px solid var(--dark-border);
  border-radius: var(--r-6);
  padding: 15px 16px 14px;
  box-shadow: 0 14px 32px rgba(58, 36, 10, 0.22);
  color: var(--header-ink);
  margin-bottom: 4px;
}
.hero .row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 9px; }
.hero .chip {
  font: 700 11.5px var(--body);
  color: var(--dark-panel);
  background: var(--gold-bright);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}
.hero .sub { font-size: 11.5px; color: var(--dark-ink-soft); }
.hero h2 {
  font-size: 1.32rem;
  color: var(--header-ink);
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.hero p { font-size: 13px; color: var(--dark-ink-2); line-height: 1.5; margin: 0 0 12px; }
.hero .bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero .price { font: 700 15px var(--display); color: var(--gold-bright); }
.hero .go {
  border: 0;
  background: var(--grad-primary);
  color: var(--dark);
  font: 700 13.5px var(--body);
  border-radius: var(--r-2);
  padding: 9px 15px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: var(--gold-shadow-32);
}
.hero .go:hover { background: var(--grad-primary-hover); }
.hero .go:active { transform: translateY(1px); }

/* ---------- фильтры ---------- */

.filts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin: 0 0 14px; scrollbar-width: none; }
.filts::-webkit-scrollbar { display: none; }
.filts button {
  flex: none;
  min-height: 44px;
  padding: 4px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--muted);
  font: 600 12.5px var(--body);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.filts button:hover { border-color: var(--gold); color: var(--ink); }
.filts button[aria-pressed="true"] {
  background: var(--grad-primary);
  border-color: var(--gold-line-strong);
  color: var(--dark);
  font-weight: 700;
  box-shadow: 0 3px 10px var(--gold-shadow-10);
}

/* ---------- карточка вечера ---------- */

.ev {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-6);
  padding: 0 0 12px;
  margin-bottom: 11px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}
.ev:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ev .rule { height: 4px; background: var(--grad-rule); }
.ev .inner { padding: 12px 14px 0; }
.ev .top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }
.ev .when {
  font: 700 11.5px var(--body);
  letter-spacing: 0.02em;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line-soft);
  border-radius: var(--r-pill);
  padding: 3px 9px;
}
.ev h3 {
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
  line-height: 1.25;
}
.ev .sub { font-size: 12.5px; color: var(--muted); margin: 0 0 9px; line-height: 1.5; }
.ev .starts { display: flex; gap: 4px; margin-bottom: 9px; flex-wrap: wrap; }
.ev .starts span {
  font: 600 11.5px var(--body);
  color: var(--muted);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 7px;
}
.ev .starts span.few { color: var(--hot); border-color: var(--hot-line); background: var(--hot-bg); }
.ev .foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px 0; margin-top: 4px;
  border-top: 1.5px dashed var(--line);
}
.ev .seats { font-size: 12px; color: var(--muted); }
.ev .seats b { color: var(--ink); font-weight: 700; }
.ev .more { font: 700 12.5px var(--body); color: var(--gold-deep); }

/* ---------- бейджи ---------- */

.bg {
  display: inline-flex; align-items: center; gap: 5px;
  font: 700 11.5px var(--body);
  border-radius: var(--r-pill);
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: var(--card-2);
  white-space: nowrap;
}
.bg.hot { color: var(--hot); border-color: var(--hot-line); background: var(--hot-bg); }
.bg.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.bg.gold { color: var(--gold-deep); border-color: var(--gold-line); background: var(--gold-soft); }

/* ---------- строки выбора ---------- */

.pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-5);
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
  font-family: var(--body);
  color: var(--ink);
}
.pick:hover { border-color: var(--gold); background: var(--card-hover); }
.pick[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--grad-choice);
  box-shadow: var(--gold-shadow-18), var(--ring-gold);
}
.pick .t { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.pick .t b { font: 700 14.5px var(--body); color: var(--ink); }
.pick .d { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.pick .p { font: 700 14px var(--body); color: var(--gold-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pick .p small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: right; }
.pick .radio {
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  display: grid; place-items: center;
  flex: none;
}
.pick[aria-pressed="true"] .radio { border-color: var(--gold-deep); }
.pick[aria-pressed="true"] .radio::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold-deep);
}
.pick.off { opacity: 0.5; cursor: not-allowed; background: var(--disabled-bg); }
.pick.off:hover { border-color: var(--line); }

/* ---------- тарифы ---------- */

.tarif {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-5);
  padding: 12px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
  font-family: var(--body);
  color: var(--ink);
}
.tarif:hover { border-color: var(--gold); background: var(--card-hover); }
.tarif[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--grad-choice);
  box-shadow: var(--gold-shadow-18), var(--ring-gold);
}
.tarif .line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tarif .name { font-family: var(--display); font-size: 14px; letter-spacing: -0.02em; font-weight: 700; }
.tarif .price { font: 700 15px var(--body); color: var(--gold-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tarif .note {
  font-size: 12px; color: var(--muted); line-height: 1.45; margin: 5px 0 0;
  border: 0; background: none; padding: 0; border-radius: 0;
}
.tarif .tag {
  display: inline-block;
  font: 700 11.5px var(--body);
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  margin-top: 7px;
}

/* ---------- аккордеон стартов ---------- */

.start {
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  background: rgba(255, 253, 249, 0.7);
  margin-bottom: 9px;
  overflow: hidden;
}
.start > .head {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  border: 0;
  background: none;
  padding: 11px 13px;
  cursor: pointer;
  font-family: var(--body);
  text-align: left;
  min-height: 52px;
  color: var(--ink);
}
.start > .head:hover { background: var(--gold-wash-50); }
.start .time {
  font-family: var(--display);
  font-size: 17.5px;
  letter-spacing: -0.02em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.start .picked-label {
  font-size: 11.5px; color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.start .body .pick { min-height: 50px; padding: 9px 12px; }
.start .body .pick .t b { font-size: 13.5px; }
.start .body .pick .d { font-size: 11.5px; }
.start .chev { color: var(--gold-deep); font-size: 12px; font-weight: 700; }
.start .body { padding: 0 11px 10px; }
.start .hint { font-size: 11.5px; color: var(--muted); padding: 0 4px 8px; line-height: 1.45; }

/* ---------- карта мест ---------- */

.seats { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.seats .tbl {
  display: flex;
  gap: 3px;
  padding: 4px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--ground);
}
.seats i {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1px solid var(--gold-deep);
  background: var(--card);
  display: block;
}
.seats i.on { background: var(--gold-deep); }

/* ---------- футер ---------- */

.a-foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: var(--shell-mobile);
  margin: 0 auto;
  padding: 10px 15px 14px;
  background: var(--grad-fade);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  z-index: 15;
  display: grid;
  gap: 7px;
}
.a-foot .line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.a-foot .line b { font: 700 15px var(--display); color: var(--gold-deep); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.a-foot .row { display: flex; gap: 7px; }
.a-foot .hintline { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.45; }

.btn {
  font: 600 14.5px var(--body);
  min-height: 46px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  background: var(--card-2);
  color: var(--ink);
  padding: 8px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease),
              background var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.btn:hover { border-color: var(--gold); background: var(--gold-hover-bg); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  flex: 1;
  background: var(--grad-primary);
  border: 1px solid var(--gold-line-strong);
  color: var(--dark);
  font-weight: 700;
  min-height: 50px;
  font-size: 15px;
  box-shadow: var(--shadow-gold);
}
.btn.primary:hover { background: var(--grad-primary-hover); box-shadow: var(--shadow-gold-lg); }
.btn.ghost { background: rgba(255, 253, 249, 0.8); border-color: var(--line); color: var(--muted); }
.btn.text {
  border: 0; background: none; color: var(--gold-deep);
  min-height: 44px; padding: 4px 2px; font-weight: 600; font-size: 12.5px;
}
.btn.text:hover { color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- панели ---------- */

.pnl {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.pnl > h3 { font-size: 13.5px; margin: 0 0 7px; }
.pnl p { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; line-height: 1.55; }
.pnl p:last-child { margin-bottom: 0; }

/* расписание */
.sched .row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px dashed var(--line-2);
}
.sched .row:first-child { border-top: 0; }
.sched .t { font: 700 13px var(--display); font-variant-numeric: tabular-nums; }
.sched .g { font-size: 12.5px; color: var(--muted); }
.sched .f { font: 700 11.5px var(--body); color: var(--ok); }
.sched .f.none { color: var(--hot); }

/* список «что входит» */
.bullets { display: grid; gap: 7px; }
.bullets .b { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.bullets .b i { color: var(--gold); font-style: normal; font-weight: 700; }

/* ---------- сводка ---------- */

.sum { margin: 0; }
.sum > div {
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-2);
}
.sum > div:last-child { border-bottom: 0; }
.sum dt { color: var(--muted); font-size: 12.5px; }
.sum dd { margin: 0; text-align: right; font-size: 12.5px; font-weight: 600; }
.sum .total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--line-2);
  border-bottom: 0;
  padding-top: 10px; margin-top: 6px;
  grid-template-columns: none;
}
.pnl > .total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--line-2);
  padding-top: 10px; margin-top: 6px;
}
.pnl > .total b { font-family: var(--display); font-size: 1.2rem; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.sum .total b { font-family: var(--display); font-size: 1.2rem; color: var(--gold-deep); font-variant-numeric: tabular-nums; }

/* ---------- поля ---------- */

.fld { display: grid; gap: 5px; margin-bottom: 11px; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fld input, .fld textarea, .fld select {
  font: 400 15px var(--body);
  color: var(--ink);
  min-height: 46px;
  width: 100%;
  padding: 9px 11px;
  background: var(--card);
  border: 1.5px solid var(--line-2);
  border-radius: 11px;
}
.fld input:focus, .fld select:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(223, 155, 53, 0.16); }
.fld .ok-note { font-size: 11.5px; color: var(--ok); font-weight: 600; }
.fld .err { font-size: 11.5px; color: var(--hot); }

.note {
  border-left: 3px solid var(--gold);
  background: var(--gold-wash-50);
  border-radius: 0 var(--r-2) var(--r-2) 0;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 12px;
}
.note b { color: var(--ink); }

/* ---------- билет ---------- */

.tkt {
  border: 2px solid var(--gold);
  border-radius: var(--r-7);
  background: var(--grad-ticket);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.tkt .top { padding: 14px 15px 12px; }
.tkt .row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tkt .num { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--gold-deep); letter-spacing: -0.01em; }
.tkt .when { font-family: var(--display); font-size: 1.16rem; letter-spacing: -0.03em; line-height: 1.2; margin: 0 0 4px; }
.tkt .what { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tkt .perf {
  height: 0;
  border-top: 1.5px dashed var(--line-2);
  position: relative;
  margin: 12px 0;
}
.tkt .perf::before, .tkt .perf::after {
  content: "";
  position: absolute; top: -8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ground);
  border: 1.5px solid var(--gold);
}
.tkt .perf::before { left: -24px; }
.tkt .perf::after { right: -24px; }
.tkt .qr-wrap { padding: 0 15px 14px; text-align: center; }
.qr {
  width: 176px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 9px;
  box-shadow: 0 4px 14px rgba(58, 36, 10, 0.07);
}
.qr svg { display: block; width: 100%; height: auto; }
.tkt .tok {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  letter-spacing: 0.04em; margin-top: 7px; word-break: break-all;
}
.tkt .code-hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

/* ---------- история ---------- */

.hist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  background: var(--card);
  margin-bottom: 7px;
}
.hist .n { font-family: var(--display); font-size: 12.5px; font-weight: 700; }
.hist .m { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- статусы ---------- */

.status {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 12px 13px;
  border-radius: var(--r-4);
  margin-bottom: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.status.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--success-ink); }
.status.hot { background: var(--hot-bg); border: 1px solid var(--hot-line); color: var(--danger-ink); }
.status .mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 13px var(--body);
  border: 1px solid currentColor;
}

.timer {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--hot);
}

/* ---------- клуб ---------- */

.rules { display: grid; gap: 9px; }
.rules .r { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.rules .r i { color: var(--gold); font-style: normal; font-weight: 700; }

/* ---------- диалог ---------- */

dialog {
  border: 1px solid var(--line);
  border-radius: var(--r-6);
  background: var(--card);
  color: var(--ink);
  padding: 18px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(26, 18, 9, 0.42); }
dialog h2 { font-family: var(--display); font-size: 1.1rem; margin-bottom: 6px; }
dialog .lede { margin-bottom: 12px; }
dialog .btn { width: 100%; }

/* ==========================================================================
   Админка
   ========================================================================== */

.wide {
  max-width: var(--shell-admin);
  width: 100%;
  margin: 0 auto;
  padding: 16px 12px 60px;
  overflow-x: clip;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-6);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  min-width: 0;
}
.admin-head > div { min-width: 0; max-width: 100%; }
.admin-head h1 { font-family: var(--display); font-size: 1.5rem; letter-spacing: -0.03em; margin: 0 0 3px; }
.admin-head .eyebrow { margin-bottom: 2px; }
.admin-head .row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; min-width: 0; max-width: 100%; }
.admin-head .row-actions .btn { flex: 0 0 auto; }
.admin-head .row-actions .btn.primary { flex: 0 0 auto; }
.admin-head select {
  min-height: 44px; padding: 6px 10px; border-radius: 11px;
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink);
  font: 600 13px var(--body);
  max-width: 100%; min-width: 0;
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 11px 13px;
}
.kpi span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi b { display: block; font-family: var(--display); font-size: 1.35rem; color: var(--gold-deep); font-variant-numeric: tabular-nums; margin: 3px 0 1px; }
.kpi small { font-size: 11.5px; color: var(--muted); }
.wide .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.wide .tabs button {
  border-radius: var(--r-pill); min-height: 44px; font-size: 13px; padding: 6px 15px;
  background: var(--card); border: 1px solid var(--line-2); color: var(--muted); cursor: pointer;
  font-family: var(--body);
}
.wide .tabs button[aria-selected="true"] { background: var(--grad-primary); color: var(--dark); border-color: var(--gold-line-strong); font-weight: 700; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-6);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
  max-width: 100%;
}
.form-row label {
  display: grid;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
}
.form-row label > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font: 400 14px var(--body);
}
.log { display: grid; gap: 6px; }
.log > div {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: 12px; overflow-wrap: anywhere; word-break: break-word;
}
.card h2 { font-family: var(--display); font-size: 1.06rem; margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 700; padding: 7px 6px; border-bottom: 1px solid var(--line);
}
td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--gold-soft); }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.loadrow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 8px; }
.loadrow .t { font: 700 12.5px var(--display); font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: minmax(104px, auto) minmax(36px, 1fr) 44px; gap: 10px; align-items: center; margin-bottom: 6px; }
.bar .n { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bar .track { height: 7px; border-radius: var(--r-pill); background: var(--ground-2); overflow: hidden; }
.bar .fill { height: 100%; background: var(--grad-primary); border-radius: var(--r-pill); }
.bar .fill.hot { background: linear-gradient(90deg, var(--hot), var(--hot)); }
.bar .v { font-size: 11.5px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.warn-banner {
  padding: 10px 13px; border-radius: var(--r-4);
  background: var(--hot-bg); border: 1px solid var(--hot-line); color: var(--danger-ink);
  font-size: 12.5px; margin-bottom: 14px;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#panel > div > .row-actions { margin-bottom: 12px; }
.ghost { background: rgba(255, 253, 249, 0.8); border: 1px solid var(--line); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

/* ==========================================================================
   Сканер
   ========================================================================== */

.scan-wrap { max-width: var(--shell-scan); margin: 0 auto; padding: 16px; }
.scan-card { max-width: 520px; margin: 0 auto; }
.cam {
  position: relative;
  height: 300px;
  border-radius: var(--r-6);
  background: radial-gradient(120% 90% at 50% 0%, var(--camera-1), var(--camera-2));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--dark-ink-soft);
}
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .frame {
  width: 176px; height: 176px;
  border-radius: var(--r-5);
  box-shadow: inset 0 0 0 2px var(--gold-bright);
  position: relative;
  z-index: 2;
}
.cam .hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 11.5px; z-index: 2; }
.cam.ok { background: linear-gradient(160deg, var(--scan-ok-1), var(--scan-ok-2)); }
.cam.bad { background: linear-gradient(160deg, var(--scan-bad-1), var(--scan-bad-2)); }
.cam .big { font: 700 52px var(--body); text-align: center; }
.cam .big.ok { color: var(--ok-line); }
.cam .big.bad { color: var(--hot-line); }
.cam .say { text-align: center; color: var(--card); padding: 0 20px; }
.cam .say h2 { font-family: var(--display); font-size: 1.35rem; color: var(--card); margin: 4px 0 2px; }
.cam .say p { font-size: 13px; color: var(--dark-ink-2); }
.man { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 12px; }

@media (max-width: 1020px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  table .col-start { display: none; }
}
@media (max-width: 640px) {
  .man { grid-template-columns: minmax(0, 1fr); }
  .admin-head { flex-direction: column; }
  .admin-head .row-actions { margin-left: 0; width: 100%; }
  .admin-head select { width: 100%; }
  .admin-head .row-actions .btn { flex: 1 1 auto; }
}

/* страховка от белого экрана */
.boot-note { padding: 24px 4px; text-align: center; color: var(--muted); font: 15px/1.5 var(--body); }

/* порядковый номер игрока вместо QR */
.seq-box { padding: 10px 15px 16px; text-align: center; }
.seq-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
.seq-num {
  font-family: var(--display); font-size: 2.6rem; font-weight: 700;
  color: var(--gold-deep); line-height: 1.1; margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
