* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.background {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 550px;
  height: 100%;
}

.background img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.main-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 550px;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.logo {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
}

.logo img {
  width: 100%;
}

.screen {
  position: absolute;
  top: 53%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fruit grid */
.icon-grid {
  position: absolute;
  top: 73.3%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 94%;
  aspect-ratio: 3/2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  z-index: 1;
}

.icon-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.icon-grid img:nth-child(1) {
  margin-top: 100px;
}
.icon-grid img:nth-child(2) {
  margin-top: 100px;
}
.icon-grid img:nth-child(3) {
  margin-top: 100px;
}
.icon-grid img:nth-child(4) {
  margin-bottom: 100px;
}
.icon-grid img:nth-child(5) {
  margin-bottom: 100px;
}
.icon-grid img:nth-child(6) {
  margin-bottom: 100px;
}
.icon-grid img.revealed {
  opacity: 1;
  transform: scale(1.05);
}

/* Overlay */
.overlay-grid {
  position: absolute;
  top: 73.3%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 94%;
  aspect-ratio: 3/2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  z-index: 2;
  gap: 8px;
}

.overlay-square {
  background: #C0C0C0;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.overlay-square.revealed {
  opacity: 0;
  pointer-events: none;
}

/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  display: none;
}

.popup-content {
  text-align: center;
}
.popup-content img {
  max-width: 45%;
  margin: -200px auto;
  display: block;
}

.try-again {
  cursor: pointer;
  transition: transform 0.2s;
}

.try-again:hover {
  transform: scale(1.05);
}

.try-again:active {
  transform: scale(0.95);
}

/* Responsive Design for Mobile Devices (768px and below) */
@media (max-width: 768px) {
  .background {
    width: 100%;
    height: 100%;
  }
  
  .main-content {
    width: 100%;
    height: 100vh;
  }
  
  .logo {
    width: 60%;
    top: 15%;
  }
  
  .screen {
    width: 90%;
    max-width: 400px;
    top: 50%;
  }
  
  .icon-grid {
    width: 90%;
    top: 70%;
  }
  
  .overlay-grid {
    width: 90%;
    top: 70%;
    gap: 6px;
  }
  
  .overlay-square {
    border-radius: 6px;
  }
  
  .icon-grid img:nth-child(1),
  .icon-grid img:nth-child(2),
  .icon-grid img:nth-child(3) {
    margin-top: 80px;
  }
  
  .icon-grid img:nth-child(4),
  .icon-grid img:nth-child(5),
  .icon-grid img:nth-child(6) {
    margin-bottom: 80px;
  }
  
  .popup-content img {
    max-width: 60%;
    margin: 5px auto;
  }
}

/* Responsive Design for Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
  .logo {
    width: 50%;
    top: 15%;
  }
  
  .screen {
    width: 95%;
    max-width: 350px;
    top: 48%;
  }
  
  .icon-grid {
    width: 95%;
    top: 68%;
  }
  
  .overlay-grid {
    width: 94%;
    top: 73%;
    gap: 4px;
  }
  
  .overlay-square {
    border-radius: 4px;
  }
  
  .icon-grid img:nth-child(1),
  .icon-grid img:nth-child(2),
  .icon-grid img:nth-child(3) {
    margin-top: 70px;
  }
  
  .icon-grid img:nth-child(4),
  .icon-grid img:nth-child(5),
  .icon-grid img:nth-child(6) {
    margin-bottom: 50px;
  }
  
  .popup-content img {
    max-width: 95%;
    margin: -200px auto;
  }
}