:root {
  --bg: #2A2A2A;
  --bg-card: #1A1A1A;
  --bg-header: #0D0D0D;
  --border: #3A3A3A;
  --text: #FFFFFF;
  --text-muted: rgba(255,255,255,0.5);
  --text-faint: rgba(255,255,255,0.25);
  --yellow: #FFE234;
  --pink: #FF2D7A;
  --teal: #00C9A7;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html, body {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
  padding: 0 48px;
}

.block-bg {
  position: relative;
  background-color: var(--bg);
}

.block-bg .bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.block-bg .bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}

.block-bg > *:not(.bg-image):not(.bg-overlay) {
  position: relative;
  z-index: 2;
}

/* Header (старый — для cars/achievements/etc) */
header:not(.site-header) {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header:not(.site-header) .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo span { color: var(--yellow); }

nav { display: flex; gap: 4px; }

nav a {
  font-size: 15px;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
nav a.active { color: var(--text); }

.header-yt {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pink);
  border: 1px solid rgba(255,45,122,0.3);
  border-radius: var(--radius);
  padding: 5px 12px;
  transition: background 0.15s;
}

.header-yt:hover { background: rgba(255,45,122,0.08); }

/* Map section */
.map-section {
  display: flex;
  justify-content: center;
  height: calc(100vh - 56px);
}

.map-section .container {
  display: grid;
  grid-template-columns: 250px 1fr;
  width: 100%;
  padding: 0;
}

.map-sidebar {
  background: var(--bg-header);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-select-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  border: 1px solid var(--border);
}

.filter-select-all-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-group { margin-bottom: 4px; }

.filter-group-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.filter-group-title .toggle {
  width: 24px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.filter-group-title .toggle::after {
  width: 10px;
  height: 10px;
  top: 2px;
  left: 2px;
}

.filter-group-title .toggle.on::after { left: 12px; }

.filter-list { display: flex; flex-direction: column; gap: 2px; }

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.filter-item:hover { background: rgba(255,255,255,0.04); }

.filter-dot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}

.filter-name {
  font-size: 12px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-item .toggle {
  flex-shrink: 0;
}

.filter-item .filter-count {
  flex-shrink: 0;
}

.filter-count {
  font-size: 10px;
  color: var(--text-faint);
}

.toggle {
  width: 28px;
  height: 16px;
  border-radius: 8px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--teal); }

.toggle::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
}

.toggle.on::after { left: 14px; }

.divider { height: 1px; background: var(--border); }

.progress-item { margin-bottom: 8px; }

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

.progress-label span:last-child { color: var(--text); font-weight: 500; }

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
}

#map { flex: 1; --icon-size: 40px; }
.leaflet-control-attribution { display: none !important; }
.map-marker-img { width: var(--icon-size); height: var(--icon-size); display: block; }
.map-marker-dot { width: var(--icon-size); height: var(--icon-size); }

/* News section */
.news-section {
  padding: 48px 32px;
}

.news-section .container,
.cars-section .container { padding: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.section-title span { color: var(--yellow); }

.section-link {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}

.section-link:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }

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

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

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

