/* === CS2Farm — Тёмная тема, бордовый акцент === */

:root {
  --bg-primary: #0f1218;
  --bg-secondary: #141820;
  --bg-card: #1a1f2e;
  --bg-hover: #242b3d;
  --accent: #8b1a2b;
  --accent-hover: #a82040;
  --accent-light: rgba(139, 26, 43, 0.15);
  --text-primary: #e8eaf0;
  --text-secondary: #8b91a8;
  --text-muted: #5a6078;
  --border: #2a3147;
  --border-light: #353d55;
  --badge-bg: #1a2d1a;
  --badge-text: #7ec850;
  --danger: #e04050;
  --success: #4caf50;
}

/* === Reset & Base === */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-primary);
}

img {
  max-width: 100%;
  height: auto;
}

/* === Layout === */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  flex: 1;
  padding: 40px 0;
}

/* === Header === */

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Навигация */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav__link:hover,
.nav__link--active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Переключатель языка */
.lang-switch {
  margin-left: 12px;
}

.lang-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b91a8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.lang-select:hover,
.lang-select:focus {
  border-color: var(--accent);
}

.lang-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 6px;
}

/* Мобильное меню */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* === Секция Hero (главная) === */

.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero__title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

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

.hero__subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* === Секции === */

.section {
  margin-bottom: 48px;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section__title {
  font-size: 1.5rem;
  font-weight: 700;
}

.section__link {
  color: var(--accent-hover);
  font-size: 0.9rem;
  font-weight: 500;
}

.section__link:hover {
  color: var(--text-primary);
}

/* === Страницы списков === */

.page-header {
  margin-bottom: 32px;
}

.page-header__title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header__desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* === Сетка карточек === */

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

.cards-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

/* === Карточка реферальной ссылки === */

.ref-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.ref-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.ref-card--featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-light) 100%);
}

.ref-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ref-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-hover);
}

.ref-card__info {
  flex: 1;
}

.ref-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.ref-card__badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.ref-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex: 1;
}

.ref-card__btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 10px 24px;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.ref-card__btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* === Карточка статьи === */

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

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

.article-card__cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-hover);
}

.article-card__body {
  padding: 20px;
}

.article-card__category {
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.article-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.article-card__title a {
  color: var(--text-primary);
}

.article-card__title a:hover {
  color: var(--accent-hover);
}

.article-card__excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* === Карточка халявы === */

.freebie-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

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

.freebie-card__game {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.freebie-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.freebie-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  flex: 1;
}

.freebie-card__bonus {
  color: var(--badge-text);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.freebie-card__expires {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.freebie-card__btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 10px 24px;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.freebie-card__btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* === Детальная страница статьи === */

.article-detail {
  max-width: 800px;
  margin: 0 auto;
}

.article-detail__title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
  text-align: center;
}

.article-detail__meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.article-detail__cover {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 32px;
}

.article-detail__content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  text-align: center;
}

.article-detail__content h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
  text-align: center;
}

.article-detail__content h3 {
  font-size: 1.2rem;
  margin: 24px 0 12px;
  text-align: center;
}

.article-detail__content p {
  margin-bottom: 16px;
}

.article-detail__content ul,
.article-detail__content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  text-align: left;
  display: inline-block;
}

.article-detail__content li {
  margin-bottom: 8px;
}

.article-detail__content a {
  color: var(--accent-hover);
  text-decoration: underline;
}

.article-detail__content img {
  border-radius: 8px;
  margin: 16px 0;
}

.article-detail__content code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-detail__content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.article-detail__content pre code {
  background: none;
  padding: 0;
}

/* === Связанные ссылки === */

