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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #72935a;
}

#vn-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Background */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease-in-out;
}

/* Character Layer */
.character-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.character {
    position: absolute;
    bottom: 0;
    width: 30%;
    max-width: 400px;
    height: 80%;
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.character.visible {
    opacity: 1;
    transform: translateY(0);
}

.character.hiding {
    opacity: 0;
    transform: translateY(100%);
}

.character-left {
    left: 5%;
}

.character-center {
    left: 50%;
    transform: translateX(-50%) translateY(100%);
}

.character-center.visible {
    transform: translateX(-50%) translateY(0);
}

.character-center.hiding {
    transform: translateX(-50%) translateY(100%);
}

.character-right {
    right: 5%;
}

/* Textbox */
.textbox {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 20px 30px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.speaker-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #87ceeb;
    min-height: 1.2em;
}

.dialogue-text {
    font-size: 1.1em;
    line-height: 1.6;
    min-height: 3em;
}

.dialogue-text.narration {
    font-style: italic;
    color: #ddd;
}

/* Choice Menu */
.choice-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 3px solid #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.choice-menu.hidden {
    display: none;
}

.choice-prompt {
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-button {
    background-color: rgba(135, 206, 235, 0.3);
    border: 2px solid #87ceeb;
    border-radius: 8px;
    padding: 15px 20px;
    color: #fff;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.choice-button:hover {
    background-color: rgba(135, 206, 235, 0.6);
    transform: translateX(10px);
}

.choice-button:active {
    transform: translateX(10px) scale(0.98);
}

/* Continue Indicator */
.continue-indicator {
    position: absolute;
    bottom: 150px;
    right: 80px;
    font-size: 2em;
    color: #fff;
    animation: bounce 1s infinite;
    opacity: 0;
    pointer-events: none;
}

.continue-indicator.visible {
    opacity: 0.8;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .textbox {
        width: 95%;
        padding: 15px 20px;
    }

    .speaker-name {
        font-size: 1em;
    }

    .dialogue-text {
        font-size: 0.95em;
    }

    .character {
        width: 35%;
    }

    .choice-menu {
        width: 90%;
        padding: 20px;
    }

    .choice-prompt {
        font-size: 1.1em;
    }

    .choice-button {
        font-size: 1em;
        padding: 12px 15px;
    }
}

/* Debug Panel */
.debug-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.3);
    z-index: 1000;
}

.debug-panel.hidden {
    display: none;
}

.debug-header {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #00ff00;
    text-align: center;
}

.debug-content {
    margin: 10px 0;
}

.debug-variable {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

.debug-variable:last-child {
    border-bottom: none;
}

.debug-var-name {
    font-weight: bold;
    color: #00ffff;
}

.debug-var-value {
    color: #ffff00;
}

.debug-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #00ff00;
    text-align: center;
    font-size: 0.85em;
    opacity: 0.7;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content h2 {
    font-size: 2em;
    margin-bottom: 30px;
}

.loading-bar-container {
    width: 300px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00aaff, #00ff88);
    transition: width 0.3s ease;
}

.loading-content p {
    font-size: 1.1em;
    opacity: 0.8;
}
