:root {
    --bg-maroon: #5b0211; 
    --gold: #e2c079;
    --gold-dark: #b89547;
    --cream: #fff9f0;
    --font-cursive: 'Great Vibes', cursive;
    --font-serif: 'Playfair Display', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background-color: #000; font-family: var(--font-serif);
    color: var(--cream); min-height: 100vh;
    display: flex; justify-content: center; align-items: center; overflow: hidden;
}
#app {
    width: 100%; max-width: 420px; height: 100vh; max-height: 900px;
    background: radial-gradient(circle at center, #6b0718 0%, #3a0009 100%);
    position: relative; overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.8); margin: 0 auto;
}

/* Typography */
.elegant-text { font-family: var(--font-cursive); font-weight: 400; text-shadow: 1px 1px 4px rgba(0,0,0,0.4); }
.gold-text { color: var(--gold); text-shadow: 0 0 10px rgba(226,192,121,0.3); }
.subtitle { color: #f2d5a0; font-size: 1rem; font-style: italic; }

/* Screens */
.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10;
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none;
    transform: scale(0.95) translateY(20px);
    transition: opacity 1s ease, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.screen.active { opacity: 1; pointer-events: all; z-index: 20; transform: scale(1) translateY(0); }
.flex-center { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.fade-in-up { opacity: 0; }
.screen.active .fade-in-up { animation: fadeInUp 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards; }

/* Keyframes */
@keyframes pulseSoft { 0%,100%{transform:scale(1)} 50%{transform:scale(1.03)} }
@keyframes pulseFast { 0%,100%{transform:scale(1)} 15%,45%{transform:scale(1.15)} 30%{transform:scale(1)} }
@keyframes float { 0%,100%{transform:translateY(0px) rotate(0deg)} 50%{transform:translateY(-8px) rotate(2deg)} }
@keyframes floatRev { 0%,100%{transform:translateY(0px) rotate(0deg)} 50%{transform:translateY(-8px) rotate(-2deg)} }
@keyframes fadeInUp { 0%{opacity:0;transform:translateY(30px)} 100%{opacity:1;transform:translateY(0)} }
@keyframes fall { 0%{transform:translateY(-50px) rotate(0deg);opacity:0} 10%,90%{opacity:0.6} 100%{transform:translateY(900px) rotate(360deg);opacity:0} }
@keyframes blinkGlow { 0%,100%{opacity:0.2;transform:scale(0.8)} 50%{opacity:1;transform:scale(1.2)} }

/* Inovasi 8: Amplop Bergoyang */
@keyframes wobble {
    0%,100% { transform: rotate(0deg); }
    15% { transform: rotate(-4deg) scale(1.02); }
    30% { transform: rotate(4deg) scale(1.02); }
    45% { transform: rotate(-3deg); }
    60% { transform: rotate(3deg); }
    75% { transform: rotate(-1deg); }
}
.envelope-wobble { animation: wobble 2.5s ease-in-out infinite; }

/* Inovasi 1: Hujan Hati */
@keyframes heartFall {
    0% { transform: translateY(-30px) rotate(0deg) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
    90% { opacity: 0.8; }
    100% { transform: translateY(900px) rotate(720deg) scale(0.5); opacity: 0; }
}
.heart-rain { position: absolute; pointer-events: none; z-index: 50; animation: heartFall linear forwards; font-size: 1.5rem; }

/* Inovasi 2: Cursor Trail */
.star-trail {
    position: fixed; pointer-events: none; z-index: 9999;
    font-size: 0.8rem; animation: trailFade 0.8s forwards;
}
@keyframes trailFade {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0) translateY(-15px); }
}

/* Inovasi 6: Kembang Api Canvas */
#fireworks-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 5; pointer-events: none;
}

