/* Шаблон 9 (XX789). Цвета и шрифты — только из переменных схемы (schemes/*.css).
   Стиль образца: тёмный фон градиентом, шапка и футер темнее, золотые рамки и тени, скругления 3–5px,
   шрифт Lato; блик пробегает по всем кнопкам, «Register» переливается радугой. */
*, *::before, *::after { box-sizing: border-box; }
/* Шапка прилипает к верху (около 68px): переход по якорю отступает от неё. */
html { scroll-behavior: smooth; scroll-padding-top: calc(68px + 1rem); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; background: linear-gradient(120deg, var(--bg) 0%, var(--bg-2) 100%); background-attachment: fixed; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
.tg-icon { width: 1.15em; height: 1.15em; flex: none; }

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.25; margin: 0; color: var(--text); }
p { margin: 0 0 1em; }
/* Контейнер образца: 1230 с полями 10. */
.container { width: min(1230px, 100%); margin-inline: auto; padding-inline: 10px; }

/* Кнопки, как у образца: скругление 3px, жирный текст. Блик — светлая полоса под 45°, пролетает через
   кнопку раз в 2,8 секунды. */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 1.4rem; border: 0; border-radius: 3px; overflow: hidden; font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none; isolation: isolate; transition: filter 0.3s ease, transform 0.3s ease; }
.btn::after { content: ""; position: absolute; top: 50%; left: 0; z-index: 1; width: 40px; height: 300px; background: color-mix(in srgb, var(--text) 45%, transparent); transform: translate(-150%, -50%) rotate(45deg); animation: slideme 2.8s linear infinite; pointer-events: none; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
/* «Login» — оранжевая; приложение — золотая градиентом; «Register» — радуга, перетекающая по кругу. */
.btn--login { background: var(--login); color: var(--on-login); }
.btn--login:hover { color: var(--on-login); }
.btn--app { background: linear-gradient(120deg, var(--app-1), var(--app-2)); color: var(--on-app); }
.btn--app:hover { color: var(--on-app); }
.btn--go { background: linear-gradient(60deg, var(--go-1), var(--go-2), var(--go-3), var(--go-4), var(--go-5)); background-size: 300% 300%; color: var(--on-go); animation: animatedgradient 3.5s ease alternate infinite; }
.btn--go:hover { color: var(--on-go); }
@keyframes slideme {
  0% { transform: translate(-150%, -50%) rotate(45deg); opacity: 0; }
  20% { opacity: 0.5; }
  50% { transform: translate(400%, -50%) rotate(45deg); opacity: 0.35; }
  100% { transform: translate(600%, -50%) rotate(45deg); opacity: 0; }
}
@keyframes animatedgradient {
  0% { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 1.6rem 0 0; }
.buttons .btn { min-width: 220px; padding: 0.85rem 1.6rem; }

/* Шапка цвета панелей, прилипает, со светлым свечением снизу, как у образца. */
.header { position: sticky; top: 0; z-index: 20; background: var(--bar); box-shadow: 0 3px 8px color-mix(in srgb, var(--text) 45%, transparent); }
.header__bar { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.header__logo { display: inline-flex; align-items: center; flex: none; color: var(--text); font-family: var(--font-heading); font-size: 1.6rem; font-weight: 900; text-decoration: none; }
.header__logo-img { height: 48px; width: auto; max-width: 100%; object-fit: contain; }
/* В строке с меню иконка последняя, за кнопками; до 1200px, когда меню свёрнуто, она перед бургером. */
.header__contact { order: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--telegram); color: var(--on-telegram); font-size: 1.05rem; }
.header__contact:hover { color: var(--on-telegram); filter: brightness(1.1); }
/* Чекбокс бургера закреплён вверху экрана: иначе браузер при клике прокручивает страницу к нему. */
.nav__check { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }
.nav__toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.nav__menu { flex: 1; display: flex; align-items: center; gap: 1rem; min-width: 0; }
.nav__links { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 1.25rem; row-gap: 0.25rem; }
.nav__link { position: relative; padding: 0.35rem 0; color: var(--text); font-weight: 700; text-decoration: none; transition: color 0.3s ease; }
.nav__link:hover { color: var(--accent); }
/* Активная страница — золотом с чертой под ней. */
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); }
.nav__pills { display: inline-flex; flex: none; gap: 10px; }
.nav__pills .btn { padding: 0.6rem 1.2rem; }