.news-card-img {
  width: 100%;
  height: 180px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.news-card-img img { width: 100%; height: 100%; object-fit: cover; }

.news-card-body { padding: 16px; }

.news-card-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.news-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-card-date { font-size: 11px; color: var(--text-faint); }

.news-card-arrow {
  font-size: 11px;
  color: var(--yellow);
  opacity: 0;
  transition: opacity 0.15s;
}

.news-card:hover .news-card-arrow { opacity: 1; }

/* Cars section */
.cars-section { padding: 48px 32px; }

.cars-slider {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
}

.slider-btn, .slider-dots, .slider-dot { user-select: none; }
.car-slide { user-select: none; }
.car-slide .tune-code { user-select: text; }

.car-slide {
  display: none;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
}

.car-slide.active { display: grid; }

.car-image-wrap {
  height: 280px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
  overflow: hidden;
}

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

.car-info { padding: 32px; }

.car-class {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #0D0D0D;
  background: var(--yellow);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.car-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.car-manufacturer { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.car-top-label {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  color: #0D0D0D;
  background: var(--yellow);
  padding: 2px 10px; border-radius: 4px;
  margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.car-top-desc {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.6; margin-top: 8px;
  max-width: 380px;
}

.car-info .tune-item {
  background: #232323; border-radius: 8px; padding: 10px 14px;
  display: inline-block; margin-top: 12px;
}
.car-info .tune-class-label {
  font-size: 0.65rem; color: #555;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px;
}
.car-info .tune-code {
  font-family: monospace; font-size: 0.95rem;
  color: var(--yellow); letter-spacing: 0.06em;
}

.car-meta-row {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 12px;
}
.car-meta-country {
  font-size: 12px; color: var(--text-muted);
}
.car-meta-price {
  font-size: 12px; color: var(--yellow);
  background: rgba(255,226,52,0.08);
  border: 1px solid rgba(255,226,52,0.2);
  padding: 2px 10px; border-radius: 20px;
}

.car-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

.car-stat-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 3px; }
.car-stat-value { font-size: 14px; font-weight: 700; color: var(--text); }

.car-tune {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.car-tune-label { font-size: 10px; color: var(--text-faint); margin-bottom-4px; }
.car-tune-code { font-size: 14px; font-weight: 600; color: var(--teal); font-family: monospace; }

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  z-index: 10;
  transition: background 0.15s;
}

.slider-btn:hover { background: rgba(0,0,0,0.9); }
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }

.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.slider-dot.active { background: var(--yellow); }

/* Footer */
footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 48px 32px 24px;
}

footer .container { display: flex; flex-direction: column; gap: 40px; }

.footer-top {
  display: grid;
  grid-template-columns: 260px 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {}
.footer-logo { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.footer-logo span { color: var(--yellow); }
.footer-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }

.footer-yt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pink);
  border: 1px solid rgba(255,45,122,0.3);
  border-radius: var(--radius);
  padding: 6px 12px;
  transition: background 0.15s;
}
.footer-yt:hover { background: rgba(255,45,122,0.08); }

.footer-col-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-copy { font-size: 11px; color: var(--text-faint); }
.footer-version { font-size: 11px; color: var(--text-faint); }

/* ===== NEW HEADER (главная) ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  padding: 0 48px;
  height: 72px;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.site-header {
  background: rgba(10,10,10,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header.scrolled {
  background: rgba(10,10,10,0.75);
  border-bottom-color: rgba(255,255,255,0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active { opacity: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.05) 100%);
  z-index: 1;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero-left {
  flex: 1;
  min-width: 0;
}

.hero-right {
  flex: 0 0 380px;
  align-self: center;
}

/* ===== CAR QUIZ ===== */
.car-quiz {
  background: rgba(10,10,10,0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
}

.car-quiz-header {
  padding: 14px 18px 0;
}

.car-quiz-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--yellow);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.car-quiz-img {
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: rgba(0,0,0,0.5);
  margin-top: 14px;
}

.car-quiz-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.car-quiz-body {
  padding: 14px 18px 18px;
}

.car-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-option:hover:not(:disabled) {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.25);
}

.quiz-option.correct {
  background: rgba(39,174,96,0.2);
  border-color: #27AE60;
  color: #2ecc71;
}

.quiz-option.wrong {
  background: rgba(231,76,60,0.15);
  border-color: #E74C3C;
  color: #e74c3c;
}

.quiz-option:disabled { cursor: default; }

.car-quiz-result {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: #fff;
}

.car-quiz-next {
  margin-top: 10px;
  width: 100%;
  background: var(--yellow);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: 0.3px;
}

.car-quiz-next:hover { opacity: 0.85; }

.hero-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--yellow);
  margin-bottom: 14px;
}

.hero-logo {
  width: 660px;
  max-width: 100%;
  margin-bottom: 16px;
  display: block;
}

.hero-title {
  font-size: clamp(42px, 5.5vw, 76px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
  white-space: nowrap;
}

.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 36px;
}

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

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  background: var(--yellow);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius);
  transition: opacity 0.15s, transform 0.15s;
}

.hero-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.15s;
}

.hero-btn-secondary:hover { background: rgba(255,255,255,0.16); }

.hero-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.hero-dot.active {
  background: var(--yellow);
  transform: scale(1.3);
}

/* ===== HOME SECTIONS ===== */
.home-section {
  padding: 64px 0;
}

/* Превью карты */
.map-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.map-preview:hover { border-color: rgba(255,255,255,0.2); }

.map-preview-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.map-preview-icon { color: var(--yellow); margin-bottom: 4px; }
.map-preview-title { font-size: 20px; font-weight: 700; color: var(--text); }
.map-preview-sub { font-size: 13px; color: var(--text-muted); }