/* Inovasi 7: Lightbox */
.lightbox-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.92); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.lightbox-overlay.active { opacity: 1; pointer-events: all; }
.lightbox-content { text-align: center; padding: 20px; }
.lightbox-photo {
    background: #2a0008; width: 85vw; max-width: 400px; height: auto; max-height: 80vh;
    border: 3px solid var(--gold); 
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.lightbox-caption { color: var(--gold); font-family: var(--font-cursive); font-size: 2rem; margin-top: 15px; }
.lightbox-close {
    position: absolute; top: 20px; right: 20px; background: rgba(226,192,121,0.3);
    border: 1px solid var(--gold); color: var(--gold); width: 40px; height: 40px;
    border-radius: 50%; font-size: 1.2rem; cursor: pointer;
}
.clickable-photo { cursor: pointer; }
.clickable-photo:hover { opacity: 0.8; }

/* Floating Music Toggle Button */
.music-toggle-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(45, 2, 9, 0.75);
    border: 1.5px solid var(--gold);
    color: var(--gold);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 10px rgba(226,192,121,0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.music-toggle-btn:hover {
    transform: scale(1.12);
    background: rgba(75, 4, 15, 0.9);
    box-shadow: 0 0 15px rgba(226, 192, 121, 0.6);
}
.music-toggle-btn:active {
    transform: scale(0.92);
}
.music-toggle-btn.playing {
    border-color: #ffd700;
    box-shadow: 0 0 16px rgba(226, 192, 121, 0.55), 0 4px 12px rgba(0,0,0,0.6);
    animation: musicPulse 2.5s infinite ease-in-out;
}
.music-toggle-btn.paused {
    opacity: 0.75;
    border-color: rgba(226, 192, 121, 0.4);
    color: rgba(226, 192, 121, 0.6);
}
.spin-music {
    animation: spinVinyl 3.5s linear infinite;
    display: inline-block;
}
@keyframes musicPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(226, 192, 121, 0.3); }
    50% { transform: scale(1.06); box-shadow: 0 0 18px rgba(226, 192, 121, 0.6); }
}

/* Partikel & Kunang-kunang */
.particles { position: absolute; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.particle { position: absolute; animation: fall linear infinite; opacity: 0; font-size: 1.2rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.firefly {
    position: absolute; width: 4px; height: 4px; background: #ffebb3; border-radius: 50%;
    box-shadow: 0 0 10px 4px rgba(255,235,179,0.6);
    animation: blinkGlow infinite alternate ease-in-out, float 5s infinite;
}

/* Utility */
.pulse-soft { animation: pulseSoft 4s infinite; }
.pulse-fast { animation: pulseFast 3s infinite; }
.float-anim { animation: float 10s ease-in-out infinite; }
.float-anim-rev { animation: floatRev 9s ease-in-out infinite; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

.scrollable-content {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 30px 20px 20px 20px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start !important;
    width: 100%;
}
.scrollable-content::-webkit-scrollbar { width: 0; }

/* Spacer agar konten paling bawah tidak tertutup tombol fixed BACK/MENU dan bisa di-scroll sampai tuntas */
.scrollable-content::after {
    content: '';
    display: block;
    min-height: 90px;
    width: 100%;
    flex-shrink: 0;
}

/* Amplop Cover */
.envelope-wrapper { cursor: pointer; position: relative; z-index: 5; }
.envelope {
    width: 240px; height: 160px; background: #e6d3ba; position: relative;
    border-radius: 2px; box-shadow: 0 15px 30px rgba(0,0,0,0.6);
}
.envelope::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #f7ebd9 50%, #e6d3ba 50%); z-index: 1;
}
.envelope-flap {
    position: absolute; top: 0; left: 0;
    border-left: 120px solid transparent; border-right: 120px solid transparent;
    border-top: 95px solid #fdf5e6; z-index: 3; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}
.envelope-seal {
    position: absolute; top: 75px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 50px; background: radial-gradient(circle, #aa001b, #6b000f);
    border-radius: 50%; z-index: 4; box-shadow: 0 4px 8px rgba(0,0,0,0.6);
    border: 2px solid #3a0009; display: flex; justify-content: center; align-items: center;
    color: var(--gold); font-size: 1.2rem;
}

/* Collage Full (Referensi Design) */
.collage-full {
    position: relative; width: 100%; height: 75vh;
    display: flex; justify-content: center; align-items: center;
}

/* Kartu Tengah */
.center-card {
    background: #fdf5e6;
    padding: 20px 25px;
    border: 2px solid #dcb579;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    text-align: center;
    position: relative;
    z-index: 10;
    min-width: 180px;
}
.card-decor-left {
    position: absolute; top: -18px; left: -18px;
    font-size: 2.2rem; filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.3));
}
.card-decor-right {
    position: absolute; bottom: -18px; right: -18px;
    font-size: 2rem;
}

/* Polaroid Besar di Sudut */
.big-polaroid {
    position: absolute;
    background: #fff;
    padding: 8px 8px 28px 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.55);
    width: 140px;
    cursor: pointer;
    transition: transform 0.3s;
    z-index: 5;
}
.big-polaroid:hover { transform: scale(1.08) rotate(0deg) !important; z-index: 15; }
.big-polaroid .photo {
    background: #e8dbce; width: 100%; height: 120px;
    display: flex; justify-content: center; align-items: center;
    color: #9c8a73; font-style: italic; font-size: 0.8rem; gap: 5px;
    object-fit: cover; /* Untuk <img> tag */
    display: block;
}

/* Posisi di 4 sudut */
.pol-tl { top: 8%; left: 3%; transform: rotate(-10deg); }
.pol-tr { top: 8%; right: 3%; transform: rotate(10deg); }
.pol-bl { bottom: 8%; left: 3%; transform: rotate(-8deg); }
.pol-br { bottom: 8%; right: 3%; transform: rotate(8deg); }

/* Dekorasi Terbang di Ruang Kosong */
.collage-decor {
    position: absolute; z-index: 8; pointer-events: none;
    font-size: 1.8rem; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.4));
}
.cd-butterfly-top { top: 10%; left: 50%; transform: translateX(-50%); font-size: 2.2rem; }
.cd-rose-mid      { top: 50%; left: 3%; transform: translateY(-50%); font-size: 2rem; }
.cd-bird-tr       { top: 45%; right: 3%; transform: translateY(-50%); font-size: 1.8rem; }
.cd-flower-bl     { bottom: 22%; left: 35%; font-size: 1.6rem; }
.cd-hibiscus-br   { bottom: 22%; right: 5%; font-size: 1.8rem; }
.cd-butterfly-br  { bottom: 5%; left: 55%; font-size: 1.8rem; }
.cd-sparkle-1     { top: 30%; left: 44%; font-size: 1.4rem; }
.cd-sparkle-2     { top: 62%; right: 44%; font-size: 1.2rem; }


