@import url('https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&display=swap');

* {
    font-family: "Mochiy Pop One";
}

html {
    overflow: hidden;
}

/* General body styling */
body {
	background-color: #272326;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
    overflow: hidden;
}

/* Birthday card styling */
.birthday-card{
    width: 100vw;
    max-width: 600px;
    max-height: 500px;
	position: relative;
	transition-duration: 1s;
	perspective: 1500;
}

/* Making input styling none in general */
input[type="checkbox"] {
    display: none;
}

/* Styling for the front and back cover */
.cover {
	background-color: #FFF;
	width: 100%;
	height: 100%;
	border-radius: 0 10px 10px 0;
	box-shadow: 10px 0 20px rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transform-origin: center left;
}

.back-cover {
    background-color: #FFF;
	width: 600px;
	height: 500px;
	border-radius: 0 10px 10px 0;
	box-shadow: 10px 0 20px rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transform-origin: center left;

}

/* Positioning for the cover */
.cover {
	position: absolute;
	z-index: 4;
	transition: transform 1s;
}

/* Styling for the cover labels */
.cover label {
	width: 100%;
	height: 100%;
	cursor: pointer;
}

/* Positioning for the back cover */
.back-cover {
	position: relative;
	z-index: -1;
}

/* Styling for the page */
.page {
	position: absolute;
	width: 330px;
	height: 430px;
	margin-top: 10px;
	transform-origin: left;
	transform-style: preserve-3d;
	transform: rotateY(0deg);
	transition-duration: 1.5s;
}

/* Page image styling */
.page img {
	width: 100%;
	height: 100%;
	border-radius: 15px 0 0 15px;
}

/* Front page styling */
.front-page {
	position: absolute;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
}

/* Back page styling */
.back-page {
	transform: rotateY(180deg);
	position: absolute;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	z-index: 99;
}

/* Clicking for next and previous */
.next, .prev {
	position: absolute;
	cursor: pointer;
}


/* Checked flipping */
#checkbox-cover:checked ~ .birthday-card {
	transform: translateX(200px);
}
#checkbox-cover:checked ~ .birthday-card .cover {
	transition: transform 1.5s, z-index 0.5s 0.5s;
	transform: rotateY(-180deg);
	z-index: 1;
}
#checkbox-page1:checked ~ .birthday-card #page1 {
	transform: rotateY(-180deg);
	z-index: 2;
}


/* Cover image styling */
.cover img {
    width: 600px;
    height: 500px;
    object-fit: cover;
    border-radius: 0 10px 10px 0;
    display: block;
}

/* Front image */
.front-page img {
    width: 600px;
    height: 490px;
}

/* Text styling to show gift */
.show-gift {
    position: absolute;
    bottom: -54px;
    left: 8%;
    width: 220px;
    color: rgba(254, 89, 194, 1);
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    transition: background-color 0.3s;
}

/* Text show gift hover effect */
.show-gift:hover {
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

/* Birthday gift part */
.birthday-gift-wrapper {
    display: none;
    position: absolute;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Displaying the birthday gift */
#show-gift:checked ~ .birthday-gift-wrapper {
    display: block;
}

/* Birthday gift positioning */
.birthday-gift {
    position: relative;
}

/* Birthday gift before opening */
.birthday-gift:before {
    content: "";
    position: absolute;
    width: 170px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    top: 90px;
    left: -10px;
}

/* Gift styling */
.gift {
    position: relative;
    width: 150px;
    height: 100px;
    background-color: #000080;
}

/* Gift styling before opening */
.gift:before {
    content: "";
    position: absolute;
    width: 25px;
    height: 100px;
    background-color: #301934;
    left: 62px;
}

/* Gift styling after opening */
.gift:after {
    content: "";
    position: absolute;
    box-shadow: inset 0 10px rgba(0, 0, 0, 0.3);
    width: 150px;
    height: 100px;
}

.click {
    position: absolute;
    background-color: #000080;
    width: 170px;
    height: 40px;
    top: -40px;
    left: -10px;
    transform-origin: bottom left;
    transition: 0.3s;
    cursor: pointer;
}

/* Styling to open the gift */
.click:before {
    content: "";
    position: absolute;
    width: 25px;
    height: 40px;
    background-color: #301934;
    left: 69px;
}
.click:after {
    content: "";
    position: absolute;
    width: 5px;
    height: 0;
    border-bottom: 30px solid #000080;
    border-top: 30px solid #000080;
    border-left: 0px solid transparent;
    border-right: 30px solid transparent;
    transform: rotate(-90deg);
    left: 65px;
    top: -47px;
}
#click:checked + .click {
    transform: rotate(-110deg) scaleX(0.85);
}


/* Change display after clicking on click */
#click:checked ~ .sparkles {
    display: block;
}


/* Sparkles styling */
.sparkles {
    position: absolute;
    display: none;
    top: -15px;
    z-index: -2;
    left: 40px;
}

