:root {
    --bg-dark: #0a0a0c;
    --box-bg: #111118;
    --border-color: #c8aa6e;
    --text-color: #f0e6d2;
    --highlight: #00A1E4;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Press Start 2P', cursive;
    color: var(--text-color);
    overflow: hidden;
    user-select: none;
}

#game-container {
    width: 800px;
    height: 600px;
    position: relative;
    background-color: #1a1a24;
    border: 6px solid var(--border-color);
    box-shadow: 0 0 30px rgba(200, 170, 110, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    cursor: pointer;
    /* Pixel pattern background simulating retro game */
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.5) 2px, transparent 2px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.5) 2px, transparent 2px);
    background-size: 8px 8px;
    image-rendering: pixelated;
}

#scene {
    width: 100%;
    height: 450px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 10;
}

.character {
    width: 450px;
    height: 400px;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.character.hidden {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

.character img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.9)) contrast(1.1) saturate(1.2);
}

#character-left {
    transform-origin: bottom center;
}

#character-right {
    transform-origin: bottom center;
}

#character-left.speaking {
    transform: scale(1.05);
    filter: brightness(1.1);
    z-index: 15;
}

#character-right.speaking {
    transform: scale(1.05);
    filter: brightness(1.1);
    z-index: 15;
}

.character:not(.speaking) {
    filter: brightness(0.5);
    z-index: 5;
}

#dialogue-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 130px;
    background-color: rgba(10, 10, 12, 0.95);
    border: 4px solid var(--border-color);
    border-radius: 0px;
    /* pixel look */
    padding: 20px 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 20;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

#speaker-name {
    font-size: 16px;
    color: var(--border-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    text-shadow: 3px 3px 0px #000;
    letter-spacing: 1px;
}

#dialogue-text {
    font-size: 14px;
    line-height: 1.8;
    flex-grow: 1;
    text-shadow: 2px 2px 0px #000;
}

#continue-indicator {
    align-self: flex-end;
    animation: bounce 0.8s infinite;
    font-size: 14px;
    color: var(--border-color);
    margin-top: -15px;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

#fx-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30;
}

.heart {
    position: absolute;
    font-size: 60px;
    color: #ff4b4b;
    animation: floatUp 2s ease-out forwards;
    opacity: 0;
    text-shadow: 0 0 10px rgba(255, 75, 75, 0.8);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translateY(-150px) scale(1.5);
        opacity: 0;
    }
}

.flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 100;
    animation: flashAnim 0.7s ease-out forwards;
}

@keyframes flashAnim {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.character-name {
    position: absolute;
    top: 60px;
    width: 100%;
    text-align: center;
    font-size: 16px;
    color: var(--border-color);
    text-shadow: 2px 2px 0px #000;
    z-index: 20;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
}

.character:not(.speaking) .character-name {
    opacity: 0.5;
}

#love-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease;
}

#love-scene.hidden {
    opacity: 0;
    pointer-events: none;
}

#love-scene img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    border: 4px solid var(--border-color);
}

#continue-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    background-color: var(--highlight);
    color: #fff;
    border: 4px solid #fff;
    cursor: pointer;
    font-size: 14px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, background-color 0.2s;
}

#continue-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background-color: #0088cc;
}

#continue-btn.hidden {
    display: none;
}