/* ==========================================================================
   СОВРЕМЕННЫЙ ТЁМНЫЙ РЕЖИМ — единый стиль всех сайтов golld
   Подключается последним в <head> главной страницы каждого сайта.
   Переопределяет тему сайта поверх локального CSS.
   ========================================================================== */

/* ---------- Токены ---------- */
:root {
  --m-accent: #7aa2ff;
  --m-accent-2: #a78bfa;
  --m-accent-strong: #4f6ef7;
  --m-bg: #0b0f17;
  --m-surface: #11161f;
  --m-card: rgba(255, 255, 255, .045);
  --m-card-hover: rgba(255, 255, 255, .08);
  --m-border: rgba(255, 255, 255, .09);
  --m-border-strong: rgba(255, 255, 255, .18);
  --m-text: #e6e8ee;
  --m-muted: #98a1b3;
  --m-radius: 14px;
  --m-font: "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- База ---------- */
html {
  background: var(--m-bg) !important;
  color-scheme: dark;
}

body {
  font-family: var(--m-font) !important;
  font-style: normal !important;
  color: var(--m-text) !important;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(79, 110, 247, .16), transparent 60%),
    radial-gradient(ellipse 80% 60% at 90% 110%, rgba(167, 139, 250, .12), transparent 60%),
    var(--m-bg) !important;
  background-attachment: fixed !important;
  background-color: var(--m-bg) !important;
  text-rendering: optimizeLegibility;
}

body::selection,
::-moz-selection {
  background: #3b5bd6 !important;
  color: #ffffff !important;
}

* {
  scrollbar-color: #2c3648 transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--m-bg); }
::-webkit-scrollbar-thumb { background: #2c3648; border-radius: 999px; border: 2px solid var(--m-bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4a63; }

/* ---------- Текст ---------- */
p, li, dd, blockquote, figcaption, .lead, .subtitle, .tagline,
.section-desc, .section-subtitle, .hero-sub, .hero-desc, .card-desc,
.recipe-desc, .item-desc, .category-desc, .story-body, .comment-text,
.testimonial-text, .card-body {
  color: var(--m-text) !important;
}

p, li, dd { line-height: 1.65; }

strong, b { color: #ffffff; font-weight: 700; }

small, .muted, .meta,
.card-meta, .recipe-meta, .stat-label,
.footer, footer, .muted-text, .note {
  color: var(--m-muted) !important;
}

/* ---------- Заголовки ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--m-font) !important;
  font-style: normal !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
  color: #f2f4f8 !important;
  text-shadow: none !important;
  letter-spacing: .2px;
}

body h1 {
  background: linear-gradient(120deg, #ffffff 10%, #b9cbff 90%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

h2 { font-weight: 800 !important; }
h3 { font-weight: 700 !important; }

/* ---------- Ссылки ---------- */
a {
  color: var(--m-accent) !important;
  text-decoration: none !important;
  transition: color .2s ease, filter .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

a:hover {
  color: #aec2ff !important;
  filter: drop-shadow(0 0 8px rgba(122, 162, 255, .45));
}

/* ---------- Верхние панели ---------- */
header,
.site-header,
.site-head,
.navbar,
.main-nav,
.nav-menu,
.navbar-nav,
.header,
.page-head,
.nav {
  background: rgba(17, 22, 31, .82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--m-border) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 30px rgba(0, 0, 0, .35) !important;
}

header a,
.navbar a,
.main-nav a,
.nav-menu a,
.nav-links a,
.nav-link,
.header a,
.menu-back {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--m-accent) !important;
}

@media (hover: hover) {
  header a:hover,
  .navbar a:hover,
  .main-nav a:hover,
  .nav-menu a:hover,
  .nav-links a:hover,
  .nav-link:hover,
  .header a:hover,
  .menu-back:hover {
    color: #ffffff !important;
    filter: none !important;
  }
}

/* ---------- Hero ---------- */
.hero,
.page-hero,
.hero-content,
.hero-inner,
.banner {
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, rgba(79, 110, 247, .16), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01)) !important;
  border: 1px solid var(--m-border) !important;
  border-radius: var(--m-radius) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4) !important;
}

.hero h1,
.page-hero h1,
.banner h1 {
  background: linear-gradient(120deg, #ffffff 10%, #b9cbff 90%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* ---------- Карточки и блоки ---------- */
.card, .cards, .card-item, .home-card, .recipe-card, .category-card, .tip-card,
.info-card, .diff-card, .grade-card, .lesson-card, .feature-card,
.testimonial-card, .movie-card, .level-card, .emergency-card, .consequence-card,
.stat-box, .support-card, .sber-card, .donate-card, .chat-card, .info-block,
.panel, .quiz-container, .problem-box, .solution-box, .example-box, .rule-card,
.sign-card, .znk-card, .fact-box, .quote-box, .product-card, .entry-card,
.step-content, .interface-item, .support-box, .card-block, .topic-card,
.card-wrap, .menu-card, .category-card, .support, .detail, .cat-banner {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)) !important;
  border: 1px solid var(--m-border) !important;
  border-radius: var(--m-radius) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--m-text);
}

