:root {
  --bg: #0f1419;
  --card: #1a222c;
  --text: #e8eef5;
  --muted: #9aa7b5;
  --accent: #e11d48;
  --accent2: #f59e0b;
  --link: #38bdf8;
  --header-bg: #0b0f14;
  --border: #243041;
}

* { box-sizing: border-box; }
html {
  /* Меньше «прыжка» контента при появлении вертикального скролла (DevTools / смена ширины) */
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Эмулятор ширины иногда оставляет горизонтальный scrollLeft — без перезагрузки блок «уезжает» */
  overflow-x: hidden;
}
a { color: var(--link); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
/* Логотип: ограничиваем «коробку», сохраняем пропорции. Горизонтальный вордмарк при max-height
   даёт большую ширину; узкий вертикальный PNG останется узким — см. подсказку в Studio (широкий 3:1…5:1). */
.logo img {
  display: block;
  width: auto;
  height: auto;
  max-height: 52px;
  max-width: min(300px, 52vw);
  object-fit: contain;
  object-position: left center;
}
/* Крупнее логотип только вместе с «десктопной» шапкой (см. min-width ниже по файлу). */
@media (min-width: 1024px) {
  .logo img {
    max-height: 56px;
    max-width: min(340px, 36vw);
  }
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.nav a { text-decoration: none; font-weight: 600; color: var(--text); }
.nav a:hover { text-decoration: underline; color: var(--link); }
/* Текущий раздел (генератор ставит aria-current на пункт главного меню) */
.nav a.nav__link--current,
.nav a[aria-current="page"] {
  color: var(--link);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, var(--link) 70%, var(--border));
  padding-bottom: 0.15em;
}
.nav a.nav__link--current:hover,
.nav a[aria-current="page"]:hover {
  color: color-mix(in srgb, var(--link) 88%, var(--text));
  border-bottom-color: var(--link);
}
.header-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 0.5rem;
}
.lang-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.lang-switcher:empty { display: none; }
.footer-lang {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.footer-lang:has(.lang-switcher:empty) {
  display: none;
  margin-bottom: 0;
}
.lang-switcher--footer .lang-switcher__pill {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
  min-width: 1.85rem;
}
.lang-switcher__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
}
a.lang-switcher__pill:hover {
  border-color: var(--link);
  color: var(--link);
}
.lang-switcher__pill--current {
  border-color: color-mix(in srgb, var(--link) 55%, var(--border));
  color: var(--link);
  cursor: default;
}
.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border-color: #334155; color: var(--text); }
.btn-accent { background: var(--accent2); color: #111; }
/* Компактные CTA в мобильной шапке */
.btn-header-sm {
  padding: 0.42rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-header-sm.btn-primary {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}
.main { max-width: 1160px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* Видимые хлебные крошки (не главная) */
.breadcrumbs {
  margin: 0 0 1rem;
  padding: 0;
}
.breadcrumbs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.breadcrumbs__item:not(:last-child)::after {
  content: "/";
  color: var(--border);
  font-weight: 400;
  margin-left: 0.5rem;
  pointer-events: none;
}
.breadcrumbs__link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.breadcrumbs__link:hover {
  color: var(--text);
}
.breadcrumbs__item--current {
  color: var(--text);
  font-weight: 500;
  max-width: 100%;
}
.hero { margin-bottom: 2rem; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.2; margin: 0.5rem 0 1rem; }
.hero--simple { margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.hero--simple__h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.25; margin: 0; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; margin: 0; }

/* Визуальный hero (баннер + CTA) */
.hero-visual {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: clamp(320px, 40vw, 400px);
  margin-bottom: 2rem;
  background: var(--card) center/cover no-repeat;
  background-image: var(--hero-img);
  border: 1px solid var(--border);
}
.hero-visual--gradient {
  background-image: linear-gradient(135deg, var(--header-bg) 0%, var(--card) 45%, color-mix(in srgb, var(--accent) 35%, var(--card)) 100%);
}
.hero-visual__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
  pointer-events: none;
}
.hero-visual__inner {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  max-width: min(100%, 420px);
}
.hero-visual__promo {
  font-size: clamp(1.15rem, 2.8vw, 1.65rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0.5rem 0 0.35rem;
  color: var(--text);
}
.hero-visual__fineprint {
  margin: 0 0 1rem;
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--muted) 55%, var(--text) 45%);
  max-width: min(100%, 40rem);
}
.hero-visual__cta { display: inline-block; margin-top: 0.15rem; }

/* Parallax hero (4 слоя, скролл + мышь; JS: assets/hero-parallax.js) */
.hero-visual--parallax {
  background-image: none;
  background-color: var(--bg);
  min-height: clamp(340px, 46vw, 480px);
}
/* Растягиваем блок на ширину вьюпорта: hero лежит внутри .main (max-width ~1160px).
   Только .hero-visual--parallax — обычный баннер / колесо без этого класса не трогаем. */
.main > .hero-visual--parallax {
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}
/* На главной крошек нет — первый ребёнок main это параллакс; убираем верхний padding main,
   иначе между шапкой и баннером остаётся «полоска» (фон body / рамка). */
.main:has(> .hero-visual--parallax:first-child) {
  padding-top: 0;
}
.hero-visual--parallax .hero-parallax__layers {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  z-index: 0;
}
.hero-visual--parallax .hero-parallax__layer {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  will-change: transform;
}
.hero-visual--parallax .hero-parallax__layer--bg { z-index: 0; }
.hero-visual--parallax .hero-parallax__layer--far { z-index: 1; }
.hero-visual--parallax .hero-parallax__layer--near { z-index: 2; }
.hero-visual--parallax .hero-parallax__layer--mug {
  z-index: 3;
  object-fit: contain;
  object-position: center bottom;
}
.hero-visual--parallax .hero-visual__scrim {
  z-index: 4;
}
.hero-visual--parallax .hero-visual__inner {
  position: relative;
  z-index: 5;
}

/* Decorative wheel animation (lightweight CSS) */
.hero-visual__wheel-wrap {
  position: absolute;
  right: clamp(0.5rem, 3vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(170px, 32vw, 380px);
  aspect-ratio: 1 / 1;
  z-index: 0;
  cursor: pointer;
  display: block;
}
/* Золотой указатель (стрелочка) справа */
.hero-visual__wheel-wrap::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 28px solid #fbbf24; /* Золотой цвет */
  filter: drop-shadow(-3px 3px 5px rgba(0,0,0,0.6));
  z-index: 10;
}
.hero-visual__wheel {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
  animation: slowSpin 24s linear infinite;
  will-change: transform;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.45));
}
.hero-visual__wheel-glow {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 70%, transparent) 0%, transparent 70%);
  filter: blur(10px);
  opacity: 0.45;
  animation: softPulse 4s ease-in-out infinite;
}

