/* ============================================================
   Carvi — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,500;1,600&display=swap');

:root {
  --bg-0: #07070f;
  --bg-1: #0d0d1c;
  --bg-2: #13132a;
  --bg-3: #1c1c38;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --accent: #4f8ef7;
  --accent-2: #a855f7;
  --accent-gradient: linear-gradient(135deg, #4f8ef7 0%, #a855f7 100%);
  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #475569;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.05);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.6);
  --glow: 0 0 40px rgba(79,142,247,0.15);
  --t: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-0);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(79,142,247,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(168,85,247,0.06) 0%, transparent 60%);
  color: var(--text-1);
  font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Typography ─── */
h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.12; }
h2 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.35rem, 2.5vw, 1.9rem); font-weight: 600; letter-spacing: 0; }
h1 em, h2 em { font-style: italic; font-weight: 600; }
h3 { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; }
p  { color: var(--text-2); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navbar ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,7,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-1);
}
.nav-brand .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.nav-brand:hover { text-decoration: none; }

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

.nav-link {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--t);
  text-decoration: none;
}
.nav-link:hover { color: var(--text-1); background: var(--bg-card-hover); text-decoration: none; }
.nav-link.active { color: var(--accent); background: rgba(79,142,247,0.12); }

.nav-cta {
  padding: 8px 18px;
  background: var(--accent-gradient);
  color: #fff !important;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--t);
  text-decoration: none;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); text-decoration: none; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--t);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79,142,247,0.3);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(79,142,247,0.4); text-decoration: none; color: #fff; }

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

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(79,142,247,0.1); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-1); border-color: rgba(255,255,255,0.15); background: var(--bg-card); text-decoration: none; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--r-lg); }
.btn-icon { padding: 10px; }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: var(--t);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-md);
}
.card-link { cursor: pointer; text-decoration: none; color: inherit; display: block; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-blue  { background: rgba(79,142,247,0.15); color: var(--accent); }
.badge-purple{ background: rgba(168,85,247,0.15);  color: var(--accent-2); }
.badge-green { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-amber { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-red   { background: rgba(239,68,68,0.15);   color: var(--danger); }
.badge-neutral { background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border-light); }

/* ─── Rating Segments ─── */
.rating-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rating-bar .seg {
  height: 6px;
  flex: 1;
  border-radius: 3px;
  background: var(--bg-3);
  transition: var(--t);
}
.rating-bar .seg.filled.r1, .rating-bar .seg.filled.r2 { background: var(--danger); }
.rating-bar .seg.filled.r3 { background: var(--warning); }
.rating-bar .seg.filled.r4, .rating-bar .seg.filled.r5 { background: var(--success); }

.rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.rating-label {
  font-size: 0.85rem;
  color: var(--text-2);
  width: 120px;
  flex-shrink: 0;
}
.rating-bar { flex: 1; }
.rating-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
  width: 28px;
  text-align: right;
}

/* ─── Stat Chips ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.stat-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: center;
}
.stat-chip .val {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-chip .unit {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-chip .lbl {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 2px;
}

/* ─── Section Layout ─── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.section-header {
  margin-bottom: 32px;
}
.section-header p {
  margin-top: 8px;
  font-size: 1rem;
}

/* ─── Page Header ─── */
.page-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 32px;
}
.page-hero h1 {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t);
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-1); background: var(--bg-card); }
.tab-btn.active {
  background: var(--bg-3);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Table ─── */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.spec-table td:first-child { color: var(--text-2); }
.spec-table td:last-child { color: var(--text-1); font-weight: 500; }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr:hover td { background: var(--bg-card); }

/* ─── Car Image Placeholder ─── */
.car-visual {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
}
.car-visual .car-brand-bg {
  font-size: clamp(4rem, 15vw, 9rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  opacity: 0.05;
  position: absolute;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
}
.car-visual .car-svg {
  position: relative;
  z-index: 1;
}
.car-visual .car-name-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 2;
}
.car-visual .car-name-overlay .brand {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.car-visual .car-name-overlay .model {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.car-visual .accent-dot {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

/* ─── Pro/Con List ─── */
.pro-con-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pro-con-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.5;
}
.pro-con-list .icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }

/* ─── Select ─── */
.select-custom {
  appearance: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 40px 12px 16px;
  cursor: pointer;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  transition: var(--t);
}
.select-custom:hover { border-color: rgba(255,255,255,0.15); }
.select-custom:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,142,247,0.15); }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 999;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── Divider ─── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ─── Grid helpers ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ─── Language Toggle ─── */
.lang-toggle {
  padding: 5px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--t);
  letter-spacing: 0.06em;
  margin-left: 6px;
  flex-shrink: 0;
}
.lang-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Scroll ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.animate-up   { animation: fadeUp 0.5s var(--t) both; }
.animate-in   { animation: fadeIn 0.4s var(--t) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ─── Skeleton loading ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .nav-links .nav-link { padding: 6px 10px; font-size: 0.82rem; }
  .section { padding: 32px 16px; }
  .page-hero { padding: 32px 16px 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .tabs { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .nav-links { gap: 2px; }
  .nav-link span { display: none; }
}

/* ─── Comparison verdict "Итог" ─── */
.verdict-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--r-lg);
  padding: 22px 26px;
}
.verdict-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 10px; color: var(--text-1); }
.verdict-text { color: var(--text-1); font-size: 1rem; line-height: 1.6; }
.verdict-caveat {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light);
  color: var(--text-2); font-size: 0.9rem; line-height: 1.55;
}

