:root {
    /* --- GEN Z DARK MODE PALETTE --- */
    --bg-color: #0a0118;
    --bg-gradient: linear-gradient(135deg, #0a0118 0%, #1a0b2e 40%, #2d1235 100%);
    
    --text-color: #e0e0e0;
    --primary-color: #FAFF00;  /* Ultra Lemon */
    --secondary-color: #FF00FF; /* Magenta Neon */
    --tertiary-color: #00FFFF;  /* Cyan Neon */
    
    /* Glassmorphism */
    --glass-bg: rgba(20, 20, 40, 0.4); 
    --glass-border: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 0, 255, 0.2) 50%, rgba(0, 255, 255, 0.2) 100%);
    
    --overlay-color: rgba(10, 1, 24, 0.7);
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Lato', sans-serif;
    
    --section-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --neon-glow: 0 0 10px rgba(250, 255, 0, 0.7), 0 0 20px rgba(250, 255, 0, 0.4);
}

[data-theme="light"] {
    /* --- GEN Z LIGHT MODE PALETTE --- */
    --bg-color: #ffffff;
    --bg-gradient: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 50%, #90f7ec 100%);
    
    --text-color: #2a1b3d;
    --primary-color: #ff4757; 
    --secondary-color: #5352ed;
    --tertiary-color: #2ed573;

    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    --overlay-color: rgba(255, 255, 255, 0.6);
    
    --section-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --neon-glow: none; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-color); 
    background-image: var(--bg-gradient); 
    background-attachment: fixed;
    color: var(--text-color);
    overflow-x: hidden;
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
    cursor: default;
    transition: background 0.5s ease, color 0.5s ease;
}

/* --- LOADERS & BACKGROUND --- */
#loader-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color); background-image: var(--bg-gradient);
    z-index: 99999; display: flex; justify-content: center; align-items: center;
    animation: fadeOutLoader 1s ease-in-out 3s forwards;
}
.paper-plane {
    width: 100px; height: auto; position: absolute; left: -20%; bottom: 10%;
    filter: drop-shadow(0 0 10px var(--primary-color)); transform: rotate(15deg);
    animation: flyAcross 3s ease-in-out forwards;
}
.paper-plane svg { width: 100%; height: 100%; color: var(--primary-color); }

@keyframes flyAcross {
    0% { left: -20%; bottom: 10%; transform: scale(0.5) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { left: 120%; bottom: 80%; transform: scale(1.5) rotate(45deg); opacity: 0; }
}
@keyframes fadeOutLoader { to { opacity: 0; visibility: hidden; } }

body::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999; opacity: 0.05; 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- CONTROLS (BUTTON UPDATE: POLOS & KACA) --- */
.controls { position: fixed; top: 20px; right: 20px; z-index: 10002; display: flex; gap: 10px; }

.controls button {
    /* Reset style lama yang ribet */
    background: rgba(255, 255, 255, 0.1); /* Transparan polos */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Garis tipis halus */
    color: var(--text-color); 
    padding: 8px 15px; 
    border-radius: 30px;
    cursor: pointer; 
    backdrop-filter: blur(8px); /* Efek blur kaca */
    -webkit-backdrop-filter: blur(8px);
    font-weight: bold;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.controls button:hover { 
    background: rgba(255, 255, 255, 0.25); /* Sedikit lebih terang saat dihover */
    transform: translateY(-2px); 
    border-color: var(--primary-color); /* Sedikit warna tema di pinggir */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Penyesuaian Tombol untuk Mode Terang */
[data-theme="light"] .controls button {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}
[data-theme="light"] .controls button:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--primary-color);
}


main { flex-grow: 1; }
.background-effects { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; pointer-events: none; z-index: -1; }
.firefly {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--secondary-color);
    animation: move-fly ease-in-out infinite, blink linear infinite; mix-blend-mode: screen;
}
@keyframes move-fly { 0%, 100% { transform: translate(var(--x-start), var(--y-start)); } 50% { transform: translate(var(--x-end), var(--y-end)); } }
@keyframes blink { 0%, 100% { opacity: 0.4; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.3); } }

