body,
html {
  height: 100%;  
  font-family: 'Quicksand', sans-serif;
  text-align: center;
}

.bg {
  /* Location of the image */
  background-image: url(./img/bg.png);
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  /* This is what makes the background image rescale based
     on the container's size */
  background-size: cover;

  /* Set a background color that will be displayed
     while the background image is loading */
  background-color: #FEC0CD;
  height: 100%;
}


.img {
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  top: 20px;
  margin-bottom: 30px;
  width: 350px;
}

#tap {
  display: inline-block;
}

.foto {
  width: 80%;
  max-width: 400px;
  min-width: 300px;
  margin-top: 100px;
  /* margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px; */
  display: inline-block;
  /* vertical-align: middle;
  line-height: normal; */
}



/* Paper */
@import url(https://fonts.googleapis.com/css?family=Roboto);
@import url(https://fonts.googleapis.com/css?family=Handlee);


.paper {
  font-family: 'Roboto', sans-serif;
  position: relative;
  width: 90%;
  max-width: 800px;
  min-width: 300px;
  height: 540px;
  margin: 50px auto;
  display: inline-block;
  vertical-align: middle;
  line-height: normal;
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  overflow: hidden;
}

.paper:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 45px;
  background: radial-gradient(#616161 6px, transparent 7px) repeat-y;
  background-size: 30px 30px;
  border-right: 3px solid #D44147;
  box-sizing: border-box;
}

.paper-content {
  position: absolute;
  top: 30px;
  right: 0;
  bottom: 30px;
  left: 50px;
  background: linear-gradient(transparent, transparent 28px, #91D1D3 28px);
  background-size: 30px 30px;
}

.paper-content .teks {
  text-align: left;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  line-height: 30px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #3f3f44;
  font-family: 'Handlee', cursive;
  font-size: 18px;
  box-sizing: border-box;
  z-index: 1;
}

.kotak {
  position: relative;
  width: 90%;
  max-width: 550px;
  min-width: 200px;
  max-height: 350px;
  min-height: 100px;
  top: 300px;
  padding: 20px 0;
  display: inline-block;
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  overflow: hidden;
}

.btn {
  border-radius: 40px;
}

#slideLima {
  position: relative;
  top: 300px;
}

#trims {
  position: relative;
  top: 300px;
  display: inline-block;
}

h1 {
  font-weight: normal;
}

li {
  display: inline-block;
  font-size: 16px;
  list-style-type: none;
  position: relative;
  left: -20px;
  margin-top: 10px;
  padding: 10px;
  text-transform: uppercase;
}

li span {
  display: block;
  font-size: 24px;
}

body {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.countdown-layout {
  color: #333;
  position: relative;
  top: 170px;
  width: min(980px, 95vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.countdown-photo-wrap {
  flex: 1 1 45%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-photo {
  width: min(430px, 90%);
  max-height: 68vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
}

.countdown-panel {
  flex: 1 1 55%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(31, 42, 68, 0.14);
}

.countdown-panel ul {
  margin-bottom: 10px;
}

.skip-btn {
  border: 1px solid rgba(31, 42, 68, 0.25);
  background: linear-gradient(135deg, rgba(135, 212, 209, 0.88), rgba(255, 183, 197, 0.88));
  color: #1f2a44;
  border-radius: 999px;
  font-weight: 700;
  padding: 7px 16px;
}

.skip-btn:hover,
.skip-btn:focus {
  outline: none;
  transform: translateY(-1px);
}

.sound-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, rgba(135, 212, 209, 0.9), rgba(255, 183, 197, 0.9));
  color: #1f2a44;
  border-radius: 999px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 22px rgba(31, 42, 68, 0.2);
}

.sound-toggle i {
  font-size: 14px;
}

.sound-toggle:focus,
.sound-toggle:hover {
  outline: none;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .countdown-layout {
    top: 90px;
    flex-direction: column;
    gap: 14px;
  }

  .countdown-panel {
    order: 1;
    width: 100%;
  }

  .countdown-photo-wrap {
    order: 2;
    width: 100%;
  }

  .countdown-photo {
    width: min(360px, 85vw);
    max-height: 48vh;
  }

  li {
    left: 0;
    padding: 6px;
  }
}

@media (max-width: 600px) {
  .countdown-layout {
    top: 72px;
    width: min(96vw, 520px);
    gap: 10px;
  }

  .countdown-panel {
    padding: 14px 10px;
    border-radius: 14px;
  }

  .countdown-panel h5 {
    font-size: 1.22rem;
    line-height: 1.35;
    margin-bottom: 8px;
  }

  .countdown-panel ul {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px 6px;
    padding: 0;
    margin: 0 0 10px;
  }

  .countdown-panel li {
    left: 0;
    margin: 0;
    padding: 2px 1px;
    font-size: 11px;
  }

  .countdown-panel li span {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 2px;
  }

  .countdown-photo {
    width: min(300px, 80vw);
    max-height: 40vh;
  }

  .skip-btn {
    padding: 6px 14px;
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .countdown-panel li {
    font-size: 10px;
  }

  .countdown-panel li span {
    font-size: 21px;
  }
}

.post-sequence {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 4;
}

.post-sequence.page-exit {
  animation: pageTwoFadeOut 520ms ease forwards;
}

.post-sequence.stage-one {
  --timer-center-y: 300px;
}

.sequence-image {
  width: min(360px, 80vw);
  filter: drop-shadow(0 18px 25px rgba(0, 0, 0, 0.35));
  opacity: 0;
  z-index: 6;
}

.sequence-image.scene-one {
  position: absolute;
  left: 50%;
  top: var(--timer-center-y, 300px);
  transform: translate(-50%, -50%);
  animation: hbdOnTimer 5s ease-in-out forwards;
}

.sequence-image.scene-two {
  position: relative;
  left: auto;
  top: auto;
  opacity: 1;
  transform: translateY(-70px);
  animation: none;
}
.gif-cluster {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 170px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "left-top . right-top"
    "bottom-one bottom-two bottom-three";
  align-items: end;
  justify-items: center;
  column-gap: 26px;
  row-gap: 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 9;
}

.post-sequence.stage-two-active .gif-cluster {
  opacity: 1;
}

.second-next-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  border: 1px solid rgba(31, 42, 68, 0.22);
  background: linear-gradient(135deg, rgba(135, 212, 209, 0.92), rgba(255, 183, 197, 0.92));
  color: #1f2a44;
  border-radius: 999px;
  font-weight: 700;
  padding: 8px 18px;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
}

.post-sequence.stage-two-active .second-next-btn {
  opacity: 1;
  pointer-events: auto;
}

.second-next-btn:hover,
.second-next-btn:focus {
  outline: none;
  transform: translateY(-1px);
}

.third-prev-btn:hover,
.third-prev-btn:focus {
  outline: none;
  transform: translateY(-1px);
}

.strip-gif {
  height: clamp(58px, 9.4vw, 112px);
  width: auto;
  object-fit: contain;
}

.gif-left-top {
  grid-area: left-top;
}

.gif-right-top {
  grid-area: right-top;
}

.gif-bottom-one {
  grid-area: bottom-one;
}

.gif-bottom-two {
  grid-area: bottom-two;
  transform: scale(1.12);
  transform-origin: center;
}

.gif-bottom-three {
  grid-area: bottom-three;
}

.bottom-gif {
  position: absolute;
  bottom: clamp(10px, 2.5vh, 28px);
  width: min(220px, 34vw);
  opacity: 0;
  transform: translateY(170px);
  pointer-events: none;
  z-index: 6;
}

@media (max-width: 700px) {
  .gif-cluster {
    bottom: 218px;
    width: min(680px, calc(100vw - 20px));
    column-gap: 8px;
    row-gap: 6px;
  }

  .strip-gif {
    height: clamp(52px, 13.5vw, 86px);
  }

  .second-next-btn {
    right: 12px;
    bottom: 12px;
    padding: 7px 14px;
  }

  .third-prev-btn {
    left: 12px;
    bottom: 12px;
    padding: 7px 14px;
  }

  .bottom-gif {
    bottom: clamp(6px, 1.6vh, 16px);
    width: min(200px, 40vw);
  }

  .left-gif {
    left: 0;
  }

  .right-gif {
    right: 0;
  }
}

.left-gif {
  left: clamp(8px, 5vw, 48px);
}

.right-gif {
  right: clamp(8px, 5vw, 48px);
}

.post-sequence.stage-two-active .left-gif {
  animation: gifRiseLeft 1s ease-out forwards;
}

.post-sequence.stage-two-active .right-gif {
  animation: gifRiseRight 1s ease-out 0.16s forwards;
}

.letter-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.letter-paper {
  width: min(920px, 95vw);
  height: min(620px, 80vh);
  margin: 0;
}

.letter-note {
  height: 100%;
  width: 100%;
  font-size: clamp(16px, 2.2vw, 23px);
  line-height: 30px;
  padding-top: 4px;
}
.scene-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));
  opacity: 0;
  transition: opacity 850ms ease;
  pointer-events: none;
  z-index: 7;
}