/* Первый экран: слайдер и полоса игр. */
.top { padding: 20px 0 0; }
.top .container { display: flex; flex-direction: column; gap: 22px; }

/* Слайдер: картинки во всю ширину контейнера 3:1 (на телефоне 16:9), тёмная дымка снизу под
   заголовком, стрелки по бокам, точки внизу. Рамка — золотая тень, как у образца. */
.slider { position: relative; overflow: hidden; width: 100%; aspect-ratio: 3 / 1; border-radius: 5px; box-shadow: 3px 3px 5px color-mix(in srgb, var(--accent) 30%, transparent); }
.slider__track { display: flex; height: 100%; transition: transform 0.4s ease; }
.slide { position: relative; flex: 0 0 100%; height: 100%; color: var(--text); text-decoration: none; }
.slide::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, color-mix(in srgb, var(--bar) 85%, transparent) 0%, transparent 65%); pointer-events: none; }
.slide__img { width: 100%; height: 100%; object-fit: cover; }
.slide__content { position: absolute; left: 24px; right: 24px; bottom: 34px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; }
.slide__title { max-width: 32ch; color: var(--text); font-family: var(--font-heading); font-size: clamp(1.1rem, 2.6vw, 2rem); font-weight: 900; line-height: 1.2; text-shadow: 0 2px 6px var(--bar); }
.slide__btn { padding: 0.65rem 1.3rem; }
.slider__arrow { position: absolute; top: 50%; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid color-mix(in srgb, var(--text) 55%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--bar) 55%, transparent); color: var(--text); font-size: 1.3rem; cursor: pointer; transform: translateY(-50%); transition: background-color 0.3s ease; }
.slider__arrow:hover { background: color-mix(in srgb, var(--bar) 85%, transparent); }
.slider__arrow--prev { left: 10px; }
.slider__arrow--next { right: 10px; }
.slider__dots { position: absolute; left: 50%; bottom: 10px; z-index: 3; display: flex; gap: 8px; transform: translateX(-50%); }
.slider__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--text-2); cursor: pointer; transition: background-color 0.3s ease; }
.slider__dot.is-active { background: var(--accent); }

/* Полоса «Popular Games»: заголовок капителью с золотой чертой, «All» справа; игры в строку с
   прокруткой вбок, по «All» — сеткой. */
.games { position: relative; }
.games__check { position: absolute; opacity: 0; pointer-events: none; }
.games__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 15px; }
.games__title { display: inline-flex; flex-direction: column; gap: 4px; margin: 0; color: var(--text); font-family: var(--font-heading); font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 900; text-transform: uppercase; }
.games__title::after { content: ""; height: 1px; background: var(--accent); }
.games__all { padding: 0.3rem 0.6rem; color: var(--text); font-weight: 700; cursor: pointer; }
.games__all:hover, .games__check:checked ~ .games__head .games__all { color: var(--accent); }
.games__check:focus-visible ~ .games__head .games__all { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.games__list { display: flex; gap: 10px; overflow-x: auto; padding: 0 6px 10px 0; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--text-2) transparent; }
.games__check:checked ~ .games__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; overflow: visible; }
.game { display: flex; flex: none; flex-direction: column; width: 150px; border: 1px solid color-mix(in srgb, var(--highlight) 30%, transparent); border-radius: 5px; overflow: hidden; background: var(--bar); text-decoration: none; box-shadow: 3px 3px 5px color-mix(in srgb, var(--accent) 55%, transparent); transition: transform 0.3s ease; }
.game:hover { transform: translateY(-3px); }
.games__check:checked ~ .games__list .game { width: auto; }
.game__img { width: 100%; aspect-ratio: 500 / 376; object-fit: cover; }
.game__name { margin: 5px 4px; color: var(--highlight); font-size: 0.75rem; font-weight: 700; text-align: center; }

