.background {
  background-color: #dceff3; /* Light desaturated cyan-blue */
}

.board {
  position: relative;
  margin: 50px auto;
  image-rendering: pixelated;
  min-height: 600px;
  display: flex;
  flex-wrap: wrap;
  background-color: #dceff3; /* Light desaturated cyan-blue */
  justify-content: center;
}

.card {
  position: absolute;
  width: 160px;
  height: 160px;
  background: #89b5ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  /* Minecraft-style border using box-shadow */
  box-shadow: inset -4px -4px 0 0 #393939, inset 4px 4px 0 0 #fff;
  border: 4px solid #585858;
  image-rendering: pixelated;
  font-family: "Courier New", monospace;
  font-size: 22px;
  transform: rotate(var(--rotation));
  transition: transform 0.2s ease;
  text-shadow: 2px 2px #000;
  color: white;
  padding: 5px;
  text-align: center;
  font-size: 16px;
  line-height: 1.3;
  box-sizing: border-box;
  position: absolute;
  transform-origin: center center;
  margin: 10px;
  min-width: 160px;
  min-height: 160px;
  /* position: relative; */
  overflow: hidden;
}

.card img {
  width: calc(
    100% - 0px
  ) !important; /* Adjust image size to account for padding */
  height: calc(100% - 0px) !important;
  object-fit: contain !important;
  margin: 10px;
}

.card img,
.card .content {
  position: relative;
  z-index: 1;
}

.card:hover {
  transform: rotate(0deg) scale(1.1);
  z-index: 10;
  box-shadow: inset -4px -4px 0 0 #393939, inset 4px 4px 0 0 #fff,
    0 0 10px rgba(0, 0, 0, 0.5);
}

.card.revealed {
  background: #4a7b52;
  box-shadow: inset -4px -4px 0 0 #2d4a32, inset 4px 4px 0 0 #7fb884;
}

.card.matched {
  background: #4a7b52;
  box-shadow: inset -4px -4px 0 0 #2d4a32, inset 4px 4px 0 0 #7fb884,
    0 0 15px rgba(74, 123, 82, 0.5);
  transform: rotate(0deg);
  cursor: default;
}

.card.matched:hover {
  transform: rotate(0deg) scale(1);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("./assets/images/logo.png"); /* Add your logo image path here */
  background-size: 80% 80%;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #7a7a7a;
}

.card.revealed::before {
  display: none;
}

@keyframes pop {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.5) translateY(-20px);
    opacity: 0.7;
  }
  100% {
    transform: scale(2) translateY(-40px);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .board {
    margin: 20px auto;
  }

  .card {
    margin: 5px;
  }
}

.match-sprite {
  position: absolute;
  font-size: 2rem;
  pointer-events: none;
  animation: pop 0.8s ease-out forwards;
  image-rendering: pixelated;
  text-shadow: 2px 2px #000;
  z-index: 100;
}

.xp-orb {
  color: #7fff00;
  font-size: 24px;
  font-family: "Courier New", monospace;
  text-shadow: 2px 2px 0 #006400, -2px -2px 0 #98fb98;
}

.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.zoom-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.zoomed-content {
  max-width: 80vw;
  max-height: 80vh;
  background: #4a7b52;
  padding: 20px;
  box-shadow: inset -8px -8px 0 0 #393939, inset 8px 8px 0 0 #fff;
  border: 8px solid #585858;
  image-rendering: pixelated;
  font-family: "Courier New", monospace;
  color: white;
  text-shadow: 2px 2px #000;
  font-size: 2rem;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  font-weight: bold;
}

.zoom-overlay.active .zoomed-content {
  transform: scale(0.8);
}

.zoomed-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.win-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.win-overlay.active {
  opacity: 1;
}

.win-message {
  background: #4a7b52;
  padding: 30px 50px;
  font-size: 2.5rem;
  color: white;
  text-shadow: 2px 2px #000;
  font-family: "Courier New", monospace;
  font-weight: bold;
  box-shadow: inset -8px -8px 0 0 #2d4a32, inset 8px 8px 0 0 #7fb884;
  border: 8px solid #585858;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  text-align: center;
}

.win-overlay.active .win-message {
  transform: scale(1);
}

.firework {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: firework 1s infinite;
  animation-delay: var(--delay);
  left: var(--x);
  top: 50%;
}

@keyframes firework {
  0% {
    transform: translateY(0);
    background: yellow;
    box-shadow: 0 0 20px yellow;
  }
  50% {
    transform: translateY(-100px) scale(1.5);
    background: #ff4400;
    box-shadow: 0 0 40px #ff4400;
  }
  100% {
    transform: translateY(-150px) scale(0.1);
    background: #ff8800;
    box-shadow: 0 0 0 #ff8800;
    opacity: 0;
  }
}

/* Add different colors for fireworks */
.firework:nth-child(2n) {
  background: #ff4400;
}
.firework:nth-child(3n) {
  background: #00ff44;
}
.firework:nth-child(4n) {
  background: #4400ff;
}

.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* slightly lighter backdrop */
  backdrop-filter: blur(4px); /* Optional blur */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 1;
  transition: opacity 1s ease; /* slower transition */
}

.welcome-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.welcome-box {
  background: #4a7b52;
  padding: 40px;
  border: 8px solid #585858;
  box-shadow: inset -8px -8px 0 0 #2d4a32, inset 8px 8px 0 0 #7fb884;
  font-family: "Courier New", monospace;
  color: white;
  text-align: left;
  font-weight: 500;
  max-width: 600px;
  max-height: 600px;
  font-size: 1.3rem;
  text-shadow: 2px 2px #000;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers contents horizontally */
  justify-content: center; /* Centers contents vertically */
}

.welcome-box h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.welcome-box button {
  margin-top: 20px;
  padding: 12px 24px;
  font-size: 1.3rem;
  font-family: "Courier New", monospace;
  background: #7fb884;
  border: 4px solid #393939;
  box-shadow: inset -2px -2px 0 0 #2d4a32, inset 2px 2px 0 0 #fff;
  color: #000;
  cursor: pointer;
  transition: transform 0.2s ease;
  font-weight: bold;
  text-transform: uppercase;
}

.welcome-box button:hover {
  transform: scale(1.05);
}
