:root {  
  --primary-color: #ff4d4d;  
  --primary-light: #ff7777;  
  --primary-dark: #e60000;  
  --accent-color: #2e6bff;  
  --accent-light: #80a4ff;  
  --bg-color: #1a1a1aa9;  
  --card-bg: #20232ace;  
  --text-color: #f0f0f0;  
  --text-secondary: #b8b8b8;  
  --border-light: rgba(255, 255, 255, 0.1);  
  --shadow-color: rgba(0, 0, 0, 0.1);
}  

body {  
  margin: 0;  
  padding: 0;  
  /* отступ под шапку даёт layout (main { margin-top: 80px }) — не дублировать */
  background-color: var(--bg-color);
  color: var(--text-color);  
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;  
  line-height: 1.7;  
  font-weight: 400;
}  

/* === КНОПКА ВЫЗОВА НАВИГАЦИИ === */
.nav-toggle-btn {
    position: fixed;
    top: 110px;
    right: 30px;
    z-index: 1000;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    color: white;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-toggle-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-toggle-btn:active {
    transform: translateY(0);
}

/* Простая иконка гамбургера */
.nav-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-toggle-icon span {
    width: 16px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.2s ease;
}

.nav-toggle-text {
    font-size: 0.9rem;
    white-space: nowrap;
}

/* === МОДАЛЬНОЕ ОКНО НАВИГАЦИИ === */
.nav-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.nav-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(94vw, 680px);
    max-width: 680px;
    max-height: 85vh;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-modal-overlay.active .nav-modal {
    transform: translate(-50%, -50%) scale(1);
}

/* === КНОПКА ЗАКРЫТИЯ === */
.nav-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-close-btn span {
    position: absolute;
    width: 12px;
    height: 1px;
    background: var(--text-color);
    border-radius: 1px;
}

.nav-close-btn span:first-child {
    transform: rotate(45deg);
}

.nav-close-btn span:last-child {
    transform: rotate(-45deg);
}

/* === НАВИГАЦИЯ В МОДАЛЬНОМ ОКНЕ === */
.rules-navigation {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

/* Заголовок навигации */
.rules-navigation h3 {
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    margin: 0;
    padding: 20px;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Список навигации */
.rules-navigation ul {
    list-style: none;
    padding: 16px;
    margin: 0;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* Кастомный скроллбар */
.rules-navigation ul::-webkit-scrollbar {
    width: 4px;
}

.rules-navigation ul::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.rules-navigation ul::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.rules-navigation ul::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.rules-navigation ul li {
    margin-bottom: 6px;
}

.rules-navigation ul li a {
    display: block;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.45;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border-left: 3px solid transparent;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.rules-navigation ul li a:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

.rules-navigation ul li a.active {
    color: var(--primary-color);
    font-weight: 500;
    background: rgba(255, 77, 77, 0.1);
    border-left-color: var(--primary-color);
}

/* === СТРУКТУРА СТРАНИЦЫ === */  
.rules-page {  
    max-width: 1800px; /* Увеличил с 1400px до 1800px */
    margin: 20px auto;  
    padding: 0 40px; /* Увеличил боковые отступы */
    animation: fadeIn 0.4s ease-out;
}  

@keyframes fadeIn {  
  from {  
    opacity: 0;  
    transform: translateY(20px);  
  }  
  to {  
    opacity: 1;  
    transform: translateY(0);  
  }  
}  

/* === ОСНОВНОЙ КОНТЕЙНЕР === */  
.rules-container {  
  width: 100%;
  margin: 0;
  padding: 60px; /* Увеличил внутренние отступы с 50px до 60px */
  background-color: var(--card-bg);  
  border-radius: 8px;  
  box-shadow: 0 2px 8px var(--shadow-color);  
  border-top: 3px solid var(--primary-color);
  backdrop-filter: blur(7px);
}  

/* === ЗАГОЛОВКИ === */  
.rules-container h1 {  
  color: var(--text-color);  
  font-size: 2.6rem; /* Увеличил с 2.4rem */
  text-align: center;  
  margin-bottom: 3rem; /* Увеличил отступ */
  font-weight: 600;  
  position: relative;
}  

.rules-container h1::after {  
  content: '';  
  position: absolute;  
  bottom: -8px;  
  left: 50%;  
  transform: translateX(-50%);  
  width: 80px; /* Увеличил длину подчеркивания */
  height: 2px;  
  background: var(--primary-color);  
  border-radius: 1px;
}

.rules-container h2 {  
  color: var(--primary-color);  
  font-size: 1.9rem; /* Увеличил с 1.7rem */
  margin-top: 3rem; /* Увеличил отступ сверху */
  margin-bottom: 1.5rem; /* Увеличил отступ снизу */
  font-weight: 500;  
  position: relative;  
  padding-left: 20px; /* Увеличил отступ слева */
}  

.rules-container h2::before {  
  content: '';  
  position: absolute;  
  left: 0;  
  top: 0;  
  bottom: 0;
  width: 5px; /* Увеличил толщину линии */
  background: var(--primary-color);
  border-radius: 2px;
}

.rules-container h3 {  
  color: var(--primary-light);  
  font-size: 1.5rem; /* Увеличил с 1.4rem */
  margin-top: 2rem; /* Увеличил отступ сверху */
  margin-bottom: 1.3rem; /* Увеличил отступ снизу */
  font-weight: 500;
}  

/* === СЕКЦИИ ПРАВИЛ === */  
.rule-section {  
  background-color: rgba(255, 255, 255, 0.02);  
  padding: 35px; /* Увеличил с 30px до 35px */
  border-radius: 8px; /* Увеличил радиус */
  margin-bottom: 35px; /* Увеличил отступ между секциями */
  border-left: 4px solid var(--primary-color); /* Увеличил толщину */
  transition: all 0.2s ease;
}  

.rule-section:hover {  
  background-color: rgba(255, 255, 255, 0.03);
  transform: translateX(4px); /* Увеличил смещение */
}  

/* === СПИСКИ === */  
.rules-container ul,  
.rules-container ol {  
  padding-left: 0;  
  margin: 25px 0; /* Увеличил отступы */
}  

.rules-container ul {  
  list-style: none;  
}  

.rules-container ol {  
  counter-reset: rules-counter;  
  list-style: none;  
}  

.rules-container ol li {  
  counter-increment: rules-counter;  
  position: relative;  
  margin-bottom: 18px; /* Увеличил отступ */
  padding: 24px 24px 24px 55px; /* Увеличил отступы */
  background-color: rgba(0, 0, 0, 0.2);  
  border-radius: 8px; /* Увеличил радиус */
  transition: all 0.2s ease;  
  border-left: 3px solid transparent;
  font-size: 1.05rem; /* Увеличил размер шрифта */
}  

.rules-container ol li::before {  
  content: counter(rules-counter);  
  position: absolute;  
  left: -16px;  
  top: 24px;
  background: var(--primary-color);  
  color: white;  
  width: 32px; /* Увеличил размер */
  height: 32px;  
  border-radius: 50%;  
  display: flex;  
  align-items: center;  
  justify-content: center;  
  font-size: 1rem; /* Увеличил шрифт */
  font-weight: 500;
  border: 3px solid var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}  

.rules-container ol li:hover {  
  background-color: rgba(0, 0, 0, 0.3);  
  border-left-color: var(--primary-color);
}  

.rules-container ul li {  
  position: relative;  
  margin-bottom: 18px; /* Увеличил отступ */
  padding: 24px 24px 24px 45px; /* Увеличил отступы */
  background-color: rgba(0, 0, 0, 0.2);  
  border-radius: 8px; /* Увеличил радиус */
  transition: all 0.2s ease;  
  border-left: 3px solid transparent;
  font-size: 1.05rem; /* Увеличил размер шрифта */
}  

.rules-container ul li::before {  
  content: '';  
  position: absolute;  
  left: 18px; /* Увеличил отступ */
  top: 50%;  
  transform: translateY(-50%);  
  width: 6px; /* Увеличил размер точки */
  height: 6px;  
  background-color: var(--primary-color);  
  border-radius: 50%;
}  

.rules-container ul li:hover {  
  background-color: rgba(0, 0, 0, 0.3);  
  border-left-color: var(--primary-color);
}  

/* === ПАРАГРАФЫ === */
.rules-container p {
  margin-bottom: 1.4rem; /* Увеличил отступ */
  line-height: 1.75; /* Увеличил межстрочный интервал */
  color: var(--text-color);
  font-size: 1.05rem; /* Увеличил размер шрифта */
}

/* === ССЫЛКИ === */  
.rules-container a {  
  color: var(--accent-light);  
  text-decoration: none;  
  transition: color 0.2s ease;
  border-bottom: 1px solid transparent;
}  

.rules-container a:hover {  
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* === АДАПТИВНОСТЬ === */  
@media (max-width: 1920px) {
  .rules-page {
    max-width: 1600px;
    padding: 0 35px;
  }
}

@media (max-width: 1600px) {
  .rules-page {
    max-width: 1400px;
    padding: 0 30px;
  }
  
  .rules-container {
    padding: 55px;
  }
}

@media (max-width: 1400px) {
  .rules-page {
    max-width: 1200px;
    padding: 0 25px;
  }
  
  .rules-container {
    padding: 50px;
  }
  
  .rules-container h1 {
    font-size: 2.4rem;
  }
  
  .rules-container h2 {
    font-size: 1.7rem;
  }
  
  .rules-container h3 {
    font-size: 1.4rem;
  }
}

@media (max-width: 1200px) {
  .rules-page {
    max-width: 95%;
    padding: 0 20px;
  }
  
  .rules-container {
    padding: 40px 35px;
  }
}

@media (max-width: 768px) {  
  .rules-page {  
    margin: 16px auto;  
    padding: 0 16px;
  }  
  
  .nav-toggle-btn {
    top: 80px;
    right: 16px;
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .nav-modal {
    width: 95%;
    max-height: 80vh;
  }
  
  .rules-container {  
    padding: 24px 20px;
  } 
  
  .rules-container h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
  
  .rules-container h1::after {
    width: 60px;
  }
  
  .rules-container h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 12px;
  }
  
  .rules-container h2::before {
    width: 3px;
  }
  
  .rules-container h3 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
  }
  
  .rule-section {
    padding: 20px 16px;
    margin-bottom: 20px;
  }
  
  .rules-container ol li {
    margin-bottom: 10px;
    padding: 12px 12px 12px 36px;
    font-size: 0.95rem;
  }
  
  .rules-container ol li::before {
    left: -10px;
    top: 12px;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }
  
  .rules-container ul li {
    margin-bottom: 10px;
    padding: 12px 12px 12px 28px;
    font-size: 0.95rem;
  }
  
  .rules-container ul li::before {
    left: 10px;
    width: 4px;
    height: 4px;
  }
  
  .rules-container p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.7;
  }
}  

@media (max-width: 480px) {  
  .nav-toggle-text {
    display: none;
  }
  
  .nav-toggle-btn {
    top: 80px;
    padding: 10px;
    border-radius: 50%;
    right: 12px;
  }
  
  .rules-page {
    padding: 0 8px;
  }
  
  .rules-container {  
    padding: 20px 16px;
  }  
  
  .rules-container h1 {  
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
  }  
  
  .rules-container h2 {  
    font-size: 1.3rem;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
  }  
  
  .rules-container h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.6rem;
  }
  
  .rule-section {
    padding: 16px 12px;
    margin-bottom: 16px;
  }

  .rules-container ol li {
    margin-bottom: 8px;
    padding: 10px 10px 10px 32px;
    font-size: 0.9rem;
  }
  
  .rules-container ol li::before {
    left: -8px;
    top: 10px;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
  }
  
  .rules-container ul li {
    margin-bottom: 8px;
    padding: 10px 10px 10px 24px;
    font-size: 0.9rem;
  }
  
  .rules-container ul li::before {
    left: 8px;
  }
  
  .rules-container p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
  }
}

@media (max-width: 360px) {
  .rules-container {
    padding: 16px 12px;
  }
  
  .rules-container h1 {
    font-size: 1.4rem;
  }
  
  .rules-container ol li,
  .rules-container ul li {
    font-size: 0.85rem;
    padding: 8px 8px 8px 28px;
  }
  
  .rules-container ol li::before {
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
    left: -6px;
    top: 8px;
  }
  
  .rules-container ul li::before {
    left: 6px;
  }
}

/* Touch-устройства */
@media (hover: none) and (pointer: coarse) {
  .nav-toggle-btn {
    min-height: 44px;
  }
  
  .nav-close-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Отключаем hover-трансформации; карточки сохраняют фон */
  .rule-section:hover {
    transform: none;
  }

  .rules-container ol li:hover,
  .rules-container ul li:hover {
    transform: none;
  }
}

/* Специальные стили для лучшей читаемости */
@media (prefers-reduced-motion: reduce) {
  .rules-page,
  .nav-modal,
  .nav-toggle-btn,
  .rule-section,
  .rules-container ol li,
  .rules-container ul li {
    animation: none;
    transition: none;
  }
  
  .rule-section:hover,
  .rules-container ol li:hover,
  .rules-container ul li:hover {
    transform: none;
  }

  .rule-section:hover {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.05) inset,
      0 10px 32px rgba(0, 0, 0, 0.38);
  }
}

/* =====================================================
   STYLE OVERRIDE — align rules with site palette
   accent: #dc3545 | bg: rgba(10,12,18,...)
   ===================================================== */
@font-face {
  font-family: 'Future Z';
  src: url('/Fonts/Future Z.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary-color: #dc3545;
  --primary-light: #f87171;
  --primary-dark: #b91c2c;
  --bg-color: rgba(10, 12, 18, 0.95);
  --card-bg: rgba(12, 14, 20, 0.94);
  --text-color: #e8e8e8;
  --text-secondary: #9ca3af;
  --border-light: rgba(255, 255, 255, 0.07);
  --shadow-color: rgba(0, 0, 0, 0.4);
}

.rules-container {
  background: rgba(12, 14, 20, 0.92);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 3px solid var(--primary-color);
  backdrop-filter: none;
}

.nav-modal {
  width: min(94vw, 680px);
  max-width: 680px;
  background: rgba(12, 14, 20, 0.97);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Карточки разделов правил — «документ в папке» */
.rule-section {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: none;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.045) 0%, transparent 48%),
    linear-gradient(180deg, rgba(8, 10, 16, 0.92) 0%, rgba(6, 8, 12, 0.88) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 10px 32px rgba(0, 0, 0, 0.38);
  scroll-margin-top: 100px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.rule-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    rgba(248, 113, 113, 0.95) 0%,
    var(--primary-color) 38%,
    var(--primary-dark) 100%
  );
  border-radius: 12px 0 0 12px;
  pointer-events: none;
}

.rule-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(220, 53, 69, 0.55) 0%,
    rgba(220, 53, 69, 0.12) 35%,
    transparent 70%
  );
  pointer-events: none;
}

