@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    min-height: 100vh;
    background: #000;
    color: #fff;
    font-family: "Press Start 2P", monospace;
    display: flex;
}

.gameOverText {
    visibility: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    height: 100vh;
    background: #111;
    border-right: 4px solid white;
    padding: 20px;

    display: flex;
    flex-direction: column;
}

.sidebar h1 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 40px;
}

.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-links,
.bottom-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bottom-links {
    margin-top: auto;
}

.sidebar a {
    color: white;
    text-decoration: none;

    border: 2px solid white;
    padding: 15px;

    text-align: center;

    transition: 0.2s;
}

.sidebar a:hover {
    background: white;
    color: black;
}

.sidebar button {
    background-color: black;
    text-decoration: none;
    color: white;

    border: 2px solid white;
    padding: 15px;

    font-size: 15px;

    text-align: center;

    font-family: "Press Start 2P", monospace;

    transition: 0.2s;
}

.sidebar button:hover {
    background: white;
    color: black;
}

/* Main Game Area Layout */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Anchors content toward the top */
    padding-top: 80px;           /* Distance from top edge */
    gap: 40px;                  /* Space between score and canvas */
}

/* Score Label */
.score {
    font-size: 36px;
    text-align: center;
}

/* Canvas Display */
#gameplayCanvas {
    background-color: #000;
    
    /* Replaces fixed 800px width with a fluid percentage */
    width: 95%; 
    max-width: 1000px; /* Prevents the canvas from becoming unplayably large on big screens */
    
    /* Forces the browser to maintain the 800x300 proportion (8:3) */
    aspect-ratio: 8 / 3; 
    height: auto;
    flex-shrink: 0;

    /* Keeps your pixel art and scaled images crisp */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

@media (max-width: 900px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 4px solid white;
    }

    .sidebar nav {
        flex-direction: row;
        justify-content: space-between;
        gap: 15px;
    }

    .game-area {
        padding-top: 40px;
    }
}