@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Poppins:wght@400;600&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #ffe6e6;
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Saat slide final aktif, body boleh tumbuh & discroll secara natural */
body.scrollable {
    height: auto;
    min-height: 100vh;
    justify-content: flex-start;
}

/* =========================================
   SECTION CONTAINER UMUM (pertanyaan & game)
   ========================================= */
.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.3);
    z-index: 10;
    max-width: 600px;
    width: 85%;
}

.progress-label {
    display: inline-block;
    background: #ffd6e8;
    color: #d81b60;
    font-size: 0.8em;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}

h1 {
    font-family: 'Dancing Script', cursive;
    color: #ff1493;
    font-size: 3em;
    margin-bottom: 10px;
}

h2 {
    color: #d81b60;
}

p {
    color: #555;
    font-size: 1.1em;
}

.buttons {
    margin-top: 30px;
    position: relative;
    height: 60px;
}

button {
    padding: 12px 25px;
    font-size: 1.1em;
    font-family: 'Poppins', sans-serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s;
    font-weight: bold;
}

#btn-yes {
    background-color: #ff69b4;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
    position: relative;
    z-index: 5;
}

#btn-yes:hover {
    background-color: #ff1493;
    transform: scale(1.1);
}

#btn-no {
    background-color: #ccc;
    color: white;
    position: absolute;
    margin-left: 10px;
}

.hidden {
    display: none !important;
}

/* =========================================
   MINI GAME: TANGKAP HATI
   ========================================= */
.game-sub {
    font-size: 0.95em;
    color: #888;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.stat-box {
    background: #fff0f5;
    border: 2px solid #ffb6d9;
    border-radius: 14px;
    padding: 10px 20px;
    min-width: 90px;
}

.stat-box .stat-label {
    display: block;
    font-size: 0.75em;
    color: #d81b60;
    font-weight: 600;
    margin-bottom: 4px;
}

#game-score, #game-timer {
    font-size: 1.6em;
    font-weight: bold;
    color: #ff1493;
}

#btn-start-game {
    background-color: #ff69b4;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
    margin-top: 10px;
}

#btn-start-game:hover {
    background-color: #ff1493;
    transform: scale(1.05);
}

#game-area {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    border-radius: 14px;
    margin-top: 15px;
    transition: height 0.2s;
}

#game-area.active {
    height: 320px;
    background: linear-gradient(180deg, #fff0f5 0%, #ffe0ec 100%);
    border: 2px dashed #ffb6d9;
}

.falling-heart {
    position: absolute;
    top: -40px;
    font-size: 28px;
    cursor: pointer;
    user-select: none;
    animation: heartFall linear forwards;
}

.falling-heart.caught {
    animation: none;
    transform: scale(1.8);
    opacity: 0;
    transition: transform 0.15s, opacity 0.15s;
}

@keyframes heartFall {
    to { top: 100%; }
}

#game-result {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px dashed #ffd6e8;
}

#game-result h2 {
    margin-bottom: 5px;
}

#btn-continue {
    background-color: #ff1493;
    color: white;
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

#btn-continue:hover {
    transform: scale(1.05);
}

/* =========================================
   SLIDE FINAL — FOTO + SURAT (BESAR, SCROLLABLE)
   ========================================= */
#gallery-section {
    max-width: 700px;
    width: 92%;
    padding: 36px 24px 44px;
}

.final-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    margin: 28px 0;
}

.photos-stack {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.polaroid {
    background: #fff;
    padding: 12px 12px 0;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.3s;
}

.polaroid-mini {
    width: 190px;
}

.polaroid[data-tilt="-3"] { transform: rotate(-4deg); }
.polaroid[data-tilt="2"] { transform: rotate(3deg); }
.polaroid[data-tilt="-2"] { transform: rotate(-3deg); }

.polaroid:hover {
    transform: rotate(0deg) scale(1.06) !important;
    z-index: 20;
}

.ribbon-deco {
    position: absolute;
    top: -14px;
    right: -10px;
    font-size: 1.8em;
    transform: rotate(15deg);
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
    z-index: 2;
}

.polaroid-photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 3px;
    background: #eee;
}

