:root {
    --primary: #8e2de2;
    --secondary: #4a00e0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: white;
    transition: background 1.2s ease-in-out;
}

/* =========================================
         THEME 1: ORIGINAL (Default - UNTOUCHED)
      ========================================= */
body.theme-original {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

.theme-original .card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.theme-original .polaroid {
    background: white;
    padding: 8px 8px 25px 8px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: rotate(-2deg);
}

.theme-original .polaroid:nth-child(even) {
    transform: rotate(2deg);
}

.theme-original .polaroid:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 5;
}

.theme-original .btn-surprise {
    background: #ff5f6d;
    background: linear-gradient(45deg, #ff5f6d, #ffc371);
    border: none;
    color: white;
    border-radius: 30px;
    font-size: 14px;
    letter-spacing: 2px;
    padding: 10px 30px;
    transition: all 0.3s ease;
}

.theme-original .btn-surprise:hover {
    background: #ffc371;
    background: linear-gradient(45deg, #ffc371, #ff5f6d);
    box-shadow: 0 0 15px rgba(255, 95, 109, 0.5);
}

/* =========================================
         THEME 2: JAPANESE — Ink wash, washi, bokeh
      ========================================= */
body.theme-japanese {
    background: #0a0a12;
    color: #f0e8e0;
    font-family: "Noto Serif JP", serif;
}

/* Animated moon + fog layers */
body.theme-japanese::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 400px 400px at 80% 15%,
            rgba(255, 220, 150, 0.12) 0%,
            transparent 70%),
        radial-gradient(ellipse 200px 200px at 80% 15%,
            rgba(255, 240, 200, 0.08) 0%,
            transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.theme-japanese::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 900px 300px at 50% 100%,
            rgba(180, 30, 60, 0.25) 0%,
            transparent 70%),
        radial-gradient(ellipse 600px 200px at 20% 80%,
            rgba(80, 0, 120, 0.2) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: fogDrift 20s ease-in-out infinite alternate;
}

@keyframes fogDrift {
    0% {
        opacity: 0.6;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(30px);
    }
}

.theme-japanese .card {
    background: rgba(10, 8, 20, 0.75);
    border-radius: 2px;
    border-top: 1px solid rgba(255, 200, 150, 0.3);
    border-left: 1px solid rgba(255, 200, 150, 0.15);
    border-right: 1px solid rgba(100, 0, 50, 0.4);
    border-bottom: 1px solid rgba(100, 0, 50, 0.4);
    box-shadow:
        0 0 60px rgba(180, 30, 60, 0.15),
        0 40px 80px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 200, 150, 0.1);
    backdrop-filter: blur(20px);
    position: relative;
}

/* Vertical brushstroke decoration */
.theme-japanese .card::before {
    content: "誕生日おめでとう";
    position: absolute;
    right: -32px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-family: "Noto Serif JP", serif;
    font-size: 11px;
    letter-spacing: 8px;
    color: rgba(200, 100, 120, 0.5);
    writing-mode: vertical-rl;
    transform: none;
    right: -28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    letter-spacing: 6px;
    white-space: nowrap;
    pointer-events: none;
}

.theme-japanese h1 {
    font-family: "Noto Serif JP", serif;
    font-weight: 300;
    font-size: 32px;
    letter-spacing: 4px;
    color: #f0e0d0;
    text-shadow: 0 0 30px rgba(255, 150, 150, 0.4);
    margin-bottom: 5px;
}

.theme-japanese #typing {
    font-family: "Noto Serif JP", serif;
    font-size: 14px;
    line-height: 2;
    color: rgba(240, 220, 200, 0.85);
    letter-spacing: 0.5px;
}

.theme-japanese .gallery-wrapper {
    border-top: 1px solid rgba(200, 100, 100, 0.2);
    border-bottom: 1px solid rgba(200, 100, 100, 0.2);
    padding: 12px 0;
}

.theme-japanese .polaroid {
    background: transparent;
    padding: 3px;
    border-radius: 0;
    border: 1px solid rgba(200, 120, 100, 0.35);
    transform: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.theme-japanese .polaroid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(180, 30, 60, 0.3) 0%,
            transparent 60%);
    pointer-events: none;
    transition: opacity 0.4s;
}

