@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
body {
    font-family: 'Press Start 2P', sans-serif;
}

p{
    margin:0;
    padding:0;
}

img {
    width: 100%; /* Scales to 100% of the parent container's width */
    height: auto; /* Maintains the aspect ratio */
    display: block; /* Removes any extra spacing around the image */
}


body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    height: 100vh;         /* Fullscreen height */
    overflow: hidden;      /* Prevent scrolling */
    background-color: #000; /* Fullscreen background */
}

#loadingMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 3px;
    display: none; /* Hidden by default */
    z-index: 800;
}


#orientation-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it sits above all other elements */
}


.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 900;
    color: white;
}

.character-options {
    display: flex;
    gap: 20px;
}

.character {
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.character img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.character:hover {
    transform: scale(1.7);
    background-color: rgba(255, 255, 150, 0.05);
    border-radius: 20px;
}

.character.selected {
    border-color: white;
}

 #progress {
    align: center;
	margin: 20px auto;
    width: 300px;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
    }
#progress-bar {
    height: 100%;
    width: 0;
    background-color: #4caf50;
    }

#game-container {
	display: none;
    position: relative;
    width: 600px;
    height: 400px;
    margin: auto;
    border: 2px solid #000;
    background-color: #fff;
    overflow: hidden;
    background-image: url('grafix/venue_bg_big.png'); /* Path to your background image */
    background-size: cover; /* Adjust as needed */
    background-repeat: repeat-x; /* Only repeat horizontally */
    animation: scrollBackground 7s linear infinite; /* Scroll effect */
	animation-play-state: paused; /* Paused by default */
}

/* Keyframes for scrolling background */
@keyframes scrollBackground {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -1800px 0;
    }
}


#game-container.paused {
    animation-play-state: paused;
}

#player {
    position: absolute;
    bottom: 64px;
    left: 64px;
    width: 64px;      /* Match the frame width */
    height: 64px;     /* Match the frame height */
    background-image: url('sprites/Marni.png');
    background-size: 576px 64px;  /* Full width of sprite sheet for single row, height matches frame height */
    background-position-x: -64px;
	animation-play-state: paused; /* Paused by default */
	/*border: 1px solid red;*/ /* Temporary border for debugging */
}


.obstacle {
    position: absolute;
    bottom: 64px;
    width: 64px;
    height: 64px;
	background-image: url('sprites/mosher.png');
    background-size: 576px 64px;  /* Full width of sprite sheet for single row, height matches frame height */
    background-position-x: -64px;
    animation: walk-animation 0.35s steps(1) infinite, moveObstacle 3s linear;
	animation-play-state: paused; /* Paused by default */
}

@keyframes moveObstacle {
    from { right: -50px; }
    to { right: 850px; }
}

/* Stance animation (3 frames) */
.stance {
    animation: stance-animation 0.2s steps(1) infinite;  /* Adjust duration and frame count */
	animation-play-state: running; /* Paused by default */
}

@keyframes stance-animation {
    from {
        background-position-x: -64px; /* Position of the desired frame */
    }
    to {
        background-position-x: -64px; /* Same position to "freeze" */
    }
}

/* Walking animation (3 frames) */
.walking {
    animation: walk-animation 0.2s steps(1) infinite;  /* Adjust duration and frame count */
	animation-play-state: paused; /* Paused by default */
}

@keyframes walk-animation {
    0% { background-position: 0 0; }            /* Frame 1 */
    33.33% { background-position: -64px 0; }    /* Frame 2 */
    66.66% { background-position: -128px 0; }   /* Frame 3 */
}

/* Jumping animation (3 frames) */
.jumping {
    animation: jump-animation 0.2s steps(1) infinite;
}

@keyframes jump-animation {
    0% { background-position: -192px 0; }       /* Frame 1 */
    33.33% { background-position: -256px 0; }   /* Frame 2 */
    66.66% { background-position: -320px 0; }   /* Frame 3 */
}

/* Landing animation (3 frames) */
.landing {
    animation: land-animation 0.3s steps(1) forwards;
}

@keyframes land-animation {
    0% { background-position: -384px 0; }       /* Frame 1 */
    33.33% { background-position: -448px 0; }   /* Frame 2 */
    66.66% { background-position: -512px 0; }   /* Frame 3 */
}

/* Button styling */
button {
    position: absolute;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
}


#start-game-button {
    font-family: 'Press Start 2P', sans-serif;
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
    z-index: 700;
}

#start-game-button.enabled {
    opacity: 1;
    pointer-events: auto;
}

#start-button {
    font-family: 'Press Start 2P', sans-serif;
    font-size: 10px;
    top: 50%;
    left: 50%;
    background-color: black;
    color: white;
    transform: translate(-50%, -50%);
}

#retry-button {
    font-family: 'Press Start 2P', sans-serif;
    font-size: 10px;
    background-color: white;
    top: 10px;
    right: 10px;
}

#game-over-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    font-size: 24px;
    border-radius: 8px;
    z-index: 10;
    text-align: center;
}

#runtime {
    color: white;         /* Change text color */
    font-size: 11px;    /* Change text size */
}
