/* sixsevengames.ru — стили каталога */
:root {
  --header-h: 64px;
  --sidebar-w: 320px;
  --bg: #f2f3f7;
  --surface: #ffffff;
  --text: #14151a;
  --text-secondary: #6b7280;
  --border: rgba(20, 21, 26, 0.08);
  --accent: #7c3aed;
  --accent-bright: #8b5cf6;
  --accent-soft: rgba(124, 58, 237, 0.12);
  --dark: #0d0d14;
  --dark-2: #15151f;
  --gold: #f5b301;
  --radius: 14px;
  --shadow-card: 0 4px 16px rgba(20, 21, 26, 0.07);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button { font-family: inherit; }
img { max-width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: var(--dark);
  color: #fff;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo__mark {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  font-style: italic;
  font-size: 16px;
}
.logo__domain span { color: var(--accent-bright); }
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
}
.site-nav a:hover, .site-nav a.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.header-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.header-search input {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 14px 0 38px;
  font-size: 14px;
  outline: none;
}
.header-search input::placeholder { color: rgba(255, 255, 255, 0.45); }
.header-search input:focus { border-color: var(--accent-bright); background: rgba(255, 255, 255, 0.12); }
.header-search::before {
  content: "";
  position: absolute;
  left: 13px; top: 50%;
  width: 14px; height: 14px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  clip-path: none;
}
.header-search::after {
  content: "";
  position: absolute;
  left: 25px; top: 50%;
  width: 6px; height: 2px;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(45deg);
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.player-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.player-chip__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d28d9, #2563eb);
  display: grid;
  place-items: center;
  font-size: 15px;
}
.player-chip__level {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12.5px;
}
.coins {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14.5px;
}
.coins::before {
  content: "";
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd75e, #e79b00);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}

/* ---------- Каркас ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 20px;
  max-width: 1660px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 20px) 20px 40px;
}
.content { min-width: 0; }

/* ---------- Баннер-карусель ---------- */
.hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: stretch;
  color: #fff;
  box-shadow: var(--shadow-card);
}
.hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 36px 48px;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.hero__slide.active { opacity: 1; pointer-events: auto; position: relative; width: 100%; }
.hero__text { max-width: 55%; }
.hero__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero__subtitle { margin: 0 0 22px; font-size: 16px; opacity: 0.85; }
.hero__play {
  display: inline-block;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 13px 34px;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hero__play:hover { background: var(--accent-bright); transform: translateY(-1px); }
.hero__art {
  margin-left: auto;
  width: 190px; height: 190px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
.hero__dots {
  position: absolute;
  left: 48px; bottom: 18px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.hero__dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.35);
}
.hero__dots button.active { background: #fff; }

/* ---------- Категории ---------- */
.categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 6px;
}
.category-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.category-btn:hover { border-color: rgba(124, 58, 237, 0.4); }
.category-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Секции и сетка игр ---------- */
.section-title {
  margin: 22px 0 14px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.game-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 21, 26, 0.13); }