.rule-section:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 16px 44px rgba(0, 0, 0, 0.48);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-toggle-btn {
  background: var(--primary-color);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(220, 53, 69, 0.3);
}

.nav-toggle-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(220, 53, 69, 0.4);
}

.rules-navigation ul li a.active {
  background: rgba(220, 53, 69, 0.1);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

.rules-navigation h3 {
  padding-left: 22px;
  padding-right: 22px;
}

/* Читаемость основного текста */
.rules-page .rules-container {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.rules-container p {
  line-height: 1.78;
}

.rules-container ol li,
.rules-container ul li {
  line-height: 1.72;
}

/* Навигация: фильтр разделов */
.rules-nav-search-wrap {
  display: block;
  position: relative;
  padding: 0 18px 14px;
}

.rules-nav-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px 11px 38px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
}

.rules-nav-search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-secondary);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.7;
}

.rules-nav-search-icon::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 5px;
  height: 2px;
  background: var(--text-secondary);
  transform: rotate(45deg);
  border-radius: 1px;
}

.rules-navigation ul.rules-nav-list {
  max-height: calc(85vh - 148px);
  padding: 18px 18px 20px;
}

/* Прогресс чтения */
.rules-read-progress {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.rules-read-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-color), #f87171);
  box-shadow: 0 0 12px rgba(220, 53, 69, 0.45);
  transition: width 0.12s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .rules-read-progress-bar {
    transition: none;
  }
}

