@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700;900&family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #0ea5e9;
    --danger: #ef4444;
    --purple: #a855f7;
    --gold: #facc15;
    --bg-dark: #020617;
}

body { 
    margin: 0; padding: 0; overflow: hidden; 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-dark); 
    display: flex; flex-direction: column; 
    height: 100vh; width: 100vw;
    user-select: none;
}

/* --- LAYAR START --- */
#start-overlay {
    position: fixed; inset: 0; background: #020617; z-index: 99999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.8s ease;
}
.btn-start-game {
    padding: 15px 40px; font-size: 18px; font-weight: 900; letter-spacing: 2px;
    background: transparent; color: #38bdf8; border: 2px solid #38bdf8;
    border-radius: 8px; cursor: pointer; transition: 0.3s;
    box-shadow: 0 0 15px rgba(56,189,248,0.2);
    font-family: 'Space Grotesk', sans-serif;
    margin-top: 20px;
}
.btn-start-game:hover {
    background: #38bdf8; color: #000; box-shadow: 0 0 30px rgba(56,189,248,0.6);
    transform: translateY(-3px);
}

/* --- VISUAL STAGE & VFX --- */
.visual-stage {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #020617; transition: background-color 1.5s ease;
    z-index: 1; overflow: hidden;
}

.scene-container {
    width: 100%; height: 100%; position: absolute; top: 0; left: 0;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transform: scale(1.05); 
    transition: opacity 0.8s ease, transform 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.scene-container.active { opacity: 1; transform: scale(1); }
.svg-scene { width: 100%; height: 100%; object-fit: cover; }

.glitch-active { animation: glitchTV 0.3s ease-in-out; }
@keyframes glitchTV {
    0% { filter: invert(1) hue-rotate(90deg); transform: translateX(5px); }
    50% { filter: invert(0) hue-rotate(-90deg); transform: translateX(-5px) scale(1.02); }
    100% { filter: none; transform: translateX(0); }
}

.vignette-overlay { position: absolute; inset: 0; background: radial-gradient(circle, transparent 20%, rgba(0,0,0,0.95) 120%); z-index: 5; pointer-events: none; opacity: 0.5; transition: opacity 1.5s ease; }
.vignette-overlay.show-dark { opacity: 0.95; }
.vignette-overlay.pitch-black { background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,1) 100%); opacity: 1; }

@keyframes heartbeat { 0%, 30%, 100% { opacity: 0.5; transform: scale(1); } 15%, 45% { opacity: 0.95; transform: scale(1.02); background: radial-gradient(circle, transparent 20%, rgba(66, 0, 0, 0.8) 120%); } }
.heartbeat-active { animation: heartbeat 1.5s infinite; }

@keyframes heartbeat-fast { 0%, 30%, 100% { opacity: 0.7; transform: scale(1); } 15%, 45% { opacity: 1; transform: scale(1.04); background: radial-gradient(circle, rgba(66,0,0,0.2) 20%, rgba(66, 0, 0, 1) 120%); } }
.heartbeat-fast { animation: heartbeat-fast 0.8s infinite; }

.item-float { animation: floating 3s ease-in-out infinite; }
@keyframes floating { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.character-shake { animation: shakeChar 0.1s infinite; transform-origin: center center; }
@keyframes shakeChar { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 75% { transform: translate(3px, -2px); } }

@keyframes spinFast { 0% { transform: translateY(-200px); } 100% { transform: translateY(200px); } }
.spin-reel { animation: spinFast 0.15s linear infinite; }

@keyframes spinSlow { 0% { transform: translateY(-300px); } 100% { transform: translateY(300px); } }
.spin-reel-slow { animation: spinSlow 0.4s linear infinite; }

.dialogue-wrapper {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 100; cursor: pointer; pointer-events: auto;
    opacity: 0 !important; 
}

.dialogue-wrapper.hide-subtitle { opacity: 0 !important; pointer-events: none; }

.ff-indicator { display: none !important; } 
@keyframes pulse { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.8; } }

.dialogue-content {
    width: 90%; max-width: 900px; padding: 10px 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.teks-cerita { 
    font-size: 28px; font-weight: 600; line-height: 1.5; color: #fff; 
    text-align: center; word-break: break-word; white-space: pre-wrap;
    text-shadow: 2px 2px 4px #000, -1px -1px 4px #000, 1px -1px 4px #000, -1px 1px 4px #000, 1px 1px 4px #000, 0 8px 25px rgba(0,0,0,1);
}

.kata { 
    display: inline-block; 
    opacity: 0;
    animation: textCinematicMorph 1.2s cubic-bezier(0.215, 0.610, 0.355, 1) forwards; 
}
@keyframes textCinematicMorph {
    0% { opacity: 0; filter: blur(4px); transform: translateY(5px) scale(0.95); }
    30% { opacity: 1; filter: blur(0px); transform: translateY(0) scale(1); }
    100% { opacity: 0.85; filter: blur(0px); transform: translateY(0) scale(1); } 
}

/* --- CHOICES / CROSSROADS --- */
.choices-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.95); backdrop-filter: blur(15px);
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px;
    opacity: 0; pointer-events: none; transition: opacity 1.2s ease; z-index: 200; padding: 20px;
}
.choices-overlay.muncul { opacity: 1; pointer-events: auto; }

