:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --background-color: #f5f6fa;
  --text-color: #2c3e50;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --tab-active-color: #2980b9;
  --tab-hover-color: #3498db;
  --gradient-start: #3498db;
  --gradient-end: #2c3e50;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  text-align: center;
  padding: 3rem 0;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.1)"/></svg>')
    repeat;
  opacity: 0.1;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
  position: relative;
}

.tabs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  flex: 1;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
  justify-content: center;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn {
  padding: 0.8rem 1.2rem;
  background-color: white;
  border: 2px solid var(--secondary-color);
  border-radius: 6px;
  color: var(--secondary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  background-color: var(--tab-hover-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
  background-color: var(--tab-active-color);
  color: white;
  border-color: var(--tab-active-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.games-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding: 0.5rem;
}

.game-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  position: relative;
}

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

.game-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover .game-image {
  transform: scale(1.05);
}

.game-info {
  padding: 0.8rem;
  position: relative;
}

.game-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-description {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #777;
  margin-bottom: 0.5rem;
  padding-top: 0.3rem;
  border-top: 1px solid #eee;
}

.play-button {
  display: inline-block;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.no-games {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.1)"/></svg>')
    repeat;
  opacity: 0.1;
}

footer p {
  position: relative;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.footer-section {
  color: white;
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  position: relative;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 50px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
}

.footer-section p {
  opacity: 0.9;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: white;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.footer-section ul li a:hover {
  opacity: 1;
}

.copyright {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.8;
}

.special-games-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.special-game-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.special-game-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.special-game-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.special-game-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: white;
}

.special-game-description {
  font-size: 0.8rem;
  opacity: 0.9;
  line-height: 1.4;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }

  .tabs {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }

  .tab-btn {
    width: 100%;
    max-width: 250px;
    margin-bottom: 0.5rem;
  }

  .games-container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.8rem;
  }

  .game-image {
    height: 120px;
  }

  .game-info {
    padding: 0.6rem;
  }

  .game-title {
    font-size: 0.9rem;
  }

  .game-description {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }

  .play-button {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

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

@media (min-width: 1200px) {
  .games-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Loading Animation */
@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.loading {
  animation: pulse 1.5s infinite;
  text-align: center;
  padding: 2rem;
  color: var(--secondary-color);
  font-size: 1.2rem;
}

/* Game Rating Stars */
.rating {
  color: var(--warning-color);
  font-size: 0.9rem;
}

.rating::before {
  content: "★";
  margin-right: 0.2rem;
}

/* Game Plays Counter */
.plays {
  color: var(--success-color);
  font-weight: 600;
}

.main-nav {
  margin: 1.5rem 0;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.main-nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  opacity: 0.9;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.main-nav a.active {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

@media (max-width: 768px) {
  .main-nav ul {
    flex-direction: column;
    align-items: center;
  }

  .main-nav a {
    width: 100%;
    text-align: center;
    max-width: 250px;
  }
}
