/* =============================================
   ROOT & RESET
   ============================================= */
:root {
  --sidebar-w: 200px;
  --topbar-h: 60px;

  --bg-deep:    #1a0e05;
  --bg-dark:    #241208;
  --bg-mid:     #2e1a0a;
  --bg-card:    #351e0d;
  --bg-hover:   #3f2510;

  --gold:       #c9922a;
  --gold-light: #e8b84b;
  --gold-glow:  #f5d27a;
  --amber:      #d4710d;

  --text-main:  #f0ddb8;
  --text-muted: #9e7e56;
  --text-dim:   #6b5033;

  --border:     rgba(201,146,42,.18);
  --border-hot: rgba(201,146,42,.45);

  --red-badge:  #d42a2a;
  --teal-badge: #1a7f6e;

  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 20px rgba(0,0,0,.55);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  background: var(--bg-deep);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: auto;
}
.skip-link:focus {
  position: fixed; left: 16px; top: 16px; z-index: 9999;
  background: var(--gold); color: var(--bg-deep);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 700;
}

/* =============================================
   LAYOUT
   ============================================= */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 300;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: transform .3s ease;
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo img {
  max-width: 140px;
  height: auto;
}

.sidebar-promos {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-promo-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--bg-mid);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s, border-color .2s;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold-light);
  text-transform: uppercase;
}
.sidebar-promo-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hot);
}
.sidebar-promo-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav-item--section {
  padding: 12px 14px 4px;
}
.sidebar-section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.sidebar-nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .2s;
}
.sidebar-nav-link:hover,
.sidebar-nav-link.is-active {
  color: var(--gold-light);
  background: linear-gradient(90deg, rgba(201,146,42,.08) 0%, transparent 100%);
  border-left-color: var(--gold);
}
.sidebar-nav-link.is-active svg,
.sidebar-nav-link:hover svg {
  opacity: 1;
}

/* ─── MENU_TOP() OUTPUT STYLING ──────────────── */
/* Стилизует li/a элементы от menu_top() как sidebar-nav-link */
.sidebar-nav-list li > a:not(.sidebar-nav-link) {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
  text-decoration: none;
}
.sidebar-nav-list li > a:not(.sidebar-nav-link):hover,
.sidebar-nav-list li > a:not(.sidebar-nav-link).active,
.sidebar-nav-list li > a:not(.sidebar-nav-link).is-active {
  color: var(--gold-light);
  background: linear-gradient(90deg, rgba(201,146,42,.08) 0%, transparent 100%);
  border-left-color: var(--gold);
}
/* Скрываем лишние классы Bootstrap если есть */
.sidebar-nav-list li { list-style: none; }
.sidebar-nav-list .nav-item { padding: 0; }



.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-lang,
.sidebar-support {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.sidebar-lang:hover,
.sidebar-support:hover {
  color: var(--gold-light);
  border-color: var(--border-hot);
}
.sidebar-support svg {
  width: 15px;
  height: 15px;
}

/* =============================================
   TOPBAR
   ============================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  height: 38px;
  transition: border-color .2s;
}
.topbar-search:focus-within {
  border-color: var(--border-hot);
}
.topbar-search svg {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.topbar-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}
.topbar-search input::placeholder { color: var(--text-dim); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  height: 38px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  cursor: pointer;
  border: 0;
  transition: transform .2s, opacity .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-login {
  background: transparent;
  border: 1px solid var(--border-hot);
  color: var(--gold-light);
}
.btn-login:hover {
  background: rgba(201,146,42,.1);
}

.btn-register {
  background: linear-gradient(135deg, var(--amber) 0%, var(--gold) 100%);
  color: var(--bg-deep);
  box-shadow: 0 2px 12px rgba(201,146,42,.35);
}
.btn-register:hover {
  box-shadow: 0 4px 20px rgba(201,146,42,.55);
}

.btn-hero {
  background: linear-gradient(135deg, var(--amber) 0%, var(--gold-light) 100%);
  color: var(--bg-deep);
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  padding: 0 32px;
  height: 46px;
  box-shadow: 0 0 24px rgba(201,146,42,.5), 0 4px 16px rgba(0,0,0,.5);
  border-radius: 6px;
  letter-spacing: .08em;
}
.btn-hero:hover {
  box-shadow: 0 0 40px rgba(201,146,42,.7), 0 6px 24px rgba(0,0,0,.6);
}

/* =============================================
   HERO BANNER
   ============================================= */
.hero-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16/5;
  max-height: 550px;
  background: var(--bg-mid);
  margin: 0;
}

.hero-slides { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.hero-slide__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 60px;
  background: linear-gradient(90deg, rgba(10,5,0,.8) 0%, rgba(10,5,0,.2) 60%, transparent 100%);
}

.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--gold-glow);
  text-shadow: 0 0 40px rgba(245,210,122,.4), 2px 3px 0 rgba(0,0,0,.8);
  margin-bottom: 20px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.5);
  border: 1px solid var(--border-hot);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 10;
}
.hero-arrow:hover { background: rgba(201,146,42,.3); }
.hero-arrow--prev { left: 12px; }
.hero-arrow--next { right: 12px; }

.hero-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  border: 0;
  cursor: pointer;
  transition: background .2s, transform .2s;
  padding: 0;
}
.hero-dot.is-active {
  background: var(--gold);
  transform: scale(1.3);
}

/* =============================================
   CATEGORIES BAR
   ============================================= */
