/* =====================================================================
   Gamaloplay UI additions — sidebar icons, game badges, Top games carousel.
   Loaded after main1.css / media.css / style.css.
   ===================================================================== */

/* ---------- 1. Sidebar: category pictograms (plain colored icons, no plate) ---------- */
.page > .sidebar .all_cat {
  margin-left: 11px;
  gap: 4px;
}
.page > .sidebar .single_cat > a {
  padding: 4px;
  border-radius: 12px;
  transition: background 0.2s ease;
}
.page > .sidebar .single_cat:hover > a,
.page > .sidebar .single_cat.is-active > a {
  background: rgba(255, 255, 255, 0.07);
}
.single_cat_img.gp-ico,
.single_cat:hover .single_cat_img.gp-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--gp-c1, #E2B64F);
}
.single_cat_img.gp-ico svg {
  width: 24px;
  height: 24px;
}
.single_cat .single_cat_img.gp-ico + label {
  font-weight: 500;
  font-size: 14px;
  color: #E6E3F0;
}
.single_cat:hover label,
.single_cat.is-active label {
  color: #fff;
}
.single_cat.is-active label {
  color: #E2B64F;
}

/* ---------- 2. Badges: Hot / New / Top rated ---------- */
.game-card,
.left-game-card,
.gp-tile {
  position: relative;
}
.gp-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 5px 10px 5px 9px;
  border-radius: 16px 0 12px 0;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.gp-badge--hot {
  background: linear-gradient(135deg, #FF7A2F 0%, #F2381B 100%);
}
.gp-badge--new {
  background: linear-gradient(135deg, #34D399 0%, #059669 100%);
}
.gp-badge--top {
  background: linear-gradient(135deg, #FFD66B 0%, #F5A524 100%);
  color: #2A1A00;
}
.gp-badge--big {
  padding: 7px 14px 7px 12px;
  font-size: 13px;
}
.left-game-card .gp-badge {
  padding: 3px 7px;
  border-radius: 20px 0 10px 0;
  font-size: 9px;
}

/* ---------- 3. Top games carousel ---------- */
.all_categorys {
  background-size: 100% 100%;
}
.all_categorys > .popular {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}
.gp-top {
  --gp-h: 190px;   /* row height = big tile size */
  --gp-gap: 10px;
  position: relative;
  text-align: left;
}
.gp-top__track {
  display: flex;
  gap: var(--gp-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
}
.gp-top__track::-webkit-scrollbar {
  display: none;
}
.gp-top.is-dragging .gp-top__track {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
}
.gp-top.is-dragging .gp-tile {
  pointer-events: none;
}
.gp-top__group {
  display: flex;
  gap: var(--gp-gap);
  flex: none;
  scroll-snap-align: start;
}
.gp-top__quad {
  display: grid;
  grid-template-columns: repeat(2, calc((var(--gp-h) - var(--gp-gap)) / 2));
  grid-auto-rows: calc((var(--gp-h) - var(--gp-gap)) / 2);
  gap: var(--gp-gap);
  align-content: start;
}
.gp-tile {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  border: solid 2px transparent;
  background: #1B1830;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.gp-tile--big {
  width: var(--gp-h);
  height: var(--gp-h);
}
.gp-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gp-tile:hover {
  border-color: #E2B64F;
  text-decoration: none;
}
.gp-tile:hover img {
  transform: scale(1.05);
}
/* name label — same orange pill as the old .slide_row label */
.gp-tile label {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  z-index: 2;
  padding: 3px 5px;
  border-radius: 8px;
  background: #C95B32;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.gp-tile--big label {
  font-size: 13px;
  line-height: 18px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
}
.gp-tile {
  border-radius: 12px;
}
.gp-top .gp-badge {
  padding: 3px 7px;
  border-radius: 12px 0 9px 0;
  font-size: 9px;
}
.gp-top .gp-badge--big {
  padding: 4px 9px;
  font-size: 11px;
}
.gp-tile:hover label {
  opacity: 1;
}

/* arrows */
.gp-top__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(19, 22, 58, 0.88);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.gp-top__nav:hover {
  background: #C95B32;
  transform: scale(1.06);
}
.gp-top__nav--prev { left: -16px; }
.gp-top__nav--next { right: -16px; }
.gp-top__nav[disabled] {
  opacity: 0;
  pointer-events: none;
}
.gp-top.is-static .gp-top__nav {
  display: none;
}


@media (max-width: 768px) {
  .gp-top { --gp-h: 170px; --gp-gap: 8px; }
  .gp-top__nav { display: none; }
  /* no hover on touch — keep names visible */
  .gp-tile label {
    opacity: 1;
    left: 0; right: 0; bottom: 0;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(180deg, transparent 0%, rgba(19, 22, 58, 0.9) 70%);
    padding: 18px 6px 6px;
    font-size: 11px;
    line-height: 14px;
  }
  .gp-tile--big label { font-size: 11px; line-height: 14px; }
  .gp-tile--small label { font-size: 9px; padding: 14px 4px 4px; }
}
@media (max-width: 480px) {
  .gp-top { --gp-h: 150px; --gp-gap: 8px; }
}

/* ---------- 4. Game page (single.php): left column = glass panel, 2 columns of Top games ---------- */
.main.single .left_sidebar {
  width: 214px;
  flex: none;
  align-self: flex-start;
  padding: 14px 12px 12px;
  border-radius: 24px;
  text-align: left;
}
.gp-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 12px;
  font-family: 'Future', 'Poppins', sans-serif;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.gp-side-title:before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, #E2B64F, #C95B32);
  box-shadow: 0 0 10px rgba(226, 182, 79, 0.6);
}
.gp-side-title:after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
}
.main.single .left_sidebar .left_block {
  display: grid;
  grid-template-columns: repeat(2, 90px);
  gap: 10px;
}
.main.single .left_sidebar .left-game-card {
  width: 90px;
  height: 90px;
  margin: 0;
}
/* card link fills the card (hover lift + glare host) */
.main.single .left_sidebar .left-game-card > a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 2px; /* = старая прозрачная рамка 2px у картинки */
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* равные квадраты независимо от пропорций исходной картинки */
.main.single .left_sidebar .left-game-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 18px;
  background: #1B1830;
  transition: transform 0.4s ease;
}
.main.single .left_sidebar .left-game-card img:hover {
  background-color: #1B1830;
}
.main.single .left_sidebar .left-game-card:hover > a {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(201, 91, 50, 0.4), 0 0 14px rgba(226, 182, 79, 0.3);
}
.main.single .left_sidebar .left-game-card .game-card__name {
  z-index: 2;
  left: 2px;
  right: 2px;
  bottom: 2px;
  width: auto;
  margin: 0;
  padding: 14px 4px 5px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, transparent, rgba(19, 22, 58, 0.92));
  font-size: 10px;
  line-height: 12px;
}
.main.single .left_sidebar .gp-badge {
  z-index: 3;
  border-radius: 20px 0 10px 0;
}