.btn-pilihan { 
    text-decoration: none; font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; line-height: 1.5;
    padding: 18px 30px; border-radius: 12px; transition: all 0.3s; 
    width: 100%; max-width: 700px; text-align: left; display: flex; align-items: center;
    background: rgba(15, 23, 42, 0.9); color: #fff; border: 1px solid rgba(255,255,255,0.2); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); position: relative; overflow: hidden;
}

.btn-panik { background: rgba(66, 0, 0, 0.6); color: #fca5a5; border: 2px solid #ef4444; box-shadow: 0 0 20px rgba(239,68,68,0.2); animation: redPulse 1.5s infinite;}
.btn-panik:hover { transform: scale(1.03); background: rgba(127, 29, 29, 0.9); color: #fff; box-shadow: 0 0 30px rgba(239,68,68,0.6);}
@keyframes redPulse { 0%, 100% { border-color: rgba(239,68,68,0.4); } 50% { border-color: rgba(239,68,68,1); } }

.btn-kusam { background: #1e293b; color: #94a3b8; border: 1px solid #475569; }
.btn-kusam:hover { transform: scale(1.03); background: #334155; color: #f8fafc; border-color: #94a3b8; }

.btn-gelap { background: transparent; color: #475569; border: 1px dashed #334155; }
.btn-gelap:hover { transform: scale(1.02); background: rgba(15, 23, 42, 0.8); color: #94a3b8; border-style: solid;}

.btn-normal::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary); transition: 0.3s; }
.btn-normal:hover { transform: translateY(-5px) scale(1.02); background: rgba(30, 41, 59, 0.95); border-color: var(--primary); box-shadow: 0 15px 40px rgba(14,165,233,0.3); }
.btn-normal:hover::before { width: 10px; }

.btn-badge { padding: 4px 12px; border-radius: 6px; margin-right: 15px; font-size: 14px; font-weight: 900;}
.btn-normal .btn-badge { background: #1e293b; color: #fff; }
.btn-panik .btn-badge { background: #ef4444; color: #fff; }
.btn-kusam .btn-badge { background: #475569; color: #fff; }
.btn-gelap .btn-badge { background: #334155; color: #000; }

.chapter-title { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 50px; font-weight: 900; letter-spacing: 5px; opacity: 0; z-index: 500; text-align: center; pointer-events: none;}
.chapter-title span { font-size: 20px; display: block; color: var(--gold); letter-spacing: 2px;}
.anim-chap { animation: fadeChap 5s forwards; }
@keyframes fadeChap { 0% { opacity: 0; transform: translate(-50%, -45%); } 25%, 75% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -55%); } }

/* OVERLAY TRANSISI ENDING/CHAPTER */
#ending-overlay {
    position: fixed; inset: 0; background: #000; z-index: 999999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 1.5s ease;
}
#ending-overlay.show { opacity: 1; pointer-events: auto; }
#ending-text {
    color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700;
    letter-spacing: 3px; text-shadow: 0 0 15px rgba(255,255,255,0.5);
    text-align: center; margin-top: 20px;
}

/* =======================================================
   PLUG-IN: ASISTEN V.E.R.A (DARK MODE KHUSUS OXYTALE)
   ======================================================= */
#vera-feature-guide {
    position: fixed; bottom: 30px; left: 30px; z-index: 9999999; /* Di atas Start Overlay jika dipanggil */
    display: flex; align-items: flex-end; gap: 15px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    transform: translateY(150%); opacity: 0; pointer-events: none;
}
#vera-feature-guide.aktif { transform: translateY(0); opacity: 1; pointer-events: auto; }

.vera-f-avatar {
    width: 75px; height: 75px; border-radius: 50%; 
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    display: flex; justify-content: center; align-items: center;
    font-size: 38px; box-shadow: 0 10px 25px rgba(14, 165, 233, 0.4);
    border: 4px solid #fff; animation: floatVeraF 3s ease-in-out infinite; cursor: pointer;
}

/* Dark Mode Bubble biar nyatu sama Cinematic */
.vera-f-bubble {
    background: rgba(15, 23, 42, 0.95); padding: 18px 25px; border-radius: 20px; border-bottom-left-radius: 0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); max-width: 320px;
    border: 2px solid #38bdf8; color: #f8fafc; font-family: 'Poppins', sans-serif;
    backdrop-filter: blur(10px);
}

.vera-f-name { font-size: 11px; font-weight: 900; color: #38bdf8; letter-spacing: 1px; margin-bottom: 5px; text-transform: uppercase;}
.vera-f-text { font-size: 13px; font-weight: 500; line-height: 1.6; min-height: 40px;}
.vera-f-cursor { animation: blinkVeraF 1s step-end infinite; font-weight: 900; color: #38bdf8; }

@keyframes blinkVeraF { 50% { opacity: 0; } }
@keyframes floatVeraF { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 768px) {
    #vera-feature-guide { bottom: 15px; left: 15px; right: 15px; }
    .vera-f-bubble { max-width: 100%; }
}