:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --accent: #ff3c00;
  --accent-hover: #ff5c28;
  --text: #f5f5f5;
  --text-muted: #9a9a9a;
  --border: #2a2a2a;
  --sidebar-w: 56px;
  --header-h: 64px;
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a.ref,
button.ref,
a {
  color: inherit;
}

a.ref,
button.ref {
  text-decoration: none;
  cursor: pointer;
}

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

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0e0e0e;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  z-index: 50;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 8px;
    border-right: none;
    border-top: 1px solid var(--border);
  }
}

.side-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.side-btn:hover,
.side-btn.active {
  background: var(--bg-card);
  color: var(--accent);
}

.side-btn svg {
  width: 22px;
  height: 22px;
}

.sidebar-spacer {
  flex: 1;
}

@media (max-width: 900px) {
  .sidebar-spacer {
    display: none;
  }
}

/* Main column */
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 900px) {
  .main-col {
    padding-bottom: 72px;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

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

.search-wrap {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
}

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

.search-wrap svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

@media (max-width: 720px) {
  .search-wrap {
    display: none;
  }
}

.btn-race {
  display: none;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .btn-race {
    display: inline-flex;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.link-login {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.link-login:hover {
  color: var(--accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Content */
.content {
  padding: 20px 20px 48px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Главный баннер Motor Casino */
.motor-banner {
  display: block;
  margin: 0 0 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #1a0c0c;
  line-height: 0;
}

.motor-banner img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  object-position: center;
  display: block;
}

@media (max-width: 600px) {
  .motor-banner img {
    max-height: 140px;
  }
}

/* Hero banners */
.hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .hero-row {
    grid-template-columns: 1fr;
  }
}

.hero-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
  background: linear-gradient(135deg, #1f1535 0%, #0e0e0e 60%);
  border: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}

.hero-card:nth-child(2) {
  background: linear-gradient(135deg, #2d1a4a 0%, #0e0e0e 55%);
}

.hero-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  flex: 1;
  z-index: 1;
}

.hero-card h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 280px;
}

.hero-card .btn-primary {
  align-self: flex-start;
  margin-top: 4px;
}

.hero-visual {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 45%;
  max-width: 200px;
  opacity: 0.85;
  pointer-events: none;
}

/* Promo strip */
.promo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .promo-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.promo-tile {
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.promo-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.promo-tile.p1 {
  background: linear-gradient(135deg, #4a2a7a, #1a1028);
}
.promo-tile.p2 {
  background: linear-gradient(135deg, #8b3a00, #2a1508);
}
.promo-tile.p3 {
  background: linear-gradient(135deg, #1a5c2e, #0e2815);
}
.promo-tile.p4 {
  background: linear-gradient(135deg, #6b5420, #2a220e);
}

/* Category tabs */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.cat-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-tab:hover,
.cat-tab.active {
  color: var(--text);
  background: var(--bg-card);
}

.cat-tab.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Section */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.section-count {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

@media (min-width: 600px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.game-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  display: block;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.game-thumb {
  aspect-ratio: 3 / 4;
  background: #222;
  position: relative;
  overflow: hidden;
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  box-sizing: border-box;
  background: #161616;
}

.game-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #8f8;
}

.game-meta {
  padding: 10px 10px 12px;
}

.game-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-provider {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Float TG */
.float-tg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #229ed9;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(34, 158, 217, 0.45);
  z-index: 60;
  text-decoration: none;
  transition: transform 0.2s;
}

.float-tg:hover {
  transform: scale(1.06);
}

@media (max-width: 900px) {
  .float-tg {
    bottom: 88px;
  }
}

/* Info bites (короткие блоки по странице) */
.info-bites {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .info-bites {
    grid-template-columns: 1fr;
  }
}

.bite {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

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

.section-lead {
  margin: 0 0 18px;
  max-width: 720px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

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

.note-banner {
  margin: 0 0 28px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #c8c8c8;
}

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

/* FAQ секция */
.faq-section {
  max-width: 800px;
  margin: 0 auto 48px;
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.faq-intro,
.faq-teaser {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.faq-cta {
  margin-top: 24px;
  margin-bottom: 0;
}

.faq-list {
  margin-top: 8px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.faq-list summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 400;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list .faq-a {
  padding: 0 16px 16px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.faq-list .faq-a strong {
  color: var(--text);
}

.faq-list .faq-a code {
  font-size: 0.88em;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.site-footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--accent);
}
