:root {
    --maroon: #5a1818;
    --gold: #d4af37;
    --beige: #fdf8f0;
    --dark: #333;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #222;
    color: var(--dark);
    overflow-x: hidden;
}

/* Mobile Container Simulation */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--beige);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background-image: radial-gradient(var(--gold) 0.5px, transparent 0.5px);
    background-size: 20px 20px;
    overflow: hidden; 
}

/* Typography */
h1, h2, h3, .serif { font-family: 'Playfair Display', serif; }
.script { font-family: 'Great Vibes', cursive; }

.text-maroon { color: var(--maroon); }
.text-gold { color: var(--gold); }
.text-center { text-align: center; }

/* Cover Overlay */
#cover {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, 0); 
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: linear-gradient(135deg, var(--maroon), #3a0f0f);
    color: var(--beige);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1); 
    overflow: hidden;
}

.cover-content {
    border: 2px solid var(--gold);
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    position: relative;
    opacity: 0;
    z-index: 10;
    background-color: transparent; 
}

.cover-content::before {
    content: ''; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 10px;
}

.btn-buka {
    background-color: var(--gold);
    color: var(--maroon);
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-top: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: 0.3s;
    position: relative;
    z-index: 2;
}

.btn-buka:hover { transform: scale(1.05); }

/* Sections & Box Wrapper */
section { padding: 60px 20px; position: relative; }

.frame-ornament, 
.family-wrapper, 
.guestbook-wrapper {
    border: 2px solid var(--maroon);
    padding: 30px 20px;
    text-align: center;
    border-radius: 10px;
    background-color: rgba(253, 248, 240, 0.95);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
    margin-bottom: 30px;
}

.btn-action {
    display: inline-block; background: var(--maroon); color: var(--gold);
    padding: 10px 20px; border-radius: 25px; text-decoration: none;
    font-size: 0.85rem; margin-top: 15px; transition: 0.3s; border: 1px solid var(--gold);
}
.btn-action:hover { transform: scale(1.03); }

/* =========================================
   COUNTDOWN TIMER (FORMAT 2x2 ABSOLUT)
========================================= */
.countdown-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Pasti 2x2 */
    gap: 12px; 
    max-width: 180px; 
    margin: 20px auto 30px auto;
    position: relative;
    z-index: 20; /* Agar tidak tertutup frame */
}