@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes softPulse {
  0% { opacity: 0.24; transform: scale(0.95); }
  50% { opacity: 0.62; transform: scale(1.05); }
  100% { opacity: 0.24; transform: scale(0.95); }
}

@media (max-width: 900px) {
  .hero-visual__wheel-wrap {
    right: 15px;
    opacity: 0.86;
    width: clamp(130px, 38vw, 250px);
  }
  .hero-visual__wheel {
    animation-duration: 36s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual__wheel,
  .hero-visual__wheel-glow {
    animation: none !important;
  }
  .hero-visual--parallax .hero-parallax__layer {
    will-change: auto;
  }
}

.page-intro { margin-bottom: 1.5rem; }
.page-intro__h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 0;
}

/* Слоты */
.slots-zone { margin-bottom: 2.25rem; }
.slots-zone__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.slots-zone__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.slots-zone__nav { display: flex; gap: 0.35rem; }
.slots-nav {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.slots-nav:hover { filter: brightness(1.08); }

.slots-root--grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  min-width: 0;
}
.slots-root--carousel .slots-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.slots-root--carousel .slot-card {
  flex: 0 0 min(200px, 72vw);
  scroll-snap-align: start;
}

.slot-card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.slot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.slot-card__media {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 220 / 280;
  background: color-mix(in srgb, var(--bg) 80%, var(--border));
}
.slot-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slot-card__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.slot-card__play {
  text-align: center;
  margin-top: auto;
  font-size: 0.8rem;
  padding: 0.45rem 0.65rem;
}

