* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.6;
}

/* Шапка сайта */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background-color: #1a1a1a;
  border-bottom: 1px solid #333;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #4caf50;
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav a:hover,
.nav a.active {
  color: #4caf50;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-login {
  padding: 0.5rem 1rem;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
}

.text-decoration-none {
  text-decoration: none;
}

.btn-login:hover {
  background-color: #3e8e41;
}

.avatar {
  width: 40px;
  height: 40px;
  background-color: #333;
  border-radius: 50%;
  overflow: hidden;
  background-image: url('/images/i.jpg'); 
  background-size: cover;
}

/* Баннер */
.banner {
  height: 400px;
  background: linear-gradient(135deg, #1e1e1e 0%, #333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/images/fon.jpg') center/cover no-repeat;
  opacity: 0.2;
}

.banner-content {
  max-width: 800px;
  z-index: 1;
}

.banner h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.banner p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #bbb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary {
  padding: 1rem 2rem;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-primary:hover {
  background-color: #3e8e41;
  transform: translateY(-2px);
}

/* Категории игр */
.categories {
  padding: 3rem 5%;
  background-color: #181818;
}

.categories h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: white;
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.category-card {
  background-color: #252525;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: white;
}

.category-card p {
  color: #aaa;
  font-size: 0.9rem;
}

/* Популярные игры */
.popular-games {
  padding: 3rem 5%;
  background-color: #121212;
}

.popular-games h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: white;
  text-align: center;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.game-card {
  background-color: #252525;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.game-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.game-card h3 {
  padding: 1rem;
  margin: 0;
  font-size: 1.1rem;
  color: white;
}

.rating {
  padding: 0 1rem 1rem;
  color: #4caf50;
  font-weight: 600;
}

.pcat {
  padding: 0 1rem 1rem;
  color: #aaa;
  font-weight: 600;
}

/* Подвал */
.footer {
  background-color: #1a1a1a;
  border-top: 1px solid #333;
  padding: 2rem 5%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.footer .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4caf50;
  margin-bottom: 1rem;
}

.footer p {
  color: #888;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links li {
  display: inline;
}

.footer-links a {
  color: #888;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #4caf50;
}

/* Адаптивность */
@media (max-width: 1200px) {
  .header {
    padding: 1rem 3%;
  }
  
  .banner h1 {
    font-size: 2.5rem;
  }
  
  .banner p {
    font-size: 1.1rem;
  }
}

@media (max-width: 992px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .user-actions {
    width: 100%;
    justify-content: center;
  }
  
  .banner {
    height: 350px;
  }
  
  .banner h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 1rem 2%;
  }
  
  .logo {
    font-size: 1.6rem;
  }
  
  .nav ul {
    gap: 1.5rem;
  }
  
  .banner {
    height: 300px;
  }
  
  .banner h1 {
    font-size: 1.8rem;
  }
  
  .banner p {
    font-size: 1rem;
  }
  
  .btn-primary {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .categories,
  .popular-games {
    padding: 2rem 2%;
  }
  
  .categories h2,
  .popular-games h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  .header {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .logo {
    font-size: 1.4rem;
  }
  
  .nav {
    display: none; /* Можно реализовать мобильное меню через JS */
  }
  
  .user-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .avatar {
    width: 32px;
    height: 32px;
  }
  
  .banner {
    height: 250px;
  }
  
  .banner h1 {
    font-size: 1.5rem;
  }
  
  .banner p {
    font-size: 0.9rem;
  }
  
  .btn-primary {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .category-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }
  
  .category-card,
  .game-card {
    padding: 1.5rem;
  }
  
  .footer-content {
    padding: 0 5%;
  }
  
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
  }
}

/* Дополнительные стили для интерактивности */
.btn-primary:active,
.btn-login:active {
  transform: translateY(0);
  opacity: 0.9;
}

/* Плавное появление элементов */
.category-card,
.game-card {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Стили для состояний */
a:not(.btn-login):not(.btn-primary) {
  position: relative;
}

a:not(.btn-login):not(.btn-primary):after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #4caf50;
  transition: width 0.3s ease;
}

a:not(.btn-login):not(.btn-primary):hover:after {
  width: 100%;
}