/* ==========================================================================
   Growiki — раздел прохождений (growiki/index.php, growiki/game.php).
   Подключается только на страницах раздела (через $extraCss в includes/header.php),
   чтобы не утяжелять остальные страницы сайта. Стили перенесены из блока
   «Growiki» макета growiki-section/style/style.css; цвета и радиусы — те же,
   что на всём сайте.
   ========================================================================== */

.gw-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.gw-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gw-arrow { display: inline-flex; flex: 0 0 auto; color: #2f9c4a; }

/* ---------- Поиск + алфавитный указатель ---------- */
.gw-top { padding: 16px 0 0; border-bottom: 1px solid rgba(103, 116, 142, 0.16); }
.gw-search { padding: 20px 24px; border-radius: 12px; background: #e8fbee; }
.gw-search__title { margin-bottom: 12px; font-size: 22px; line-height: 30px; font-weight: 600; }
.gw-search__field { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; border: 1px solid rgba(103, 116, 142, 0.16); border-radius: 8px; background: #fff; }
.gw-search__field:focus-within { border-color: #44cf5e; box-shadow: 0 0 0 3px rgba(68, 207, 94, 0.18); }
.gw-search__icon { display: flex; flex: 0 0 auto; color: #67748e; }
.gw-search__input { flex: 1 1 auto; min-width: 0; width: 100%; border: none; outline: none; background: transparent; font: 400 15px/22px "Open Sans", system-ui, sans-serif; color: #23262e; -webkit-appearance: none; appearance: none; }
.gw-search__input::-webkit-search-cancel-button { cursor: pointer; }
.gw-alpha { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 16px 0; }
.gw-alpha__item { display: flex; align-items: center; justify-content: center; min-width: 24px; min-height: 32px; font-size: 18px; font-weight: 700; color: #2f9c4a; }
.gw-alpha__item:hover { color: #23262e; }
.gw-alpha__item--off { opacity: 0.35; }
.gw-alpha__item--active, .gw-alpha__item--active:hover { color: #0d2b16; background: #44cf5e; border-radius: 8px; padding: 0 8px; opacity: 1; }

/* ---------- Каталог: заголовок, вкладки, плитки ---------- */
.gw-body { padding-top: 32px; padding-bottom: 80px; }
.gw-title { margin-bottom: 20px; font-size: 40px; line-height: 48px; font-weight: 600; letter-spacing: -0.01em; }
.gw-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid rgba(103, 116, 142, 0.16); }
.gw-tab { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(103, 116, 142, 0.16); border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600; color: #3a3f4b; cursor: pointer; }
.gw-tab:hover { border-color: #44cf5e; color: #2f9c4a; }
.gw-tab--active, .gw-tab--active:hover { background: #23262e; border-color: #23262e; color: #fff; }
.gw-tab__count { padding: 1px 7px; border-radius: 999px; background: rgba(103, 116, 142, 0.10); font-size: 12px; }
.gw-tab--active .gw-tab__count { background: rgba(68, 207, 94, 0.18); color: #44cf5e; }

.gw-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.gw-tile { flex: 1 1 calc(50% - 8px); min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid rgba(103, 116, 142, 0.16); border-radius: 12px; background: #fff; color: inherit; }
.gw-tile:hover { border-color: #44cf5e; color: inherit; }
.gw-tile[hidden] { display: none; }
.gw-tile__title { font-size: 22px; line-height: 30px; font-weight: 600; color: #23262e; }
.gw-tile__text { font-size: 14px; line-height: 22px; color: #67748e; }
.gw-tile__more { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; font-size: 15px; font-weight: 600; color: #2f9c4a; }
.gw-empty { padding: 32px 0; font-size: 15px; color: #67748e; }
.gw-empty[hidden] { display: none; }

/* ---------- Страница игры ---------- */
.gw-doc { display: flex; gap: 40px; align-items: flex-start; padding-top: 40px; padding-bottom: 80px; }
.gw-doc__body { flex: 1 1 auto; min-width: 0; }
.gw-doc__aside { flex: 0 0 320px; min-width: 0; position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }
.gw-doc__title { font-size: 32px; line-height: 42px; font-weight: 600; letter-spacing: -0.01em; }
.gw-cover { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 7; margin: 12px 0 20px; border-radius: 12px; background: rgba(103, 116, 142, 0.10); border: 1px dashed rgba(103, 116, 142, 0.24); font-size: 13px; color: #67748e; text-align: center; padding: 0 16px; }
.gw-cover--img { display: block; object-fit: cover; padding: 0; border: none; height: auto; }
.gw-prose { margin-bottom: 24px; }
.gw-prose > *:first-child { margin-top: 0; }
.gw-prose p { margin: 0 0 16px; font-size: 16px; line-height: 28px; color: #3a3f4b; }
.gw-prose h2 { margin: 32px 0 12px; font-size: 20px; line-height: 28px; font-weight: 600; color: #23262e; }
.gw-prose h3 { margin: 24px 0 10px; font-size: 18px; line-height: 26px; font-weight: 600; color: #23262e; }
.gw-prose h4 { margin: 20px 0 8px; font-size: 16px; line-height: 24px; font-weight: 600; color: #23262e; }
.gw-prose strong, .gw-prose b { font-weight: 700; }
.gw-prose a { color: #2f9c4a; text-decoration: underline; }
.gw-prose ul { margin: 0 0 16px; padding: 0; list-style: none; }
.gw-prose ul li { position: relative; margin: 0 0 8px; padding-left: 16px; font-size: 16px; line-height: 26px; color: #3a3f4b; }
.gw-prose ul li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: #44cf5e; }
.gw-prose ol { margin: 0 0 16px; padding-left: 22px; }
.gw-prose ol li { margin: 0 0 8px; padding-left: 6px; font-size: 16px; line-height: 26px; color: #3a3f4b; }
.gw-prose blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid #44cf5e; color: #3a3f4b; }
.gw-prose img { display: block; max-width: 100%; height: auto; margin: 0 0 16px; border-radius: 12px; }
.gw-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.gw-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; box-sizing: border-box; }
.gw-btn--primary { background: #44cf5e; color: #0d2b16; }
.gw-btn--primary:hover { color: #0d2b16; }
.gw-btn--dark { background: #23262e; color: #fff; }
.gw-btn--dark:hover { color: #fff; }
.gw-btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.gw-btn--lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.gw-ggsel { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 12px 20px; border-radius: 12px; background: #e8fbee; color: #2f9c4a; }
.gw-ggsel:hover { color: #23262e; background: #d6f6df; }
.gw-ggsel__mark { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; background: #44cf5e; color: #0d2b16; font-size: 14px; font-weight: 700; }
.gw-ggsel__text { flex: 1 1 auto; min-width: 0; font-size: 20px; font-weight: 600; text-decoration: underline; }

.gw-banner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 320px; align-self: center; aspect-ratio: 240 / 400; border: 1px dashed rgba(103, 116, 142, 0.24); border-radius: 12px; background: rgba(103, 116, 142, 0.10); color: #67748e; overflow: hidden; }
.gw-banner--img { border: none; background: none; }
.gw-banner--img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gw-banner__label { font-size: 13px; }
.gw-banner__size { font-size: 22px; font-weight: 600; }
.gw-product { display: flex; flex-direction: column; border: 1px solid rgba(103, 116, 142, 0.16); border-radius: 12px; overflow: hidden; background: #fff; }
.gw-product__shot { display: flex; align-items: center; justify-content: center; height: 140px; padding: 0 12px; border-bottom: 1px solid rgba(103, 116, 142, 0.16); background: rgba(103, 116, 142, 0.08); font-size: 12px; color: #67748e; text-align: center; }
.gw-product__shot--img { display: block; width: 100%; object-fit: cover; padding: 0; }
.gw-product__body { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.gw-product__title { font-size: 14px; line-height: 20px; font-weight: 600; text-transform: uppercase; }
.gw-product__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.gw-product__price { font-size: 14px; font-weight: 600; color: #23262e; white-space: nowrap; }

/* ---------- Слайдер «Популярные категории» (низ страницы игры: другие игры раздела) ---------- */
.gw-section--pop { padding-bottom: 80px; }
.gw-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.gw-pop__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.gw-pop__nav { display: flex; gap: 8px; flex: 0 0 auto; }
.gw-pop__nav[hidden] { display: none; }
.gw-pop__btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid rgba(103, 116, 142, 0.16); border-radius: 50%; background: #fff; color: #3a3f4b; cursor: pointer; }
.gw-pop__btn:hover { border-color: #44cf5e; color: #44cf5e; }
.gw-pop__btn:disabled { opacity: 0.4; cursor: default; border-color: rgba(103, 116, 142, 0.16); color: #3a3f4b; }
.gw-pop { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gw-pop::-webkit-scrollbar { display: none; }
.gw-pop__item { flex: 0 0 calc(25% - 12px); min-width: 0; scroll-snap-align: start; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid rgba(103, 116, 142, 0.16); border-radius: 12px; background: #fff; color: inherit; }
.gw-pop__item:hover { border-color: #44cf5e; color: inherit; }
.gw-pop__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; background: #23262e; color: #44cf5e; font-size: 18px; font-weight: 700; }
.gw-pop__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gw-pop__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.gw-pop__name { font-size: 15px; line-height: 22px; font-weight: 600; color: #23262e; }
.gw-pop__desc { font-size: 14px; line-height: 22px; color: #67748e; }

/* ---------- Карусель товаров GGsel (правая колонка страницы игры) ---------- */
.gw-prods { display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; }
.gw-prods__track { display: flex; min-width: 0; width: 100%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gw-prods__track::-webkit-scrollbar { display: none; }
.gw-prods__slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.gw-prods__slide .gw-product__body { flex: 1 1 auto; }
.gw-prods__slide .gw-product__title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 60px; }
.gw-prods__slide .gw-product__foot { margin-top: auto; }
.gw-prods__nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.gw-prods__nav[hidden] { display: none; }
.gw-prods__count { min-width: 48px; text-align: center; font-size: 14px; font-weight: 600; color: #67748e; }

/* ---------- Адаптив ---------- */
@media (max-width: 1200px) {
  .gw-pop__item { flex-basis: calc(50% - 8px); }
}
@media (max-width: 1024px) {
  .gw-doc { flex-wrap: wrap; }
  .gw-doc__aside { flex: 1 1 100%; position: static; }
  .gw-prods__slide { flex-basis: 320px; }
}
@media (max-width: 760px) {
  .gw-wrap { padding: 0 16px; }
  .gw-top { padding-top: 12px; }
  .gw-search { padding: 16px; }
  .gw-search__input { font-size: 16px; } /* 16px — чтобы iOS не увеличивал страницу при вводе */
  .gw-search__title { font-size: 18px; line-height: 26px; }
  .gw-alpha { justify-content: flex-start; gap: 4px 12px; }
  .gw-alpha__item { font-size: 16px; min-width: 20px; }
  .gw-body { padding-top: 24px; padding-bottom: 36px; }
  .gw-title { font-size: 28px; line-height: 36px; }
  /* вкладки категорий: прокрутка пальцем в одну строку — общее правило [data-m="tabs"] из style.css */
  .gw-tile { flex-basis: 100%; padding: 20px; }
  .gw-tile__title { font-size: 18px; line-height: 26px; }
  .gw-doc { padding-top: 24px; padding-bottom: 36px; gap: 24px; }
  .gw-doc__title { font-size: 22px; line-height: 30px; }
  .gw-prose p, .gw-prose ul li, .gw-prose ol li { font-size: 15px; line-height: 25px; }
  .gw-ggsel__text { font-size: 16px; }
  .gw-actions .gw-btn { width: 100%; }
  .gw-section--pop { padding-bottom: 36px; }
  .gw-pop__item { flex-basis: 85%; }
  .gw-prods__slide { flex-basis: 85%; max-width: 320px; }
  .gw-pop__nav { display: none !important; } /* на телефоне листаем пальцем */
}