/* ─── "Где купить" block ─── */
.buy-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.buy-title { font-size: 0.95rem; font-weight: 700; color: var(--text-1); margin-bottom: 12px; }
.buy-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.buy-btn {
  flex: 1; min-width: 90px; text-align: center;
  padding: 11px 16px; border: 1.5px solid var(--border);
  border-radius: 10px; background: transparent;
  color: var(--text-1); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: var(--t);
}
.buy-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.buy-note { font-size: 0.76rem; color: var(--text-3); margin-top: 11px; line-height: 1.5; }
.buy-note a { color: var(--text-2); text-decoration: underline; }
.buy-compact { padding: 12px 14px; }
.buy-compact .buy-title { font-size: 0.82rem; margin-bottom: 8px; }
.buy-compact .buy-btn { padding: 8px 10px; font-size: 0.82rem; min-width: 70px; }
.buy-compact .buy-note { display: none; }

/* ─── Car photos (generated renders, SVG fallback) ─── */
.car-photo {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.car-visual { position: relative; z-index: 1; }
.car-visual-svg { display: flex; justify-content: center; }

/* ─── BATTLE PAGE ─── */
.battle-hero {
  text-align: center;
  padding: 48px 24px 24px;
}
.battle-hero h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.battle-hero p { font-size: 1.1rem; margin-top: 8px; }

.battle-arena {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}

.battle-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  user-select: none;
  position: relative;
  overflow: hidden;
}
.battle-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: inherit;
}
.battle-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(79,142,247,0.2), var(--glow);
}
.battle-card:hover::before { opacity: 0.04; }
.battle-card:active { transform: translateY(-2px) scale(0.99); }

