:root {
    --primary: #ff5e7e;
    --primary-light: #ff85a0;
    --secondary: #ffb8b8;
    --accent: #ffd700;
    --bg-gradient: linear-gradient(135deg, #ffeef8 0%, #ffdeeb 50%, #eae4ff 100%);
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-color: #4a344a;
    --text-light: #8b6e8b;
    --shadow: 0 8px 32px 0 rgba(255, 94, 126, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pin-input {
    width: 32px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color);
    outline: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.pin-input:focus {
    border-color: var(--primary-light);
    background: white;
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(255, 94, 126, 0.25);
}


.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.heart-particle {
    position: absolute;
    color: var(--primary);
    opacity: 0.6;
    animation: floatUp 6s linear infinite;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) scale(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-10vh) scale(1) rotate(360deg);
        opacity: 0;
    }
}

.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    cursor: pointer;
}

.music-disc {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: var(--shadow);
    color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: spin 3s linear infinite;
    animation-play-state: paused;
}

.music-disc.playing {
    animation-play-state: running;
}

.music-disc:hover {
    transform: scale(1.1);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.envelope-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    transition: all 0.8s ease-in-out;
}

.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    background: #ff85a0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 10px 10px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.3s;
}

.envelope:hover {
    transform: translateY(-5px);
}

.flap {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 110px solid #ff5e7e;
    transform-origin: top;
    transition: transform 0.4s ease-in-out 0.2s, z-index 0.2s ease-in-out 0.2s;
    z-index: 4;
}

.pocket {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 160px solid #ffa3b6;
    border-right: 160px solid #ffa3b6;
    border-bottom: 110px solid #ff85a0;
    border-radius: 0 0 10px 10px;
    z-index: 3;
}

.letter {
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 280px;
    height: 180px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
    transition: transform 0.4s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-content {
    text-align: center;
}

.letter-heart {
    font-size: 32px;
    display: block;
    animation: heartbeat 1.2s infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.letter h2 {
    font-family: 'Grand Hotel', cursive;
    font-size: 30px;
    color: var(--primary);
    margin-bottom: 5px;
}

.letter p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.open-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 94, 126, 0.3);
}

.envelope-hint {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    animation: breathe 2s infinite ease-in-out;
}

@keyframes breathe {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(0.97);
    }

    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

.envelope.open .flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope.open .letter {
    transform: translateY(-90px);
    z-index: 5;
}

.main-container {
    width: 90%;
    max-width: 650px;
    margin: 110px auto 40px auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.nav-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 650px;
    z-index: 90;
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: var(--shadow);
    transform: scale(1.05);
}

.content-section {
    display: none;
    opacity: 0;
    transform: scale(0.96);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.content-section.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px 25px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.badge {
    background: linear-gradient(135deg, #ffd700, #ffae00);
    color: #5e4300;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.2);
}

.sparkle-text {
    font-family: 'Grand Hotel', cursive;
    font-size: 46px;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
}

.romantic-message {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 25px;
    min-height: 140px;
    text-align: left;
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 100%;
}

.love-meter-box {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.5);
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    background: linear-gradient(90deg, #ff85a0, #ff5e7e);
    height: 100%;
    color: white;
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1.5s ease-out;
}

.section-title {
    font-family: 'Grand Hotel', cursive;
    font-size: 38px;
    color: var(--primary);
    text-align: center;
    margin-bottom: 5px;
}

.section-subtitle {
    font-size: 14px;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 25px;
}

.polaroid-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.polaroid {
    background: white;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    width: 170px;
    transform: rotate(var(--rotation));
    transition: all 0.3s ease;
    cursor: pointer;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.08);
    z-index: 10;
    box-shadow: 0 15px 35px rgba(255, 94, 126, 0.2);
}

.polaroid.featured {
    width: 240px;
    padding: 16px;
    border: 3px solid var(--primary-light);
    box-shadow: 0 15px 35px rgba(255, 94, 126, 0.25);
    order: 0;
}

.polaroid.featured:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 20px 45px rgba(255, 94, 126, 0.35);
}

.polaroid.featured .polaroid-img-placeholder {
    height: 195px;
}

.polaroid.featured .polaroid-caption {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}


