:root {
  --border-radius: 8px;
  --form-border-radius: 8px;
}

html {
  scroll-behavior: smooth;
}

iframe {
  width: 100%;
  height: 80vh;
  box-sizing: border-box;
  overflow: hidden;
}


.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

.wp-site-blocks > main, 
.wp-site-blocks > .wp-block-group:not(footer) {
    flex-grow: 1;
}

.header-title {
  line-height: 1.1;
}

.header-title .wp-block-site-tagline {
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.8);
}


.game-box {
  box-shadow: var(--wp--preset--shadow--deep);
  border-radius: 8px;
  border: 3px solid var(--wp--preset--color--custom-1-1-1);
}

input[type="search"] {
  padding: 8px 12px;
  background-color: var(--wp--preset--color--custom);
  color: var(--wp--preset--color--custom-1);
}

input[type="text"],
input[type="email"],
textarea {
  box-sizing: border-box;
  width: 100%;
  border-radius: var(--form-border-radius);
  border: 2px solid var(--wp--preset--color--custom-1-1-1);
  padding: 8px 12px;
  background-color: var(--wp--preset--color--custom);
  color: var(--wp--preset--color--custom-1);
}

:focus-visible {
  outline: transparent auto 1px;
}

input[type="submit"],
button {
  border-radius: var(--border-radius);
  background-color: var(--wp--preset--color--custom);
  color: rgb(from var(--wp--preset--color--white) r g b / 0.7);
  border: 2px solid var(--wp--preset--color--custom-1-1-1);
  padding: 5px 24px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

input[type="submit"]:hover,
button:hover {
  background-color: var(--wp--preset--color--custom-1-1-1);
}

blockquote {
  border-left: 3px solid var(--wp--preset--color--custom-2);
  margin-right: 0;
  margin-left: 0;
  background-color: var(--wp--preset--color--custom);
  padding: 1rem;
  border-radius: var(--border-radius);
}

.page-wrapper {
  justify-content: space-between;
}

.item__title {
  color: var(--wp--preset--color--custom-2);
  margin: 0;

}

.item__values p {
  margin: 4px 0;
  color: var(--wp--preset--color--custom-1);
}

.site-header {
  order: 1;
}

.main-nav {
  order: 2;
}

.search-wrapper {
  order: 3;
}

.header-wrapper {
  position: relative;
}

.wp-block-search__inside-wrapper {
  border-color: var(--wp--preset--color--custom-1-1-1) !important;
  background-color: var(--wp--preset--color--custom);
  margin: 0;
  padding: 0;
}

.wp-element-button {
  padding: 0;
  color: var(--wp--preset--color--custom-1);
  padding-right: 8px;

}

.game-card {
  position: relative;
  cursor: pointer;
}

.figure-wrapper {
  border-radius: var(--border-radius) !important;
  /* border: 3px solid var(--wp--preset--color--custom-1-1-1); */
  overflow: hidden !important;
  margin: 0;

}

.figure-wrapper figure {
  aspect-ratio: 1/1 !important;
}

.figure-wrapper .wp-block-feedbackwp-rating-result-widget {
  position: absolute !important;
  bottom: -5px;
  left: 0px;
}

.figure-wrapper .rmp-results-widget__visual-rating {
  display: none;
}

.figure-wrapper .rmp-results-widget__vote-count {
  display: none;
}

.figure-wrapper .rmp-results-widget__avg-rating {
  padding: 0px;
  margin: 0;
  box-sizing: border-box;
  line-height: 1;
  display: inline-block;
}

.figure-wrapper .js-rmp-avg-rating {
  display: block;
  background: green;
  box-sizing: border-box;
  padding: 2px 5px;
  margin: 0;
}

.rmp-results-widget--not-rated {
  display: none;
}

.rmp-rating-widget .rmp-icon--full-highlight {
  color: var(--wp--preset--color--custom-2);
}

.games-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.fixed-games-list {
  grid-template-columns: repeat(2, 1fr);
}

.game-title h2,
.game-title h3 {
  line-height: 1;
  font-size: var(--wp--preset--font-size--small);
  margin: 0;
  margin-top: 5px;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Контейнер таблицы */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  background: var(--wp--preset--color--custom);
  border-radius: 12px;
  border: 2px solid var(--wp--preset--color--custom-1-1-1);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Заголовок */
.leaderboard-table certain {
  background-color: var(--wp--preset--color--custom);
  ;
}

.leaderboard-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: #666;
  border-bottom: 2px solid var(--wp--preset--color--custom-1-1-1);
}

/* Ячейки */
.leaderboard-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--wp--preset--color--custom-1-1-1);
}

/* Эффект при наведении на строку */
.leaderboard-table tbody tr:hover {
  background-color: var(--wp--preset--color--custom-1-1);
  transition: background 0.2s ease;
}

/* Выделение ТОП-3 */
.leaderboard-table tbody tr:nth-child(1) td:first-child {
  color: #ffd700;
  font-weight: bold;
}

