/* Memory Game CSS for WordPress */

/* SVG and container styling */
.cardBackSvgs {
  color: #E7E9E0 !important;
}

#memory-game-container {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  margin: 0 auto;
}

/* 3D Card styling - Critical for card flip effect */
.preserve-3d {
  transform-style: preserve-3d !important;
}

.rotate-y-180 {
  transform: rotateY(180deg) !important;
}

.backface-hidden {
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
}

/* Card container and 3D perspective */
.aspect-w-1 {
  position: relative;
  padding-bottom: 104%;
  perspective: 1000px !important;
  margin-bottom: 15px;
}

.card-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d !important;
  transition: transform 0.5s;
}

/* Card faces */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  background-color: transparent !important;
}

.card-front {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E7E9E0;
}

.card-back {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

/* Animations */
.jump-animation {
  animation: jump 0.5s ease-in-out;
}

.flip-back-animation {
  animation: flipBack 0.5s ease-in-out;
}

@keyframes jump {
  0% { transform: translateY(0) rotateY(180deg); }
  50% { transform: translateY(-20px) rotateY(180deg); }
  100% { transform: translateY(0) rotateY(180deg); }
}

@keyframes flipBack {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

/* Memory game layout */
.memory-game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  margin: 0 auto;
  padding: 1rem;
}

.memory-game-board {
  max-height: calc(100vh - 30px);
  width: 100%;
  margin: auto;
}

.memory-game-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.memory-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 650px;
  width: 100%;
  margin: 0 auto;
}

.memory-game-card {
  position: relative;
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.w-full { width: 100%; text-align:center; }
.h-full { height: 100%; }
.max-w-xl { max-width: 36rem; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-4 { padding: 1rem; }
.p-1 { padding: 0.25rem; }

.card-front .w-full:before {
  content: '';
  display: inline-block;
  vertical-align: middle;
  margin-left: -0.27em;
  height: 100%;
}

.card-front svg {
    vertical-align: middle;
    max-width: 100%;
    display: inline-block;
    max-height: 100%;
}

/* Typography */
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.font-bold { font-weight: 700; }
.mb-4 { margin-bottom: 1rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; color: #E7E9E0; }

/* Grid */
.grid { display: grid; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }

/* Card styling */
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.rounded-md { border-radius: 0.375rem; }
.transform { transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1); }
.transform-gpu { transform: translate3d(0, 0, 0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1); }
.transition-transform { transition-property: transform; }
.duration-500 { transition-duration: 500ms; }
.cursor-pointer { cursor: pointer; }