h1 { color: #00bcd4; }

.diff-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.diff-btn {
  background: #ffffff14;
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.2s;
}
.diff-btn.active { background: #00bcd4; color: #000; }

.grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.card {
  cursor: pointer;
  perspective: 600px;
  width: 82px;
  height: 82px;
}
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s;
}
.card.flipped .card-inner,
.card.matched .card-inner { transform: rotateY(180deg); }

.front, .back-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}
.front {
  background: linear-gradient(135deg, #1a1a38, #0d0d22);
  border: 2px solid #ffffff0a;
}
.front::after { content: '?'; font-size: 2rem; color: #ffffff22; }
.back-face {
  background: linear-gradient(135deg, #006064, #00838f);
  border: 2px solid #00bcd4;
  transform: rotateY(180deg);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}
.card.matched .back-face {
  background: linear-gradient(135deg, #00695c, #00897b);
  box-shadow: 0 0 14px #00bcd466;
}
.card:not(.flipped):not(.matched):hover .card-inner { transform: rotateY(10deg); }

.win-msg {
  margin-top: 14px;
  font-size: 1.3rem;
  color: #00bcd4;
  display: none;
  text-align: center;
}

button.new { background: #00bcd4; color: #000; margin-top: 12px; }
button.new:hover { background: #26c6da; }

@media (max-width: 480px) {
  .card { width: 64px; height: 64px; }
  .back-face { font-size: 1.5rem; }
  .grid { gap: 8px; }
}

@media (max-width: 340px) {
  .card { width: 54px; height: 54px; }
}
