:root {
    --bg-dark: #1a0510;
    --pink-primary: #ff1493;
    /* DeepPink */
    --pink-light: #ff69b4;
    /* HotPink */
    --pink-accent: #ffb6c1;
    /* LightPink */
    --pink-glow: rgba(255, 20, 147, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 105, 180, 0.3);
    --text-light: #ffffff;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    /* Prevent scrolling during game */
    height: 100vh;
    height: 100dvh;
}

/* Background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    top: -50px;
    /* Mulai sedikit lebih tinggi agar mulus */
    width: 3px;
    /* Ditebalkan sedikit */
    height: 35px;
    /* Dilamakan/dipanjangkan agar lebih terlihat seperti hujan deras */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 182, 193, 0.9));
    /* Warna ditingkatkan opacitynya */
    border-radius: 5px;
    animation: rainFall linear forwards;
}

@keyframes rainFall {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(120vh);
        /* Pastikan melewati layar ditiap jenis device */
        transform: translateY(calc(100vh + 100px));
        /* Fallback universal */
    }
}

.title-font {
    font-family: 'Pacifico', cursive;
    font-weight: 400;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out, transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.95) translateY(20px);
    padding: 20px;
    z-index: 10;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* UI Elements */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    max-width: 800px;
    /* Made wider for laptop */
    width: 90%;
    /* Fluid width for smaller screens */
    margin: auto;
    flex-shrink: 0;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 20, 147, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-pulse {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.pink-gradient-text {
    background: linear-gradient(135deg, #ffffff, var(--pink-accent), var(--pink-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    padding-bottom: 5px;
    /* prevent font clipping */
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.instruction-box {
    background: rgba(255, 20, 147, 0.15);
    border: 1px dashed var(--pink-light);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.instruction-box h3 {
    color: var(--pink-light);
    margin-bottom: 10px;
}

.instruction-box p {
    font-size: 1.1rem;
}

.pink-glow-btn {
    background: linear-gradient(45deg, var(--pink-primary), var(--pink-light));
    border: none;
    padding: 15px 45px;
    border-radius: 50px;
    color: white;
    font-size: 1.3rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 25px var(--pink-glow);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pink-glow-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 35px rgba(255, 20, 147, 0.8);
}

.pink-glow-btn:active {
    transform: translateY(2px) scale(0.95);
}

/* GAME UI */
.progress-container {
    position: absolute;
    top: 50px;
    width: 85%;
    max-width: 400px;
    height: 35px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 2px solid var(--pink-light);
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pink-light), var(--pink-primary), #ff0055);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

#hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 15;
}

/* Floating Stars Area Constraints for Laptops vs Mobile */
.floating-star {
    position: absolute;
    bottom: -150px;
    font-size: clamp(3rem, 6vw, 5rem);
    /* Scales based on viewport */
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: floatUp linear forwards;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    transition: transform 0.2s;
}

.floating-star:hover {
    transform: scale(1.1) rotate(0deg) !important;
    /* Visual cue for mouse users on laptop */
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1) rotate(-15deg);
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-120vh) scale(1.2) rotate(15deg);
        opacity: 0;
    }
}

.floating-star.caught {
    animation: popCaught 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: none;
}

@keyframes popCaught {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.6);
        opacity: 0.8;
        filter: brightness(1.5);
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* SURPRISE SCREEN IMAGES AND EXTRAS */
.photo-carousel {
    position: relative;
    width: 100%;
    height: 180px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    /* Provides depth for the custom transform */
    z-index: 5;
}

.photo-carousel img {
    position: absolute;
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--pink-light);
    box-shadow: 0 10px 25px rgba(255, 20, 147, 0.4);
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.6s ease, z-index 0.6s;
    background-color: var(--bg-dark);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
        filter: drop-shadow(0 15px 10px rgba(0, 0, 0, 0.2));
    }
}

h2.name-animate {
    font-size: 2.2rem;
    color: var(--pink-accent);
    margin-bottom: 25px;
    text-shadow: 0 0 10px var(--pink-glow);
}