.theme-japanese .polaroid:hover::after {
    opacity: 0;
}

.theme-japanese .polaroid img {
    width: 110px;
    height: 130px;
    object-fit: cover;
    display: block;
    filter: saturate(0.7) contrast(1.05) brightness(0.9);
    transition: filter 0.6s ease;
}

.theme-japanese .polaroid:hover img {
    filter: saturate(1.1) contrast(1.05) brightness(1);
}

.theme-japanese .polaroid:hover {
    transform: translateY(-8px);
    border-color: rgba(220, 150, 150, 0.6);
}

.theme-japanese .btn-surprise {
    background: transparent;
    border: 1px solid rgba(200, 120, 120, 0.6);
    color: #f0ddd0;
    border-radius: 1px;
    font-family: "Noto Serif JP", serif;
    font-size: 13px;
    letter-spacing: 3px;
    padding: 10px 30px;
    transition: all 0.4s;
    text-transform: none;
}

.theme-japanese .btn-surprise:hover {
    background: rgba(180, 30, 60, 0.3);
    border-color: rgba(220, 150, 150, 0.9);
    box-shadow:
        0 0 20px rgba(180, 30, 60, 0.3),
        inset 0 0 10px rgba(180, 30, 60, 0.1);
}

/* =========================================
         THEME 3: INDONESIAN — Batik / Rempah / Gold
      ========================================= */
body.theme-indonesian {
    background: #1a0e08;
    color: #f5e6c8;
    font-family: "Playfair Display", serif;
}