.categories-bar {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
}
.categories-scroll {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 0;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .2s, background .2s;
  border: 1px solid transparent;
}
.cat-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.cat-tab:hover {
  color: var(--gold-light);
  background: var(--bg-mid);
}
.cat-tab.is-active {
  color: var(--gold-glow);
  background: linear-gradient(135deg, rgba(201,146,42,.15) 0%, rgba(201,146,42,.05) 100%);
  border-color: var(--border-hot);
}

/* =============================================
   GAMES SECTION
   ============================================= */
.games-section {
  padding: 22px 18px 10px;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0;
}
.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.section-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .2s;
}
.section-link:hover { color: var(--gold-light); }
.section-link span { font-size: 18px; line-height: 1; }

/* GAME GRID */
.games-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.game-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.game-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--border-hot);
  box-shadow: 0 8px 28px rgba(0,0,0,.6), 0 0 20px rgba(201,146,42,.2);
  z-index: 5;
}

.game-card__link { display: block; }

.game-card__image {
  position: relative;
  aspect-ratio: 6/3;
  overflow: hidden;
}
.game-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.game-card:hover .game-card__image img {
  transform: scale(1.05);
}

.game-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity .25s;
}
.game-card:hover .game-card__overlay { opacity: 1; }

.game-card__badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 2;
}
.game-card__badge--new  { background: var(--red-badge);  color: #fff; }
.game-card__badge--excl { background: var(--teal-badge); color: #fff; }

.game-card__play {
  background: linear-gradient(135deg, var(--amber) 0%, var(--gold-light) 100%);
  color: var(--bg-deep);
  border: 0;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(201,146,42,.5);
  transition: transform .2s, box-shadow .2s;
}
.game-card__play:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(201,146,42,.7);
}

.game-card__title {
  margin: 0;
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}
.game-card:hover .game-card__title { color: var(--gold-light); }

/* TOP RANKED CARDS */
.game-card--top .game-card__rank {
  position: absolute;
  bottom: 36px;
  left: 0;
  z-index: 10;
  font-family: 'Cinzel', serif;
  font-size: 42px;
  font-weight: 900;
  color: rgba(255,255,255,.12);
  line-height: 1;
  padding: 0 8px;
  pointer-events: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,.5);
}

/* =============================================
   CONTENT SECTION
   ============================================= */
.content-section {
  padding: 32px 18px 40px;
}
.content-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 1500px;
}
.content-inner h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0 0 16px;
}
.content-inner p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.content-inner h2 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin: 24px 0 10px;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 24px 18px;
  margin-top: auto;
}
.footer-payments {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.footer-payments img { opacity: .6; filter: grayscale(1); transition: opacity .2s; }
.footer-payments img:hover { opacity: 1; filter: none; }

.footer-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color .2s;
}
.footer-col a:hover { color: var(--gold-light); }

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

/* =============================================
   SIDEBAR OVERLAY (mobile)
   ============================================= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 299;
}
.sidebar-overlay.is-open { display: block; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
  .games-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 800px) {
  :root { --sidebar-w: 200px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.8);
  }

  .main-wrapper { margin-left: 0; }
  .burger { display: flex; }

  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-slide__content { padding: 0 40px; }
}

@media (max-width: 560px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-search { display: none; }
  .hero-banner { aspect-ratio: 16/7; }
  .hero-title { font-size: 22px; }
}

/* =============================================
   CONTENT SECTION
   ============================================= */
.content-section {
  padding: 32px 18px 40px;
}

.content-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto; /* центрирует весь текстовый блок */
  box-shadow: var(--shadow);
}

/* Заголовки и текст */
.content-inner h1,
.content-inner h2,
.content-inner h3,
.content-inner h4,
.content-inner h5,
.content-inner h6 {
  line-height: 1.3;
}

.content-inner h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0 0 16px;
}

.content-inner h2 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin: 28px 0 12px;
}

.content-inner h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
  margin: 22px 0 10px;
}

.content-inner p,
.content-inner li {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}

.content-inner p {
  margin: 0 0 14px;
}

.content-inner ul,
.content-inner ol {
  margin: 0 0 18px 22px;
  padding: 0;
}

.content-inner li {
  margin-bottom: 8px;
}

.content-inner strong {
  color: var(--text-main);
}

.content-inner a {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content-inner a:hover {
  color: var(--gold-glow);
}

/* Картинки в контенте */
.content-inner img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}

/* Таблицы в контенте */
.content-inner table {
  display: block;
  width: 100%;
  overflow-x: auto;      /* горизонтальный скролл если не влазит */
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 18px 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.12);
}

.content-inner thead {
  background: rgba(201,146,42,.10);
}

.content-inner th,
.content-inner td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
}

.content-inner th {
  color: var(--gold-glow);
  font-weight: 700;
}

.content-inner td {
  color: var(--text-main);
}

.content-inner tbody tr:nth-child(even) {
  background: rgba(255,255,255,.02);
}

.content-inner tbody tr:hover {
  background: rgba(201,146,42,.06);
}

/* Цитаты */
.content-inner blockquote {
  margin: 24px 0 0;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  background: rgba(201,146,42,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-main);
}

.content-inner blockquote p:last-child {
  margin-bottom: 0;
}

/* Адаптив */
@media (max-width: 800px) {
  .content-inner {
    padding: 22px 18px;
  }

  .content-inner h1 {
    font-size: 20px;
  }

  .content-inner h2 {
    font-size: 17px;
  }

  .content-inner h3 {
    font-size: 15px;
  }

  .content-inner th,
  .content-inner td {
    padding: 10px 12px;
    font-size: 13px;
  }
}