@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    color: white;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Efek Background Bergerak Kanan-Kiri (Panning) --- */
.bg-image {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background-image: url('bg.jpg'); 
    /* Mengatur tinggi penuh dan membiarkan lebar melar secara proporsional */
    background-size: auto 100%; 
    background-repeat: no-repeat;
    z-index: -1;
    filter: brightness(0.5); 
    /* Jalankan animasi bergerak konstan selama 20 detik */
    animation: panBackground 20s infinite ease-in-out alternate;
}

@keyframes panBackground {
    0% {
        /* Mulai dari ujung kiri gambar */
        background-position: left center;
    }
    100% {
        /* Geser perlahan sampai ujung kanan gambar */
        background-position: right center;
    }
}

/* --- Efek Partikel Jatuh --- */
.particles-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    top: -20px;
    color: rgba(255, 182, 193, 0.7); 
    font-size: 14px;
    user-select: none;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(105vh) rotate(360deg);
        opacity: 0;
    }
}

/* --- Pengaturan Transisi Layar Halus --- */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    position: absolute;
}

.screen.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    position: relative;
}

/* --- Layar 1 (Tombol Slider Denyut) --- */
#screen1 p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.slider-container {
    position: relative;
    width: 260px;
    height: 54px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    display: flex;
    align-items: center;
    overflow: hidden;
    touch-action: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    animation: pulseContainer 2s infinite ease-in-out;
}

@keyframes pulseContainer {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 1); }
    100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
}

.slider-text {
    position: absolute;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

.slider-thumb {
    position: absolute;
    left: 4px;
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 2;
    transition: transform 0.3s ease-out;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.slider-thumb.dragging {
    transition: none;
    cursor: grabbing;
}

/* --- Layar 2 (Kartu Gosok) --- */
.card-container {
    width: 90%;
    max-width: 400px;
    background: rgba(20, 30, 48, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.card-container h2 { font-size: 1.2rem; margin-bottom: 5px; letter-spacing: 0.5px; }
.card-container p { font-size: 0.85rem; margin-bottom: 20px; color: #d1d5db; }
.bottom-text { margin-top: 15px; margin-bottom: 0 !important; }

.scratch-container {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.15);
}

.secret-message {
    position: absolute;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff4d4d;
    text-align: center;
    z-index: 1;
    line-height: 1.4;
}

canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
    cursor: pointer;
}

/* --- Layar 3 (Surat) --- */
#screen3 {
    width: 90%;
    max-width: 400px;
}

.chat-box {
    background: rgba(20, 30, 48, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px 20px 25px 20px;
    position: relative;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.profile-pic {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    position: absolute;
    top: -38px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid #141e30;
    background-color: #fff;
    background-image: url('profil.jpg'); 
    background-size: cover;
    background-position: center;
}

.date-title { text-align: center; margin-top: 25px; margin-bottom: 20px; }
.date-title span { font-size: 0.75rem; color: #9ca3af; }
.date-title h3 { font-size: 1.1rem; margin-top: 5px; font-weight: 700; }

.message-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e5e7eb;
    white-space: pre-wrap;
    min-height: 150px;
}

.btn-balas {
    display: none;
    margin-top: 25px;
    background: #fff;
    color: #111827;
    padding: 12px;
    width: 100%;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-balas:hover {
    background: #f3f4f6;
}