body.theme-indonesian::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 10% 20%,
            rgba(180, 100, 20, 0.12) 0%,
            transparent 50%),
        radial-gradient(circle at 90% 80%,
            rgba(120, 50, 10, 0.15) 0%,
            transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 5 L55 30 L30 55 L5 30 Z' fill='none' stroke='rgba(180,120,40,0.06)' stroke-width='1'/%3E%3Ccircle cx='30' cy='30' r='8' fill='none' stroke='rgba(180,120,40,0.06)' stroke-width='0.5'/%3E%3Cpath d='M30 5 L30 55 M5 30 L55 30' stroke='rgba(180,120,40,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.theme-indonesian .card {
    background: rgba(28, 16, 8, 0.9);
    border-radius: 4px;
    border: 1px solid rgba(180, 120, 40, 0.4);
    box-shadow:
        0 0 0 6px rgba(28, 16, 8, 0.8),
        0 0 0 7px rgba(180, 120, 40, 0.3),
        0 0 0 12px rgba(28, 16, 8, 0.6),
        0 0 0 13px rgba(120, 80, 20, 0.2),
        0 40px 80px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible !important;
}

/* Corner ornaments */
.theme-indonesian .card::before,
.theme-indonesian .card::after {
    content: "✦";
    position: absolute;
    font-size: 20px;
    color: rgba(200, 150, 50, 0.6);
    line-height: 1;
}

.theme-indonesian .card::before {
    top: -12px;
    left: -12px;
}

.theme-indonesian .card::after {
    bottom: -12px;
    right: -12px;
}

.theme-indonesian h1 {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: 40px;
    font-weight: 700;
    background: linear-gradient(135deg,
            #d4a843 0%,
            #f5d98b 40%,
            #c8922a 70%,
            #f0c860 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(180, 120, 30, 0.4));
    letter-spacing: 1px;
}

.theme-indonesian #typing {
    font-family: "Lora", serif;
    font-size: 14px;
    line-height: 1.9;
    color: rgba(240, 220, 190, 0.9);
    font-style: italic;
}

.theme-indonesian .gallery-wrapper {
    border-top: 1px solid rgba(180, 120, 40, 0.25);
    border-bottom: 1px solid rgba(180, 120, 40, 0.25);
    padding: 10px 0;
}

.theme-indonesian .polaroid {
    background: rgba(20, 12, 5, 0.8);
    padding: 6px 6px 20px;
    border-radius: 1px;
    border: 1px solid rgba(180, 120, 40, 0.3);
    transform: none;
    flex-shrink: 0;
}

.theme-indonesian .polaroid img {
    width: 110px;
    height: 130px;
    object-fit: cover;
    filter: sepia(0.4) saturate(1.2) contrast(1.1) brightness(0.95);
    transition: filter 0.5s;
}

.theme-indonesian .polaroid:hover img {
    filter: sepia(0) saturate(1.2) contrast(1.05) brightness(1);
}

.theme-indonesian .polaroid:hover {
    transform: translateY(-8px) rotate(1deg);
    border-color: rgba(220, 170, 60, 0.6);
}

.theme-indonesian .btn-surprise {
    background: transparent;
    border: 1px solid rgba(200, 150, 50, 0.7);
    color: #f0d890;
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: 14px;
    letter-spacing: 2px;
    padding: 10px 30px;
    border-radius: 1px;
    transition: all 0.4s;
}

.theme-indonesian .btn-surprise:hover {
    background: rgba(180, 120, 30, 0.3);
    border-color: rgba(220, 170, 60, 1);
    box-shadow:
        0 0 25px rgba(180, 120, 30, 0.4),
        inset 0 0 15px rgba(180, 120, 30, 0.1);
    color: #fde9a0;
}

/* =========================================
         THEME 4: WESTERN — Synthwave / Neon / Grid
      ========================================= */
body.theme-western {
    background: #04000f;
    color: #e8e0ff;
    font-family: "Space Mono", monospace;
}

/* Perspective grid floor */
body.theme-western::before {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55vh;
    background-image:
        linear-gradient(rgba(255, 0, 200, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 200, 0.15) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(400px) rotateX(60deg);
    transform-origin: bottom center;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* Horizon glow */
body.theme-western::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 45vh;
    height: 3px;
    background: linear-gradient(90deg,
            transparent,
            #ff00c8,
            #00f0ff,
            #ff00c8,
            transparent);
    box-shadow:
        0 0 30px 10px rgba(255, 0, 200, 0.3),
        0 0 60px 20px rgba(0, 240, 255, 0.15);
    pointer-events: none;
    z-index: 0;
}

.theme-western .card {
    background: rgba(4, 0, 20, 0.85);
    border-radius: 0;
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-top: 1px solid rgba(255, 0, 200, 0.5);
    box-shadow:
        0 0 0 1px rgba(255, 0, 200, 0.1),
        0 0 40px rgba(255, 0, 200, 0.1),
        0 0 80px rgba(0, 240, 255, 0.06),
        inset 0 1px 0 rgba(255, 0, 200, 0.2),
        0 40px 80px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    clip-path: polygon(0 0,
            calc(100% - 20px) 0,
            100% 20px,
            100% 100%,
            20px 100%,
            0 calc(100% - 20px));
    position: relative;
}

/* Scanlines overlay */
.theme-western .card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 240, 255, 0.02) 2px,
            rgba(0, 240, 255, 0.02) 4px);
    pointer-events: none;
    z-index: 10;
}

.theme-western h1 {
    font-family: "Space Mono", monospace;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #ff00c8, #00f0ff, #ff00c8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neonSlide 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 0, 200, 0.6));
    line-height: 1.3;
}

@keyframes neonSlide {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.theme-western #typing {
    font-family: "Space Mono", monospace;
    font-size: 12px;
    line-height: 1.9;
    color: rgba(180, 220, 255, 0.8);
    letter-spacing: 0.3px;
}

.theme-western .gallery-wrapper {
    border-top: 1px solid rgba(255, 0, 200, 0.2);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.3);
}

.theme-western .polaroid {
    background: transparent;
    padding: 0;
    transform: none;
    border-radius: 0;
    border: 1px solid rgba(0, 240, 255, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.theme-western .polaroid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 0, 200, 0.2) 0%,
            transparent 50%,
            rgba(0, 240, 255, 0.1) 100%);
    pointer-events: none;
    transition: opacity 0.4s;
}

.theme-western .polaroid:hover::after {
    opacity: 0;
}

.theme-western .polaroid img {
    width: 110px;
    height: 130px;
    object-fit: cover;
    filter: saturate(0.3) contrast(1.4) hue-rotate(200deg) brightness(0.9);
    transition: filter 0.5s;
    display: block;
}