/* Золото */
.leaderboard-table tbody tr:nth-child(2) td:first-child {
  color: #c0c0c0;
  font-weight: bold;
}

/* Серебро */
.leaderboard-table tbody tr:nth-child(3) td:first-child {
  color: #cd7f32;
  font-weight: bold;
}

/* Бронза */

/* Очки жирным шрифтом */
.leaderboard-table td:last-child {
  font-weight: 700;
  color: var(--wp--preset--color--custom-2);
}

.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-clip {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  /* Скрыто по умолчанию */
  transition: opacity 0.3s ease;
}

/* Показываем видео при наведении на контейнер */
.game-card:hover .preview-clip {
  opacity: 1;
}

.uagb-block-a44c5250 .spectra-image-gallery__control-arrows svg {
  fill: var(--wp--preset--color--custom-2);
}

.uagb-block-a44c5250 .spectra-image-gallery__layout--carousel ul.slick-dots li button:before {
  color: var(--wp--preset--color--custom-2);
}

.poisk-games-posts-list__title {
  color: rgb(from var(--wp--preset--color--custom-2) r g b / 0.75);
  margin: 0;
  line-height: 1.6;
  margin-top: 3rem;
}

p:has(.poisk-games-posts-list__date) {
  margin: 0 !important;
}

.poisk-games-posts-list__date {
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.65);
  font-size: 0.9rem;
}

.poisk-games-posts-list__item p {
  line-height: 1.6;
}

.content-wrapper p {
  margin-bottom: 1rem;
}

.fullscreen-active {
  position: absolute;
  flex-wrap: nowrap;
  border: none;
  width: 100%;
  height: 100;
}

.fullscreen-active iframe {
  border: none;
  width: 100%;
  height: 100%;
}

.fullscreen-active .game-embed-wrapper {
  height: 100%;
}

.game-embed-wrapper:fullscreen,
.game-embed-wrapper:-webkit-full-screen {
  background: #000;
}

.game-embed-wrapper:fullscreen .game-embed-iframe,
.game-embed-wrapper:-webkit-full-screen .game-embed-iframe {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Hide enter-fullscreen control while already in fullscreen */
.game-embed-wrapper:fullscreen .fullscreen-button,
.game-embed-wrapper:-webkit-full-screen .fullscreen-button {
  display: none !important;
}

/* Firefox fullscreen compatibility */
.game-embed-wrapper:-moz-full-screen {
  background: #000;
}

.game-embed-wrapper:-moz-full-screen .game-embed-iframe {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.game-embed-wrapper:-moz-full-screen .fullscreen-button {
  display: none !important;
}

/* Prevent top gap in fullscreen if wpautop injects <br> into shortcode output */
.game-embed-wrapper br {
  display: none;
}

.game-embed-iframe {
  display: block;
}

.game-embed-wrapper:fullscreen,
.game-embed-wrapper:-webkit-full-screen,
.game-embed-wrapper:-moz-full-screen {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.fullscreen-active div:has(.panel) {
  background: linear-gradient(172deg,
      rgba(63, 53, 67, 1) 0%,
      rgba(63, 53, 67, 0.85) 50%,
      rgba(63, 53, 67, 1) 100%);
}

.wp-block-comment-template {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment>ol {
  border-left: 2px solid rgb(from var(--wp--preset--color--custom-1) r g b / 0.5);
  padding-left: 0.5rem;
}

.wp-block-comment-date,
.comment-notes,
.comment-form-cookies-consent {
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.6) !important;
  font-size: var(--wp--preset--font-size--small) !important;
}

.wp-block-comment-content {
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.75) !important;
}

.comment {
  padding: 20px;
  /* border: 1px solid var(--wp--preset--color--custom-1-1-1); */
  background: var(--wp--preset--color--custom);
  border-radius: 8px;
}

.comment-awaiting-moderation {
  color: var(--wp--preset--color--custom-2);
}

.comment-form p {
  margin: 0;
  margin-bottom: 0.5rem;
}

.comment-form label {
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.8)
}

.left {
  display: none !important;
}

.fullscreen-active .panel-rating {
  display: none !important;
}

.yoast-breadcrumbs a {
  text-decoration: none;
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.7);
}

.yoast-breadcrumbs a:hover {
  color: var(--wp--preset--color--custom-2);
}

.yoast-breadcrumbs span {
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.5);
}

.schema-faq-section {
  outline: 1px solid transparent;
  border: none;
  /* Убираем обычный border */
  border-radius: 8px;
  margin-bottom: 12px;
  /* transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
  display: flex;
  flex-direction: column;
  background: var(--wp--preset--color--custom);
  overflow: hidden;
}

/* Заголовок */
.schema-faq-question {
  display: block;
  padding: 12px 20px;
  padding-right: 35px;
  cursor: pointer;
  position: relative;
  user-select: none;
  font-weight: 600;
  overflow: hidden;
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.9);
  transition: background-color 0.2s;
}

