:root {
  --bg: #040404;
  --surface: #0b0b0b;
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: #8e8e8e;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 4, 4, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .2s;
}

.nav-links a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s ease;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: none;
}

.btn-primary:hover {
  background: #e5e5e5;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.hero {
  padding: 36px 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  padding: 5px 10px;
  border-radius: 100px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ccc;
}

.tag.accent {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.hero h1 {
  font-size: clamp(30px, 4.5vw, 54px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 22px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 360px;
  margin-bottom: 26px;
}

.countdown-box {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}

.countdown-val {
  font-size: 20px;
  font-weight: 800;
  display: block;
}

.countdown-lbl {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: #000000;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
}

.hero-video-shell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section-head {
  text-align: center;
  margin: 64px 0 28px;
}

.section-head h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.section-head p {
  color: var(--muted);
  font-size: 14px;
}

/* Сетка билетов адаптирована под 3 карточки */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: center;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .2s, transform .2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-price {
  font-size: 28px;
  font-weight: 900;
  margin: 10px 0;
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.card-featured {
  border-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(11, 11, 11, 1) 100%);
}

.bar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 26px;
}

.bar-info h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}

.bar-info p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
}

.bar-highlight {
  color: #e5e5e5;
  font-size: 13px;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  padding-left: 10px;
  margin: 12px 0;
}

.bar-badge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.bar-badge-item {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border);
}

.bar-badge-item strong {
  font-size: 13px;
  color: #fff;
  display: block;
  margin-bottom: 3px;
}

.bar-badge-item span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  display: block;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.menu-item-sub {
  font-size: 11px;
  color: #737373;
}

.menu-item-badge {
  font-size: 11px;
  font-weight: 700;
  color: #d4d4d4;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  margin-left: 10px;
}

.menu-item-badge.free {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.poster-section {
  margin-top: 60px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: center;
}

.poster-img-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  aspect-ratio: 9/16;
  max-width: 300px;
  width: 100%;
  background: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}

.poster-img-wrap:hover {
  transform: scale(1.02);
}

.poster-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  cursor: pointer;
  background: #111;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  display: block;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.05);
}

.video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  z-index: 2;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.rule-box {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
}

.rule-box strong {
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.lightbox,
.legal-modal,
.admin-modal,
.qr-viewer-modal,
.logs-modal,
.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.active,
.legal-modal.active,
.admin-modal.active,
.qr-viewer-modal.active,
.logs-modal.active,
.chat-modal.active {
  display: flex;
}

.legal-dialog,
.admin-dialog,
.qr-viewer-dialog,
.logs-dialog,
.chat-dialog {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  position: relative;
}

.legal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.legal-requisites {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
  font-size: 12px;
  color: #bbb;
  line-height: 1.6;
}

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-height: 82vh;
  max-width: 88vw;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--surface-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10002;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
}

.lightbox-nav-btn.prev { left: -64px; }
.lightbox-nav-btn.next { right: -64px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.admin-role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--surface-border);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 20px auto;
}

.admin-input {
  background: #111;
  border: 1px solid var(--surface-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.admin-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.admin-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-box {
  background: #111;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.admin-stat-val {
  font-size: 22px;
  font-weight: 800;
  display: block;
  color: #fff;
}

.admin-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}

.admin-table th {
  text-align: left;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-bottom: 1px solid var(--surface-border);
  font-size: 11px;
  text-transform: uppercase;
}

.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.admin-action-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.admin-action-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.admin-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.db-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 6px;
}

.scanner-box {
  background: #111;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
  display: none;
}

#reader {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
}

.scan-fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: #090909;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px;
}

.scan-fullscreen-modal.active {
  display: flex;
}

.scan-fs-card {
  background: #121212;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 22px;
  margin-top: 10px;
}

.order-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #111;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 10px;
  flex-wrap: wrap;
}

.order-wristband {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-right: 8px;
}

.chat-dialog {
  display: flex;
  flex-direction: column;
  height: 84vh;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 12px;
}

.chat-audience-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
  flex-wrap: wrap;
}

.chat-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  font-size: 13px;
}

.chat-msg-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--surface-border);
}

.logs-body {
  overflow-y: auto;
  max-height: 55vh;
  font-family: monospace;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.log-entry {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid #777;
  border-radius: 4px;
  color: #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-entry.entry-pass { border-left-color: #10b981; }
.log-entry.entry-fail { border-left-color: #ef4444; }
.log-entry.entry-bar { border-left-color: #3b82f6; }
.log-entry.entry-voucher { border-left-color: #f59e0b; }
.log-entry.entry-system { border-left-color: #8b5cf6; }

footer {
  border-top: 1px solid var(--surface-border);
  margin-top: 80px;
  padding: 36px 0 28px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-links a,
.footer-links button {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .2s;
  padding: 0;
}

.footer-links a:hover,
.footer-links button:hover { color: #fff; }
.footer-copy { color: #555; font-size: 12px; }

.footer-legal-line {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: #888;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .bar-grid { grid-template-columns: 1fr; padding: 18px; }
  .poster-section { grid-template-columns: 1fr; }
  .poster-img-wrap { max-width: 240px; margin: 0 auto; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .lightbox-content { max-width: 96vw; }
  .lightbox-nav-btn.prev { left: 8px; }
  .lightbox-nav-btn.next { right: 8px; }
  .admin-stat-row { grid-template-columns: 1fr; }
}