.polaroid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.polaroid-caption {
    margin: 0;
    padding: 12px 6px 16px;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: 1.15em;
    color: #ff1493;
    font-weight: 700;
    line-height: 1.25;
}

.message {
    margin-top: 10px;
    font-style: italic;
    color: #ff1493;
    font-weight: bold;
    text-align: center;
}

.envelopes-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.envelope-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.25s;
}

.envelope-card:hover {
    transform: translateY(-5px) scale(1.05);
}

.envelope {
    width: 130px;
    height: 95px;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.envelope.red {
    background-color: #f5e6d3;
    border: 3px solid #c0392b;
}

.envelope.blue {
    background-color: #dceffb;
    border: 3px solid #2e86c1;
}

.envelope-flap {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    height: 0;
    width: calc(100% + 6px);
    border-left: 65px solid transparent;
    border-right: 65px solid transparent;
    border-top: 55px solid;
}

.envelope.red .envelope-flap {
    border-top-color: #c0392b;
}

.envelope.blue .envelope-flap {
    border-top-color: #2e86c1;
}

.envelope-heart {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6em;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.envelope-label {
    font-weight: 600;
    color: #d81b60;
    font-size: 0.95em;
    text-align: center;
}

/* =========================================
   MODAL SURAT
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.letter-paper {
    background: #fffaf3;
    background-image: linear-gradient(rgba(255,182,217,0.08) 1px, transparent 1px);
    background-size: 100% 28px;
    max-width: 450px;
    width: 100%;
    padding: 40px 30px 30px;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    animation: letterPopIn 0.3s ease;
}

@keyframes letterPopIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.letter-paper h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8em;
    margin-bottom: 16px;
}

.letter-paper p {
    text-align: left;
    line-height: 1.7;
    color: #555;
}

.letter-signoff {
    text-align: right !important;
    font-family: 'Dancing Script', cursive;
    font-size: 1.3em;
    color: #ff1493;
    margin-top: 20px;
}

.letter-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.3em;
    color: #aaa;
    cursor: pointer;
    padding: 4px 8px;
}

.letter-close:hover {
    color: #ff1493;
    transform: none;
}

#btn-memories {
    margin-top: 22px;
    background-color: #fff;
    color: #d81b60;
    border: 2px solid #ff8fb8;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.25);
}

#btn-memories:hover {
    background-color: #ff69b4;
    color: #fff;
    transform: scale(1.05);
}

/* =========================================
   SECTION 5: KENANGAN (KOLASE SCRAPBOOK)
   ========================================= */
#memories-section {
    width: 100%;
    max-width: 720px;
    box-sizing: border-box;
    background: #f1e9da;
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.025) 0px, rgba(0,0,0,0.025) 1px, transparent 1px, transparent 26px);
    border-radius: 18px;
    padding: 50px 24px 60px;
    position: relative;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.btn-back {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.85em;
    color: #555;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    z-index: 30;
}

.btn-back:hover {
    background: #fff;
    transform: translateX(-3px);
}

.memories-header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px;
}

.memories-badge {
    display: inline-block;
    background: #eef0f5;
    border: 2px solid #c7cde0;
    border-radius: 30px;
    padding: 10px 30px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.8em;
    font-weight: 700;
    color: #4a5478;
    letter-spacing: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: rotate(-2deg);
}

.sticker {
    position: absolute;
    background: #ffe1ea;
    border: 2px solid #ff8fb8;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 0.75em;
    font-weight: 600;
    color: #d81b60;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    white-space: nowrap;
}

.sticker-1 {
    top: -6px;
    right: -4px;
    transform: rotate(6deg);
}

.sticker-2 {
    top: 56px;
    left: -6px;
    transform: rotate(-5deg);
}

.memories-collage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 16px;
    justify-content: center;
    padding: 10px 4px 20px;
}

.mem-card {
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    aspect-ratio: 1 / 1;
    transition: transform 0.25s, z-index 0.25s;
    position: relative;
}

