:root {
    --bg-gradient-1: #fdfbfb;
    --bg-gradient-2: #ebedee;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(220, 180, 190, 0.2);
    --text-main: #333333;
    --text-subtle: #777777;
    --accent-red: #ff4d6d;
    --accent-pink: #ffb3c1;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevent scrolling during transitions */
    -webkit-font-smoothing: antialiased;
}

/* Background animated subtle blob (Optional abstract liquid feel) */
body::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: var(--accent-pink);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: floatBlob 10s infinite alternate ease-in-out;
    z-index: -1;
}

@keyframes floatBlob {
    0% { transform: translate(-100px, -100px); }
    100% { transform: translate(100px, 100px); }
}

#app-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    max-height: 900px;
    position: relative;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glass Panel Base */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 40px 30px;
    text-align: center;
    width: 100%;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.glass-panel.full-bleed {
    padding: 0;
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Stage Transitions */
.stage { position: absolute; }
.stage.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 10;
}
.stage.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    pointer-events: none;
    z-index: 1;
}

/* Typography */
h1, h2 { font-weight: 600; margin-bottom: 16px; color: var(--text-main); }
p { font-size: 1.1rem; line-height: 1.6; margin-bottom: 24px; color: var(--text-main); }
.subtle-text { color: var(--text-subtle); font-size: 0.9rem; }

/* Buttons */
.glass-btn {
    appearance: none;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-family: var(--font-family);
    margin: 8px;
}
.glass-btn:hover, .glass-btn:active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.02);
}
.glass-btn.primary { background: var(--accent-red); color: white; border: none; }
.glass-btn.primary:hover { background: #e03e5c; }
.glass-btn.secondary { background: transparent; }
.glass-btn.text-only { background: none; border: none; box-shadow: none; text-decoration: underline; }

/* Stage 2: Question */
.button-group { display: flex; justify-content: center; gap: 10px; position: relative; }
#btn-no { position: relative; transition: transform 0.3s ease; }

/* Stage 3: Heart 3D */
#canvas-container { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.heart-overlay { position: relative; z-index: 2; pointer-events: none; }
.heart-overlay h1, .heart-overlay p { text-shadow: 0 2px 10px rgba(255,255,255,0.8); }
.heart-overlay button { pointer-events: auto; }

/* Stage 4: Tic-Tac-Toe */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 260px;
    margin: 0 auto 20px;
}
.ttt-cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}
.ttt-cell:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.6); }

/* Stage 5: Letter */
.letter-content {
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 1.05rem;
}

/* Stage 6: Photobooth */
#pb-video { width: 100%; border-radius: 16px; margin-bottom: 15px; background: #000; }
#pb-canvas { width: 100%; max-width: 320px; border-radius: 16px; margin-bottom: 15px; box-shadow: var(--glass-shadow); }

/* Utility Animations */
.fade-in { opacity: 0; animation: fadeIn 1s forwards; }
.delay-1 { animation-delay: 0.8s; }
.delay-2 { animation-delay: 1.6s; }
.delay-3 { animation-delay: 2.4s; }
.delay-4 { animation-delay: 3.2s; }
@keyframes fadeIn { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }


}

.letter-content p {
    margin-bottom: 1.2rem; /* Jarak antar bait/paragraf */
    line-height: 1.6;      /* Jarak antar baris dalam satu bait */
    white-space: normal;
}

.letter-content p:last-child {
    margin-bottom: 0;
}