/* Menu Timer Block */
.timer-block { display: flex; gap: 15px; width: 90%; }
.time-together-card, .countdown-card {
    flex: 1; background: rgba(0,0,0,0.4); border: 1px solid rgba(226,192,121,0.3);
    border-radius: 15px; padding: 15px 10px; text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); backdrop-filter: blur(5px);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}

/* Menu List */
.menu-list { display: flex; flex-direction: column; gap: 16px; width: 88%; }
.menu-item {
    display: flex; align-items: center; gap: 18px; cursor: pointer; transition: transform 0.3s;
    background: rgba(91,2,17,0.5); padding: 16px 22px; border-radius: 18px;
    border: 1px solid rgba(226,192,121,0.2); box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.menu-item:hover { transform: translateY(-4px); border-color: var(--gold); }
.menu-item h2 { font-size: 1.9rem; margin: 0; color: #fff; text-shadow: 1px 2px 4px rgba(0,0,0,0.5); white-space: nowrap; }
.icon-box {
    width: 46px; height: 46px; flex-shrink: 0; background: radial-gradient(circle, #fff9f0, #e2c079);
    border-radius: 12px; display: flex; justify-content: center; align-items: center;
    color: #5b0211; font-size: 1.3rem; box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

/* Timeline */
.timeline-container { position: relative; padding-left: 20px; margin-top: 10px; }
.timeline-container::before {
    content: ''; position: absolute; top: 0; left: 29px; height: 100%; width: 2px;
    background: rgba(226,192,121,0.4);
}
.timeline-item { position: relative; margin-bottom: 35px; padding-left: 40px; }
.timeline-dot {
    position: absolute; left: 0; top: 5px; width: 18px; height: 18px;
    background: var(--gold); border-radius: 50%; border: 3px solid #3a0009;
    box-shadow: 0 0 10px rgba(226,192,121,0.8);
}
.timeline-content { padding: 12px; }
.elegant-card {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(226,192,121,0.3);
    padding: 15px; border-radius: 10px;
}

/* Gallery Grid & Aesthetic Polaroid */
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 90%; }
.gallery-grid .aesthetic-polaroid { width: 100%; position: relative; }

/* Polaroid Standar (Our Journey & Sweet Memories) */
.aesthetic-polaroid {
    background: #fff; padding: 8px 8px 24px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); position: relative; text-align: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
/* Efek Selotip (Tape) untuk mempermanis */
.aesthetic-polaroid::before {
    content: ''; position: absolute;
    top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg);
    width: 70px; height: 28px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 5;
    backdrop-filter: blur(3px);
}
.aesthetic-polaroid:hover { transform: scale(1.08) rotate(0deg) !important; z-index: 10; }
.aesthetic-polaroid .photo {
    background: #e8dbce; width: 100%; height: auto; aspect-ratio: 1 / 1;
    display: flex; justify-content: center; align-items: center;
    color: #9c8a73; font-style: italic; font-size: 0.85rem; gap: 5px;
    object-fit: cover; display: block;
}
.photo-top { object-position: top center !important; }

/* Foto timeline Our Journey mengikuti rasio asli foto tanpa terpotong */
.timeline-item .aesthetic-polaroid .photo {
    aspect-ratio: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 520px;
    object-fit: contain !important;
    display: block;
    border-radius: 2px;
}

/* Galeri Lengkap di Bawah Our Journey */
.journey-gallery-section {
    margin-top: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gallery-divider-line {
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 15px auto 10px auto;
}
.journey-gallery-section .gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-top: 15px;
}
.journey-gallery-section .aesthetic-polaroid {
    width: 100%;
    margin-bottom: 5px;
}

/* Playlist */
.playlist-container { width: 95%; display: flex; flex-direction: column; align-items: center; }
.video-wrapper {
    width: 100%; aspect-ratio: 16/9; border: 3px solid var(--gold-dark); border-radius: 4px; overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6); background: #111;
}
.frames-grid { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; z-index: 5; width: 100%; }
.gold-frame { background: #000; border: 4px solid var(--gold); box-shadow: 0 8px 20px rgba(0,0,0,0.6); overflow: hidden; cursor: pointer; }
.gold-frame .photo { width: 100%; height: 100%; display: block; object-fit: cover; background: #333; color: #aaa; font-style: italic; font-size: 0.8rem; }
.frame-1 { width: 100px; height: 80px; transform: rotate(-6deg); }
.frame-2 { width: 80px; height: 100px; transform: rotate(8deg); }
.frame-3 { width: 95px; height: 95px; transform: rotate(-3deg); }
.frame-4 { width: 90px; height: 75px; transform: rotate(12deg); }
.frame-5 { width: 110px; height: 85px; transform: rotate(-8deg); }

/* Vinyl */
.vinyl-player { cursor: pointer; z-index: 10; display: flex; flex-direction: column; align-items: center; }
.vinyl-disc {
    width: 100%; height: 100%;
    background: radial-gradient(circle, #ff5757 10%, #111 20%, #222 30%, #111 40%, #222 50%, #111 60%, #222 70%, #111 80%);
    border-radius: 50%; box-shadow: 0 5px 15px rgba(0,0,0,0.6);
}
.vinyl-player.playing .vinyl-disc { animation: spinVinyl 4s linear infinite; }
@keyframes spinVinyl { 100% { transform: rotate(360deg); } }
.play-indicator { color: var(--gold); font-size: 0.9rem; margin-top: 10px; }

/* Surat */
.gift-layout { width: 95%; position: relative; display: flex; flex-direction: column; align-items: center; }
.vintage-letter {
    background: #f4eee1; padding: 25px 20px; border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); border: 1px solid #dcb579; width: 100%;
}
.title-right { text-align: left; font-size: 2.5rem; margin-bottom: 10px; border-bottom: 1px dashed #dcb579; padding-bottom: 10px; }
.letter-text { font-size: 1.05rem; line-height: 1.8; color: #3a1a00; font-style: italic; text-align: justify; min-height: 120px; }
.large-frame {
    width: 260px;
    max-width: 85%;
    height: auto;
    transform: rotate(-3deg);
    border-width: 5px;
    overflow: hidden;
    background: transparent;
}
.large-frame .photo {
    width: 100%;
    height: auto;
    max-height: 480px;
    display: block;
    object-fit: contain;
}



/* Tombol Back Transparan Emas */
.back-btn-gold {
    position: absolute; bottom: 20px;
    background-color: rgba(0,0,0,0.4); color: var(--gold);
    border: 2px solid var(--gold); padding: 10px 35px;
    font-size: 1rem; font-weight: bold; font-family: var(--font-serif); letter-spacing: 1px;
    border-radius: 30px; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); z-index: 100;
    transition: all 0.3s ease; backdrop-filter: blur(5px);
}
.back-btn-gold:hover { background-color: rgba(226,192,121,0.2); transform: translateY(-3px); }
