/* ===================================
   GLOBAL STYLES & RESET
   =================================== */
@import url("https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

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

:root {
  --primary-color: #b31b48;
  --secondary-color: #20a988;
  --accent-color: #f8973e;
  --dark-bg: #1a1a2e;
  --card-bg: #614492;
  --text-light: #eee;
  --text-accent: #f1f1f1;
  --border-color: #b55199;
  --shadow: rgba(0, 0, 0, 0.5);
}

body {
  font-family: "Barlow", cursive;
  background: linear-gradient(135deg, #1a1a2e 0%, #614492 50%, #b55199 100%);
  background-attachment: fixed;
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  width: 100%;
}

/* Animated background effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 2px,
    rgba(255, 255, 255, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ===================================
   CONTAINER & LAYOUT
   =================================== */

.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ===================================
   HEADER
   =================================== */

.header {
  text-align: center;
  padding: 40px 20px;
  animation: fadeInDown 1s ease-out;
}

.title {
  font-size: clamp(1.5rem, 3vw, 3.5vw);
  color: #fff;
  text-shadow: 4px 4px 0px var(--secondary-color), 8px 8px 0px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
  letter-spacing: 2px;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 4px 4px 0px var(--secondary-color), 8px 8px 0px rgba(0, 0, 0, 0.2);
  }
  to {
    text-shadow: 4px 4px 0px var(--secondary-color), 8px 8px 0px rgba(0, 0, 0, 0.2),
      0 0 20px #24bfd0, 0 0 40px #24bfd0;
  }
}

.subtitle {
  font-size: clamp(0.7rem, 2vw, 1rem);
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* ===================================
   GAMES GRID
   =================================== */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  padding: 0 20px 40px 20px;
  flex: 1;
  align-items: center;
  animation: fadeIn 1s ease-out 0.3s backwards;
}

/* ===================================
   GAME CARDS
   =================================== */

.game-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 4px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  height: 350px;
}

.game-card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color),
    var(--accent-color)
  );
  border-radius: 8px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.3);
}

.game-card:hover::before {
  opacity: 0.3;
}

.game-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 2s ease-in-out infinite;
}

.game-card:nth-child(2) .game-icon {
  animation-delay: 0.5s;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.game-title {
  font-size: 26px;
  color: var(--secondary-color);
  margin-bottom: 20px;
  line-height: 1.4;
}

.game-description {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 25px;
  line-height: 1.8;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================
   GAME FEATURES
   =================================== */

.game-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.feature {
  font-size: clamp(0.4rem, 1.2vw, 0.6rem);
  color: var(--accent-color);
  background: rgba(255, 230, 109, 0.1);
  padding: 8px 12px;
  border-radius: 4px;
  border: 2px solid rgba(255, 230, 109, 0.3);
}

/* ===================================
   PLAY BUTTON
   =================================== */

.play-button {
  width: 100%;
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 8px;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--primary-color);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.play-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.play-button:hover::before {
  width: 300px;
  height: 300px;
}

.play-button:hover {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
  transform: scale(1.05);
}

.play-button:active {
  transform: scale(0.98);
}

.button-text {
  position: relative;
  z-index: 1;
  font-size: 18px;
}

/* ===================================
   FOOTER
   =================================== */

.footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 2px solid var(--border-color);
  margin-top: 40px;
  animation: fadeIn 1s ease-out 0.6s backwards;
}

.footer-text {
  font-size: clamp(0.4rem, 1.2vw, 0.6rem);
  color: var(--text-light);
  opacity: 0.7;
}

/* ===================================
   ANIMATIONS
   =================================== */

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

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

/* ===================================
   ACCESSIBILITY
   =================================== */

.play-button:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Jessie */
.jessie-img-dtp {
  display: block;
  image-rendering: pixelated;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 15%;
  max-width: 150px;
  z-index: 10;
}

.jessie-img-mbl {
  display: none;
}
/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
  .container {
    padding: 10px;
    min-height: auto;
  }

  .header {
    padding: 30px 10px;
    margin-bottom: 50px;
  }

  .games-grid {
    position: relative;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 10px;
  }

  .game-card {
    padding: 25px 20px;
    overflow: visible;
    height: auto;
  }

  .game-description {
    min-height: auto;
  }

  .title {
    letter-spacing: 1px;
  }

  .subtitle {
    letter-spacing: 2px;
  }

  /* Jessie */
  .jessie-img-mbl {
    display: block;
    image-rendering: pixelated;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    max-width: 120px;
  }

  .jessie-img-dtp {
    display: none;
  }
}

@media (max-width: 480px) {
  .game-icon {
    font-size: 3rem;
  }

  .play-button {
    padding: 12px 24px;
    width: 100%;
  }

  .feature {
    font-size: 0.5rem;
  }
}