.schema-faq-section:hover {
  box-shadow: var(--wp--preset--shadow--natural);
  outline: 1px solid var(--wp--preset--color--custom-1-1-1);
}

/* Иконка-стрелка */
.schema-faq-question::after {
  content: '';
  position: absolute;
  right: 25px;
  top: 25px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #a0aec0;
  border-bottom: 2px solid #a0aec0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Контейнер для анимации высоты */
.schema-faq-section .answer-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  /* Начальное состояние — скрыто */
  /* transition: grid-template-rows 0.4s ease-out; */
}

/* Текст ответа */
.schema-faq-answer {
  overflow: hidden;
  padding: 0 20px;
  margin: 0;
  color: rgb(from var(--wp--preset--color--custom-1) r g b / 0.7);
  line-height: 1.6;
  margin-bottom: 0 !important;
}

/* Состояние при клике (активно) */
.schema-faq-section.is-active {
  outline: 1px solid var(--wp--preset--color--custom-1-1-1);
  box-shadow: var(--wp--preset--shadow--natural);
}

.schema-faq-section.is-active .answer-wrapper {
  grid-template-rows: 1fr;
  /* Раскрываем */
}

.schema-faq-section.is-active .schema-faq-answer {
  padding-bottom: 20px;
  /* Добавляем отступ только когда открыто */
}

.schema-faq-section.is-active .schema-faq-question::after {
  transform: translateY(-20%) rotate(-135deg);
  border-color: var(--wp--preset--color--custom-2);
}

.yarpp-thumbnail-title {
  display: none;
}

.yarpp-thumbnails-horizontal .yarpp-thumbnail {
    width: 100%;
    height: auto;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--wp--preset--shadow--natural);
}

.yarpp-thumbnail > img, .yarpp-thumbnail-default {
    width: 100%;
    height: auto;
    margin: 0;
    transition: transform 0.3s ease;
}

.yarpp-thumbnail:hover {
    border-color: var(--wp--preset--color--custom-2);
    box-shadow: var(--wp--preset--shadow--deep);
}

.yarpp-thumbnail:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

@media (max-width: 480px) {

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
}


/* Tablet: 768px-1023px */
@media (min-width: 768px) and (max-width: 1023px) {

  .left {
    display: flex !important;
  }

  .right {
    flex-direction: row-reverse;
  }

  .panel {
    justify-content: space-between;
  }

  .games-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .fixed-games-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .game-card figure {
    aspect-ratio: 4/3 !important;
  }

  .search-wrapper {
    flex-basis: 100%;
  }

}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {

  .left {
    display: flex !important;
  }

  .right {
    flex-direction: row-reverse;
  }

  .panel {
    justify-content: space-between;
  }

  .yarpp-thumbnails-horizontal {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }

  .game-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 1;
  }

  .games-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .fixed-games-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .game-title {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end !important;
    align-items: stretch;
    padding: 8px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .game-title a {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    color: var(--wp--preset--color--white);
    text-align: left;
    pointer-events: auto;
    text-decoration: none;
  }

  .game-title .uagb-container-inner-blocks-wrap,
  .game-title h2,
  .game-title h3 {
    position: relative;
    min-height: 0;
    overflow: visible;
  }

  .game-title .uagb-container-inner-blocks-wrap {
    margin-top: auto;
    width: 100%;
  }

  .game-title h2,
  .game-title h3 {
    font-size: var(--wp--preset--font-size--medium);
    display: block;
    color: var(--wp--preset--color--white);
    margin: 0;
    margin-left: 5px;
    width: 100%;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
  }

  .game-card figure {
    border-radius: 0 !important;
    border: none !important;
    margin: 0;
    aspect-ratio: 3/2 !important;
  }

  .game-card {
    border-radius: var(--border-radius) !important;
    overflow: hidden !important;
    border: 2px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: var(--wp--preset--shadow--natural) !important;
  }

  .game-card:hover {
    border: 2px solid var(--wp--preset--color--custom-2) !important;
  }

  .game-card:hover::after {
    background: rgba(0, 0, 0, 0.5);
  }

  .game-card:hover .game-title {
    opacity: 1;
  }

  .game-card:hover .game-title h2,
  .game-card:hover .game-title h3 {
    color: var(--wp--preset--color--custom-1) !important;
  }

  .game-card:hover .wp-block-feedbackwp-rating-result-widget {
    display: none !important;
  }

  .site-header {
    order: 1;
  }

  .main-nav {
    order: 3;
  }

  .search-wrapper {
    order: 2;
  }

  .content-wrapper {
    padding: 50px !important;
  }

  .game-content {
    padding-left: calc(100% / 2/3) !important;
    padding-right: calc(100% / 2/3) !important;
  }

}

@media (min-width: 1280px) {
  .games-list {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }

  .fixed-games-list {
    grid-template-columns: repeat(4, 1fr);
  }
}