.message-box {
    background: rgba(255, 20, 147, 0.1);
    padding: 25px;
    border-radius: 20px;
    border-left: 5px solid var(--pink-primary);
    text-align: left;
    margin-bottom: 25px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.message-box p {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 12px;
    font-weight: 300;
}

.message-box p:last-child {
    margin-bottom: 0;
}

.signature {
    font-weight: 600;
    color: var(--pink-light);
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.mt-4 {
    margin-top: 1.5rem;
}

.pink-outline-btn {
    background: transparent;
    border: 2px solid var(--pink-light);
    padding: 12px 30px;
    border-radius: 50px;
    color: var(--pink-light);
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pink-outline-btn:hover {
    background: rgba(255, 105, 180, 0.2);
    box-shadow: 0 0 15px var(--pink-glow);
    transform: translateY(-2px);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .glass-panel {
        padding: 2.5rem;
    }

    .pink-gradient-text {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .glass-panel {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }

    .pink-gradient-text {
        font-size: 2.8rem;
    }

    h2.name-animate {
        font-size: 2rem;
    }

    .instruction-box p {
        font-size: 1.05rem;
    }

    .photo-carousel {
        height: 150px;
    }

    .photo-carousel img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 1.5rem 1rem;
    }

    .pink-gradient-text {
        font-size: 2.2rem;
    }

    h2.name-animate {
        font-size: 1.6rem;
    }

    .message-box {
        padding: 15px;
    }

    .message-box p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .pink-glow-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .photo-carousel {
        height: 130px;
    }

    .photo-carousel img {
        width: 100px;
        height: 100px;
    }

    .pink-outline-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Opening Text Sequence */
#opening-screen {
    justify-content: center;
    overflow: hidden;
}

.giant-text {
    font-size: 8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    color: var(--text-light);
    text-shadow: 0 0 30px var(--pink-glow), 0 0 60px var(--pink-primary);
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    transition: opacity 1.2s ease-in-out, transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    background: linear-gradient(135deg, #ffffff, var(--pink-accent), var(--pink-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 20px;
    margin: 0;
    line-height: 1.2;
    max-width: 100%;
    word-wrap: break-word;
}

.giant-text.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

@media (max-width: 1024px) {
    .giant-text {
        font-size: 6.5rem;
    }
}

@media (max-width: 768px) {
    .giant-text {
        font-size: 4.5rem;
    }
}

@media (max-width: 480px) {
    .giant-text {
        font-size: 3.2rem;
    }
}

/* Candle Styles */
.candle-container {
    position: relative;
    width: 60px;
    height: 150px;
    margin: 40px auto;
    cursor: pointer;
    display: flex;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.candle-stick {
    position: absolute;
    bottom: 0;
    width: 40px;
    height: 100px;
    background: linear-gradient(to right, #ff69b4, #ff1493, #ff69b4);
    border-radius: 5px 5px 10px 10px;
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.5);
    z-index: 2;
}

.candle-stick::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 18px;
    width: 4px;
    height: 15px;
    background: #333;
    border-radius: 2px;
}

.flame {
    position: absolute;
    top: 5px;
    width: 25px;
    height: 45px;
    background: #ffdb58;
    border-radius: 50% 50% 20% 20%;
    box-shadow:
        0 0 20px #ffdb58,
        0 -10px 40px #ff8c00,
        0 -20px 60px #ff4500;
    transform-origin: bottom center;
    animation: flicker 0.1s infinite alternate, flutter 2s infinite ease-in-out;
    z-index: 3;
    transition: opacity 0.5s, transform 0.5s;
}

.flame.blown-out {
    opacity: 0;
    transform: scale(0) translateY(-20px);
    animation: none;
}

.instruction-text {
    font-size: 1.1rem;
    color: var(--pink-accent);
    animation: pulse 2s infinite;
}

@keyframes flicker {
    0% {
        transform: scale(1) rotate(-1deg);
        box-shadow: 0 0 20px #ffdb58, 0 -10px 40px #ff8c00;
    }

    100% {
        transform: scale(1.05) rotate(1deg);
        box-shadow: 0 0 25px #ffdb58, 0 -15px 50px #ff8c00;
    }
}

@keyframes flutter {

    0%,
    100% {
        border-radius: 50% 50% 20% 20%;
    }

    50% {
        border-radius: 40% 60% 20% 20%;
    }
}

/* Popup Messages */
.popup-message {
    position: fixed;
    background: rgba(255, 255, 255, 0.9);
    color: var(--pink-primary);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.4);
    z-index: 1000;
    pointer-events: none;
    animation: floatUpFade 2.5s ease-out forwards;
    white-space: nowrap;
}

@keyframes floatUpFade {
    0% {
        transform: translateY(20px) scale(0.8);
        opacity: 0;
    }

    20% {
        transform: translateY(0) scale(1.1);
        opacity: 1;
    }

    30% {
        transform: translateY(-5px) scale(1);
        opacity: 1;
    }

    80% {
        transform: translateY(-30px) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
}

/* Typing Effect */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--pink-primary);
    vertical-align: middle;
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================================
   CONFESSION SCREEN — Minta Izin Masuk ke Hatinya
   ============================================================ */

#confession-screen {
    justify-content: center;
    overflow-y: auto;
}

.confession-panel {
    max-width: 520px;
    padding: 3rem 2.5rem;
    min-height: 420px;
    position: relative;
    overflow: hidden;
}

/* Stars sparkle background inside panel */
.confession-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 20, 147, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 182, 193, 0.08) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 30px;
}