@media (hover: hover) {
  .card:hover, .home-card:hover, .recipe-card:hover, .category-card:hover,
  .tip-card:hover, .info-card:hover, .diff-card:hover, .grade-card:hover,
  .lesson-card:hover, .feature-card:hover, .testimonial-card:hover,
  .movie-card:hover, .level-card:hover, .chat-card:hover, .info-block:hover,
  .panel:hover, .card:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)) !important;
    border-color: var(--m-border-strong) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5), 0 0 24px rgba(122, 162, 255, .12) !important;
    transform: translateY(-2px);
  }
}

/* Сетки карточек — ровные ячейки */
.cards-grid, .card-grid, .home-grid, .recipe-grid, .recipes-grid, .category-grid,
.grades-grid, .levels-grid, .level-cards, .featured-grid, .features-grid,
.testimonials-grid, .products-grid, .lesson-grid, .lessons-grid, .vocab-grid,
.difficulty-section, .tips-grid, .info-grid, .mini-grid {
  gap: 18px !important;
}

/* ---------- Карточные акценты, не трогаем бейджи ---------- */

/* ---------- Чипы / фильтры ---------- */
.chip, .chip-btn, .filter-chip, .filter-btn, .cat-btn, .theme-lang-btn,
.tag, .lesson-tag, .hero-tag, .category-count, .badge, .time-badge,
.hero-badge, .stats-strip, .age18-badge, .visitor-badge {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid var(--m-border-strong) !important;
  color: var(--m-text) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.chip.active, .chip-btn.active, .filter-btn.active,
.chip:hover, .chip-btn:hover, .filter-chip:hover, .filter-btn:hover, .cat-btn:hover {
  background: linear-gradient(135deg, var(--m-accent-strong), var(--m-accent-2)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(79, 110, 247, .4) !important;
}

.pagebtn, .pagination span, .pagination .pagebtn {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid var(--m-border-strong) !important;
  color: var(--m-text) !important;
  border-radius: 50% !important;
}

.pagebtn.active, .pagination .pagebtn.active {
  background: linear-gradient(135deg, var(--m-accent-strong), var(--m-accent-2)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(79, 110, 247, .4) !important;
}

/* ---------- Кнопки ---------- */
button, input[type="button"], input[type="submit"], input[type="reset"] {
  font-family: var(--m-font) !important;
  background: rgba(255, 255, 255, .07) !important;
  border: 1px solid var(--m-border-strong) !important;
  color: var(--m-text) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.btn, .btn-primary, .cta, .cta-button, .hero-btn, .agegate-btn,
.nav-cta, .btn-secondary, .all-lessons-btn, .all-read-btn, .random-btn,
.go, .primary {
  background: linear-gradient(135deg, var(--m-accent-strong), var(--m-accent-2)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(79, 110, 247, .35) !important;
  font-weight: 700 !important;
}

@media (hover: hover) {
  button:hover, input[type="button"]:hover, input[type="submit"]:hover,
  .btn:hover, .btn-primary:hover, .cta:hover, .cta-button:hover, .hero-btn:hover {
    background: linear-gradient(135deg, #5f7ef0, #8f7ffa) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(79, 110, 247, .55) !important;
  }
}

/* ---------- Поля ввода ---------- */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], textarea, select, .search-input {
  font-family: var(--m-font) !important;
  background: rgba(5, 8, 14, .75) !important;
  border: 1px solid var(--m-border) !important;
  color: var(--m-text) !important;
  border-radius: 10px !important;
}

input:focus, textarea:focus, select:focus, .search-input:focus {
  border-color: var(--m-accent) !important;
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .22) !important;
  outline: none !important;
}

input::placeholder, textarea::placeholder { color: var(--m-muted) !important; }

/* ---------- Таблицы ---------- */
table {
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid var(--m-border) !important;
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  background: rgba(255, 255, 255, .02) !important;
  border-color: var(--m-border) !important;
  color: var(--m-text);
}

th { color: #ffffff !important; }

/* ---------- Прочее ---------- */
hr {
  border: none !important;
  border-top: 1px solid var(--m-border) !important;
  box-shadow: none !important;
}

footer, .footer, .site-footer, .footer-content, .credits {
  background: rgba(13, 17, 24, .7) !important;
  border-top: 1px solid var(--m-border) !important;
  color: var(--m-muted) !important;
}

img {
  filter: none !important;
  border-radius: 10px;
}

.avatar, .logo, .logo-ico, .logo-icon, #demonicToggle { border-radius: 12px !important; }

/* Навигация по шагам */
.steps, .step-content { position: relative; }

.orbit-line, .radar, .spark, .graffiti { display: none !important; }

/* ---------- Светлые декоративные слои → тёмный фон ---------- */
.heaven-bg {
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(79, 110, 247, .18), transparent 60%),
    radial-gradient(ellipse 80% 60% at 90% 110%, rgba(167, 139, 250, .12), transparent 60%),
    var(--m-bg) !important;
  background-size: 100% 100% !important;
  animation: none !important;
  z-index: -3 !important;
}

.rays, .cloud-field, .glow-haze { display: none !important; }