@import url('https://fonts.googleapis.com/css2?family=Acme&family=Lexend+Exa&display=swap');

* {
    box-sizing: border-box;
}

/* --- FULLSCREEN VN VIEWPORT --- */
body.vn-active .vnViewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    z-index: 99999; /* Keeps it strictly on top of everything else only when active */
}

/* Tint overlay */
body.vn-active .vnViewport::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

/* Background image */
body.vn-active .vn-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}

/* Dialogue box positioning scoped exclusively to vn-active */
body.vn-active .vnViewport .dialogueContainer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    z-index: 10;
}

/* Background image */
.vn-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}

/* Dialogue box positioning (CORRECT VERSION — ONLY THIS ONE) */
.vnViewport .dialogueContainer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    z-index: 10;
}


/* --- SPRITES SITTING ON THE TEXTBOX --- */
.spriteElement {
    position: absolute;
    bottom: 105px;
    height: 60vh;
    width: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* LEFT SPRITE — horizontal movement */
#vnSpriteLeft.posLeft100 { left: 100px; }
#vnSpriteLeft.posLeft300 { left: 300px; }
#vnSpriteLeft.posLeft600 { left: 600px; }

/* LEFT SPRITE — vertical movement */
#vnSpriteLeft.posLeftUp   { bottom: 150px; }
#vnSpriteLeft.posLeftDown { bottom: 50px; }

/* RIGHT SPRITE — FORCE RIGHT SIDE ANCHOR */
#vnSpriteRight {
    right: 0;
    left: auto;
    bottom: 85px;
}

/* RIGHT SPRITE — horizontal movement */
#vnSpriteRight.posRight120 { right: 120px; }
#vnSpriteRight.posRight380 { right: 380px; }
#vnSpriteRight.posRight720 { right: 720px; }

/* ACTIVE SPRITE FADE-IN */
.spriteElement.active {
    opacity: 1;
}

/* Dialogue UI */
.speakerLabel {
    font-family: 'Acme', sans-serif;
    font-size: 2rem;
    color: #ff3838;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 10px;
    min-height: 38px;
    text-shadow: 0 0 10px rgba(255, 56, 56, 0.4);
}

.dialogueWindow {
    width: 100%;
    background: #06060e;
    border: 2px solid #291f22;
    border-radius: 12px;
    padding: 30px 40px;
    min-height: 150px;
    cursor: pointer;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.dialogueWindow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.15);
}

.dialogueWindow:active {
    transform: scale(0.995);
}

#sceneText {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: center;
    color: #ffffff;
    opacity: 0;
}

.actionPrompt {
    position: absolute;
    bottom: 12px;
    right: 20px;
    font-size: 0.65rem;
    color: #ffffff;
    letter-spacing: 1px;
    opacity: 0.5;
    text-transform: uppercase;
}
