* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  background: linear-gradient(to bottom right, #2e1065, #312e81, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  max-width: 600px;
}

.header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.title {
  font-size: 2.5rem;
  font-weight: bold;
  background: linear-gradient(to right, #d8b4fe, #f9a8d4, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.score {
  color: #c7d2fe;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: rgba(49, 46, 129, 0.5);
  backdrop-filter: blur(4px);
}

@media (min-width: 768px) {
  .card-grid {
    gap: 1.5rem;
  }
}

.card {
  position: relative;
  width: 6rem;
  height: 6rem;
  cursor: pointer;
  perspective: 1000px;
  border-radius: 0.5rem;
  border: 1px solid #4338ca;
  background-color: #1e1b4b;
  transition: all 0.3s;
  transform-style: preserve-3d;
}

.card:hover {
  border-color: #4f46e5;
  background-color: rgba(30, 27, 75, 0.8);
}

@media (min-width: 768px) {
  .card {
    width: 8rem;
    height: 8rem;
  }
}

.card.flipped {
  transform: rotateY(180deg);
  background-color: rgba(49, 46, 129, 0.5);
  border-color: rgba(99, 102, 241, 0.5);
}

.card.matched {
  background-color: rgba(49, 46, 129, 0.5);
  border-color: rgba(129, 140, 248, 0.5);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-front {
  background: linear-gradient(to bottom right, transparent, rgba(99, 102, 241, 0.05), rgba(255, 255, 255, 0.05));
}

.card-back {
  transform: rotateY(180deg);
}

.card.matched .icon {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.reset-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background-color: #1e1b4b;
  color: #c7d2fe;
  border: 1px solid #4338ca;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-button:hover {
  background-color: #312e81;
  border-color: #6366f1;
  color: #e0e7ff;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4c1d95;
  color: #e9d5ff;
  border: 1px solid #7e22ce;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(1rem);
  pointer-events: none;
}

.icon-heart { color: #fb7185; }
.icon-star { color: #fbbf24; }
.icon-sun { color: #facc15; }
.icon-moon { color: #c084fc; }
.icon-cloud { color: #38bdf8; }
.icon-flower { color: #34d399; }