* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Varela Round', Arial, sans-serif;
    overflow: hidden;
    cursor: pointer;
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('loadingscreen.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Loading Bar Container */
.loading-bar-container {
    width: 300px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading Bar */
.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #000000, #333333, #666666, #999999, #CCCCCC, #FFFFFF);
    border-radius: 8px;
    transition: width 0.3s ease;
}

/* Loading Percentage - Menggunakan Varela Round */
.loading-percentage {
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    font-family: 'Varela Round', Arial, sans-serif;
}

/* Main Content Styles */
.main-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('background1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.main-content.active {
    opacity: 1;
    visibility: visible;
}

/* Visual Novel Scene Styles */
.vn-scene {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Character Container */
.characters-container {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 70%;
    gap: 100px;
}

/* Character Styles */
.character {
    position: relative;
    transition: filter 0.3s ease;
}

.character img {
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Ukuran karakter sama untuk Vio dan Paimon */
.character.vio img {
    height: 320px;
}

.character.paimon img {
    height: 320px;
}

/* Vio ketika solo (tengah) */
.character.vio.solo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
}

.character.vio.solo img {
    height: 350px;
}

/* Posisi karakter saat berdialog */
.character.vio:not(.solo) {
    margin-right: auto;
    margin-left: 100px;
}

.character.paimon {
    margin-left: auto;
    margin-right: 100px;
}

.character.inactive {
    filter: brightness(0.6);
}

.character.active {
    filter: brightness(1);
}

/* Speech Bubble Styles */
.speech-bubble {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 18px;
    max-width: 320px;
    min-width: 200px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    font-family: 'Varela Round', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #333;
    z-index: 100;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Speech bubble positioning - di samping kepala */
.speech-bubble.left {
    left: 320px; /* Di samping kanan Vio */
    top: 120px; /* Di samping kepala */
}

.speech-bubble.left::after {
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
    left: -12px;
    top: 15px;
}

.speech-bubble.right {
    right: 320px; /* Di samping kiri Paimon */
    top: 120px; /* Di samping kepala */
}

.speech-bubble.right::after {
    border-width: 8px 12px 8px 0;
    border-color: transparent rgba(255, 255, 255, 0.95) transparent transparent;
    right: -12px;
    top: 15px;
}

.speech-bubble.center {
    left: 50%;
    transform: translateX(-50%);
    top: 120px;
}

.speech-bubble.center::after {
    border-width: 0 10px 12px 10px;
    border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
    left: 50%;
    transform: translateX(-50%);
    top: -12px;
}

/* Character Name */
.character-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 16px;
    border-bottom: 1px solid #3498db;
    padding-bottom: 3px;
}

/* Dialogue Text */
.dialogue-text {
    font-size: 14px;
    line-height: 1.5;
}

/* Choices Container */
.choices-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 150px;
    z-index: 200;
    width: 90%;
    max-width: 400px;
}

.choices-box {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Envelope Image Container */
.envelope-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 400;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Di style.css tambahkan ini di bagian .envelope-img */
.envelope-img {
    width: 300px; /* DIPERBESAR dari 200px */
    height: auto;
    max-height: 200px; /* DIPERBESAR dari 150px */
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

.envelope-text {
    color: white;
    font-family: 'Varela Round', Arial, sans-serif;
    font-size: 24px;
    text-align: center;
    margin-top: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Open Envelope Choice */
.open-envelope-choice {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 150px;
    z-index: 200;
    width: 90%;
    max-width: 400px;
}

.choice-box {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.choice {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px 20px;
    color: white;
    font-family: 'Varela Round', Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.choice:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.choice:active {
    transform: translateY(0);
}

/* Paper Container */
.paper-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

.paper-image {
    width: 80%;
    max-width: 600px;
    height: auto;
    max-height: 80%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

/* Ending Message */
.ending-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.ending-box {
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 30px 40px;
    color: white;
    font-family: 'Varela Round', Arial, sans-serif;
    font-size: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Click to continue indicator */
.click-continue {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Varela Round', Arial, sans-serif;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}



/* Responsive Design */
@media (max-width: 1200px) {
    .characters-container {
        gap: 80px;
    }
    
    .character.vio img,
    .character.paimon img {
        height: 280px;
    }
    
    .character.vio.solo img {
        height: 300px;
    }
    
    .speech-bubble {
        max-width: 280px;
    }
    
    .speech-bubble.left {
        left: 260px;
    }
    
    .speech-bubble.right {
        right: 260px;
    }
    
    .choices-container,
    .open-envelope-choice {
        bottom: 130px;
    }
    
    .envelope-img {
        width: 180px;
    }
    
    .envelope-text {
        font-size: 20px;
    }
    
    .paper-image {
        width: 85%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .loading-bar-container {
        width: 250px;
        height: 18px;
    }
    
    .loading-percentage {
        font-size: 14px;
    }
    
    .characters-container {
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        height: 80%;
        gap: 20px;
    }
    
    .character.vio img,
    .character.paimon img {
        height: 220px;
    }
    
    .character.vio.solo {
        position: relative;
        left: auto;
        transform: none;
    }
    
    .character.vio.solo img {
        height: 240px;
    }
    
    .character.vio:not(.solo) {
        margin: 0;
        order: 2;
    }
    
    .character.paimon {
        margin: 0;
        order: 1;
    }
    
    .speech-bubble {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        max-width: 85%;
        min-width: auto;
        margin: 20px auto;
        transform: none !important;
    }
    
    .speech-bubble::after {
        display: none;
    }
    
    .choices-container,
    .open-envelope-choice {
        bottom: 120px;
        width: 80%;
    }
    
    .choice {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .envelope-img {
        width: 150px;
    }
    
    .envelope-text {
        font-size: 18px;
    }
    
    .paper-image {
        width: 90%;
        max-width: 400px;
    }
    
    .ending-box {
        font-size: 16px;
        padding: 20px 25px;
        max-width: 80%;
    }
    
    .click-continue {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .loading-bar-container {
        width: 200px;
        height: 16px;
    }
    
    .loading-percentage {
        font-size: 12px;
    }
    
    .character.vio img,
    .character.paimon img {
        height: 180px;
    }
    
    .character.vio.solo img {
        height: 200px;
    }
    
    .speech-bubble {
        font-size: 13px;
        padding: 10px 14px;
        max-width: 90%;
    }
    
    .character-name {
        font-size: 14px;
    }
    
    .dialogue-text {
        font-size: 12px;
    }
    
    .choices-container,
    .open-envelope-choice {
        bottom: 100px;
    }
    
    .choices-box,
    .choice-box {
        padding: 15px;
        gap: 10px;
    }
    
    .choice {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .envelope-img {
        width: 120px;
    }
    
    .envelope-text {
        font-size: 16px;
    }
    
    .paper-image {
        width: 95%;
        max-width: 300px;
    }
    
    .ending-box {
        font-size: 14px;
        padding: 15px 20px;
    }
    
    .click-continue {
        font-size: 11px;
    }
}