
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 30px 10px 50px;
    background: #050505;
    font-family: Arial, sans-serif;
    text-align: center;
    overflow-x: hidden;
}

h1 {
    color: #ff4d88;
    font-size: clamp(22px, 5vw, 36px);
    text-shadow: 0 0 12px #ff1f65;
}

.subtitle {
    color: #d6a0b3;
    font-size: 14px;
    margin-bottom: 25px;
}

.heart-container {
    width: 100%;
    max-width: 850px;
    margin: auto;
}

/* Button above the heart */
.middle-button {
    display: block;
    margin: 0 auto 35px;
    padding: 12px 28px;

    border: 2px solid #ff6b9d;
    border-radius: 30px;
    background: #ff2b70;
    color: white;

    font-size: 14px;
    font-weight: bold;
    cursor: pointer;

    box-shadow:
        0 0 10px #ff2b70,
        0 0 20px #ff2b70;

    transition: 0.3s ease;
}

.middle-button:hover {
    transform: scale(1.1);
    box-shadow:
        0 0 15px #ff2b70,
        0 0 30px #ff2b70;
}

/* Heart grid */
.heart {
    width: min(100%, 650px);
    margin: auto;

    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    grid-auto-rows: minmax(42px, auto);

    gap: 7px 4px;
    justify-items: center;
    align-items: center;
}

/* Love phrases */
.phrase {
    width: 100%;
    min-width: 0;

    color: #ff6b9d;
    font-size: clamp(8px, 1.5vw, 13px);
    font-weight: bold;
    line-height: 1.3;
    text-align: center;

    overflow-wrap: anywhere;

    text-shadow:
        0 0 5px #ff2b70,
        0 0 12px #ff2b70;

    opacity: 0;
    transform: scale(0.7);

    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

.phrase.show {
    opacity: 1;
    transform: scale(1);
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 25px 5px 40px;
    }

    .heart {
        gap: 5px 2px;
        grid-auto-rows: minmax(35px, auto);
    }

    .phrase {
        font-size: 7px;
        line-height: 1.2;
        text-shadow: 0 0 5px #ff2b70;
    }

    .middle-button {
        margin-bottom: 25px;
        padding: 10px 22px;
        font-size: 12px;
    }
}


/* Dark background overlay */
.message-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.85);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
    z-index: 100;

    opacity: 0;
    visibility: hidden;

    transition: 0.4s ease;
}

/* Show message */
.message-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Message container */
.message-box {
    position: relative;

    width: min(100%, 400px);
    padding: 35px 25px;

    background: #160711;
    border: 1px solid #ff4d88;
    border-radius: 20px;

    

    color: white;

    transform: scale(0.7);
    transition: 0.4s ease;
}

/* Pop-up animation */
.message-overlay.active .message-box {
    transform: scale(1);
}

/* Message title */
.message-box h2 {
    color: #ff6b9d;
    font-size: 26px;

    text-shadow: 0 0 12px #f8f5f6;

    margin-bottom: 20px;
}

/* Message text */
.message-box p {
    color: #ffd5e2;
    font-size: 15px;
    line-height: 1.8;
}

/* Heart decoration */
.message-heart {
    font-size: 35px;
    margin-top: 15px;

    animation: heartbeat 1s infinite;
}

/* Close button */
.close-button {
    position: absolute;
    top: 10px;
    right: 15px;

    border: none;
    background: transparent;

    color: #ff6b9d;
    font-size: 30px;

    cursor: pointer;
}

.close-button:hover {
    color: white;
    text-shadow: 0 0 10px #ff2b70;
}

/* Heartbeat animation */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Small screen adjustment */
@media (max-width: 480px) {
    .message-box {
        padding: 30px 20px;
    }

    .message-box h2 {
        font-size: 22px;
    }

    .message-box p {
        font-size: 13px;
    }
}