:root {
    --pink: #F22283;
    --blue: #8FCBD9;
    --green: #34BF49;
    --yellow: #EDF249;
    --orange: #F2C029;
    --text-color: #232323;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    margin: 0;
    padding: 0;
    background-color: var(--yellow);
    color: var(--text);
    min-height: 100vh;
  }
  
  .container {
    width: 640px;
    max-width: 100%;
    padding: 2rem;
    margin: 0 auto;
    text-align: center;
  }
  
  h1, h2, h3, h4 {
    font-family: "Kurale", serif;
    font-size: 3rem;
    color: var(--pink);
    margin-bottom: 0.5rem;
    text-align: center;
  }
  
  p {
    margin-bottom: 0.5rem;
  }

  .click-messege {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .click-messege.step1 {
    font-weight: 500;
  }

  .click-messege.step2 {
    font-weight: 600;
  }

  .click-messege.step3 {
    font-weight: 700;
  }

  .click-messege.step4 {
    font-weight: 800;
  }

  .click-messege.step5 {
    font-weight: 900;
  }

  .click-messege.step6 {
    font-size: 1.6rem;
    font-weight: 900;
  }
  
  /* Стили для кнопки */
  .btn {
    color: inherit;
    text-decoration: none;
    box-shadow: none;
    font-size: 2rem;
    display: inline-block;
    padding: 1rem 3rem;
    border-radius: 30px;
    background-color: var(--green);
    border: 1px solid;
    margin: 0 auto;
    transition: 0.3s ease;
    }

    .btn:hover,
    .close-btn:hover {   
        box-shadow: 4px 4px 0 0 var(--text-color);
    }

    .close-btn {
        font-size: 2rem;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid;
        margin-left: auto;
        cursor: pointer;
    }
  
  /* Стили для медиа */
  .media {
    margin-top: 20px;
  }
  
  img, video {
    display: inline-block;
    max-width: 100%;
    height: auto;
  }
  
  /* Стили для всплывающего окна */
  .popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border: 1px solid;
    padding: 20px;
    box-shadow: 4px 4px 0 0 var(--text-color);
    z-index: -1;
    opacity: 0;
    transition: 0.3s ease-in-out;
}

  
  .popup.show {
    z-index: 10;
    opacity: 1;
  }

  .popup-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    align-items: center;
    font-weight: 900;
    padding-top: 1.5rem;
    border-top: 1px solid;
    margin-top: 1.5rem;
    font-size: 1.5rem;
}

.popup-footer .btn {
    flex-shrink: 0;
}
  
  /* Стили для конфетти */
  canvas {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 20;
  }
  
  .browsehappy {
    margin: 0.2em 0;
    background: #ccc;
    color: #000;
    padding: 0.2em 0;
}


.box-container {
perspective: 500;
perspective-origin: 50% -350px;
overflow: hidden;
}

.box {
  width:300px;
  height:300px;
  position:relative;
  margin: 9rem auto 0;
  transform-style:preserve-3d;
  cursor: pointer;
}

.box::before {
    content: '';
    width: 250px;
    height: 250px;
    position: absolute;
    top: -108px;
    left: 50%;
    transform: translateX(-50%) translateZ(250px);
    background: url('/media/bow-knot.webp') no-repeat bottom center/contain;
    transform-style:preserve-3d;
    transition: 0.3s ease-in;
}

.box.opened::before{
    transform: translateX(100vw) translateZ(250px);
}

.box.hover {
    animation: shaking 0.2s linear 10;
}

.side {
  width:300px;
  height:300px;
  background: var(--blue) url('/media/blue-texture.webp');
  background-size: cover;
  border:1px solid #000;
  position:absolute;
}
.side-1 {
  width:300px;
  height:300px;
  position:absolute;
  -o-transform: rotateX(90deg) translateZ(150px);
  transform: rotateX(90deg) translateZ(150px);
  transform-style:preserve-3d;
}

.side-2 {
  transform: translateZ(150px);
  font-family: "Kurale", serif;
  line-height: 30px;
  font-size: 2rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-3 {
  transform: rotateY(90deg) translateZ(150px);
}

.side-4 {
  transform: rotateX(-90deg) rotate(180deg) translateZ(150px);
}

.side-5 {
  transform: rotateY(180deg) translateZ(150px);
}

.side-6 {
  transform: rotateY(-90deg) translateZ(150px);
}
.inner-side {
  transition: 1.5s all linear;
}

.flap-1, .flap-2 {
  width:300px;
  height:150px; 
}

.flap-1 {
  top:150px;
  transform-origin:0px 150px;
}

.flap-2 {
  transform-origin:300px 0px;
}
.box.opened .flap-1 {
  transform: rotateX(-120deg);
}

.box.opened .flap-2 {
  transform: rotateX(120deg);
}

@keyframes shaking {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5px, 5px) rotate(5deg); }
    50% { transform: translate(0, 0) rotate(0eg); }
    75% { transform: translate(-5px, 5px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@media (max-width: 640px) {
    h1, h2, h3, h4 {
        font-family: "Kurale", serif;
        font-size: 2.1rem;
        color: var(--pink);
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }

    .click-messege {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .click-messege.step6 {
      font-size: 1.3rem;
    }

    .btn {
        font-size: 1.2rem;
    }

    .popup {
        width: 94%;
        max-height: 80vh;
        overflow: auto;
    }

    .popup-footer {
        flex-wrap: wrap;
    }
}