@media (max-width: 1024px) {
  .slots-root--grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  /* Hero: колонка вместо наложения текста на колесо — удобный тап по CTA */
  .hero-visual {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    overflow: visible;
  }
  .hero-visual__scrim {
    border-radius: inherit;
  }
  .hero-visual__inner {
    order: 1;
    max-width: none;
    z-index: 2;
    padding: clamp(1.15rem, 4vw, 1.75rem);
    padding-bottom: 0.35rem;
  }
  .hero-visual__promo {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  }
  .hero-visual__fineprint {
    margin-bottom: 0.75rem;
  }
  .hero-visual__cta {
    display: block;
    width: 100%;
    max-width: min(20rem, 100%);
    margin-inline: auto;
    box-sizing: border-box;
    text-align: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    line-height: 1.25;
    touch-action: manipulation;
  }
  .hero-visual__wheel-wrap {
    order: 2;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    align-self: center;
    width: min(168px, 44vw);
    margin: 0.15rem auto 0.85rem;
    opacity: 1;
    flex-shrink: 0;
  }
  .hero-visual__wheel-wrap::after {
    right: -6px;
    border-top-width: 11px;
    border-bottom-width: 11px;
    border-right-width: 22px;
  }
  .slots-root--grid { grid-template-columns: repeat(2, 1fr); }
  .slots-zone__nav { width: 100%; justify-content: flex-end; }
}
.content {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  color: var(--text);
  /* Единая читаемая база: без мелкого pt из Google Docs (после сборки inline font-size снят) */
  font-family: inherit;
  font-size: 1.0625rem;
  line-height: 1.65;
}
/* Остаточные span/div из Docs — не перетирают размер и межстрочный интервал */
.content p,
.content li,
.content td,
.content th,
.content blockquote,
.content dd,
.content dt {
  font-size: inherit !important;
  line-height: inherit !important;
  font-family: inherit !important;
  letter-spacing: normal !important;
  text-align: start !important;
}
.content h1,
.content h2,
.content h3,
.content h4 {
  font-family: inherit !important;
  line-height: 1.28 !important;
  letter-spacing: normal !important;
  text-align: start !important;
  word-spacing: normal !important;
}
.content h2 {
  font-size: clamp(1.2rem, 4.2vw, 1.45rem) !important;
}
.content h3 {
  font-size: clamp(1.05rem, 3.5vw, 1.2rem) !important;
}
.content h4 {
  font-size: 1.05rem !important;
}
.content .faq-item__q {
  font-size: 1.05rem !important;
  line-height: 1.35 !important;
}
.content .faq-item__a,
.content .faq-item__a p {
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
}
/* Docs: text-align:justify даёт огромные пробелы на узкой колонке; margin:0 слипает абзацы */
.content p {
  text-align: start !important;
  text-align-last: auto !important;
  word-spacing: normal !important;
  hyphens: manual;
  margin: 0 0 1rem !important;
}
.content p:last-child {
  margin-bottom: 0 !important;
}
.content .faq-item__a p {
  text-align: start !important;
  margin: 0 0 0.65rem !important;
}
.content .faq-item__a p:last-child {
  margin-bottom: 0 !important;
}
.content .page-dates {
  font-size: 0.78rem;
  color: var(--muted) !important;
  margin: 0 0 1rem;
  line-height: 1.45;
}
.content .page-dates__time {
  white-space: nowrap;
  color: var(--muted) !important;
}
/* Вставки из Google Docs с inline color:#000 — перекрываем для тёмной темы */
.content *:not(a) {
  color: inherit !important;
}
.content a {
  color: var(--link);
}
/* Картинки из контента: по центру блока, на всю ширину карточки (не сбоку) */
.content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1rem auto;
}
.content figure {
  margin: 1rem 0;
  text-align: center;
}
.content figure img {
  margin-left: auto;
  margin-right: auto;
}

