/* Base Styles */
body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f7e9d7; /* Warm beige background */
  background-image:url("../img/bg.png"); 
  font-family: 'Roboto';
}
.angpao-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Creates 4 equal-width columns */
  grid-gap: 100px; /* Adds spacing between items */
  margin: 20px auto; /* Centers the grid */
  max-width: 1200px; /* Limits the width of the grid */
}

.angpao-item {
  text-align: center; /* Centers content inside each item */
}
#envlope_parent_9{
    display:none;
}
/* Mobile-specific styles */
@media (max-width: 768px) {
  .angpao-grid {
    grid-template-columns: repeat(2, 1fr); /* Switch to 2 columns for tablets and smaller devices */
    grid-gap: 50px; /* Reduce spacing between items */
    margin: 10px auto; /* Adjust margin for smaller screens */
    max-width: 600px; /* Limit the width for better readability */
  }
  #envlope_parent_9{
    display:grid;
}
  .flip-cover {
  width: 100px!important;
  height: 150px!important;
  margin-left:20%;
}
}

@media (max-width: 480px) {
  .angpao-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile phones */
    grid-gap: 30px; /* Further reduce spacing between items */
    margin: 10px auto; /* Adjust margin for smaller screens */
    max-width: 100%; /* Allow full width on very small screens */
    padding: 0 10px; /* Add padding to prevent content from touching screen edges */
  }
  .flip-cover {
  width: 100px!important;
  height: 150px!important;
  
  margin-left:20%;
}
}
@media (max-width: 480px) {
  .angpao-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Single or two-column layout */
    grid-gap: 10px; /* Minimal spacing for very small screens */
  }

  .angpao-item {
    font-size: 0.8rem; /* Even smaller font size for tiny screens */
  }
}
#welcome-wrapper {
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    pointer-events:auto;
    z-index: 9999999;
}
#congrats-wrapper, #back-wrapper{
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    pointer-events:auto;
    z-index: 9999999;
}
#welcome, #congrats, #back {
    width: 800px;
    max-width: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 30px;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1.75;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.2);
    color: #f0f0f0;
}
.flip-cover {
  position: relative;
  width: 150px;
  height: 200px;
  perspective: 1000px;
  cursor: pointer;
}

.close-cover{
  position: absolute;
  display:none;
  width: 100%;
  height: 30%;
  background-size: 100% 100%;
  background-position: center;
  backface-visibility: hidden; /* Hide the back face during flip */
  transition: transform 0.6s ease-in-out;
}
.close-cover.opened{
  display:block;
z-index: 3;
}
.front-cover,
.back-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
  background-position: center;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  backface-visibility: hidden; /* Hide the back face during flip */
  transition: transform 0.6s ease-in-out;
}
.tumbul-ngab.setuju{
  background-color: #ff9604;
    background-image: linear-gradient(315deg, #fdc24b 0%, #ffa200 74%);
    line-height: 42px;
    padding: 0;
    border: none;
}

.geser{
  margin-right: 100px;
}

.sitik{
  margin-left: 100px;
}

.tumbul-ngab.ngintip{
    background:#181733;
    line-height: 42px;
    padding: 0;
    border: none;
}

.tumbul-ngab{
  width: 100%;
  margin-bottom: 10px;
    height: 40px;
    color: #fff;
    border-radius: 5px;
    padding: 10px 25px;
    font-family: "Lato", sans-serif;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.3sease;
    position: relative;
    display: inline-block;
    box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, 0.5), 7px 7px 20px 0px rgba(0, 0, 0, 0.1), 4px 4px 5px 0px rgba(0, 0, 0, 0.1);
    outline: none;
}
.close-cover {
  background-image: url(../img/tutup.png) !important;
  z-index: 4; /* Ensure it's above other layers */
  transform: translateY(0); /* Initially in place */
}

.front-cover {
  background-image: url(../img/missionary.png);
  transform: rotateY(0deg); /* Initially visible */
}

.back-cover {
  background-image: url(../img/doggy.png);
  transform: rotateY(180deg); /* Initially hidden */
  background-color: rebeccapurple;
}