/* Шапка документа */
.rules-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 2rem 1.5rem 2.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(220, 53, 69, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(46, 107, 255, 0.06), transparent 50%),
    rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.rules-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.5;
}

.rules-hero .page-title {
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.rules-doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.rules-doc-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
}

.rules-doc-version {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-light);
  letter-spacing: 0.04em;
}

.rules-doc-lead {
  max-width: 52rem;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* Логотипное «RED» в лиде */
.rules-brand-mark {
  font-family: 'Future Z', sans-serif;
  font-size: 1.25em;
  display: inline-block;
  vertical-align: -0.04em;
  line-height: 1;
  color: var(--primary-color);
  font-weight: normal;
  letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(220, 53, 69, 0.35);
}

.rules-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.rules-search-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.rules-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px 12px 44px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rules-search-input:focus {
  outline: none;
  border-color: rgba(220, 53, 69, 0.45);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.rules-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-secondary);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.75;
}

.rules-search-icon::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 6px;
  height: 2px;
  background: var(--text-secondary);
  transform: rotate(45deg);
  border-radius: 1px;
}

.rules-continue-btn {
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid rgba(220, 53, 69, 0.4);
  background: rgba(220, 53, 69, 0.12);
  color: var(--primary-light);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.rules-continue-btn:hover {
  background: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.55);
}