.countdown-box {
    background: linear-gradient(135deg, var(--maroon), #3a0f0f);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 12px 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.countdown-box span {
    font-size: 1.4rem; 
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.countdown-box p {
    font-size: 0.65rem; 
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   STYLE FORM RSVP & UCAPAN
========================================= */
.form-group { margin-bottom: 15px; text-align: left; }
.form-control {
    width: 100%; padding: 12px 15px; border: 1px solid rgba(90, 24, 24, 0.3);
    border-radius: 8px; background: rgba(255, 255, 255, 0.8); 
    font-family: 'Poppins', sans-serif; font-size: 0.85rem; color: var(--dark);
    transition: all 0.3s ease;
}
.form-control:focus {
    outline: none; border-color: var(--maroon); background: #fff;
    box-shadow: 0 0 8px rgba(90, 24, 24, 0.15);
}
textarea.form-control { resize: vertical; min-height: 80px; }

.guestbook-wrapper {
    position: relative; height: 350px; overflow: hidden; margin-top: 30px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    margin-bottom: 30px;
}
.guestbook-content {
    display: flex; flex-direction: column;
    animation: scrollVerticalMsg 30s linear infinite; 
}
.guestbook-wrapper:hover .guestbook-content,
.guestbook-wrapper:active .guestbook-content { animation-play-state: paused; }

@keyframes scrollVerticalMsg {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.msg-item {
    background: #fff; border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 16px 16px 16px 4px; padding: 15px; margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04); text-align: left;
}
.msg-name {
    font-weight: 600; color: var(--maroon); font-size: 0.95rem; display: flex;
    justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 8px; margin-bottom: 8px;
}
.msg-label {
    font-size: 0.7rem; background: var(--gold); color: white; padding: 3px 10px;
    border-radius: 12px; font-weight: 500; letter-spacing: 0.5px;
}
.msg-text { font-size: 0.85rem; color: #555; line-height: 1.5; }

/* Tambahan Style untuk Denah & Petunjuk Arah */
.direction-card {
    background: white; border-left: 4px solid var(--maroon); padding: 15px;
    margin-top: 15px; text-align: left; border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.direction-title { font-weight: 600; color: var(--maroon); font-size: 0.95rem; margin-bottom: 5px; }
.direction-text { font-size: 0.8rem; color: #555; line-height: 1.5; }

.map-route-sim {
    background: rgba(90, 24, 24, 0.03); border: 1px dashed var(--gold);
    border-radius: 8px; padding: 15px; margin: 20px 0; display: flex;
    justify-content: space-between; align-items: center; position: relative;
}
.route-node { text-align: center; flex: 1; z-index: 2; }
.route-node i {
    background: var(--maroon); color: var(--gold); width: 32px; height: 32px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem; margin-bottom: 5px; border: 2px solid var(--gold);
}
.route-node p { font-size: 0.7rem; font-weight: 600; color: var(--dark); }
.route-line {
    position: absolute; top: 31px; left: 15%; right: 15%; height: 2px;
    background: var(--gold); z-index: 1;
}

@keyframes munculMembesar {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.efek-cover-masuk { animation: munculMembesar 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.map-embed-wrapper {
    position: relative; width: 100%; padding-bottom: 100%; height: 0; overflow: hidden;
    border: 2px solid var(--gold); border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin: 25px 0;
}
.map-embed-wrapper iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* Style Baru Box Keluarga dengan Auto-Scroll */
.family-title-badge {
    background: var(--maroon); color: var(--gold); display: inline-block;
    padding: 6px 18px; border-radius: 20px; font-size: 0.85rem;
    font-weight: 600; letter-spacing: 1px; margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(90, 24, 24, 0.2);
}

.marquee-container {
    position: relative; height: 220px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}
.marquee-content {
    display: flex; flex-direction: column; animation: scrollVertical 20s linear infinite; 
}
.marquee-container:hover .marquee-content,
.marquee-container:active .marquee-content { animation-play-state: paused; }

@keyframes scrollVertical {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } 
}

.family-grid { display: grid; grid-template-columns: 1fr; gap: 8px; font-size: 0.8rem; color: #444; }
.family-item {
    border-bottom: 1px dashed #eee; padding-bottom: 4px; line-height: 1.4;
    padding: 10px 5px; font-size: 0.85rem; text-align: left;
}
.family-relation { color: #888; font-style: italic; font-size: 0.75rem; margin-left: 5px; }

/* =========================================
   DEKORASI SUDUT (PATTERN / PITA) & PEMBATAS
========================================= */
.decor-tl {
    position: absolute; top: -180px; left: -180px; width: 500px; 
    z-index: 0; pointer-events: none; transform: rotate(-45deg);
}
.decor-br {
    position: absolute; bottom: -180px; right: -180px; width: 500px; 
    z-index: 0; pointer-events: none; transform: rotate(-45deg);
}
.section-pattern {
    position: absolute; bottom: -30px; left: 0; width: 100%;
    height: 70px; object-fit: cover; z-index: 1; pointer-events: none; opacity: 0.9;
}

/* =========================================
   DEKORASI BUNGA BERKELIP
========================================= */
.bunga-animasi {
    position: absolute; width: 60px; height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='50' cy='25' rx='10' ry='25' fill='%23d4af37'/%3E%3Cellipse cx='50' cy='75' rx='10' ry='25' fill='%23d4af37'/%3E%3Cellipse cx='25' cy='50' rx='25' ry='10' fill='%23d4af37'/%3E%3Cellipse cx='75' cy='50' rx='25' ry='10' fill='%23d4af37'/%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
    z-index: 1; pointer-events: none; opacity: 0; 
    animation: munculHilang 6s ease-in-out infinite;
}
.b-1 { top: 15%; left: 15%; animation-delay: 0s; }
.b-2 { top: 75%; left: 10%; animation-delay: 2s; width: 45px; height: 45px; }
.b-3 { top: 20%; right: 15%; animation-delay: 4s; width: 80px; height: 80px; }
.b-4 { top: 65%; right: 20%; animation-delay: 1.5s; width: 50px; height: 50px; }
.b-5 { top: 40%; left: 50%; animation-delay: 3s; width: 70px; height: 70px; }
.b-6 { top: 85%; right: 45%; animation-delay: 5s; width: 40px; height: 40px; }

@keyframes munculHilang {
    0% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 0.4; transform: scale(1) rotate(45deg); }
    100% { opacity: 0; transform: scale(0.5) rotate(90deg); }
}

/* =========================================
   OPTIMASI KHUSUS LAYAR HP
========================================= */
@media screen and (max-width: 480px) {
    section { padding: 40px 15px; }
    .frame-ornament, .family-wrapper, .guestbook-wrapper { padding: 25px 15px; }
    h2.serif { font-size: 1.6rem !important; }
}

/* =========================================
   SECTION QUOTE (KUTIPAN)
========================================= */
.quote-wrapper {
    padding: 40px 20px;
    margin: 10px auto 30px auto;
    position: relative;
    z-index: 10;
    text-align: center;
}

.quote-icon {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    color: rgba(212, 175, 55, 0.2); /* Warna emas transparan */
    display: block;
    line-height: 0;
    margin-bottom: 25px;
}

.quote-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--maroon);
    font-style: italic;
    margin-bottom: 15px;
}

.quote-author {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: 1px;
    text-transform: uppercase;
}