.gift-cover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  opacity: 0; /* Initially hidden */
  transition: all 0.5s ease-in-out;
  border-radius: 6px;
  box-shadow: 0 2px 26px rgba(0, 0, 0, 0.3);
  z-index: 3;
  background: radial-gradient(ellipse farthest-corner at right bottom, #fedb37 0%, #fdb931 8%, #9f7928 30%, #8a6e2f 40%, transparent 80%), radial-gradient(ellipse farthest-corner at left top, #ffffff 0%, #ffffac 8%, #d1b464 25%, #5d4a1f 62.5%, #5d4a1f 100%);
  transform-origin: bottom center; /* Anchor point for scaling */
}

.gift-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Flip animation */
.flip-cover.flipped .front-cover {
  transform: rotateY(180deg); /* Flip to hide front */
}

.flip-cover.flipped .back-cover {
  transform: rotateY(0deg); /* Flip to show back */
}

/* Close-cover animation */
.flip-cover.opened .close-cover {
animation: closeCoverUp 0.6s forwards;
}

.flip-cover.closed .close-cover {
  animation: closeCoverDown 0.6s forwards;
}

@keyframes closeCoverUp {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%) rotate(0deg) scaleY(-1); 
  }
}

@keyframes closeCoverDown {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(0); /* Move downward */
  }
}

.pull-out {
  animation: pullOut 1s forwards;
}

.pull-in {
  animation: pullin 1s forwards;
}
@keyframes pullOut {
  0% {
    transform: translate(-50%, -50%) scale(1); /* Start inside the angpao */
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -200%) scale(1.2); /* Move upward and slightly enlarge */
  }
}
@keyframes pullin {
  0% {
    transform: translate(-50%, -200%) scale(1.2);
    
  }
  100% {
     transform: translate(-50%, -50%) scale(1); /* Start inside the angpao */
    opacity: 0;
  }
}
/* Trembling animation */
@keyframes tremble {
  0% {
    transform: translateX(0px) translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateX(2px) translateY(-2px) rotate(2deg);
  }
  50% {
    transform: translateX(-2px) translateY(2px) rotate(-2deg);
  }
  75% {
    transform: translateX(1px) translateY(-1px) rotate(2deg);
  }
  100% {
    transform: translateX(0px) translateY(0px) rotate(0deg);
  }
}

.tremble-animation {
  animation: tremble 2s infinite; /* Loop the animation indefinitely */
}

/* Confetti Container */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none; /* Ensure it doesn't block interactions */
  z-index: 10; /* Place above other content */
}

/* Individual Confetti Pieces */
.confetti {
  position: absolute;
  top: -10px; /* Start slightly above the container */
  width: 30px;
  height: 30px;
  background-color: #ff6f61; /* Default color (will be overridden by JS) */
  border-radius: 50%; /* Circular shape */
  opacity: 1;
}

/* Slow Animation */
.confetti--animation-slow {
  animation: confetti-slow 3s linear infinite;
}

/* Medium Animation */
.confetti--animation-medium {
  animation: confetti-medium 2s linear infinite;
}

/* Fast Animation */
.confetti--animation-fast {
  animation: confetti-fast 1.5s linear infinite;
}

/* Keyframes for Slow Animation */
@keyframes confetti-slow {
  0% {
    transform: translate3d(0, 0, 0) rotateX(0) rotateY(0);
  }
  100% {
    transform: translate3d(25px, 105vh, 0) rotateX(360deg) rotateY(180deg);
  }
}

/* Keyframes for Medium Animation */
@keyframes confetti-medium {
  0% {
    transform: translate3d(0, 0, 0) rotateX(0) rotateY(0);
  }
  100% {
    transform: translate3d(100px, 105vh, 0) rotateX(100deg) rotateY(360deg);
  }
}

/* Keyframes for Fast Animation */
@keyframes confetti-fast {
  0% {
    transform: translate3d(0, 0, 0) rotateX(0) rotateY(0);
  }
  100% {
    transform: translate3d(-50px, 105vh, 0) rotateX(10deg) rotateY(250deg);
  }
}

.daleman{
    width:800px;
    max-width: 100%;
    position: absolute;
    bottom: 10%;
    left: 50%;
    padding: 30px;
    transform: translate(-50%,-50%);
    -webkit-transform: translate(-50%,-50%);
    -moz-transform: translate(-50%,-50%);
    text-align: center;
    line-height: 1.75;
    letter-spacing: 1px;
    background: #333;
    color: #f0f0f0;
}

#rand{
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    margin:0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    pointer-events:auto;
    z-index: 9999999;
}