/* Minimal overrides — keep Y8 CSS sizes intact */

/* Prefer local Inter (preloaded) over remote Inter subsets from y8-main */
html,
body {
  font-family: "InterY8", Inter, system-ui, sans-serif !important;
}

/* fontello: enable swap so icons don't block text paint (PSI font-display) */
@font-face {
  font-family: "fontello";
  font-display: swap;
  font-weight: normal;
  font-style: normal;
  src: url("https://img.y8.com/assets/fontello-ad2d8469396fc928954bf28abe6c3d4d509d26eac50be6a71bd0dc291314722c.woff2?36321710")
    format("woff2");
}

/* Below-fold category rows: skip rendering work until near viewport */
@media (max-width: 767.98px) {
  .items-row:nth-child(n + 3) {
    content-visibility: auto;
    contain-intrinsic-size: auto 220px;
  }
}

/* Lazy images visible without Y8 JS */
img.lazy,
img.lazyloaded,
.item__img-container img,
.item-card__image img,
.item-card__char img,
picture img {
  opacity: 1 !important;
}

/* Multiplayer bg without lazysizes */
.multiplayer-box .multiplayer-box__img.multiplayer-box__img-1 {
  background-image: url("https://img.y8.com/assets/y8/multiplayer-box-bg-de4cde95ba61235974dde426368ff4c3807dccf62717d3720b986d9e826b3373.webp");
}
.multiplayer-box .multiplayer-box__img.multiplayer-box__img-2 {
  background-image: url("https://img.y8.com/assets/y8/multiplayer-box-bg-2-1ea1c5b191ac505e53e152583df18c85b4a7c53595b1c7c0aba6c75203253b08.webp");
}