.scene-fade.active {
  opacity: 1;
}

.third-page-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 10;
  animation: pageThreeFadeIn 560ms ease;
}

.second-decor {
  position: absolute;
  width: clamp(120px, 18vw, 290px);
  height: auto;
  z-index: 8;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12));
}

.second-decor-left {
  left: 0;
  top: 0;
}

.second-decor-right {
  right: 0;
  top: 0;
  transform: scaleX(-1);
}

.third-paper {
  width: min(1040px, 95vw);
  height: min(680px, 84vh);
  margin: 0;
}

.third-note {
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.6;
  padding-top: 4px;
}

@media (max-width: 900px) {
  .third-page-layer {
    padding: 16px;
  }

  .third-paper {
    width: min(96vw, 860px);
    height: min(72vh, 620px);
  }

  .second-decor {
    width: clamp(110px, 24vw, 220px);
  }
}

@media (max-width: 700px) {
  .second-decor {
    width: clamp(160px, 36vw, 280px);
  }

  .second-decor-left,
  .second-decor-right {
    top: -4px;
  }
}

.third-prev-btn {
  position: absolute;
  left: 18px;
  bottom: 18px;
  border: 1px solid rgba(31, 42, 68, 0.22);
  background: linear-gradient(135deg, rgba(135, 212, 209, 0.92), rgba(255, 183, 197, 0.92));
  color: #1f2a44;
  border-radius: 999px;
  font-weight: 700;
  padding: 8px 18px;
  z-index: 12;
}