/* Блок h1: заголовок по центру, абзацы по ширине, как у образца. */
.hero { padding: 10px 0 20px; }
.hero__title { margin: 28px 0 20px; font-size: clamp(1.4rem, 4vw, 2.15rem); font-weight: 900; text-align: center; }
.hero p, .sec p { text-align: justify; hyphens: auto; }

/* Секции текстом во всю ширину; с картинкой — две колонки, картинка слева. */
.sec { padding: 28px 0; }
.sec__title { margin-bottom: 20px; font-size: clamp(1.3rem, 3.2vw, 1.75rem); font-weight: 900; }
.sec__sub { margin: 1.6rem 0 0.8rem; color: var(--accent); font-size: 1.2rem; font-weight: 700; }
.sec__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: center; }
.sec__media { display: block; border-radius: 5px; overflow: hidden; box-shadow: 3px 3px 5px color-mix(in srgb, var(--accent) 45%, transparent); }
.sec__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.sec__body > :last-child { margin-bottom: 0; }
.sec p a, .marks a, .steps a, .table td a, .hero p a { color: var(--accent); font-weight: 700; }
.picture { display: block; margin: 1.5rem 0; border-radius: 5px; overflow: hidden; }
.picture__img { width: 100%; }

/* Маркированный список — золотые ромбы. */
.marks { margin: 1rem 0 1.4rem; padding: 0; list-style: none; }
.marks li { position: relative; margin-bottom: 10px; padding-left: 1.5rem; }
.marks li::before { content: ""; position: absolute; left: 0.2rem; top: 0.55em; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }

/* Нумерованный список — номера в золотых кружках. */
.steps { margin: 1rem 0 1.4rem; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; margin-bottom: 12px; padding-left: 2.6rem; min-height: 1.9rem; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -0.1rem; display: flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: 0.9rem; font-weight: 900; }

/* Сноска — золотой чертой слева на плашке цвета шапки. */
.footnote { margin: 1.4rem 0; padding: 1rem 1.2rem; border-left: 3px solid var(--accent); border-radius: 0 5px 5px 0; background: var(--bar); }

/* Таблица: шапка цвета панелей с золотым текстом, рамки золотом. */
.table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 5px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { padding: 0.8rem 1rem; background: var(--bar); color: var(--accent); font-weight: 700; text-align: left; white-space: nowrap; }
.table td { padding: 0.8rem 1rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bar) 55%, transparent); }

/* Карточки, как «why» у образца: плашка цвета шапки, золотая рамка и тень, текст по центру. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 1.4rem 0; }
.card { padding: 1.2rem 1rem; border: 1px solid var(--accent); border-radius: 5px; background: var(--bar); text-align: center; box-shadow: 3px 3px 5px color-mix(in srgb, var(--accent) 45%, transparent); }
.card__title { margin-bottom: 0.5rem; color: var(--accent); font-size: 1.1rem; font-weight: 900; }
.sec .card__text { margin: 0; color: var(--text-2); text-align: center; }

/* Другие страницы: плитки в золотых рамках, по четыре в ряд. */
.links__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.link-card { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem; border: 1px solid var(--accent); border-radius: 5px; background: var(--bar); text-align: center; text-decoration: none; box-shadow: 3px 2px 4px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 0.3s ease; }
.link-card:hover { transform: translateY(-3px); }
.link-card__label { color: var(--accent); font-weight: 900; text-transform: uppercase; }
.link-card__desc { color: var(--text-2); font-size: 0.9rem; line-height: 1.45; }

/* FAQ гармошкой: вопрос в рамке, открытый и под курсором — жёлтым; ответ плашкой цвета шапки. */
.faq__item { margin: 10px 0; }
.faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 15px 20px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); font-weight: 700; cursor: pointer; list-style: none; transition: color 0.3s ease; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover, .faq__item[open] summary { color: var(--highlight); }
.faq__chevron { display: inline-flex; flex: none; transition: transform 0.3s ease; }
.faq__item[open] .faq__chevron { transform: rotate(180deg); }
.faq__answer { margin: 10px 5px; padding: 20px; border-radius: 20px; background: var(--bar); box-shadow: 0 2px 5px color-mix(in srgb, var(--bar) 60%, transparent); }
.faq__answer p { margin: 0; }