.spark1, .spark2, .spark3, .spark4, .spark5, .spark6 {
    position: absolute;
    background-color: #301934;
    border-radius: 50%;
    top: -9px;
    z-index: -1;
}

.spark1 {
    width: 8px;
    height: 8px;
    left: 30px;
    top: -9px;
    animation: fire 0.9s ease-in-out infinite, color 0.4s linear infinite;
}

.spark1:before {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    top: 8px;
    left: 11px;
    background-color: #301934;
    border-radius: 50%;
}

.spark2 {
    width: 9px;
    height: 9px;
    left: 33px;
    top: -5px;
    animation: fire2 0.28s ease-in-out infinite, color 0.4s linear infinite;
}

.spark2:before {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    top: 12px;
    left: 3px;
    background-color: #301934;
    border-radius: 50%;
}

.spark3 {
    width: 8.5px;
    height: 8.5px;
    left: 33px;
    top: -5px;
    animation: fire3 0.36s ease-in-out infinite, color2 0.4s linear infinite;
}

.spark3:before {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    top: 12px;
    left: -1px;
    background-color: #301934;
    border-radius: 50%;
}

.spark4 {
    width: 7px;
    height: 7px;
    left: 27px;
    top: -5px;
    animation: fire2 0.24s ease-in-out infinite, color2 0.2s linear infinite;
}

.spark5 {
    width: 7px;
    height: 7px;
    left: 29px;
    top: -5px;
    animation: fire3 0.45s ease-in-out infinite, color 0.2s linear infinite;
}

.spark6 {
    width: 6px;
    height: 6px;
    left: 29px;
    top: -5px;
    animation: fire 0.35s ease-in-out infinite, color2 0.2s linear infinite;
}

@keyframes fire3 {
    100% {
        transform: translateX(20px) translateY(-93px);
        opacity: 0.3;
    }
}

@keyframes fire2 {
    100% {
        transform: translateX(-5px) translateY(-90px);
        opacity: 0.3;
    }
}

@keyframes fire {
    100% {
        transform: translateX(-25px) translateY(-95px);
        opacity: 0.3;
    }
}

@keyframes color {
    from {
        background-color: #FE59C2;
    }
    to {
        background-color: #702963;
    }
}

@keyframes color2 {
    from {
        background-color: #702963;
    }
    to {
        background-color: #FE59C2;
    }
}


/* Modal styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  width: 100dvw; 
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; 
}

/* Modal content styling */
.modal-content {
  background: white;
  padding: 30px 40px;
  border-radius: 16px;
  text-align: center;
  height: 400px;
  width: 500px;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
}

/* Modal input styling */
.modal-content input {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* Modal button stylinh */
.modal-content button {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  background-color: #FE59C2;
  color: white;
  border: none;
  border-radius: 8px;
}

.modal-content button:hover {
  background-color: rgba(254, 89, 194, 0.90);
}

#error-msg {
    color: red;
}

/* Chocolate and bowl image styling */
.chocolate-and-bowl-and-cinnamoroll {
    position: absolute;
    top: -70px;
    left: -40px;      
    width: 150px;
    height: 65px;
    opacity: 0;
    transform: translateY(100px);  
    transition: 0.5s;
    display: flex;   
    z-index: -5;  
    align-items: center;
    justify-content: center;
}


.chocolate-img {
    position: absolute;
    left: 60px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
    transform: rotate(265deg);
}

.chopsticks-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
    transform: rotate(245deg);
}

.cinnamoroll-img {
    position: absolute;
    bottom: -17px;
    left: 20px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
    transform: rotate(-4deg);
}

#click:checked ~ .chocolate-and-bowl-and-cinnamoroll {
    opacity: 1;
    transform: translateY(0);
    z-index: -1;
}


.chocolate-img {
    transition: transform 0.3s ease;
}

.chopsticks-img {
    transition: transform 0.3s ease;
}

.cinnamoroll-img {
    transition: transform 0.3s ease;
}

.chocolate-img:hover {
    transform: scale(1.5) rotate(265deg);
    cursor: pointer;
}

.chopsticks-img:hover {
    transform: scale(1.5) rotate(245deg);
    cursor: pointer;
}

.cinnamoroll-img:hover {
    transform: scale(1.5) rotate(-4deg);
    cursor: pointer;
}


/* Modals for chocolate and chopsticks */
.item-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.item-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-item-content {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.item-modal.show .modal-item-content {
    transform: scale(1);
    opacity: 1;
}

.modal-item-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
}

.modal-item-content p {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #301934;
}

.close-modal {
    padding: 8px 16px;
    font-size: 16px;
    background-color: #FE59C2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.close-modal:hover {
    background-color: rgba(254, 89, 194, 0.8);
}

/* Canvas styling  */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    pointer-events: auto; 
    cursor: crosshair;
}

/* Protected content styling */
#protected-content {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.3;
}

