:root {
    --primary: #ff4d6d;
    --secondary: #ff758c;
    --glass: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: white;
    text-align: center;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
#stars {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url("https://www.transparenttextures.com/patterns/stardust.png");
    z-index: -2; opacity: 0.4;
}

#hearts {
    position: fixed; width: 100%; height: 100%; pointer-events: none; z-index: -1;
}

.heart {
    position: absolute; color: var(--primary);
    animation: floatUp 6s linear forwards;
}

@keyframes floatUp {
    to { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* Opening Section */
#opening {
    height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
}

.gift-gif {
    width: 180px; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

.gift-gif.exploded {
    animation: explode 1s forwards cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(2.5); opacity: 0.5; filter: blur(5px); }
    100% { transform: scale(5); opacity: 0; visibility: hidden; }
}

.tap-hint {
    margin-top: 20px; font-weight: 500; letter-spacing: 2px;
    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Main Content */
.hidden { display: none; }

#mainContent {
    padding: 20px; max-width: 500px; margin: auto;
    animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header h1 { font-size: 1.8rem; margin-bottom: 5px; }
header p { font-size: 0.9rem; opacity: 0.9; margin-bottom: 10px; }

/* Padding kartu diperkecil agar konten lebih mepet ke tepi */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 15px; /* Diperkecil dari 20px */
    margin: 15px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Timer Styles */
.time-container {
    display: flex; justify-content: center; gap: 10px;
}

.time-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px; border-radius: 12px; min-width: 65px;
    border: 1px solid var(--border);
}

.time-box span {
    display: block; font-size: 1.4rem; font-weight: bold;
    color: var(--secondary);
    animation: timeTick 1s infinite;
}

@keyframes timeTick {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); color: #fff; }
}

.time-box p { font-size: 0.6rem; text-transform: uppercase; margin-top: 2px; }

/* Slideshow (Smaller & Eye-Catching) */
/* Slideshow dibuat hampir memenuhi lebar kartu */
.slideshow {
    width: 100%; /* Memenuhi lebar container kartu */
    max-width: 400px; /* Batas maksimal agar tidak terlalu raksasa di desktop */
    aspect-ratio: 4/3; /* Tetap kotak sempurna atau bisa diubah ubah*/
    margin: 10px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    position: relative;
}

.slide {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Foto akan otomatis memenuhi kotak tanpa gepeng */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.slide.active { opacity: 1; position: relative; }

/* Message Text */
.typewriter-text {
    font-size: 0.95rem; line-height: 1.7; min-height: 80px;
    text-align: center;
}

footer { margin-top: 40px; opacity: 0.6; font-size: 0.8rem; }

/* Khusus untuk tampilan HP agar margin kanan-kiri benar-benar tipis */
@media (max-width: 480px) {
    #mainContent {
        padding: 10px; /* Margin layar HP diperkecil */
    }
    .glass-card {
        padding: 10px;
    }
    .slideshow {
        width: 100%; /* Benar-benar full di dalam kartu */
    }
}