.mem-card[data-tilt="-4"] { transform: rotate(-6deg); }
.mem-card[data-tilt="-3"] { transform: rotate(-4deg); }
.mem-card[data-tilt="-2"] { transform: rotate(-3deg); }
.mem-card[data-tilt="2"] { transform: rotate(3deg); }
.mem-card[data-tilt="3"] { transform: rotate(4deg); }
.mem-card[data-tilt="4"] { transform: rotate(6deg); }

.mem-card:hover {
    transform: rotate(0deg) scale(1.12) !important;
    z-index: 25;
}

.mem-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

.mem-empty {
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed #c9b9a0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mem-empty span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8em;
    color: #b09a7d;
    font-weight: 600;
}

.memories-date {
    text-align: center;
    margin-top: 10px;
    display: inline-block;
    background: #6f5fa3;
    color: #fff;
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 1px;
    padding: 8px 22px;
    border-radius: 30px;
    position: relative;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
}

.memories-footer {
    text-align: right;
    margin-top: 28px;
    font-family: 'Dancing Script', cursive;
    font-size: 2.4em;
    font-weight: 700;
    color: #2b2b2b;
    opacity: 0.85;
    padding-right: 10px;
}

/* =========================================
   EFEK HATI JATUH (BACKGROUND GLOBAL)
   ========================================= */
.heart {
    position: fixed;
    font-size: 24px;
    color: #ff69b4;
    animation: fall linear forwards;
    z-index: 1;
    top: -50px;
}

@keyframes fall {
    to { transform: translateY(105vh) rotate(360deg); }
}

/* =========================================
   RESPONSIVITAS — TABLET & MOBILE BESAR (≤768px)
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    #gallery-section {
        width: 94%;
        padding: 30px 18px 36px;
    }

    .polaroid-mini {
        width: 150px;
    }

    .envelope {
        width: 115px;
        height: 84px;
    }

    .envelope-flap {
        border-left-width: 58px;
        border-right-width: 58px;
        border-top-width: 48px;
    }

    #memories-section {
        width: 94%;
        padding: 46px 18px 50px;
    }

    .memories-collage {
        gap: 18px 12px;
    }

    .memories-footer {
        font-size: 2em;
    }
}

/* =========================================
   RESPONSIVITAS — HP / MOBILE KECIL (≤480px)
   ========================================= */
@media (max-width: 480px) {
    .container {
        padding: 25px 15px;
    }

    h1 {
        font-size: 2.1em;
    }

    h2 {
        font-size: 1.15em;
    }

    p {
        font-size: 1em;
    }

    button {
        font-size: 0.95em;
        padding: 10px 18px;
    }

    .stat-box {
        min-width: 65px;
        padding: 8px 12px;
    }

    #gallery-section {
        width: 100%;
        border-radius: 14px;
        padding: 26px 14px 32px;
    }

    .final-layout {
        gap: 26px;
        margin: 20px 0;
    }

    .photos-stack {
        gap: 16px;
    }

    .polaroid-mini {
        width: 42%;
        max-width: 140px;
    }

    .polaroid-caption {
        font-size: 0.95em;
    }

    .envelopes-wrapper {
        gap: 18px;
    }

    .envelope {
        width: 100px;
        height: 73px;
    }

    .envelope-flap {
        border-left-width: 50px;
        border-right-width: 50px;
        border-top-width: 42px;
    }

    .envelope-label {
        font-size: 0.85em;
    }

    .letter-paper {
        padding: 28px 18px 22px;
    }

    #memories-section {
        padding: 42px 12px 44px;
        border-radius: 12px;
    }

    .memories-collage {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 12px;
    }

    .memories-badge {
        font-size: 1.4em;
        padding: 8px 22px;
    }

    .sticker {
        font-size: 0.65em;
        padding: 5px 12px;
    }

    .sticker-2 {
        top: 50px;
    }

    .memories-footer {
        font-size: 1.7em;
    }

    .btn-back {
        font-size: 0.8em;
        padding: 7px 14px;
    }
}