/* Individual step wrapper */
.confession-step {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: stepIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    width: 100%;
}

.confession-step.active {
    display: flex;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Big emoji icon per step */
.confession-icon {
    font-size: 5rem;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 0 15px rgba(255, 20, 147, 0.5));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Heartbeat for "yes" answer icon */
.heart-beat {
    animation: heartBeat 0.8s ease-in-out infinite !important;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(1.1); }
}

/* Title for each step */
.confession-title {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    background: linear-gradient(135deg, #ffffff, var(--pink-accent), var(--pink-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Normal description text */
.confession-desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    max-width: 400px;
}

/* The main question — highlighted */
.confession-question {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--pink-accent);
    font-style: italic;
    margin: 1.2rem 0;
    padding: 1rem 1.5rem;
    background: rgba(255, 20, 147, 0.12);
    border-left: 4px solid var(--pink-primary);
    border-radius: 0 15px 15px 0;
    text-shadow: 0 0 10px rgba(255, 20, 147, 0.4);
    line-height: 1.6;
    animation: questionPulse 2.5s ease-in-out infinite;
}

@keyframes questionPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 20, 147, 0); }
    50% { box-shadow: 0 0 20px rgba(255, 20, 147, 0.25); }
}

/* Button container */
.confession-btns {
    display: flex;
    gap: 14px;
    margin-top: 1.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Yes button */
.conf-btn-yes {
    background: linear-gradient(45deg, var(--pink-primary), var(--pink-light));
    border: none;
    padding: 13px 35px;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 20px var(--pink-glow);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.conf-btn-yes:hover {
    transform: translateY(-3px) scale(1.07);
    box-shadow: 0 5px 30px rgba(255, 20, 147, 0.8);
}

.conf-btn-yes:active {
    transform: scale(0.95);
}

/* No button */
.conf-btn-no {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 11px 30px;
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.conf-btn-no:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
}

/* Floating mini hearts after "yes" */
.mini-float-heart {
    position: absolute;
    font-size: 1.8rem;
    pointer-events: none;
    animation: miniHeartFloat 3s ease-out forwards;
    z-index: 50;
}

@keyframes miniHeartFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0.6) rotate(30deg);
    }
}

/* Progress dots at top */
.confession-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 2rem;
}

.confession-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 105, 180, 0.3);
    transition: all 0.4s ease;
}

.confession-dot.filled {
    background: var(--pink-primary);
    box-shadow: 0 0 8px var(--pink-glow);
    transform: scale(1.3);
}

/* Responsive */
@media (max-width: 480px) {
    .confession-title { font-size: 1.6rem; }
    .confession-desc { font-size: 1rem; }
    .confession-question { font-size: 1.15rem; }
    .confession-icon { font-size: 4rem; }
    .confession-panel { padding: 2rem 1.2rem; }
}

/* Quote penutup di step-final */
.confession-quote {
    margin-top: 20px;
    font-size: 1.15rem;
    font-weight: 600;
    font-style: italic;
    color: var(--pink-light);
    text-shadow: 0 0 12px rgba(255, 105, 180, 0.5);
    line-height: 1.7;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 105, 180, 0.2);
    width: 100%;
    text-align: center;
    animation: quoteFade 1.5s ease-in-out;
}

@keyframes quoteFade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}