/* Основные стили для игрового портала */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "DM Sans", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1f2937;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Заголовок */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo h1 {
  color: #0891b2;
  font-size: 1.5rem;
  font-weight: 700;
}

.search-box {
  flex: 1;
  max-width: 400px;
  margin: 0 2rem;
}

.search-box form {
  display: flex;
  background: white;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  font-size: 0.9rem;
}

.search-box button {
  padding: 0.75rem 1rem;
  background: #0891b2;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.search-box button:hover {
  background: #0e7490;
}

.admin-link {
  color: #0891b2;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid #0891b2;
  border-radius: 20px;
  transition: all 0.3s;
}

.admin-link:hover {
  background: #0891b2;
  color: white;
}

/* Основной контейнер - расширен для лучшего использования пространства */
.main-container {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  max-width: 1600px; /* увеличена максимальная ширина */
  margin: 0 auto;
}

/* Левая панель */
.sidebar-left {
  width: 250px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.categories h3 {
  color: #1f2937;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.category-list {
  list-style: none;
}

.category-list li {
  margin-bottom: 0.5rem;
}

.category-list a {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: #4b5563;
  border-radius: 8px;
  transition: all 0.3s;
  font-weight: 500;
}

.category-list a:hover,
.category-list .active a {
  background: #0891b2;
  color: white;
  transform: translateX(4px);
}

.category-list .icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.category-list .count {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.category-list .active .count {
  background: rgba(255, 255, 255, 0.2);
}

/* Центральная область - расширена */
.content-center {
  flex: 1;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 600px;
}

.games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.games-header h2 {
  color: #1f2937;
  font-size: 1.5rem;
}

.games-count {
  color: #6b7280;
  font-size: 0.9rem;
}

/* обновлена сетка игр для отображения 4 игр в ряд */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.games-grid-four {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* адаптивность для 4 игр в ряд */
@media (max-width: 1400px) {
  .games-grid-four {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .games-grid-four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .games-grid-four {
    grid-template-columns: 1fr;
  }
}

.game-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game-image {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.new {
  background: #10b981;
  color: white;
}

.badge.popular {
  background: #f59e0b;
  color: white;
}

.game-info {
  padding: 1rem;
}

.game-info h3 {
  color: #1f2937;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.game-info p {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.game-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag {
  background: #f3f4f6;
  color: #4b5563;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
}

/* Правая панель */
.sidebar-right {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ad-block,
.stats-block {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
}

.ad-block h4,
.stats-block h4 {
  color: #1f2937;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.stat-label {
  color: #6b7280;
}

.stat-value {
  color: #1f2937;
  font-weight: 600;
}

/* Модальное окно - увеличено до практически полного экрана */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  background-color: white;
  margin: 1% auto;
  border-radius: 12px;
  width: 98%;
  max-width: none;
  height: 98%;
  overflow: hidden;
}

/* добавлен класс для полноэкранного режима игр */
.game-modal-fullscreen {
  width: 98vw !important;
  height: 98vh !important;
  margin: 1vh auto !important;
  max-width: none !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  height: 60px;
}

.modal-header h3 {
  color: #1f2937;
  font-size: 1.2rem;
}

.close {
  color: #6b7280;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
  padding: 0.5rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
}

.close:hover {
  color: #1f2937;
  background: rgba(0, 0, 0, 0.2);
}

.modal-body {
  height: calc(100% - 60px);
  padding: 0;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.no-games {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

/* Уведомление об ошибке */
.error-notice {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 1rem;
  margin: 1rem;
  border-radius: 8px;
  text-align: center;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar-left,
  .sidebar-right {
    width: 100%;
    position: static;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .search-box {
    margin: 0;
    max-width: 100%;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .modal-content,
  .game-modal-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}
