/* Лендинг «Отпечаток» — стили по ТЗ, без inline */

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

:root {
  --color-bg: #1a1a2e;
  --color-bg-alt: #16213e;
  --color-text: #eee;
  --color-text-muted: #aaa;
  --color-accent: #3498db;
  --color-accent-hover: #2980b9;
  --color-btn-secondary: #555;
  --color-btn-secondary-hover: #666;
  --color-border: #333;
  --spacing-block: 24px;
  --spacing-block-before-footer: 32px;
  --spacing-inner: 16px;
  --spacing-footer: 10px;
  --font-size-text: clamp(16px, 2vw, 18px);
  --min-touch: 40px;
  --header-height-mobile: 56px;
  --header-height-desktop: 64px;
  --game-ratio: 1.6;
  --ad-min-height: 90px;
  --sidebar-width: 160px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-size-text);
  line-height: 1.5;
  background: linear-gradient(160deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  color: var(--color-text);
  min-height: 100vh;
  padding: 0;
}

/* Safe area для вырезов/камеры */
.top-bar,
.footer {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* --- Верхняя панель --- */
.top-bar {
  height: var(--header-height-mobile);
  padding-top: env(safe-area-inset-top);
  flex-shrink: 0;
}

.top-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  min-height: var(--min-touch);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  vertical-align: middle;
}

.logo-text {
  white-space: nowrap;
}

.logo:hover,
.logo:focus-visible {
  color: var(--color-accent);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.logo:hover .logo-img,
.logo:focus-visible .logo-img {
  opacity: 0.9;
}

.nav {
  display: none;
  gap: 8px;
}

.nav-link {
  padding: 8px 12px;
  min-height: var(--min-touch);
  min-width: var(--min-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 8px;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-switcher {
  display: flex;
  gap: 2px;
}

.lang-btn {
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.lang-btn[aria-pressed="true"] {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Планшеты и ПК: высота панели, показ меню */
@media (min-width: 768px) {
  .top-bar {
    height: var(--header-height-desktop);
  }

  .nav {
    display: flex;
  }
}

/* --- Основная колонка и боковые баннеры --- */
.main-column {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.layout-with-sides {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 auto;
}

/* Боковые баннеры: только на десктопе */
.ad-side-col {
  display: none;
}

.ad-side-col .ad-placeholder-vertical {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

/* Горизонтальные баннеры (нижние): показываем по умолчанию (мобильный) */
.main-column .ad-horizontal {
  display: block;
}

@media (min-width: 1024px) {
  /* Десктоп: горизонтальные баннеры как на мобилке + по бокам по 2 вертикальных */
  .layout-with-sides {
    flex-direction: row;
    max-width: 1600px;
    align-items: flex-start;
    gap: 24px;
  }
  /* Вертикальные баннеры на десктопе: всего 2 (слева и справа), размер 300×600 */
  .ad-side-col {
    display: block;
    flex: 0 0 300px;
    width: 300px;
    min-width: 0;
  }
  .ad-side-col .ad-vertical,
  .ad-side-col .ad-placeholder-vertical {
    width: 300px;
    height: 600px;
    min-height: 600px;
  }
  .main-column {
    flex: 1 1 auto;
    min-width: 0;
  }
  /* Горизонтальные баннеры на десктопе: 728×90, выравнивание по центру */
  .main-column .ad-horizontal {
    width: 728px;
    max-width: 100%;
    min-height: 90px;
    height: 90px;
    margin-left: auto;
    margin-right: auto;
  }
  .main-column .ad-horizontal .ad-placeholder {
    width: 728px;
    max-width: 100%;
    min-height: 90px;
    height: 90px;
  }
}

/* --- Игровой блок: пропорция 1 : 1.6 --- */
.game-section {
  width: 100%;
  margin: 0;
  padding: 0;
  vertical-align: top;
}

.game-frame-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.game-frame-wrapper::before {
  content: "";
  display: block;
  padding-top: calc(100% * var(--game-ratio));
}

.game-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- Отступы между блоками по ТЗ --- */
.game-section,
.text-block,
.ad {
  margin-top: var(--spacing-block);
  margin-bottom: var(--spacing-block);
}

.text-block {
  padding: 0 var(--spacing-inner);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.text-content {
  margin: 0;
}

.text-content p {
  margin: 0 0 1em;
}

.text-content p:last-child {
  margin-bottom: 0;
}

/* --- Рекламные блоки --- */
.ad-horizontal {
  width: 100%;
  min-height: var(--ad-min-height);
}

.ad-placeholder {
  width: 100%;
  min-height: var(--ad-min-height);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

/* Горизонтальные баннеры на мобилке: 468×60 */
@media (max-width: 1023px) {
  .main-column .ad-horizontal {
    width: 100%;
    max-width: 468px;
    min-height: 60px;
    height: 60px;
    margin-left: auto;
    margin-right: auto;
  }
  .main-column .ad-horizontal .ad-placeholder {
    width: 100%;
    max-width: 468px;
    min-height: 60px;
    height: 60px;
  }
}

/* --- CTA блок --- */
.cta-block {
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch);
  min-width: var(--min-touch);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--color-accent-hover);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--color-btn-secondary);
  color: #fff;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-btn-secondary-hover);
}

.btn-cta {
  margin-top: 1rem;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* --- Футер --- */
.footer {
  margin-top: var(--spacing-block-before-footer);
  padding: var(--spacing-footer) 16px;
  padding-bottom: calc(var(--spacing-footer) + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-link,
.footer-link-btn {
  color: var(--color-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 4px 0;
}

.footer-link:hover,
.footer-link:focus-visible,
.footer-link-btn:hover,
.footer-link-btn:focus-visible {
  color: var(--color-accent);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.footer-sep {
  margin: 0 8px;
  opacity: 0.6;
}

.footer-copy {
  white-space: nowrap;
}

/* --- Cookie баннер: блокирующее модальное окно (GDPR/TTDSG) --- */
.cookie-banner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  padding-top: calc(16px + env(safe-area-inset-top));
}

.cookie-banner-overlay .cookie-banner-inner {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.cookie-banner-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
}

.cookie-banner-text {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-banner-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-banner-overlay.hidden {
  display: none !important;
}

/* --- Модальное окно настроек cookies --- */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 16px;
}

.cookie-modal-inner {
  position: relative;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
}

.cookie-modal-title {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.cookie-modal-body {
  margin-bottom: 20px;
}

.cookie-modal-body p {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.cookie-category {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.cookie-category-desc {
  margin: 0 0 12px 24px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.cookie-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  min-height: var(--min-touch);
  cursor: pointer;
}

.cookie-check input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cookie-modal-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: var(--min-touch);
  height: var(--min-touch);
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
}

.cookie-modal-close:hover,
.cookie-modal-close:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cookie-modal.hidden {
  display: none !important;
}

/* Утилиты */
.hidden {
  display: none !important;
}

/* Скрыто визуально, доступно для SEO и скринридеров */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Фокус для доступности */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Отдельные страницы: Политика конфиденциальности, Условия использования */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.legal-page h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.legal-page p {
  margin: 0 0 1em;
}

.legal-page a {
  color: var(--color-accent);
}

.legal-page a:hover {
  text-decoration: underline;
}

.legal-page h2 {
  font-size: 1.15rem;
  margin: 1.25em 0 0.5em;
}

.legal-page h3 {
  font-size: 1rem;
  margin: 1em 0 0.35em;
}

.legal-page ul {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 1em 0;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--color-border);
  padding: 0.5em 0.6em;
  text-align: left;
}

.legal-table th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.legal-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
