body {
    font-family: "Playpen Sans";
    font-weight: bold;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #080f19;
}

body, .heart, .float-heart {
    touch-action: manipulation; /* improves tap response and prevents gesture conflicts */
}


.scoreboard {
    opacity: 0;
    position: fixed;
    top: 10px;
    right: 20px;
    background: rgba(0,0,0,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-family: "Playpen Sans", cursive;
    font-size: 1.2rem;
    z-index: 10000;
}

.scoreboard.show {
    opacity: 1;
}

#milestones {
  position: fixed;           /* stays in one place */
  top: 15%;              /* near the bottom */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;    /* stack messages vertically */
  align-items: center;       /* center horizontally */
  gap: 10px;                 /* spacing between messages */
}

.milestone-msg {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease;
    margin-top: 10px;
    color: white;
    font-size: 1.5rem;
    text-align: center;
}

/* Hidden message setup */
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2.5rem;
    text-align: center;
    opacity: 0;
    transition: all 1s ease-in-out;
    z-index: 10;
}

/* When message is shown */
.message.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Expanding heart effect */
.heart.expanded {
    transform: scale(50) rotate(-45deg);
    transition: transform 1s ease-in-out;
    z-index: 9;
}


/* Floating hearts background */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}


.floating-hearts span {
    position: absolute;
    bottom: -50px;
    width: 20px;
    height: 20px;
    background: #f20044; 
    rotate: 0 deg;
    animation: float 6s linear infinite;
}

.floating-hearts span::before,
.floating-hearts span::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #f20044;
    border-radius: 50%;
}

.floating-hearts span::before {
    top: -10px;
    left: 0;
}

.floating-hearts span::after {
    left: 10px;
    top: 0;
}


@keyframes float {
    0% {
        transform: translateY(0) rotate(-60deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50vh) rotate(0deg) scale(1);
    }
    100% {
        transform: translateY(-100vh) rotate(100deg) scale(0.8);
        opacity: 0;
    }
}

/* Heart wrapper */
.heart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Heart */
.heart {
  height: 70px;
  width: 70px;
  background: #f20044; 
  position: relative;
  transform: rotate(-45deg);
  box-shadow: -10px 10px 90px #f20044;
  animation: heart 0.6s linear infinite;
}

/* Overlay hidden by default */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f20044;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
  z-index: 9999;
}

.overlay h1 {
  color: white;
  font-size: 2.5rem;
  text-align: center;
  font-family: "Playpen Sans", cursive;
}

/* Show overlay */
.overlay.show {
  opacity: 1;
  pointer-events: all;
}


@keyframes heart {
    0%{
        transform: rotate(-45deg) scale(1.05);
    }
    10%{
        transform: rotate(-45deg) scale(1.1);
    }
    20%{
        transform: rotate(-45deg) scale(1.15);
    }
    30%{
        transform: rotate(-45deg) scale(1.2);
    }
}

.heart:before {
    content: ''; 
    position:absolute;
    height: 70px;
    width: 70px;
    background: #f20044;
    top: -50%;
    border-radius: 50px;
    box-shadow: -10px 10px 90px #f20044;
}

.heart:after {
    content: ''; 
    position:absolute;
    height: 70px;
    width: 70px;
    background: #f20044;
    right: -50%;
    border-radius: 50px;
    box-shadow: -10px 10px 90px #f20044;
}


/* FINALE OVERLAY */
.finale-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(242, 0, 68, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: "Playpen Sans", cursive;
    font-size: 2.5rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
    z-index: 100000;
    display: flex;
    flex-direction: column; /* stack messages vertically */
    justify-content: center; /* center vertically in the screen */
    align-items: center;     /* center horizontally */
    gap: 10px; /* spacing between messages */

}

.finale-overlay h3 {
  font-size: 7vw;           /* responsive font size for mobile */
  line-height: 1;
  margin: 10px 0;
}

.finale-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* floating finale hearts */
.finale-heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    transform: rotate(-45deg);
    animation: finale-float 5s linear forwards;
}

.finale-heart::before,
.finale-heart::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
}

.finale-heart::before {
    top: -10px;
    left: 0;
}

.finale-heart::after {
    left: 10px;
    top: 0;
}

@keyframes finale-float {
    from {
        transform: translateY(0) rotate(-45deg);
        opacity: 1;
    }
    to {
        transform: translateY(-120vh) rotate(-45deg);
        opacity: 0;
    }
}