.battle-card.winner {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success), 0 16px 48px rgba(34,197,94,0.25);
  animation: pulse 0.4s ease;
}
.battle-card.winner::before { background: linear-gradient(135deg, #22c55e, #16a34a); opacity: 0.06; }

.battle-card.loser {
  opacity: 0.4;
  transform: scale(0.97);
  pointer-events: none;
}

.battle-card .car-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.battle-card .car-placeholder .bg-text {
  position: absolute;
  font-size: 5rem;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.06;
  letter-spacing: -0.04em;
  white-space: nowrap;
  user-select: none;
}
.car-svg-wrap {
  position: relative;
  z-index: 1;
  opacity: 0.7;
}

.battle-card .car-info .brand {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.battle-card .car-info .model-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 4px 0 6px;
}
.battle-card .car-info .year-badge {
  display: inline-block;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 16px;
}

.battle-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-top: 8px;
}
.battle-stat {
  background: var(--bg-2);
  border-radius: var(--r-sm);
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.battle-stat .bv {
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.battle-stat .bl {
  font-size: 0.68rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 3px;
}

.vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.vs-badge {
  width: 52px; height: 52px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 24px rgba(79,142,247,0.4);
  letter-spacing: 0.03em;
}
.vs-line {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.battle-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.battle-result-bar {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: none;
}
.battle-result-bar.show { display: block; animation: fadeUp 0.4s ease both; }
.result-inner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.result-inner .result-text { flex: 1; font-weight: 600; font-size: 1rem; }
.result-inner .result-text span { color: var(--success); }

.battle-progress {
  max-width: 900px;
  margin: 0 auto 16px;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.progress-count { font-size: 0.8rem; color: var(--text-3); white-space: nowrap; }

/* ─── CARS LIST PAGE ─── */
.filters-bar {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 11px 16px 11px 42px;
  transition: var(--t);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,142,247,0.1); }

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.car-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.car-card:hover {
  border-color: rgba(79,142,247,0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}
.car-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}
.car-card-img .bg-text {
  position: absolute;
  font-size: 3.5rem;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.06;
  letter-spacing: -0.04em;
}
.car-card-body { padding: 18px; }
.car-card-brand {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.car-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 3px 0 8px;
}
.car-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.car-card-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.car-card-stat { text-align: center; }
.car-card-stat .v { font-size: 1rem; font-weight: 700; color: var(--text-1); }
.car-card-stat .l { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── CAR DETAIL PAGE ─── */
.car-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.car-hero-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-2);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.car-hero-img .bg-text {
  position: absolute;
  font-size: 7rem;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.05;
  letter-spacing: -0.04em;
  white-space: nowrap;
  user-select: none;
}
.car-hero-info { padding-top: 8px; }
.car-hero-info .category-badge { margin-bottom: 12px; }
.car-hero-info h1 { margin-bottom: 8px; }
.car-hero-info .tagline {
  font-size: 1rem;
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
}
.car-hero-scores {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.score-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 12px;
  text-align: center;
}
.score-chip .sc {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}
.score-chip .sc.s5 { color: var(--success); }
.score-chip .sc.s4 { color: #86efac; }
.score-chip .sc.s3 { color: var(--warning); }
.score-chip .sc.s2, .score-chip .sc.s1 { color: var(--danger); }
.score-chip .sn { font-size: 0.72rem; color: var(--text-3); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; }

.car-detail-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.car-tabs-wrap {
  overflow-x: auto;
  margin-bottom: 28px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.car-tabs-wrap::-webkit-scrollbar { display: none; }
.car-tabs { min-width: max-content; }

.spec-section { margin-bottom: 32px; }
.spec-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.spec-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}
.spec-row:last-child { border-bottom: none; }
.spec-key { color: var(--text-2); font-size: 0.9rem; flex: 1; }
.spec-val { color: var(--text-1); font-size: 0.9rem; font-weight: 500; }

/* ─── COMPARE PAGE ─── */
.compare-selectors {
  max-width: 900px;
  margin: 0 auto 32px;
  padding: 0 24px;
  position: relative;
  z-index: 100;
}
.pickers-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pickers-row .vs-text {
  flex-shrink: 0;
  padding-top: 20px;
}
.pickers-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.vs-text {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-3);
  text-align: center;
}

.compare-table-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.compare-header-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 16px;
  padding: 20px 0 12px;
  position: sticky;
  top: 64px;
  background: var(--bg-0);
  z-index: 10;
  border-bottom: 2px solid var(--border);
}
.compare-header-row .ch-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.compare-header-row .ch-car { text-align: center; }
.compare-header-row .ch-car .brand { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.compare-header-row .ch-car .name { font-size: 1.1rem; font-weight: 700; }

.compare-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 20px 0 8px;
}
.compare-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}
.compare-row:hover { background: var(--bg-card); margin: 0 -16px; padding: 11px 16px; border-radius: var(--r-sm); }
.compare-row .cr-label { color: var(--text-2); font-size: 0.88rem; }
.compare-row .cr-val { font-size: 0.88rem; font-weight: 500; text-align: center; }
.compare-row .cr-val.better { color: var(--success); font-weight: 700; }
.compare-row .cr-val.worse  { color: var(--danger); }

/* ─── LEARN PAGE ─── */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.learn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--t);
}
.learn-card:hover { border-color: rgba(255,255,255,0.12); box-shadow: var(--shadow-md); }
.learn-card-header {
  padding: 24px 24px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.learn-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.learn-card-header h3 { flex: 1; line-height: 1.3; }
.learn-card-header .arrow {
  font-size: 1rem;
  color: var(--text-3);
  transition: transform 0.2s;
  margin-top: 2px;
}
.learn-card.open .learn-card-header .arrow { transform: rotate(180deg); }

.learn-card-body {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px solid var(--border-light);
}
.learn-card.open .learn-card-body { display: block; animation: fadeUp 0.3s ease; }

.learn-card-body p { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; margin-bottom: 12px; }
.learn-card-body h4 { font-size: 0.9rem; font-weight: 600; margin: 16px 0 8px; }
.learn-card-body ul, .learn-card-body ol {
  color: var(--text-2);
  font-size: 0.88rem;
  padding-left: 20px;
  line-height: 1.7;
}
.learn-card-body li { margin-bottom: 4px; }

.checklist { list-style: none !important; padding-left: 0 !important; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.checklist li:last-child { border-bottom: none; }
.checklist .ci { font-size: 1rem; flex-shrink: 0; }
.checklist .ct { flex: 1; }
.checklist .ct strong { color: var(--text-1); display: block; font-size: 0.88rem; }
.checklist .ct span  { color: var(--text-3); font-size: 0.8rem; }

.learn-section { margin-bottom: 48px; }
.learn-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.learn-section-title::before, .learn-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.learn-section-title::before { display: none; }

/* ─── Footer ─── */
footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
footer p { color: var(--text-3); font-size: 0.85rem; }
footer a { color: var(--text-2); }
footer a:hover { color: var(--text-1); }

/* ─── Swipe hint ─── */
.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 0 24px;
}
.hint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.hint-key {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
}

/* ─── Touch feedback ─── */
.battle-card.left-chosen  { border-color: var(--success); }
.battle-card.right-chosen { border-color: var(--success); }

@media (max-width: 640px) {
  /* Navbar: let it scroll horizontally instead of overflowing the page */
  .navbar { padding: 0 12px; gap: 8px; }
  .nav-brand { flex-shrink: 0; font-size: 1rem; }
  .nav-brand .logo-icon { width: 30px; height: 30px; }
  .nav-links { gap: 2px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { padding: 6px 9px; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }

  /* Battle hero: smaller so it fits the phone width */
  .battle-hero { padding: 24px 12px 12px; }
  .battle-hero h1 { font-size: 1.5rem; }
  .battle-hero p { font-size: 0.9rem; }

  /* Keep the two battle cars SIDE-BY-SIDE on phones — just compact everything */
  .battle-arena {
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    padding: 0 8px 16px;
  }
  .battle-card { padding: 12px 8px; border-radius: 16px; border-width: 1.5px; min-width: 0; }
  .battle-stat { min-width: 0; }
  .battle-card .car-placeholder { margin-bottom: 8px; }
  .battle-card .car-placeholder svg { width: 92%; height: auto; }
  .battle-card .car-placeholder .bg-text { font-size: 2.4rem; }
  .battle-card .car-info .brand { font-size: 0.6rem; letter-spacing: 0.08em; }
  .battle-card .car-info .model-name { font-size: 0.98rem; margin: 2px 0 4px; }
  .battle-card .car-info .year-badge { font-size: 0.58rem; padding: 1px 5px; margin-bottom: 8px; }
  .battle-stats { gap: 4px; }
  .battle-stat { padding: 6px 2px; }
  .battle-stat .bv { font-size: 0.8rem; }
  .battle-stat .bl { font-size: 0.5rem; letter-spacing: 0.02em; margin-top: 2px; }
  .vs-divider { flex-direction: column; gap: 4px; }
  .vs-badge { width: 34px; height: 34px; font-size: 0.7rem; box-shadow: 0 0 14px rgba(0,0,0,0.25); }
  .vs-line { width: 2px; height: 16px; }

  .compare-selectors { grid-template-columns: 1fr; }
  .vs-text { display: none; }
  .car-hero { grid-template-columns: 1fr; }
  .compare-header-row, .compare-row {
    grid-template-columns: 140px 1fr 1fr;
    font-size: 0.82rem;
  }
}