.theme-western .polaroid:hover img {
    filter: saturate(1.3) contrast(1.1) hue-rotate(0deg) brightness(1.1);
}

.theme-western .polaroid:hover {
    border-color: rgba(255, 0, 200, 0.8);
    box-shadow: 0 0 20px rgba(255, 0, 200, 0.3);
}

.theme-western .btn-surprise {
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.6);
    color: #00f0ff;
    border-radius: 0;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    padding: 10px 30px;
    clip-path: polygon(0 0,
            calc(100% - 10px) 0,
            100% 10px,
            100% 100%,
            10px 100%,
            0 calc(100% - 10px));
    transition: all 0.3s;
}

.theme-western .btn-surprise:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 1);
    color: #fff;
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.4),
        inset 0 0 20px rgba(0, 240, 255, 0.05);
}

/* =========================================
         BASE LAYOUT (All themes share this)
      ========================================= */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition:
        opacity 0.8s ease-in-out,
        transform 0.8s ease-in-out;
    z-index: 2;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

#intro,
#theme-selection {
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
}

.btn-start {
    padding: 15px 40px;
    font-size: 20px;
    background: white;
    color: var(--secondary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transition: transform 0.3s;
    animation: pulseBtn 2s infinite;
}

.btn-start:hover {
    transform: scale(1.1);
}

@keyframes pulseBtn {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.theme-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
    margin-top: 20px;
}

.btn-theme {
    padding: 12px 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-theme:hover {
    background: white;
    color: #333;
    transform: translateY(-5px);
}

.card {
    padding: 30px;
    max-width: 90%;
    width: 600px;
    height: 65%;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.8s ease;
}

h1 {
    font-family: "Dancing Script", cursive;
    font-size: 42px;
    margin: 0 0 10px 0;
}

#typing {
    font-size: 18px;
    line-height: 1.6;
    min-height: 80px;
    margin-bottom: 20px;
    text-align: center;
}

.gallery-wrapper {
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.gallery-wrapper::-webkit-scrollbar {
    display: none;
}

.gallery {
    display: flex;
    padding: 5px;
    transition: all 0.8s ease;
    gap: 8px;
}

.polaroid {
    transition: all 0.5s ease;
    flex-shrink: 0;
}

.polaroid img {
    width: 125px;
    height: 150px;
    object-fit: cover;
    display: block;
}

.btn-surprise {
    margin-top: 25px;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    color: white;
}

/* =========================================
         FLOATING ICONS
      ========================================= */
.floating-icon {
    position: fixed;
    font-size: 24px;
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatDown {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(110vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatSway {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    40% {
        transform: translateY(40vh) translateX(30px) rotate(90deg);
    }

    70% {
        transform: translateY(70vh) translateX(-20px) rotate(180deg);
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(110vh) translateX(10px) rotate(270deg);
        opacity: 0;
    }
}

@keyframes scanlineFloat {
    0% {
        transform: translateY(110vh) scaleX(0.8);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
        transform: scaleX(1);
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-10vh) scaleX(0.8);
        opacity: 0;
    }
}

/* =========================================
         ENDING SCREEN
      ========================================= */
#ending {
    background: radial-gradient(circle at center, #1a0b2e 0%, #000000 100%);
    z-index: 5;
    text-align: center;
    padding: 20px;
    color: white;
}

.star-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.ending-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: twinkle ease-in-out infinite alternate;
    transform: translate3d(calc(var(--parallax-x) * var(--depth, 1)),
            calc(var(--parallax-y) * var(--depth, 1)),
            0);
}

#ending h2 {
    font-family: "Dancing Script", cursive;
    font-size: 50px;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #a0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: explode 1s ease-out forwards;
    z-index: 1;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.gallery-wrapper {
    overflow-x: auto;
    padding: 15px 5px;
    scrollbar-width: none;
    /* Firefox */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    /* Kursor tangan terbuka */
}

/* Saat diklik dan digeser, kursor jadi tangan menggenggam */
.gallery-wrapper:active {
    cursor: grabbing;
}

/* Sembunyikan scrollbar di Chrome/Safari/Edge */
.gallery-wrapper::-webkit-scrollbar {
    display: none;
}