.color-match-grid {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 640px;
  margin: 16px 0;
}

.color-match-card {
  aspect-ratio: 1 / 1;
  min-width: 80px;
  min-height: 80px;
  perspective: 600px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.color-match-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.35s ease;
  transform-style: preserve-3d;
}

.color-match-card.flipped .color-match-card-inner,
.color-match-card.matched .color-match-card-inner {
  transform: rotateY(180deg);
}

.color-match-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  backface-visibility: hidden;
  border: 3px solid var(--color-accent);
}

.color-match-face-back {
  background: var(--color-button);
  font-size: 32px;
}

.color-match-face-front {
  background: var(--color-bg-panel);
  transform: rotateY(180deg);
  font-size: 40px;
}

.color-match-card.matched .color-match-face-front {
  opacity: 0.5;
}