/* =====================================================================
   5. SITE-WIDE: glass panels + glare on hover
   ===================================================================== */

/* ---- Glass panels ---- */
.all_categorys,
.popular_category,
.main_block,
.seo_block,
.catalog__title,
.emded,
.main.single .left_sidebar {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 45%, rgba(201, 91, 50, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(5, 6, 25, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
/* blur of what is behind — not on .main_block: the fullscreen fallback of the
   game player uses position:fixed, which a backdrop-filter ancestor would break */
.all_categorys,
.popular_category,
.seo_block,
.catalog__title,
.emded,
.main.single .left_sidebar {
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
.all_categorys,
.popular_category,
.main_block {
  border-radius: 28px;
}
.all_categorys {
  background-size: auto;
}
#owl-carousel .owl-item {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 60%, rgba(201, 91, 50, 0.07) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
/* left menu */
.page > .sidebar {
  background: linear-gradient(180deg, rgba(44, 33, 56, 0.72) 0%, rgba(19, 22, 58, 0.55) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Glare on hover (all game cards and category tiles) ---- */
.game-card__thumb > a,
.left-game-card > a,
.right-game-card > a,
.gp-tile,
#owl-carousel .owl-item {
  position: relative;
  display: block;
  overflow: hidden;
}
.game-card__thumb > a { height: 100%; border-radius: 16px; }
.left-game-card > a,
.right-game-card > a { height: 100%; border-radius: 20px; }
#owl-carousel .owl-item { display: flex; }

.game-card__thumb > a:after,
.left-game-card > a:after,
.right-game-card > a:after,
.gp-tile:after,
#owl-carousel .owl-item:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.38) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: 130% 0;
  background-repeat: no-repeat;
  pointer-events: none;
}
.game-card__thumb > a:hover:after,
.left-game-card > a:hover:after,
.right-game-card > a:hover:after,
.gp-tile:hover:after,
#owl-carousel .owl-item:hover:after {
  animation: gp-glare 0.9s ease forwards;
}
/* labels stay above the glare */
.game-card__thumb .game-card__name,
.left-game-card .game-card__name,
.right-game-card .game-card__name,
.gp-tile label,
#owl-carousel .category_item label {
  z-index: 2;
}
#owl-carousel .category_item { position: relative; z-index: 2; }

@keyframes gp-glare {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card__thumb > a:hover:after,
  .left-game-card > a:hover:after,
  .right-game-card > a:hover:after,
  .gp-tile:hover:after,
  #owl-carousel .owl-item:hover:after { animation: none; }
}

/* =====================================================================
   6. TOP MENU (header) — glass pill + burger on mobile
   :is(#menu-main-menu, ul) keeps ID-level specificity to override the
   old "ul#menu-main-menu" rules even if the menu gets another ID.
   ===================================================================== */
.top_block .header {
  align-items: center;
  padding: 10px 0;
}
.top_block .logo { padding-top: 0; }
.top_block .menu_top {
  overflow: visible;
  margin-left: 10px;
}
.top_block .menu_top :is(#menu-main-menu, ul) {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 5px;
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 60%, rgba(201, 91, 50, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 26px rgba(5, 6, 25, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
.top_block .menu_top :is(#menu-main-menu, ul) > li,
.top_block .menu_top :is(#menu-main-menu, ul) > li:hover {
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 999px;
}
.top_block .menu_top :is(#menu-main-menu, ul) > li > a {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 10px 18px;
  border-radius: 999px;
  color: #F2EAD2;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.top_block .menu_top :is(#menu-main-menu, ul) > li > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.top_block .menu_top :is(#menu-main-menu, ul) > li:is(.current-menu-item, .current_page_item, .current-menu-ancestor) > a {
  color: #fff;
  background: linear-gradient(135deg, #E2B64F 0%, #C95B32 100%);
  box-shadow: 0 4px 14px rgba(201, 91, 50, 0.45);
}
/* same glare as on game cards */
.top_block .menu_top :is(#menu-main-menu, ul) > li > a:after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 130% 0;
  pointer-events: none;
}
.top_block .menu_top :is(#menu-main-menu, ul) > li > a:hover:after {
  animation: gp-glare 0.9s ease forwards;
}

/* search — glass pill to match */
.top_block .search-container { margin-top: 0; }
.top_block .search input {
  width: 170px;
  height: 42px;
  padding: 0 40px 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.top_block .search input:focus {
  border-color: rgba(226, 182, 79, 0.6);
  background: rgba(255, 255, 255, 0.09);
}
.top_block .search-container:after {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 0;
  pointer-events: none;
}

/* burger (mobile only) */
.gp-burger {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.gp-burger span {
  position: absolute;
  left: 11px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #F2EAD2;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.gp-burger span:nth-child(1) { top: 14px; }
.gp-burger span:nth-child(2) { top: 20px; }
.gp-burger span:nth-child(3) { top: 26px; }
.gp-nav-open .gp-burger { background: linear-gradient(135deg, #E2B64F, #C95B32); }
.gp-nav-open .gp-burger span { background: #fff; }
.gp-nav-open .gp-burger span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.gp-nav-open .gp-burger span:nth-child(2) { opacity: 0; }
.gp-nav-open .gp-burger span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

@media (max-width: 768px) {
  .top_block .header {
    flex-wrap: wrap;
    padding: 10px 15px;
    row-gap: 0;
  }
  .gp-burger { display: block; }
  .top_block .menu_top {
    display: none;
    order: 3;
    width: 100%;
    margin: 10px 0 0;
    overflow: visible;
  }
  .top_block .header.gp-nav-open .menu_top {
    display: block;
    animation: gp-drop 0.25s ease;
  }
  .top_block .menu_top :is(#menu-main-menu, ul) {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border-radius: 20px;
  }
  .top_block .menu_top :is(#menu-main-menu, ul) > li > a {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 14px;
  }
}
@keyframes gp-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* =====================================================================
   7. MOBILE: game page — Top Games block under the game (was hidden)
   ===================================================================== */
@media (max-width: 768px) {
  .main.single .left_main_block {
    flex-direction: column;
  }
  .main.single .central_main_block { order: 1; }
  .main.single .left_sidebar {
    display: block;
    order: 2;
    width: 100%;
    margin: 16px 0 0;
  }
  .main.single .left_sidebar .left_block {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  /* 12 игр = 4 ровных ряда по 3 */
  .main.single .left_sidebar .left-game-card:nth-child(n+13) {
    display: none;
  }
  @media (min-width: 481px) {
    .main.single .left_sidebar .left_block { grid-template-columns: repeat(6, 1fr); }
  }
  .main.single .left_sidebar .left-game-card {
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* Mobile: category button sits in the header next to the burger
   (it was fixed at 94px from the top and overlapped content under the lower header) */
@media (max-width: 768px) {
  .page { position: relative; }
  .page > .mobil_menu {
    position: absolute;
    top: 10px;
    right: 80px;
    left: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    background: url(../img/category.svg) center / 24px 24px no-repeat, linear-gradient(135deg, #E2B64F 0%, #C95B32 100%);
    box-shadow: 0 4px 14px rgba(201, 91, 50, 0.4);
    cursor: pointer;
  }
}
