/* ==================== БАЗОВЫЕ СТИЛИ (как на RAWG) ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: #131313;
  color: #ffffff;
  background-repeat: no-repeat;
  background-position: top;
  background-size: 100%;
  line-height: 1.5;
}

.no-background {
  background-image: none !important;
}

.hidden-element {
  position: absolute;
  top: 90%;
  left: 0;
  right: 0;
  background: #202020;
  padding: 15px;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2;
  min-height: fit-content;
  height: auto;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.game-card:hover .hidden-element {
  opacity: 0.95;
  visibility: visible;
  transform: translateY(0);
}

.game-name {
  position: relative;
  margin-left: 12px;
  font-size: 20px;
}

.hidden-element .game-meta-dl {
  width: 100%;
  margin: 0;
}
.hr {
  border: 0.1px solid #313131;
  background-color: #4f4f4fba;
  margin-top: 15px;
  margin-bottom: 15px;
}
.hidden-element .game-meta-dl + .game-meta-dl {
  margin-top: 8px;
}

.hidden-element .game-meta-dl dt {
  font-size: 12px;
  color: rgb(122, 121, 121);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  width: 100%;
  margin: 0;
  text-align: left;
}

.hidden-element .game-meta-dl dd {
  margin: 0;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  white-space: normal;
}

.hidden-element .game-meta-dl dt .genres-name,
.hidden-element .game-meta-dl dd {
  max-width: 100%;
  line-height: 1.4;
}

.add-background::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: -1;
}

/* ==================== КОНТЕЙНЕР (стиль RAWG) ==================== */