/* Кнопки перед футером. */
.join { padding: 10px 0 40px; }

/* Футер по центру цвета шапки; снизу запас под закреплённую полосу кнопок. */
.footer { padding: 30px 0 calc(1.5rem + 64px); background: var(--bar); }
.footer__wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer__logo { display: inline-flex; color: var(--text); font-family: var(--font-heading); font-size: 1.6rem; font-weight: 900; text-decoration: none; }
.footer__logo-img { height: 48px; width: auto; max-width: 100%; object-fit: contain; }
.footer__title { margin: 0; color: var(--text); font-size: 1.2rem; font-weight: 700; text-transform: uppercase; }
.footer__legal { margin: 0; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.footer__text { max-width: 860px; margin: 0; color: var(--text-2); font-size: 0.92rem; }
.footer__age { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; color: var(--text-2); font-size: 0.9rem; }
.pill { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 0.85rem; font-weight: 900; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.footer__links a { color: var(--text); font-weight: 700; text-decoration: none; }
.footer__links a:hover { color: var(--accent); }
.footer__links a.footer__tg { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--telegram); }
.footer__copy { margin: 6px 0 0; color: var(--text-2); font-size: 0.85rem; }

/* Закреплённая внизу полоса на всех ширинах: «Login» и «Register» поровну. */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 0; background: var(--dock); }
.dock__row { display: flex; gap: 10px; max-width: 640px; }
.dock .btn { flex: 1; min-height: 44px; }

/* Средний экран: меню бургером, раскрывается столбиком под шапкой; кнопки шапки — в нём. */
@media (max-width: 1200px) {
  .header__bar { flex-wrap: wrap; min-height: 0; padding-top: 10px; padding-bottom: 10px; column-gap: 0.6rem; }
  .header__logo { margin-right: auto; }
  .header__contact { order: 0; }
  .nav__toggle { display: inline-flex; }
  .nav__menu { display: none; flex: none; flex-basis: 100%; flex-direction: column; align-items: stretch; margin-top: 0.6rem; }
  .nav__check:checked ~ .nav__menu { display: flex; }
  .nav__links { flex-direction: column; align-items: flex-start; }
  .nav__link { width: 100%; padding: 0.7rem 0; border-bottom: 1px solid var(--line); text-transform: uppercase; }
  .nav__link.is-active::after { display: none; }
  .nav__pills { padding-bottom: 0.4rem; }
  .nav__pills .btn { flex: 1; }
}

/* Узкий экран: секция с картинкой в колонку, сетка игр и плиток уже, слайдер 16:9. */
@media (max-width: 768px) {
  /* Логотип 5:1 высотой 48 px, иконка и бургер в одну строку от 360 px: 240 + 8 + 38 + 8 + 42. */
  .header__bar { column-gap: 0.5rem; }
  .nav__toggle { width: 42px; }
  .slider { aspect-ratio: 16 / 9; }
  .slide__content { left: 14px; right: 14px; bottom: 28px; }
  .slide__btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .slider__arrow { width: 32px; height: 32px; font-size: 1.1rem; }
  .slider__arrow--prev { left: 6px; }
  .slider__arrow--next { right: 6px; }
  .games__check:checked ~ .games__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .game { width: 110px; }
  .game__name { font-size: 0.68rem; }
  .sec__grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .links__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buttons .btn { width: 100%; min-width: 0; }
}

/* Совсем узкий экран: кнопка слайда мельче под заголовком, сетка игр по две. */
@media (max-width: 440px) {
  .slide__content { bottom: 26px; gap: 0.4rem; }
  .slide__title { flex-basis: 100%; font-size: 1rem; }
  .slide__btn { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
  .games__check:checked ~ .games__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero p, .sec p { text-align: left; }
}

/* Уже 360 px иконка не встаёт рядом с широким логотипом (бывают 5:1), а он не ниже 48 px: ссылка остаётся в футере. */
@media (max-width: 359px) {
  .header__contact { display: none; }
}

/* Кому движение мешает — блик, радуга и пролистывание слайдера без анимации. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn::after { display: none; }
  .btn--go { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