/* Our slick track layout */
.items-row__items {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.items-row .slick-initialized.slick-slider {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.items-row .slick-list {
  overflow: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
}

.items-row .slick-track {
  display: flex;
  align-items: stretch;
}

.items-row .slick-slide {
  display: block !important;
  float: none;
  height: auto;
  min-height: 1px;
  visibility: visible;
}

.items-row .slick-prev.slick-disabled {
  display: none !important;
}

.items-row__wrapper {
  align-items: normal;
}

.header__search {
  display: block !important;
}
.header__login-buttons .user-not-logged-in-new {
  display: block !important;
}

/* Replace Y8 logo with Snakegame.biz logo */
.header__logo .site-logo.site-logo--snakegame {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  height: auto !important;
  min-width: 100px;
  min-height: 45px;
  background: none !important;
  background-image: none !important;
}
.header__logo .site-logo.site-logo--snakegame::before,
.header__logo .site-logo.site-logo--snakegame::after {
  content: none !important;
  display: none !important;
}
.header__logo .site-logo__img {
  display: block;
  width: 100px;
  height: 45px;
  object-fit: contain;
}
.header__logo .header__logo-text-container {
  display: none !important;
}

/* Mobile: match Y8 135px thumbs */
@media (max-width: 767.98px) {
  .items-row__items {
    max-width: 100%;
    width: 100%;
  }
  .items-row .slick-slide {
    margin: 0;
    min-width: 147px;
    width: 147px !important;
  }
  .items-row .slick-slide .item {
    width: 135px !important;
    min-width: 135px !important;
    max-width: 135px;
    height: 101.25px;
    margin: 0 12px 0 0 !important;
    display: block !important;
  }
  .items-row .slick-slide .item__thumbarea,
  .items-row .slick-slide .item__img-container,
  .items-row .slick-slide .item__img-container img {
    width: 135px !important;
    height: 101.25px !important;
  }
  .items-row .slick-prev,
  .items-row .slick-next {
    display: none !important;
  }
}

/* Tablet/Desktop: 180px thumbs; slick width follows Y8 breakpoints via flex */
@media (min-width: 768px) {
  .items-row .slick-slide {
    width: 200px !important;
    min-width: 200px;
  }
  .items-row .slick-slide .item {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px;
    height: 135px;
    margin: 0 10px !important;
    display: block !important;
  }
  .items-row .slick-next {
    right: -40px;
  }
  .items-row .slick-prev {
    left: -40px;
  }
}

/* Match Y8 .slick-slider fixed widths (override our width:100% base) */
@media (min-width: 1366px) {
  .items-row .slick-initialized.slick-slider {
    width: 800px;
  }
}
@media (min-width: 1480px) {
  .items-row .slick-initialized.slick-slider {
    width: 1000px;
  }
}
@media (min-width: 1680px) {
  .items-row .slick-initialized.slick-slider {
    width: 1200px;
  }
}
@media (min-width: 1920px) {
  .items-row .slick-initialized.slick-slider {
    width: 1400px;
  }
}
@media (min-width: 2240px) {
  .items-row .slick-initialized.slick-slider {
    width: 1590px;
  }
}
@media (min-width: 2640px) {
  .items-row .slick-initialized.slick-slider {
    width: 2000px;
  }
}

/* Grid sections: Y8 JS normally toggles visibility */
.grid-layout .items-container {
  visibility: visible;
}

/* Highscore cards use full column width (not 180×135 thumbs) */
.item.item--highscore .item__img-container,
.item.item--highscore .item__img-container img.thumb {
  width: 100% !important;
  height: auto !important;
  max-width: none;
  aspect-ratio: 4 / 3;
}

/* Snake sidebar icons (fontello, same as Y8) */
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-new::before{color:#0062b2;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-popular::before{color:#ffa300;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-io::before{color:#ff5b88;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-classic::before{color:#4e7aea;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-multiplayer::before{color:#e57304;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-worms::before{color:#d28558;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-skill::before{color:#4ba700;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-action::before{color:#f75d4d;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-puzzle::before{color:#b575eb;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-kids::before{color:#9a9a00;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-3d::before{color:#22aa32;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-mobile::before{color:#50a9f9;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-arcade::before{color:#4e7aea;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}
.sidebar-item .sidebar-item__link.sidebar-item__link--snake-adventure::before{color:#22aa32;content:"";font-family:'fontello';font-size:24px;font-weight:normal;font-style:normal}

/* Show search trends new-design (Y8 hides via JS toggle) */
.js-search-trends.js-search-trends--new-design {
  display: block !important;
}

/* Tag icons visible sizing */
.top-tags .tag-item .tag-icons {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 6px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Featured/originals: keep Y8 sizing (height:0 + padding-bottom:75%).
   Do NOT set height:auto on .item__thumbarea — that doubles card height. */
.grid-layout.grid-layout--originals .items-container {
  gap: 15px 20px !important;
  grid-auto-flow: dense !important;
  justify-content: start;
}
.grid-layout.grid-layout--originals .items-container .item:first-child {
  grid-column: span 2 !important;
  grid-row: span 2 !important;
}
.grid-layout.grid-layout--originals .item.item--originals {
  width: 100%;
  max-width: none;
}
.grid-layout.grid-layout--originals .item.item--originals .item__img-container img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  /* match Y8: inline so padding-bottom aspect box is not doubled */
  display: inline;
}

@media (max-width: 767.98px) {
  .grid-layout.grid-layout--originals .items-container .item:first-child {
    grid-row: span 1 !important;
  }
}

/* Top tags: single compact horizontal scroll row */
.home-box .top-tags.top-tags--new-design {
  padding: 0;
  margin: 0;
}
.home-box .top-tags.top-tags--new-design .top-tags__wrapper {
  flex-direction: row;
  width: 100%;
}
.home-box .top-tags.top-tags--new-design .top-tags__height,
.home-box .top-tags.top-tags--new-design .row.top-tags__height.single-line {
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: hidden;
  padding: 10px 0 !important;
}
.home-box .top-tags.top-tags--new-design ul {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 4px !important;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.home-box .top-tags.top-tags--new-design ul::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
  width: 0;
  height: 0;
}
.home-box .top-tags.top-tags--new-design ul li {
  flex: 0 0 auto !important;
  margin: 0 !important;
  white-space: nowrap;
}
.home-box .top-tags.top-tags--new-design .top-tags__title {
  margin: 0 8px 0 0 !important;
  flex-shrink: 0;
  white-space: nowrap;
}
.home-box .top-tags.top-tags--new-design .tag-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Search trends: show full left icon + single scroll row */
.js-search-trends.js-search-trends--new-design .search-trends-box {
  margin-top: 12px;
  padding: 10px 0 !important;
  border-radius: 16px;
  overflow: hidden;
}
.js-search-trends.js-search-trends--new-design .search-trends-box .single-line {
  height: auto !important;
  overflow: visible !important;
  padding: 0 !important;
}
.js-search-trends.js-search-trends--new-design .search-trends-box .search-trends-container {
  background-image: url("https://img.y8.com/assets/svg/top-search-icon-92c81912277d6dbb8fd842aee190e6e26274da6e2c5b8563ca6d4ffef2f63afe.webp") !important;
  background-position: left 10px center !important;
  background-repeat: no-repeat !important;
  background-size: 84px auto !important;
  min-height: 84px !important;
  padding: 8px 20px 8px 110px !important;
  display: flex !important;
  align-items: center;
  box-sizing: border-box;
}
.js-search-trends.js-search-trends--new-design .search-trends-box .search-trends {
  min-height: 0 !important;
  width: 100%;
  overflow: hidden;
}
.js-search-trends.js-search-trends--new-design .search-trends-box ul {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.js-search-trends.js-search-trends--new-design .search-trends-box ul::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.js-search-trends.js-search-trends--new-design .search-trends-box ul li {
  flex: 0 0 auto !important;
  margin: 0 !important;
  white-space: nowrap;
}
.js-search-trends.js-search-trends--new-design .search-trends-box .search-trends__title {
  margin: 0 !important;
  white-space: nowrap;
}
.js-search-trends.js-search-trends--new-design .search-trends-box .open-modal-btn {
  flex-shrink: 0;
}
.js-search-trends.js-search-trends--new-design .search-trends-box li a {
  white-space: nowrap;
}

/* Search (q=) compact filters */
.search-container.search-container--new-design .advanced-serach-options--compact {
  margin-top: 12px;
}
.search-container.search-container--new-design .search-filter-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
  font-size: 13px;
  color: #555;
}
.search-container.search-container--new-design .search-filter-select .form-control {
  height: 40px;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 0 12px;
  background: #fff;
}

/* Category page (Y8 /categories) polish */
.categories-show .content-block__count {
  opacity: 0.9;
  font-weight: 600;
}
.categories-show .tags-scroller {
  margin: 30px 0 0;
  padding: 0 0 0 20px;
  overflow: hidden;
  background: rgba(242, 242, 242, 0.75);
  border-radius: 16px;
}
.categories-show .tags-scroller__title {
  display: none;
}
.categories-show .tags-scroller__wrapper {
  padding: 18px 0;
}
.categories-show .tags-scroller__scroll {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 0 0;
  scrollbar-width: none;
}
.categories-show .tags-scroller__scroll::-webkit-scrollbar {
  display: none;
}
.categories-show .tag-item.tag-item--category-page-new.tag-item--title {
  display: none;
}
.categories-show .tag-item.tag-item--category-page-new.tag-item--category {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 40px;
  padding: 7px 12px 7px 10px;
  border-radius: 14px;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.categories-show .tag-item.tag-item--category-page-new.tag-item--category:hover {
  background: #f7f7f7;
}
.categories-show .tag-item.tag-item--category-page-new .tag-icons {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.categories-show .content-block__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 12px;
}
.categories-show .sort-by--categories {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}
.categories-show .sort-by--categories select.form-control {
  min-width: 160px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  padding: 0 10px;
}
.categories-show .grid-layout {
  margin-top: 8px;
}

/* Homepage SEO body: readable long-form */
.pre-content--homepage .pre-content__body {
  font-size: 14px;
  line-height: 1.65;
  color: #333;
}
.pre-content--homepage .pre-content__body p {
  margin: 0 0 12px;
}
.pre-content--homepage .pre-content__body a {
  color: #2a6ebb;
  text-decoration: underline;
}
.pre-content--homepage .pre-content__section h3.pre-content__subtitle {
  font-size: 16px;
  margin: 18px 0 8px;
}

/* Game page sidebar tags — ensure sprite icons show */
.box.box--game-page.tags .tag-item {
  display: inline-flex;
  align-items: center;
}
.box.box--game-page.tags .tag-item .tag-icons {
  flex-shrink: 0;
}
.box.box--game-page.tags .tag-item p {
  margin: 0;
}

/* Hide raw embed code — Y8 uses click-to-open modal */
.promo-banner.promo-banner--embed-game .item-embed-code {
  display: none !important;
}