.polaroid-img-placeholder {
    width: 100%;
    height: 140px;
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.polaroid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    border-radius: 2px;
}

.emoji-fallback {
    z-index: 1;
}

.polaroid-caption {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    color: #6a4a6a;
}

.custom-note {
    font-size: 13px;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    width: 100%;
}

.quiz-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.quiz-step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.5;
}

.quiz-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    justify-content: center;
    height: 180px;
    position: relative;
    align-items: center;
}

.btn {
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.btn-yes {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 14px 35px;
    font-size: 16px;
    z-index: 5;
}

.btn-yes:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 94, 126, 0.3);
}

.btn-no {
    background: #e0e0e0;
    color: #757575;
    padding: 12px 25px;
    font-size: 14px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-no.moving {
    position: fixed;
    z-index: 1000;
}

.quiz-response {
    margin-top: 20px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ffa300);
    color: #4a2c00;
    padding: 12px 25px;
    margin-top: 15px;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(255, 163, 0, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 163, 0, 0.4);
}

.cake-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cake-instruction {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 25px;
}

.cake-container {
    height: 220px;
    width: 300px;
    position: relative;
    margin-top: 20px;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.cake {
    position: absolute;
    bottom: 0;
    width: 280px;
    height: 130px;
    background: #f1c40f;
    border-radius: 110px / 55px;
    box-shadow: 0 10px 0 #d4a706, 0 18px 25px rgba(0, 0, 0, 0.12);
}

.frosting {
    position: absolute;
    top: 0;
    width: 280px;
    height: 50px;
    background: #e74c3c;
    border-radius: 110px / 25px;
}

.cream {
    position: absolute;
    top: 25px;
    width: 280px;
    height: 40px;
    background: #ecf0f1;
    border-radius: 110px / 20px;
    box-shadow: 0 5px 0 #bdc3c7;
}

.candles-row {
    position: absolute;
    top: -25px;
    left: 50px;
    right: 50px;
    display: flex;
    justify-content: space-around;
}

.candle {
    width: 18px;
    height: 65px;
    background: linear-gradient(to right, #3498db, #2980b9);
    position: relative;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.candle:nth-child(2) {
    background: linear-gradient(to right, #9b59b6, #8e44ad);
}

.candle:nth-child(3) {
    background: linear-gradient(to right, #2ecc71, #27ae60);
}

.flame {
    width: 16px;
    height: 26px;
    background: #ff9f43;
    border-radius: 50% 50% 20% 20%;
    position: absolute;
    top: -28px;
    left: 1px;
    box-shadow: 0 0 12px #ff9f43, 0 0 24px #ff9f43;
    transform-origin: bottom center;
    animation: flicker 1s infinite alternate;
}

@keyframes flicker {
    0% {
        transform: scale(1) rotate(-1deg);
    }

    100% {
        transform: scale(1.1) rotate(1.5deg);
    }
}

.candle.out .flame {
    display: none;
}

.celebration-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    z-index: 100;
    width: 90%;
    max-width: 600px;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    display: none;
}

.celebration-box.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.pyro-effect {
    font-family: 'Grand Hotel', cursive;
    font-size: 64px;
    font-weight: 400;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 1px;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite ease-in-out;
    text-shadow: 0 0 10px #ff5e7e, 0 0 20px #ff5e7e, 0 0 45px #ff5e7e, 0 0 60px #ff85a0, 0 0 100px #ff5e7e;
}

.wishes-text {
    font-size: 19px;
    line-height: 1.8;
    color: #ffeef8;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 15px rgba(255, 94, 126, 0.5);
    font-weight: 400;
    margin-bottom: 30px;
}

.celebration-box .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 12px 30px;
    border: 2px solid white;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(255, 94, 126, 0.6);
    transition: all 0.3s;
}

.celebration-box .btn-primary:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 94, 126, 0.9);
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

@media (max-width: 480px) {
    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .sparkle-text {
        font-size: 34px;
    }

    .polaroid {
        width: 130px;
    }

    .polaroid-img-placeholder {
        height: 100px;
    }

    .pyro-effect {
        font-size: 44px;
    }

    .wishes-text {
        font-size: 16px;
    }
}