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

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    /* Handle mobile browser bars */
    overflow: hidden;
    position: fixed;
    /* Lock body */
    touch-action: none;
    /* Disable scroll */
    background-color: #ffc0cb;
    /* Pink */
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

#burstCanvas {
    z-index: 20;
    /* Top layer */
    pointer-events: none;
    /* Click-through */
}

.container {
    position: relative;
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10;
    text-align: center;
    width: 80%;
    max-width: 340px;
}

@media (max-height: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        margin-bottom: 10px;
        font-size: 1.5rem;
    }

    .date-display {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 1rem;
    }

    .key {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .keypad {
        gap: 10px;
    }
}

h1 {
    color: #e91e63;
    margin-top: 0;
    margin-bottom: 20px;
    font-family: 'Pacifico', cursive;
    font-size: 1.8rem;
}

.date-display {
    background-color: #ffeff5;
    color: #e91e63;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    justify-items: center;
}

.key {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: white;
    color: #ff80ab;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: default;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    transform: scale(1.05);
    background-color: #fff0f5;
}

.key:active {
    transform: scale(0.95);
}

.action-btn {
    font-size: 0.8rem;
    color: #888;
    box-shadow: none;
}

.heart-btn {
    background-color: #e91e63;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.3);
}

.heart-btn:hover {
    background-color: #d81b60;
    color: white;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

#finalMessage {
    position: relative;
    text-align: center;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease-in-out;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#finalMessage.visible {
    opacity: 1;
    pointer-events: auto;
}

#finalMessage h1 {
    color: #ff1493;
    /* Deep pink */
    font-size: 2.6rem;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8), 0 0 10px white;
    line-height: 1.5;
}

.fade-out {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

.audio-wrapper {
    width: 80%;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto 0 auto;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

.num-key {
    cursor: pointer !important;
}

.audio-btn {
    background-color: #e91e63;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer !important;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.3);
}

.audio-btn:hover {
    background-color: #c2185b;
    transform: translateY(-2px);
}

.audio-btn:active {
    transform: translateY(0);
}

.image-stack {
    position: relative;
    width: 280px;
    height: 350px;
    margin: 30px auto 0;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 15px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 8px solid white;
    transition: opacity 3s ease-in-out;
}

.photo-overlay p {
    font-family: 'Pacifico', cursive;
    color: #e91e63;
    font-size: 1.3rem;
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

.final-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 8px solid white;
    box-sizing: border-box;
    transition: opacity 3s ease-in-out;
}

.top-photo {
    z-index: 2;
}

.bottom-photo {
    z-index: 1;
}