/* --- HERO --- */
.hero {
    height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; color: white; position: relative;
    background-image: url('https://i.ibb.co.com/Hp4kKrDN/Whats-App-Image-2025-10-15-at-21-16-41-cf0b987d.jpg');
    background-position: center; background-repeat: no-repeat; background-size: cover;
    overflow: hidden; background-attachment: fixed;
}
.hero::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay-color); backdrop-filter: blur(3px);
}
.hero-content { z-index: 1; }
.hero h1 {
    font-family: var(--font-heading); font-size: 6rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 20px var(--primary-color), 0 0 40px var(--secondary-color);
    letter-spacing: 3px; color: white; margin-bottom: 10px;
}
.hero p {
    font-size: 1.5rem; font-weight: 300; font-style: italic; margin-top: 10px;
    color: rgba(255,255,255,0.9); text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
[data-theme="light"] .hero h1 { color: var(--text-color); text-shadow: 0 0 15px rgba(255, 71, 87, 0.5); }
[data-theme="light"] .hero p { color: var(--text-color); text-shadow: none; font-weight: 700; }
[data-theme="light"] .hero::after { backdrop-filter: blur(5px) brightness(1.2); background: rgba(255, 255, 255, 0.7); }

.content-wrapper { position: relative; padding: 4rem 2rem; }

/* --- SECTION --- */
.section {
    max-width: 900px; margin: 5rem auto; padding: 3rem; background: var(--glass-bg);
    box-shadow: var(--section-shadow); backdrop-filter: blur(15px) saturate(120%);
    border-radius: 25px; border: 2px solid transparent;
    background-image: linear-gradient(var(--glass-bg), var(--glass-bg)), var(--glass-border);
    background-origin: border-box; background-clip: padding-box, border-box;
    text-align: center; overflow: hidden; position: relative;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.section:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), var(--neon-glow); border-color: var(--primary-color); }
.section h2 {
    font-family: var(--font-heading); font-size: 4rem; margin-bottom: 1.5rem; letter-spacing: 1px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* --- SECTION KHUSUS (Background Images) --- */
.section.letter, .section.song-section, .section.memory-section {
    background-color: rgba(0,0,0,0.7) !important; border: none !important; background-blend-mode: overlay;
}
.section.letter { background-image: url('https://i.ibb.co.com/sJKzs8Vc/Desain-tanpa-judul.png') !important; background-size: cover; background-position: center; }
.section.song-section { background-image: url('https://i.ibb.co.com/sdXSLgfF/Desain-tanpa-judul.png') !important; background-size: cover; background-position: center; }
.section.memory-section { background-image: url('https://i.ibb.co.com/3Ykk73yT/Desain-tanpa-judul.png') !important; background-size: cover; background-position: center; }

.section.letter h2, .section.memory-section h2, .section.song-section h2, .section.letter p {
    color: white !important; background: none; -webkit-text-fill-color: white; text-fill-color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}
.section.letter p { font-size: 1.2rem; line-height: 1.9; font-weight: 400; }
[data-theme="light"] .section.letter, [data-theme="light"] .section.memory-section, [data-theme="light"] .section.song-section {
    background-color: rgba(255,255,255,0.3) !important; background-blend-mode: soft-light;
}

/* --- MEMORY GALLERY (GRID LAYOUT - PORTRAIT) --- */
.memory-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* --- KARTU FOTO PORTRAIT --- */
.memory-card {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    position: relative;
    /* UBAH DISINI: Height lebih tinggi agar jadi Portrait */
    height: 480px; 
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    background-color: #222;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Animasi Ngambang (Dance) */
    animation: dance 5s ease-in-out infinite alternate;
}

/* Keyframes untuk animasi ngambang */
@keyframes dance {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Agar animasi ngambang selang-seling */
.memory-card:nth-child(even) { animation-delay: -2.5s; }

/* Efek saat Hover (Naik lebih tinggi & glow) */
.memory-card:hover {
    transform: translateY(-20px) scale(1.02); /* Naik ke atas */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), var(--neon-glow);
    z-index: 5;
    animation-play-state: paused; /* Stop dance saat dihover */
}

.memory-card img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; /* Memastikan foto full tanpa gepeng */
    z-index: 0;
    transition: transform 0.5s ease;
}

/* Hover effect normal cards (Zoom gambar) */
.memory-card:not(.mini-slider-card):hover img { transform: scale(1.15); filter: saturate(1.2); }

.memory-card .overlay {
    background: linear-gradient(to top, rgba(0,0,0, 0.95) 10%, rgba(26, 11, 46, 0.6) 50%, transparent 100%);
    width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center;
    padding: 2rem; color: white;
    position: absolute; top: 0; left: 0;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease-out;
}

.memory-card:hover .overlay { opacity: 1; transform: translateY(0); }
.memory-card h3 { font-family: var(--font-heading); color: var(--primary-color); margin-bottom: 0.8rem; font-size: 2rem; }
.memory-card p { font-size: 1rem; line-height: 1.5; color: rgba(255, 255, 255, 0.95); }

/* --- INTERNAL SLIDER (Untuk Kartu 7 & 11) --- */
.mini-slider-card:hover .slide-img { transform: none; }

.internal-slider {
    width: 100%; height: 100%; position: relative;
}

.slide-img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0; transition: opacity 0.5s ease;
    z-index: 1;
}

.slide-img.active { opacity: 1; z-index: 2; }

/* Tombol Navigasi Internal (Overlay di atas kartu) */
.internal-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none; color: white;
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 20; font-size: 1.5rem;
    transition: 0.3s; opacity: 0; /* Sembunyi dulu */
}