.rules-search-empty {
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 0.92rem;
  color: var(--primary-light);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Секции: якорь, заголовок, TL;DR, копирование */
.rule-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.rule-section-head h2,
.rule-section-head h3 {
  flex: 1;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 20px;
}

.rule-section-head h3 {
  color: var(--primary-color);
  font-size: 1.9rem;
  font-weight: 500;
}

.rule-copy-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.rule-copy-link:hover {
  color: var(--primary-light);
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.35);
}

.rule-section-head + .rule-tldr {
  margin-top: 1rem;
}

.rule-section-head + p:not(.rule-tldr) {
  margin-top: 1rem;
}

/* Пункты списков внутри карточки раздела */
.rules-container .rule-section > ol > li,
.rules-container .rule-section ol > li {
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.38) 0%,
    rgba(255, 255, 255, 0.025) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid rgba(220, 53, 69, 0.28);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.rules-container .rule-section > ol > li:hover,
.rules-container .rule-section ol > li:hover {
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.48) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  border-left-color: var(--primary-color);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.rules-container .rule-section ol > li::before {
  background: linear-gradient(155deg, #f87171 0%, var(--primary-color) 45%, var(--primary-dark) 100%);
  border: 2px solid rgba(10, 12, 18, 0.95);
  box-shadow:
    0 2px 10px rgba(220, 53, 69, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.rules-container .rule-section ul > li,
.rules-container .rule-section ul li {
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(46, 107, 255, 0.04) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid rgba(46, 107, 255, 0.28);
}

.rules-container .rule-section ul li:hover {
  border-left-color: rgba(96, 165, 250, 0.75);
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.36) 0%,
    rgba(46, 107, 255, 0.08) 100%
  );
}

.rules-container .rule-section ul li::before {
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.rule-tldr {
  margin: 0 0 1.25rem 0;
  padding: 14px 16px 14px 18px;
  border-radius: 10px;
  border-left: 3px solid rgba(46, 107, 255, 0.55);
  background: linear-gradient(90deg, rgba(46, 107, 255, 0.08), rgba(0, 0, 0, 0.15));
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--text-color);
}

.rule-tldr-label {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(46, 107, 255, 0.2);
  vertical-align: middle;
}

.rules-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 3000;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #fff;
  background: rgba(12, 14, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.rules-toast.rules-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .rules-toast {
    transition: none;
  }
}

.rule-tldr + h3 {
  margin-top: 1.1rem;
}

@media (max-width: 768px) {
  .nav-modal {
    width: 95%;
    max-width: none;
    max-height: 80vh;
  }

  .rules-hero {
    padding: 1.5rem 1rem 1.75rem;
    margin-bottom: 1.5rem;
  }

  .rules-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .rules-search-wrap {
    max-width: none;
  }

  .rule-section-head {
    flex-wrap: wrap;
  }

  .rule-copy-link {
    width: 36px;
    height: 36px;
  }

  .rule-section-head h3 {
    font-size: 1.35rem;
  }
}