.side-confetti {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34vw;
  max-width: 320px;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

.side-confetti.left {
  left: 0;
}

.side-confetti.right {
  right: 0;
}

.rain-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  opacity: 0;
}

.confetti-piece.from-left {
  left: 0;
  animation: burstRight 2.3s ease-out forwards;
}

.confetti-piece.from-right {
  right: 0;
  animation: burstLeft 2.3s ease-out forwards;
}

.confetti-piece.from-left-tilt {
  left: 0;
  animation: tiltToCenterFromLeft 1.9s ease-out forwards;
}

.confetti-piece.from-right-tilt {
  right: 0;
  animation: tiltToCenterFromRight 1.9s ease-out forwards;
}

.confetti-piece.from-left-corner {
  left: 0;
  animation: cornerToCenterFromLeft 2.8s cubic-bezier(0.23, 0.77, 0.39, 0.98) forwards;
}

.confetti-piece.from-right-corner {
  right: 0;
  animation: cornerToCenterFromRight 2.8s cubic-bezier(0.23, 0.77, 0.39, 0.98) forwards;
}

.confetti-piece.rain-drop {
  top: -24px;
  animation: rainDrop 2.6s linear forwards;
}

.timer-exit {
  animation: timerFadeOut 460ms ease forwards;
}

@keyframes hbdOnTimer {
  0% {
    opacity: 0;
    transform: translate(-50%, -18%) scale(0.75);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  84% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.01);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
  }
}

@keyframes burstRight {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(0deg);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(230px) translateY(30px) rotate(280deg);
  }
}

@keyframes burstLeft {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(0deg);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(-230px) translateY(30px) rotate(-280deg);
  }
}

@keyframes tiltToCenterFromLeft {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(-24deg);
  }

  12% {
    opacity: 1;
  }

  88% {
    opacity: 1;
    transform: translateX(calc(50vw - 160px)) translateY(-6px) rotate(240deg);
  }

  100% {
    opacity: 0;
    transform: translateX(calc(50vw - 130px)) translateY(-4px) rotate(260deg);
  }
}

@keyframes tiltToCenterFromRight {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(24deg);
  }

  12% {
    opacity: 1;
  }

  88% {
    opacity: 1;
    transform: translateX(calc(-50vw + 160px)) translateY(-6px) rotate(-240deg);
  }

  100% {
    opacity: 0;
    transform: translateX(calc(-50vw + 130px)) translateY(-4px) rotate(-260deg);
  }
}

@keyframes cornerToCenterFromLeft {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(-16deg);
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
    transform: translateX(calc(50vw - 150px)) translateY(-56vh) rotate(250deg);
  }

  100% {
    opacity: 0;
    transform: translateX(calc(50vw - 130px)) translateY(-58vh) rotate(270deg);
  }
}

@keyframes cornerToCenterFromRight {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(16deg);
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
    transform: translateX(calc(-50vw + 150px)) translateY(-56vh) rotate(-250deg);
  }

  100% {
    opacity: 0;
    transform: translateX(calc(-50vw + 130px)) translateY(-58vh) rotate(-270deg);
  }
}

@keyframes rainDrop {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(0deg);
  }

  14% {
    opacity: 1;
  }

  86% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(var(--rain-drift, 0px)) translateY(102vh) rotate(320deg);
  }
}

@keyframes pageTwoFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.985);
  }
}

@keyframes pageThreeFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timerFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes gifRiseLeft {
  from {
    opacity: 0;
    transform: translateY(170px) rotate(-6deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes gifRiseRight {
  from {
    opacity: 0;
    transform: translateY(170px) rotate(6deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}
