:root {
    --primary-color: #ff4d6d;
    --primary-light: #ff758f;
    --background: #fff0f3;
    --text-dark: #800f2f;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(255, 77, 109, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Quicksand', sans-serif;
}

body {
    background: var(--background);
    background-image: linear-gradient(135deg, #fff0f3 0%, #ffccd5 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--text-dark);
}

/* Background Floating Hearts */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-light);
    transform: rotate(45deg);
    opacity: 0.5;
    animation: floating ease-in infinite;
}

.heart::before,
.heart::after {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--primary-light);
    border-radius: 50%;
    position: absolute;
}

.heart::before {
    top: -10px;
    left: 0;
}

.heart::after {
    top: 0;
    left: -10px;
}

@keyframes floating {
    0% {
        transform: translateY(100vh) scale(0.5) rotate(45deg);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-20vh) scale(1.2) rotate(45deg);
        opacity: 0;
    }
}

/* Main Container */
.main-container {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

header .glow-text {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(255, 77, 109, 0.3);
    margin-bottom: 0px;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 77, 109, 0.3);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 20px rgba(255, 77, 109, 0.6);
    }

    100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 77, 109, 0.3);
    }
}

header .recipient {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

header .instruction {
    font-size: 1.1rem;
    color: #a4133c;
    margin-bottom: 1rem;
}

.gift-preview-list {
    margin-bottom: 1.5rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    border: 1px dashed var(--primary-light);
}

.gift-preview-list p {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.gift-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.gift-tags span {
    background: #fff;
    color: #c9184a;
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(255, 77, 109, 0.15);
    font-weight: bold;
    border: 1px solid #ffccd5;
}

/* Interactive Area */
.interactive-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.box-wrapper {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.box-wrapper:hover {
    transform: scale(1.1);
}

.box-img {
    width: 180px;
    height: auto;
    filter: drop-shadow(0px 10px 10px rgba(255, 77, 109, 0.4));
    animation: shake 2s infinite ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: rotate(-5deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: rotate(5deg);
    }
}

.box-wrapper.opened .box-img {
    animation: pop-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    filter: drop-shadow(0px 10px 10px rgba(255, 77, 109, 0.4));
}

@keyframes pop-in {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    80% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.shadow {
    width: 120px;
    height: 15px;
    background: rgba(128, 15, 47, 0.2);
    border-radius: 50%;
    margin-top: -10px;
    filter: blur(4px);
}

.click-hint {
    margin-top: 15px;
    font-weight: bold;
    color: var(--primary-color);
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    z-index: 101;
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem 2rem;
    border-radius: 25px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(50px) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal:not(.hidden) .modal-container {
    transform: translateY(0) scale(1);
}

.close-icon {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.2s;
}

.close-icon:hover {
    color: var(--primary-color);
}

.sparkles {
    font-size: 2rem;
    margin-bottom: 10px;
}

.modal-title {
    font-family: 'Dancing Script', cursive;
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 5px;
}

.modal-subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
}

.gift-reveal {
    background: linear-gradient(135deg, #fff0f3, #ffccd5);
    padding: 20px;
    border-radius: 20px;
    margin: 15px 0;
    border: 2px dashed var(--primary-light);
    box-shadow: inset 0 0 15px rgba(255, 77, 109, 0.1);
}

.gift-icon-ring {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    box-shadow: 0 5px 15px rgba(255, 77, 109, 0.2);
}

.gift-icon-ring img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.highlight-text {
    color: var(--text-dark);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
}

.message {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c9184a);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(201, 24, 74, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 24, 74, 0.5);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Form inputs */
.name-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #ffccd5;
    border-radius: 15px;
    font-size: 1.2rem;
    margin-bottom: 15px;
    outline: none;
    text-align: center;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
}

.name-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
}

.error-text {
    color: #d90429;
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: bold;
    animation: shake-error 0.5s;
}

@keyframes shake-error {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    header .glow-text {
        font-size: 3rem;
    }

    .box-img {
        width: 150px;
    }

    .modal-container {
        padding: 2rem 1.5rem;
    }

    .modal-title {
        font-size: 2.5rem;
    }

    .highlight-text {
        font-size: 1.2rem;
    }
}