.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-section__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* === Пагинация === */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination__link,
.pagination__current {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.pagination__link {
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}

.pagination__link:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.pagination__current {
  color: #fff;
  background: var(--accent);
}

.pagination__dots {
  color: var(--text-muted);
  padding: 8px 4px;
}

/* === Footer === */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: auto;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer__links {
  display: flex;
  gap: 20px;
}

.footer__link {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer__link:hover {
  color: var(--text-primary);
}

/* === Пустое состояние === */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state__text {
  font-size: 1.1rem;
}

/* === SEO-текст === */

.seo-text {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.seo-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 16px;
}

/* === Калькулятор фермы === */

.calculator-section .section__title {
  margin-bottom: 24px;
}

.calc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.calc__block {
  margin-bottom: 28px;
}

.calc__label {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.calc__value {
  color: var(--accent);
  font-weight: 700;
}

/* Слайдер */
.calc__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.calc__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.2s;
}

.calc__slider::-webkit-slider-thumb:hover {
  background: var(--accent-hover);
}

.calc__slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* Пресеты */
.calc__presets {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.calc__preset {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.calc__preset:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.calc__preset--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Поле ввода */
.calc__input {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  width: 160px;
  outline: none;
  transition: border-color 0.2s;
}

.calc__input:focus {
  border-color: var(--accent);
}

/* Карточки подписки */
.calc__plans {
  display: flex;
  gap: 12px;
}

.calc__plan {
  background: var(--bg-hover);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-width: 140px;
}

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

.calc__plan--active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.calc__plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.calc__plan-price {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.calc__plan--active .calc__plan-price {
  color: var(--accent-hover);
}

/* Результаты */
.calc__results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.calc__result-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.calc__result-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.calc__result-value {
  color: var(--badge-text);
  font-size: 1.3rem;
  font-weight: 700;
}

.calc__result-value--expense {
  color: var(--text-secondary);
}

.calc__result-value--highlight {
  color: var(--accent-hover);
}

/* График */
.calc__chart-wrap {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
  height: 340px;
}

/* CTA кнопка */
.calc__cta {
  text-align: center;
}

.calc__cta-btn {
  padding: 14px 40px;
  font-size: 1.05rem;
}

/* === Адаптивность === */

@media (max-width: 768px) {
  .nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    overflow-y: auto;
    z-index: 99;
  }

  .nav--open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle--open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle--open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle--open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .lang-switch {
    margin-left: 0;
    margin-top: 12px;
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid--wide {
    grid-template-columns: 1fr;
  }

  .section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article-detail__title {
    font-size: 1.5rem;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .calc {
    padding: 20px;
  }

  .calc__results {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc__plans {
    flex-direction: column;
  }

  .calc__plan {
    min-width: auto;
  }

  .calc__presets {
    flex-wrap: wrap;
  }
}

/* === Article Layout (с sidebar) === */

.article-layout {
  max-width: 800px;
  margin: 0 auto;
}

/* Inline ref button (маленькая, в тексте) */
.inline-ref-btn {
  display: inline-block;
  background: #1a3d1a;
  color: #7ec850;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  vertical-align: baseline;
}

.inline-ref-btn:hover {
  background: #245524;
  color: #a0e878;
}

/* Hero ref button — большая pill-кнопка по центру (стиль VectorPanel) */
.hero-ref-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 36px 0;
}

.hero-ref-btn,
.hero-ref-btn:link,
.hero-ref-btn:visited {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a3d1a 0%, #245a28 50%, #1a3d1a 100%);
  color: #c8f5a8;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 20px 52px;
  border-radius: 50px;
  text-decoration: none;
  border: 1px solid rgba(126, 200, 80, 0.25);
  box-shadow:
    0 0 24px rgba(126, 200, 80, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hero-ref-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(126, 200, 80, 0.10) 0%,
    transparent 60%
  );
  pointer-events: none;
  transition: opacity 0.3s;
}

.hero-ref-btn:hover {
  background: linear-gradient(135deg, #1f4a1f 0%, #2d6e32 50%, #1f4a1f 100%);
  color: #e0ffcc;
  border-color: rgba(126, 200, 80, 0.45);
  box-shadow:
    0 0 36px rgba(126, 200, 80, 0.22),
    0 6px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.hero-ref-btn:active {
  transform: translateY(0);
}

.hero-ref-btn__arrow {
  font-size: 1.4rem;
  transition: transform 0.2s;
}

.hero-ref-btn:hover .hero-ref-btn__arrow {
  transform: translateX(4px);
}

/* Article CTA блок */
.article-cta {
  margin-top: 40px;
  padding: 28px;
  background: linear-gradient(135deg, var(--bg-card), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  text-align: center;
}

.article-cta__title {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.article-cta__text {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.article-cta__btn {
  font-size: 1rem;
  padding: 12px 32px;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 24px;
}

.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.sidebar-block__title {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.sidebar-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.sidebar-card:hover {
  border-color: var(--accent);
}

.sidebar-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-card__info {
  flex: 1;
  min-width: 0;
}

.sidebar-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-card__btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-card__btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Калькулятор внутри статьи */
.article-detail__content .calculator-section {
  margin: 32px 0;
}

/* Related section */
.related-section {
  margin-top: 48px;
}

.related-section__title {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .article-layout {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0 24px;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .ref-card {
    padding: 16px;
  }
}