/* Munculkan tombol saat kartu di-hover */
.mini-slider-card:hover .internal-nav { opacity: 1; }

.internal-nav:hover { background: var(--primary-color); color: #000; }
.internal-nav.prev { left: 10px; }
.internal-nav.next { right: 10px; }


/* Tooltip */
#memory-tooltip {
    background: rgba(20, 20, 40, 0.9); backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color); box-shadow: 0 0 15px var(--primary-color);
    border-radius: 12px; padding: 15px 20px; z-index: 99999;
    pointer-events: none; transform: scale(0.9); transition: opacity 0.2s;
    max-width: 250px; position: fixed; display: none; color: white; text-align: left;
}
#memory-tooltip.visible { display: block; opacity: 1; transform: scale(1); }
#memory-tooltip h3 { font-family: var(--font-heading); color: var(--primary-color); margin-bottom: 5px; }

/* --- COUNTDOWN --- */
#countdown { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; }
.countdown-box {
    background: var(--glass-bg); padding: 1.5rem; border-radius: 20px; width: 120px;
    border: 2px solid transparent; background-image: linear-gradient(var(--glass-bg), var(--glass-bg)), var(--glass-border);
    background-origin: border-box; background-clip: padding-box, border-box;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2); transition: transform 0.3s ease;
}
.countdown-box:hover { transform: scale(1.1); box-shadow: var(--neon-glow); }
.countdown-box span {
    display: block; font-size: 3.5rem; font-weight: 800;
    background: linear-gradient(to bottom, var(--primary-color), var(--tertiary-color));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.countdown-box p { font-size: 1.1rem; margin-top: 5px; font-weight: bold; text-transform: uppercase; color: var(--text-color); opacity: 0.8; }

/* --- WORDS CAROUSEL --- */
.carousel { margin-top: 3rem; min-height: 150px; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 60px; }
.carousel-slide { font-size: 1.8rem; display: none; font-style: italic; color: var(--primary-color); text-align: center; width: 100%; }
.carousel-slide.active { display: block; animation: fadeInScale 1s forwards; }
.carousel-btn {
    background: rgba(255, 255, 255, 0.1); border: 2px solid var(--primary-color); color: var(--primary-color);
    width: 50px; height: 50px; border-radius: 50%; backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; transform: translateY(-50%);
    cursor: pointer; z-index: 10; transition: 0.3s;
}
.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }
.carousel-btn:hover { background: var(--primary-color); color: var(--bg-color); box-shadow: 0 0 20px var(--primary-color); }

/* --- GAME & FOOTER --- */
#game-section { margin-top: 4rem; text-align: center; }
#game-container {
    position: relative; margin: 0 auto; width: 90%; max-width: 600px; height: 400px;
    border: 2px solid var(--primary-color); border-radius: 20px; overflow: hidden;
    background: rgba(0,0,0,0.5); touch-action: none; cursor: crosshair;
}
#gameCanvas { display: block; width: 100%; height: 100%; }
#game-ui { position: absolute; top: 10px; left: 10px; color: var(--primary-color); font-weight: bold; font-size: 1.2rem; pointer-events: none; }
#game-start-screen, #game-over-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.8); z-index: 10; color: white;
}
.game-btn {
    margin-top: 15px; padding: 10px 25px; border: none; border-radius: 30px;
    background: var(--primary-color); color: #000; font-weight: bold; cursor: pointer;
    font-size: 1.1rem; box-shadow: 0 0 15px var(--primary-color); transition: 0.3s;
}
.game-btn:hover { transform: scale(1.1); background: var(--secondary-color); color: white; }
.hidden-screen { display: none !important; }

footer { width: 100%; padding: 3rem 1rem; margin-top: auto; background: transparent; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; opacity: 0.7; }
.hidden { opacity: 0; transform: translateY(60px) scale(0.9); filter: blur(10px); transition: all 1s; }
.show { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
.typewriter { border-right: 4px solid var(--primary-color); display: inline-block; animation: blink-caret .8s step-end infinite; }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--primary-color); } }
@keyframes fadeInScale { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }

@media (max-width: 768px) {
    .hero h1 { font-size: 3.5rem; }
    .section { margin: 3rem 1rem; padding: 2rem 1.5rem; }
    .section h2 { font-size: 2.8rem; }
    .countdown-box { width: 80px; padding: 1rem 0.5rem; }
    .countdown-box span { font-size: 2rem; }
    .slider-nav { width: 40px; height: 40px; font-size: 1rem; }
    /* Mobile Portrait Height */
    .memory-card { min-width: 100%; height: 480px; }
    .mini-nav.prev { left: 45px; }
    .mini-nav.next { right: 45px; }
    .mini-nav { width: 30px; height: 30px; font-size: 1.2rem; }
    .memory-gallery { grid-template-columns: 1fr; } /* Mobile 1 kolom */
}