.game-card__thumb { position: relative; aspect-ratio: 1 / 1; background: #e9ebf1; }
.game-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card__hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(13, 13, 20, 0.4);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.game-card:hover .game-card__hover { opacity: 1; }
.game-card__hover span {
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 10px;
}
.game-card__body { padding: 10px 12px 12px; }
.game-card__title {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.game-card__rating { color: #b45309; font-weight: 700; }
.game-card__rating::before { content: "★ "; color: var(--gold); }
.empty {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  color: var(--text-secondary);
}

/* ---------- Инлайн-баннер между секциями ---------- */
.ad-inline {
  margin: 26px 0 4px;
  min-height: 120px;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---------- Рекламный сайдбар ---------- */
.ad-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  height: calc(100vh - var(--header-h) - 40px);
  min-height: 560px;
}
body.playing .ad-sidebar {
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  min-height: 0;
  padding: 12px;
  background: var(--dark);
}
.ad-slot {
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--dark-2);
  position: relative;
}
.ad-slot__label {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 2;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.ad-net-container, .ad-net-container > div { height: 100%; }

/* ---------- Собственные (house) креативы ---------- */
.house-ad {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 28px;
  color: #fff;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(124, 58, 237, 0.35), transparent 65%),
    var(--dark-2);
}
.house-ad__kicker {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.house-ad__kicker span { color: #a78bfa; }
.house-ad__sub { margin-top: 12px; font-size: 15px; color: rgba(255, 255, 255, 0.75); }
.house-ad__visual { margin: auto 0; width: 100%; max-width: 230px; }
.house-ad__visual--emoji { font-size: 84px; line-height: 1; filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.55)); }
.house-ad__product { font-size: 19px; font-weight: 800; letter-spacing: 0.12em; }
.house-ad__specs { margin-top: 6px; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
.house-ad__cta {
  margin-top: 18px;
  width: 100%;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  padding: 14px;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.house-ad__cta:hover { background: var(--accent-bright); }
/* компактный вариант в горизонтальном инлайн-слоте */
.ad-inline .house-ad { flex-direction: row; text-align: left; padding: 18px 24px; gap: 20px; border-radius: var(--radius); }
.ad-inline .house-ad__kicker { font-size: 21px; }
.ad-inline .house-ad__sub { margin: 4px 0 0; }
.ad-inline .house-ad__visual { display: none; }
.ad-inline .house-ad__product { margin-left: auto; }
.ad-inline .house-ad__specs { display: none; }
.ad-inline .house-ad__cta { margin: 0 0 0 18px; width: auto; padding: 12px 22px; flex-shrink: 0; }

/* ---------- Полноэкранная реклама (interstitial) ---------- */
.interstitial {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 12, 0.86);
  display: grid;
  place-items: center;
  padding: 20px;
}
.interstitial__panel {
  width: min(420px, 100%);
  height: min(640px, 92vh);
  border-radius: 18px;
  overflow: hidden;
  background: var(--dark-2);
  position: relative;
  display: flex;
  flex-direction: column;
}
.interstitial__label {
  position: absolute;
  top: 10px; left: 14px;
  z-index: 2;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}
.interstitial__slot { flex: 1; }
.interstitial__close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.interstitial__close:disabled { cursor: default; opacity: 0.7; }
.interstitial__close:not(:disabled) { background: var(--accent); }

/* ---------- Страница игры (вёрстка в духе Яндекс Игр) ---------- */
.player-view { display: none; }
body.playing { background: var(--dark); }
body.playing .catalog-view { display: none; }
body.playing .player-view { display: block; }
body.playing .site-nav,
body.playing .header-search { display: none; }
/* во время игры каталожная сетка становится полноэкранной:
   игра тянется от левого края до рекламной колонки, без отступов */
body.playing .layout {
  max-width: none;
  padding: var(--header-h) 0 0;
  gap: 0;
}
/* кнопка «назад» и название игры в шапке — только во время игры */
.header-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  flex-shrink: 0;
}
.header-back:hover { background: rgba(255, 255, 255, 0.16); }
body.playing .header-back { display: inline-flex; }
.header-game-title {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 40vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15.5px;
  font-weight: 700;
}
body.playing .header-game-title { display: block; }
.fullscreen-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.fullscreen-btn:hover { background: rgba(255, 255, 255, 0.16); }
body.playing .fullscreen-btn { display: inline-flex; }
.game-frame-wrap {
  overflow: hidden;
  background: #000;
  height: calc(100vh - var(--header-h));
  min-height: 480px;
}
.game-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Подвал ---------- */
.site-footer {
  max-width: 1660px;
  margin: 0 auto;
  padding: 0 20px 30px;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-secondary); }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .ad-sidebar { display: none; }
}
@media (max-width: 860px) {
  .site-nav { display: none; }
  .player-chip__name, .player-chip__level { display: none; }
  .hero__art { display: none; }
  .hero__text { max-width: 100%; }
  .hero__slide { padding: 28px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .game-frame-wrap { height: calc(100vh - var(--header-h)); min-height: 360px; }
  .header-game-title { display: none !important; }
  .ad-inline .house-ad__product, .ad-inline .house-ad__sub { display: none; }
}

/*
  Узкие телефоны.

  На 390 px (iPhone 14/15) в шапку не помещались разом логотип, поиск и
  счётчик монет: логотип объявлен flex-shrink: 0 и занимал 205 px, поиск
  сжимался до нечитаемых 54 px, а .header-right уезжал вправо до 437 px —
  счётчик «1 240» обрезался краем экрана. Горизонтальной прокрутки при этом
  не появлялось, поэтому дефект был виден только глазами.

  Освобождаем место в пользу поиска: словесная часть логотипа прячется, знак
  «67» остаётся — бренд читается, а поиск получает нормальную ширину.
*/
@media (max-width: 430px) {
  .site-header { gap: 12px; padding: 0 12px; }
  .logo__domain { display: none; }
  .header-right { gap: 10px; }
}
