body {
    margin: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #000;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

#game-container {
    position: relative;
    width: 1000px;
    height: 600px;
    border: 2px solid #fff;
    overflow: hidden;
    background-color: #333;
}

#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.character {
    position: absolute;
    width: 100px;
    height: 150px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    transition: none;
    pointer-events: none;
}

#invincible {
    background-image: url('https://ik.imagekit.io/x2dirkim6/tr:n-ik_ml_thumbnail/images/avatars/characters/character_avatar_WERTPIRgM.webp');
    width: 125px;
    height: 187.5px;
}

#omniman {
    background-image: url('omni.png');
}

#whereisman {
    background-image: url('immorta.png');
    width: 125px;
    height: 187.5px;
    visibility: hidden;
    left: -200px;
    top: -200px;
}

.character.dashing {
    transform: scale(1.1);
}

.character.attacking {
    /* No animation here, transform is handled in JS */
}

.text-bubble {
    position: absolute;
    background-color: #fff;
    color: #000;
    padding: 8px 12px;
    border-radius: 15px;
    white-space: nowrap;
    max-width: 150px;
    text-align: center;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    z-index: 5;
    transform: scaleX(1);

    &::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #fff;
        clear: both;
    }
}

#bubble-invincible { }
#bubble-omniman { }
#bubble-whereisman { }

.health-bar {
    position: absolute;
    top: 20px;
    width: 200px;
    height: 20px;
    border: 2px solid #fff;
    z-index: 2;
}

#health-bar-invincible {
    left: 20px;
}

#health-bar-omniman {
    right: 20px;
}

.health {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease-out, background-color 0.3s ease-out;
}

.invincible-health {
    background-color: #0f0;
}

.omniman-health {
    background-color: #f00;
}

#message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2;
    font-family: sans-serif;
    font-size: 1.2em;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

#cecil-avatar {
    width: 40px;
    height: auto;
    border-radius: 50%;
    flex-shrink: 0;
}

#cecil-text {
    flex-grow: 1;
    text-align: left;
}

#dash-cooldown {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: sans-serif;
    font-size: 1em;
    z-index: 2;
    min-width: 80px;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease, border-color 0.3s ease;
}

#dash-cooldown.recharging {
    color: yellow;
    border-color: yellow;
}

#dash-cooldown.ready {
     color: lime;
     border-color: lime;
}

#fullscreen-event-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#fullscreen-event-overlay.visible {
    visibility: visible;
    opacity: 1;
}

#event-image {
    max-width: 90%;
    max-height: 70%;
    object-fit: contain;
    margin-bottom: 20px;
}

#event-text {
    color: #fff;
    font-size: 2em;
    text-align: center;
    padding: 0 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.spark {
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url('./spark.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
    pointer-events: none;
    animation: spark-animation 0.4s ease-out forwards;
}

@keyframes spark-animation {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.motion-line {
    position: absolute;
    width: 40px;
    height: 10px;
    background-image: url('./motion_line.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 3;
    pointer-events: none;
    opacity: 0.7;
    animation: motion-line-animation 0.4s linear forwards;
    transform-origin: right center;
}

@keyframes motion-line-animation {
    0% {
        opacity: 0.7;
        transform: rotate(var(--motion-line-angle, 0deg)) scaleX(1);
    }
    100% {
        opacity: 0;
        transform: rotate(var(--motion-line-angle, 0deg)) scaleX(0.1);
    }
}