.discover-columns {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* ==================== ФОРМА ПОИСКА ==================== */
.search-wrapper {
  grid-column: 1 / -1;
  position: relative;
  z-index: 100;
}

.search-form {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  background-color: #5e5e5eb7;
  opacity: 0.78;
  border-radius: 32px;
  overflow: hidden;
  gap: 0;
  padding-left: 20px;
  border: none;
  box-shadow: none;
}

.search-form:hover {
  transition: 0.8s;
  background-color: #ffffff;
  opacity: 1;
}

.search-form .fa-magnifying-glass {
  margin-right: 0;
  flex-shrink: 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.5s ease;
}

.search-form:hover .fa-magnifying-glass {
  color: #000000;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 16px 24px 16px 4px;
  border: none;
  font-size: 16px;
  outline: none;
  background: transparent;
  color: #ffffffd0;
  transition: color 0.5s ease;
}

.search-form:hover .search-input {
  color: #000000;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-form:hover .search-input::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

.search-button {
  color: #ffffff86;
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  padding-right: 8px;
  background-color: transparent;
  font-size: 14px;
  cursor: text;
  user-select: none;
  transition: color 0.5s ease;
}

.search-form:hover .search-button {
  color: rgba(0, 0, 0, 0.55);
}

.alt,
.f4 {
  margin: 5px;
  padding: 2px 8px;
  border: solid 1px rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  font-size: 14px;
  opacity: 0.8;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.search-button .plus {
  opacity: 0.8;
  color: rgba(255, 255, 255, 0.9);
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  margin-top: 4px;
  background: #000000;
  border-radius: 8px;
  box-shadow: none;
  max-height: min(400px, 55vh);
  overflow-x: hidden;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  transition: background 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item:focus-visible {
  transition: 1s;
}

.suggestion-thumb {
  width: 88px;
  height: 49px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #1a1a1a;
}

.suggestion-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.suggestion-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suggestion-thumb:hover,
.suggestion-title:hover {
  opacity: 0.4;
  transition: 0.3s;
}

.suggestion-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* ==================== КАРТОЧКИ (RAWG style) ==================== */
.game-card {
  position: relative;
  background: #202020;
  color: white;
  border-radius: 12px;
  transition: transform 0.3s ease;
  padding-bottom: 9px;
  z-index: 1;
}

.game-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transform: scale(1.05);
  opacity: 15;
}

.game-card hr {
  display: none;
}

.game-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  opacity: 0.9;
  border-radius: 12px;
}

.game-image:hover {
  opacity: 1;
  filter: brightness(1.1);
}

.game-card h3 {
  padding: 12px 16px 16px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== ДЕТАЛЬНАЯ СТРАНИЦА (RAWG style) ==================== */
.game-details {
  display: flex; /* Включаем Flexbox */
  flex-direction: column; /* Элементы идут друг за другом (вертикально) */
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}
.breadcrumbs-position {
  display: flex; /* Включаем Flexbox */
  flex-direction: column; /* Элементы идут друг за другом (вертикально) */
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}

.info {
}

.game-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
}
.about {
  font-size: 21px;
  font-weight: 700;
  color: #ffffffba;
}

.game-description {
  font-size: 14px;
  color: #b0b0b0c1;
  line-height: 1.6;
}

/* ==================== ПАГИНАЦИЯ (RAWG style) ==================== */
.pagination {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 20px 0;
}

.pagination-btn {
  padding: 8px 20px;
  background: #2a2a2a;
  color: #ffffff;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: #ff4757;
  border-color: #ff4757;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  padding: 8px 16px;
  color: #b0b0b0;
  font-size: 14px;
}

/* ==================== ЗАГРУЗКА ==================== */
.center {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.loading {
  width: 48px;
  height: 48px;
  border: 3px solid #2a2a2a;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== ОШИБКА ==================== */
.error-message {
  grid-column: 1 / -1;
  background: rgba(255, 71, 87, 0.1);
  border-left: 4px solid #ff4757;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  color: #ff6b81;
}

/* ==================== ХЛЕБНЫЕ КРОШКИ (RAWG style) ==================== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 32px 0 32px;
  font-size: 14px;
}

.breadcrumbs-games,
.breadcrumbs-home {
  cursor: pointer;
  color: #b0b0b0;
  transition: color 0.2s;
}

.breadcrumbs-games:hover,
.breadcrumbs-home:hover {
  color: #ff4757;
}

.breadcrumbs-separator {
  color: #4a4a4a;
}

/* ==================== ФИЛЬТР ==================== */
.filters-hidden {
  position: absolute;
  top: 90%;
  left: 0;
  right: 0;
  background: #202020;
  padding: 15px;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 2;
}

.filter-panel {
  position: relative;
  background: #202020;
  color: white;
  border-radius: 12px;
  transition: transform 0.3s ease;
  display: flex;
}

.filter-panel:hover .filters-hidden {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.filter-select {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: #ff4757;
}

.filter-select:focus {
  outline: none;
  border-color: #ff4757;
}

/* ==================== СКРОЛЛБАР (как на RAWG) ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff4757;
}

/* ==================== ШРИФТЫ ==================== */
.jersey-10-regular {
  font-family: "Jersey 10", sans-serif;
  font-weight: 100;
  font-style: normal;
}

.pixelify-sans {
  font-family: "Pixelify Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

/* ==================== АДАПТИВНОСТЬ ==================== */
@media (max-width: 768px) {
  #game-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 16px;
  }

  .search-form {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .search-input {
    min-width: 200px;
  }

  .search-button {
    margin-left: 0;
    padding: 8px;
  }

  .game-title {
    font-size: 24px;
    padding: 20px;
  }

  .game-description {
    padding: 0 20px 24px 20px;
  }

  .breadcrumbs {
    padding: 20px 20px 0 20px;
  }
}

@media (max-width: 480px) {
  #game-list {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-button {
    justify-content: center;
  }

  .suggestion-thumb {
    width: 72px;
    height: 40px;
  }

  .suggestion-title {
    font-size: 14px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* Для очень длинных жанров - перенос на новую строку */
@media (max-width: 300px) {
  .hidden-element .game-meta-dl dt {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hidden-element .game-meta-dl dd {
    text-align: left;
    width: 100%;
  }
}

.montserrat {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 100;
  font-style: normal;
}

/* ==================== Описание проделанной работы ==================== */
