:root {
  --bg: #05070b;
  --bg2: #0b1018;
  --card: #101820;
  --card2: #16202c;
  --line: rgba(94, 184, 245, 0.12);
  --text: #f3f7fb;
  --muted: #8b9bb0;
  --blue: #5eb8f5;
  --blue2: #7cc8ff;
  --blue-deep: #1a6aa8;
  --gold: #f0c14b;
  --green: #3ecf8e;
  --red: #ff6b7a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(94, 184, 245, 0.16), transparent 55%),
    radial-gradient(700px 360px at 110% 8%, rgba(26, 106, 168, 0.18), transparent 50%),
    var(--bg);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(82px + var(--safe-b));
}

.topbar {
  padding: 14px 18px 10px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.96), rgba(5, 7, 11, 0.55) 80%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 0 0 1px rgba(94, 184, 245, 0.25), 0 8px 20px rgba(94, 184, 245, 0.18);
}
.brand-title { font-weight: 750; letter-spacing: 0.01em; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.screen { padding: 6px 16px 24px; flex: 1; }

.hero, .guest, .card, .action-card, .product, .user-row, .empty, .error, .note, .hist-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 32, 44, 0.92), rgba(16, 24, 32, 0.96));
}

.hero {
  border-radius: 24px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -24px; top: -36px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 184, 245, 0.2), transparent 70%);
  pointer-events: none;
}
.hello { color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.name, .fio {
  font-size: 20px;
  font-weight: 800;
  margin: 8px 0 14px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(94, 184, 245, 0.1);
  border: 1px solid rgba(94, 184, 245, 0.18);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.stat i { color: var(--blue); font-size: 15px; }
.stat b { font-size: 16px; font-weight: 800; }
.stat em {
  font-style: normal;
  color: var(--blue);
  font-weight: 800;
}
.stat.gold {
  background: rgba(240, 193, 75, 0.12);
  border-color: rgba(240, 193, 75, 0.22);
}
.stat.gold i, .stat.gold b, .stat.gold span { color: var(--gold); }

.next-block { margin-top: 12px; }
.next-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.next-label i { color: var(--blue); }

.next { margin-top: 12px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.next i { color: var(--blue); margin-top: 1px; }

.actions-row { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  font-family: Manrope, sans-serif;
  font-weight: 800;
  cursor: pointer;
  color: #041018;
  background: linear-gradient(180deg, var(--blue2), var(--blue));
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(94, 184, 245, 0.22);
}
.btn i { font-size: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.btn.ghost {
  background: rgba(94, 184, 245, 0.08);
  border: 1px solid rgba(94, 184, 245, 0.18);
  color: var(--text);
  box-shadow: none;
}

.guest {
  border-radius: 24px;
  padding: 22px 18px;
  text-align: left;
  box-shadow: var(--shadow);
}
.guest-ico {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(94, 184, 245, 0.12);
  color: var(--blue);
  font-size: 24px;
  margin-bottom: 14px;
}
.steps { margin: 14px 0 0; padding: 0; list-style: none; }
.steps li {
  display: flex; gap: 10px; align-items: flex-start;
  color: var(--muted); font-size: 14px; margin-bottom: 10px;
}
.steps b {
  min-width: 22px; height: 22px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(94, 184, 245, 0.14);
  color: var(--blue); font-size: 12px;
}

.section-title {
  margin: 22px 0 10px;
  font-size: 17px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--blue); }

.hist { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
}
.op {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 16px;
}
.op.plus { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.op.minus { background: rgba(255, 107, 122, 0.15); color: var(--red); }
.op.reg, .op.other { background: rgba(94, 184, 245, 0.14); color: var(--blue); }
.hist-msg { font-size: 14px; font-weight: 600; }
.hist-date { color: var(--muted); font-size: 12px; margin-top: 3px; }
.hist-pts { font-weight: 800; color: var(--gold); white-space: nowrap; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:active { transform: scale(0.98); }
.card img, .thumb {
  width: 100%;
  height: 122px;
  object-fit: cover;
  background: var(--card2);
  display: block;
}
.card-body { padding: 10px 11px 12px; }
.card-title { font-weight: 700; font-size: 13px; line-height: 1.3; }
.card-meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.price { color: var(--gold); font-weight: 800; margin-top: 6px; }

.action-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}
.action-card img {
  width: 92px; height: 100%; min-height: 114px; object-fit: cover; background: var(--card2);
}
.action-body { padding: 12px 12px 12px 12px; }
.action-title { font-weight: 750; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.05); color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip.gold { color: var(--gold); background: rgba(240, 193, 75, 0.12); }

a, a:link, a:visited, a:hover, a:active {
  text-decoration: none !important;
}
.more-btn,
a.more-btn,
a.more-btn:link,
a.more-btn:visited,
a.more-btn:hover,
a.more-btn:active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7cc8ff, #5eb8f5);
  color: #041018 !important;
  font-family: Manrope, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  box-shadow: 0 6px 14px rgba(94, 184, 245, 0.28);
}

.tg-only {
  min-height: 50vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}
.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(94, 184, 245, 0.12);
  border: 1px solid rgba(94, 184, 245, 0.28);
  color: var(--text);
  font-weight: 750;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.tg-badge i { color: #2AABEE; font-size: 18px; }
body.from-web #tabs,
body.from-web #tab-admin { display: none !important; }
body.from-web #app { padding-bottom: 24px; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue); font-weight: 700; margin: 4px 0 12px;
  background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px;
}

.product { border-radius: 20px; overflow: hidden; }
.product img { width: 100%; height: 240px; object-fit: cover; background: var(--card2); }
.product-body { padding: 14px 16px 18px; }
.desc { color: #c5d2e0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }

.pager { display: flex; gap: 8px; margin: 14px 0 6px; }
.empty, .error, .note {
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}
.error { color: #ffb4bb; }

.user-row { border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.user-row b { font-size: 14px; }
.user-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

.tabs {
  position: fixed;
  left: 10px; right: 10px; bottom: calc(8px + var(--safe-b));
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(10, 14, 20, 0.88);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 4px 7px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.tab i { font-size: 18px; line-height: 1; }
.tab.active { color: #041018; background: linear-gradient(180deg, var(--blue2), var(--blue)); }
#tab-admin[hidden] { display: none !important; }

.skel {
  height: 16px; border-radius: 8px;
  background: linear-gradient(90deg, #16202c, #223246, #16202c);
  background-size: 200% 100%;
  animation: shine 1.2s infinite;
}
@keyframes shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

a.link { color: var(--blue2); word-break: break-all; }
