* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: 'Press Start 2P', cursive;
  background: linear-gradient(135deg, #0f0f23 0%, #1a0033 50%, #0f0f23 100%);
  background-attachment: fixed;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

h1 {
  margin-bottom: 20px;
  color: #ffeb3b;
  text-shadow: 3px 3px 0 #ff6f00, 6px 6px 0 #e65100;
  font-size: 2rem;
  text-align: center;
  letter-spacing: 4px;
}

h2 {
  margin-bottom: 30px;
  color: #00e676;
  text-shadow: 2px 2px 0 #00c853;
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 2px;
}

.game-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 15px;
  width: 100%;
  max-width: 500px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 2px solid #ffeb3b;
  box-shadow: 
    0 0 20px rgba(255, 235, 59, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.card {
  perspective: 1000px;
  cursor: pointer;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 5px #ffeb3b);
  }
  to {
    filter: drop-shadow(0 0 10px #ffeb3b);
  }
}

.card-inner {
  position: relative;
  width: 100%;
  padding-top: 100%; 
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 3px solid #ffeb3b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  backface-visibility: hidden;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.card-front {
  background: linear-gradient(145deg, #ff6f00, #ff8f00);
  color: #000;
  font-weight: bold;
  text-shadow: none;
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
}

.card-back {
  background: linear-gradient(145deg, #00e676, #00c853);
  transform: rotateY(180deg);
  color: #000;
  font-size: 2rem;
}


@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 0.7rem;
  }
  
  .game-container {
    gap: 10px;
    max-width: 100%;
  }
  
  .card-front,
  .card-back {
    font-size: 2rem;
  }
}