:root {
  --bg: #14100e;
  --bg-card: #1f1814;
  --bg-elevated: #2a211c;
  --text: #f5efe6;
  --text-muted: #a89a8c;
  --gold: #d4a84b;
  --gold-bright: #f5b800;
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, 0.15);
  --border: rgba(212, 168, 75, 0.2);
  --radius: 14px;
  --font: "Onest", system-ui, sans-serif;
  --header-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

img { max-width: 100%; height: auto; display: block; }

.container {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(20, 16, 14, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.logo-link img, .logo-link svg {
  height: 32px;
  width: auto;
  display: block;
}

@media (min-width: 768px) {
  .logo-link img, .logo-link svg {
    height: 34px;
  }
}

.logo-link img[src*="logo-white"],
.logo-link img[src*="logo-ru"],
.logo-link img[src$=".svg"] {
  filter: none;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.nav-desktop a:not(.btn) { color: var(--text-muted); }
.nav-desktop a:not(.btn):hover,
.nav-desktop a:not(.btn).active { color: var(--gold); }

.menu-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg);
  padding: 1.5rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
  border-top: 1px solid var(--border);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font-size: 1.15rem;
  color: var(--text);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .menu-btn { display: none; }
}

/* Hero / QR landing */
.hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
}

/* Search */
.search-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto 1.25rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--gold);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.search-results.open { display: block; }

.search-result-item {
  display: block;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.search-result-item:hover { background: var(--teal-soft); }

.search-result-item strong { color: var(--gold); display: block; }
.search-result-item span { font-size: 0.85rem; color: var(--text-muted); }

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.chip {
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8862e 100%);
  color: #1a1008;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Sections */
.page { padding: 2rem 0 4rem; display: none !important; visibility: hidden; }
.page.active { display: block !important; visibility: visible; }

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.section-title:has(+ .section-sub) {
  margin-bottom: 0.65rem;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2.25rem;
}

/* Cards grid */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--gold); }

.card h3 {
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 0.65rem;
}

.card .legacy-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card p { font-size: 0.9rem; color: var(--text-muted); }

.price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-bright);
  margin: 0.5rem 0 1rem;
}

/* Rules detail */
.rules-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .rules-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

.rules-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: calc(100dvh - var(--header-h) - 2rem);
  overflow-y: auto;
}

.rules-sidebar h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.65rem;
}

.rules-sidebar h4:first-child { margin-top: 0; }

.rules-sidebar a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
}

.rules-sidebar a:hover, .rules-sidebar a.active { color: var(--gold); }

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.mode-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.mode-tab.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.rule-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.rule-block h2 {
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.rule-block .legacy { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

.rule-block h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--text);
}

.rule-block ul, .rule-block ol {
  margin: 0.5rem 0 1rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.rule-block li { margin-bottom: 0.35rem; }

.rule-block p { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.95rem; }

.card-icon {
  width: 56px;
  height: 76px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: #222;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
}

.card-icon.master { background: linear-gradient(145deg, #2a4a2a, #1a301a); color: var(--gold); }

/* Compare boards */
.compare {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .compare { grid-template-columns: 1fr 1fr; }
}

.compare-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-item .label {
  padding: 0.85rem 1rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-item.old .label { background: #3a3530; color: var(--text-muted); }
.compare-item.new .label { background: var(--teal-soft); color: var(--teal); }

.compare-placeholder {
  aspect-ratio: 1;
  background: linear-gradient(145deg, var(--bg-elevated), #3d2e24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}

/* Club banner (base; landing overrides via .lp-club) */
.club-banner:not(.lp-club) {
  background: linear-gradient(135deg, var(--teal-soft) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.club-banner:not(.lp-club) h3 { font-size: 1.15rem; margin-bottom: 0.65rem; }
.club-banner:not(.lp-club) p { color: var(--text-muted); font-size: 0.9rem; max-width: 480px; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-a {
  display: none;
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q { color: var(--gold); }

/* Video */
.video-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .video-grid { grid-template-columns: 1fr 1fr; }
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.video-card video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  display: block;
}

.video-card .video-body { padding: 1rem 1.25rem; }
.video-card h3 { font-size: 1.1rem; margin-bottom: 0.65rem; }

/* Modal order */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

@media (min-width: 500px) {
  .modal-overlay { align-items: center; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(400px, 100%);
}

.modal h3 { margin-bottom: 1rem; }
.modal .btn { width: 100%; margin-bottom: 0.5rem; }

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.75rem 0 2.25rem;
  margin-top: 3rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 100%);
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer-logo {
  display: inline-block;
  line-height: 0;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.site-footer-logo:hover { opacity: 1; }

.site-footer-logo img {
  height: 40px;
  width: auto;
  display: block;
  filter: none;
}

.site-footer-tagline {
  margin: 0;
  max-width: 22rem;
  line-height: 1.5;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.site-footer-nav a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer-nav a:hover { color: var(--gold-bright); }

/* Print / PDF */
@media print {
  .site-header, .site-footer, .menu-btn, .mobile-nav, .club-banner, .btn, .search-wrap, .quick-chips { display: none !important; }
  body { background: #fff; color: #000; }
  .page { display: block !important; }
}

.hidden { display: none !important; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.alert {
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.alert strong { color: var(--text); }
