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

:root {
  --bg-color: #242d2b;
  --second-bg-color: #0b201b;
  --text-color: #ededed;
  --main-color: #a7c080;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    135deg,
    var(--bg-color) 0%,
    var(--second-bg-color) 50%,
    var(--bg-color) 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.floating-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(167, 192, 128, 0.15);
  animation: float 20s infinite linear;
}

.shape:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 80%;
  animation-delay: -5s;
}

.shape:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translateY(0px) rotate(360deg);
    opacity: 0.7;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeInUp 1s ease-out;
}

.title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  background: linear-gradient(
    45deg,
    var(--text-color),
    var(--main-color),
    var(--text-color)
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShine 3s ease-in-out infinite;
  margin-bottom: 20px;
  text-shadow: 0 0 30px rgba(167, 192, 128, 0.3);
}

@keyframes titleShine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.game-card {
  background: rgba(167, 192, 128, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid rgba(167, 192, 128, 0.2);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 1s ease-out;
  animation-fill-mode: both;
}

.game-card:nth-child(1) {
  animation-delay: 0.1s;
}
.game-card:nth-child(2) {
  animation-delay: 0.2s;
}
.game-card:nth-child(3) {
  animation-delay: 0.3s;
}
.game-card:nth-child(4) {
  animation-delay: 0.4s;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 192, 128, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.game-card:hover::before {
  left: 100%;
}

.game-card:hover {
  transform: translateY(-10px) scale(1.02);
  background: rgba(167, 192, 128, 0.15);
  border-color: var(--main-color);
  box-shadow: 0 20px 40px rgba(11, 32, 27, 0.4);
}

.game-preview {
  width: 50%;
  left: 50%;
  translate: -50% 0;
  aspect-ratio: 1;
  background: linear-gradient(
    135deg,
    var(--main-color),
    var(--second-bg-color)
  );
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-color);
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(11, 32, 27, 0.5);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.game-preview::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(167, 192, 128, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.game-card:hover .game-preview::after {
  opacity: 1;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  transition: transform 0.3s ease;
}

.preview-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: var(--text-color);
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(11, 32, 27, 0.5);
  display: none;
}

.game-preview.game1 {
  background: linear-gradient(135deg, var(--main-color), #8fb574);
}
.game-preview.game2 {
  background: linear-gradient(135deg, #8fb574, var(--second-bg-color));
}
.game-preview.game3 {
  background: linear-gradient(
    135deg,
    var(--second-bg-color),
    var(--main-color)
  );
}
.game-preview.game4 {
  background: linear-gradient(135deg, var(--main-color), var(--bg-color));
}

.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 10px;
  text-align: center;
}

.play-button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(45deg, var(--main-color), #8fb574);
  color: var(--bg-color);
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.play-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #8fb574, var(--main-color));
  transition: left 0.3s ease;
  z-index: -1;
}

.play-button:hover::before {
  left: 0;
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(11, 32, 27, 0.3);
}

.play-button:active {
  transform: translateY(0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sparkleAnim {
  0% {
    opacity: 1;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(360deg);
  }
}

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

  .container {
    padding: 20px 15px;
  }

  .game-card {
    padding: 20px;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(167, 192, 128, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(167, 192, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(167, 192, 128, 0);
  }
}