/* Таблицы из Google Docs: перекрываем inline border/фон под палитру темы */
.content table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse !important;
  margin: 1.25rem 0 !important;
  font-size: 0.95rem;
  line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--border) 85%, var(--muted) 15%) !important;
  border-radius: 10px;
  overflow: hidden;
  /* Чуть светлее чистого card, чтобы таблица не «проваливалась» в фон */
  background: color-mix(in srgb, var(--card) 72%, var(--muted) 14%) !important;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 50%, transparent);
}
.content thead,
.content tbody,
.content tfoot,
.content tr {
  background: transparent !important;
}
.content th,
.content td {
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--muted) 20%) !important;
  padding: 0.7rem 0.9rem !important;
  text-align: left;
  vertical-align: top;
  color: inherit !important;
}
.content thead th,
.content thead td {
  background: color-mix(in srgb, var(--header-bg) 75%, var(--card) 25%) !important;
  color: var(--text) !important;
  font-weight: 700;
}
.content tbody th {
  background: color-mix(in srgb, var(--header-bg) 65%, var(--card) 35%) !important;
  font-weight: 700;
}
.content td {
  background: color-mix(in srgb, var(--card) 55%, transparent) !important;
}
.content tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--card) 40%, var(--bg) 35%) !important;
}
/* Docs часто делает шапку первой строкой &lt;td&gt; без &lt;thead&gt; */
.content table:not(:has(thead)) > tbody > tr:first-child > th,
.content table:not(:has(thead)) > tbody > tr:first-child > td {
  background: color-mix(in srgb, var(--header-bg) 75%, var(--card) 25%) !important;
  color: var(--text) !important;
  font-weight: 700;
}
@media (max-width: 640px) {
  .content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.content h2 { margin-top: 1.75rem; }

.faq-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.faq-block__title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.faq-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.faq-item__q {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
}
.faq-item__a {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.faq-item__a p { margin: 0 0 0.65rem; }
.faq-item__a p:last-child { margin-bottom: 0; }

.scroll-top {
  position: fixed;
  z-index: 110;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.scroll-top:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
}
.scroll-top[hidden] {
  display: none !important;
}

/* Footer: trust badges + payment icons (global, all pages) */
.footer-trust {
  margin: 0 auto 1.5rem;
  max-width: 960px;
}
.footer-trust__intro {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.footer-trust__intro-p {
  margin: 0 0 0.65rem;
}
.footer-trust__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  justify-content: center;
  align-items: center;
}
.footer-trust__item {
  margin: 0;
}
.footer-trust__badge,
.footer-trust__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-trust__img {
  max-height: 42px;
  width: auto;
  max-width: 140px;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}
.footer-trust__link {
  opacity: 0.92;
}
.footer-trust__link:hover {
  opacity: 1;
}
.footer-trust__divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem auto;
  max-width: 720px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.footer-links {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: 1rem 1.25rem;
  justify-content: center;
}
.footer-links a { color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }
.footer-links a:hover { color: var(--text); }
.copy { margin: 0; }

/* Header + mobile nav */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
}
.nav-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: flex-end;
}
.nav-scrim {
  display: none;
}
.header-bar-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  flex-shrink: 0;
}
.header-mobile-cta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
}

/* Полоса с пунктами меню в одну линию — только от 1024px. Иначе iPhone в ландшафте (~844–932px)
   попадал в «десктоп», колонка CTA сжималась и Login/Register переносились столбиком. */
@media (min-width: 1024px) {
  /* Без display:contents — иначе в Safari меню может пропасть из потока */
  .header-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1rem 1.5rem;
  }
  .header-bar > .logo {
    grid-column: 1;
    justify-self: start;
  }
  .header-bar-end {
    display: none;
  }
  .menu-toggle {
    display: none !important;
  }
  .nav-panel {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem 1rem;
    flex: unset;
    justify-content: unset;
    position: static;
    width: 100%;
    max-width: none;
    height: auto;
    transform: none;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  .header-mid {
    grid-column: 2;
    justify-self: center;
    min-width: 0;
  }
  .header-cta {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    flex-shrink: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
}

@media (max-width: 1023px) {
  .site-header {
    padding: 0.65rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  /* Логотип может сжиматься; выезжающее меню не участвует во flex-раскладке — иначе при ресайзе полоска с Login/Register ломается */
  .header-bar > .logo {
    flex: 1 1 0;
    min-width: 0;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-panel {
    flex: none;
    position: fixed;
    top: 0;
    right: 0;
    width: min(100%, 320px);
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 4.5rem 1.25rem 1.5rem;
    padding-top: max(4.5rem, calc(env(safe-area-inset-top) + 3rem));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--header-bg);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(0,0,0,0.35);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-panel.is-open {
    transform: translateX(0);
  }
  .nav-panel .header-mid {
    width: 100%;
  }
  .nav-panel .nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  .nav-panel .header-cta {
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
  }
  .nav-panel .header-cta .btn {
    text-align: center;
    width: 100%;
  }
  /* Очень узкий экран: в полоске шапки только основная CTA, Login остаётся в выезжающем меню */
  @media (max-width: 360px) {
    .header-mobile-cta .btn-ghost {
      display: none;
    }
    .btn-header-sm.btn-primary {
      max-width: 56vw;
    }
  }
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }
  .nav-scrim[hidden] {
    display: none !important;
  }
  body.nav-open {
    overflow: hidden;
  }
  .main {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }
  .site-footer {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}
