/* style.css */

/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, h5, h6, p, button, canvas {
    margin: 0;
    padding: 0;
}

button {
    cursor: pointer;
}

/* General Styles */
body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #22272e; /* Darker charcoal background */
    color: #e0e0e0; /* Light grey text */
    overflow: hidden;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 0.6px;
    font-size: 2.5em;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.3);
}

/* Game Container to center canvas and UI */
#gameContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; /* For positioning UI elements */
}

/* Canvas Styling */
#gameCanvas {
    background-color: #34495e; /* Dark grey-blue for paths */
    border: none; /* Removed border for minimalist look */
    border-radius: 0px; /* No rounded corners */
    display: block;
    width: 95vw;
    height: 85vh;
    max-width: 700px;
    max-height: 600px;
    cursor: default;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Subtle shadow for depth */
}

#gameCanvas:focus {
    outline: 2px solid #a29bfe; /* Focus outline */
    outline-offset: 1px;
}

/* UI Screens - Start and Game Over */
#startScreen, #gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black overlay */
    color: #fff;
    text-align: center;
    padding: 20px;
    z-index: 10; /* Ensure it's on top of canvas */
}

#startScreen h2, #gameOverScreen h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #f8f9fa;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.5);
}

#startScreen p, #gameOverScreen p {
    font-size: 1.2em;
    margin-bottom: 25px;
    color: #ddd;
}

.start-button, .play-again-button {
    padding: 12px 25px;
    font-size: 1.1em;
    background-color: #6a89cc; /* Accent color button */
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.start-button:hover, .play-again-button:hover {
    background-color: #a29bfe; /* Lighter accent on hover */
    transform: scale(1.05);
}

.start-button:active, .play-again-button:active {
    transform: scale(1.0); /* Slightly depress on click */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hidden {
    display: none !important;
}

/* Responsiveness - Media Queries */

/* Tablets and larger phones (landscape) */
@media (max-width: 992px) {
    h1 {
        font-size: 2.2em;
        margin-bottom: 15px;
    }
    #gameCanvas {
        width: 96vw;
        height: auto;
        max-height: 70vh;
        max-width: none; /* Remove max-width on tablets */
    }
    #startScreen h2, #gameOverScreen h2 {
        font-size: 2.2em;
    }
    #startScreen p, #gameOverScreen p {
        font-size: 1.1em;
    }
    .start-button, .play-again-button {
        font-size: 1em;
        padding: 10px 20px;
    }
}

/* Smaller phones (portrait) */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    #gameCanvas {
        width: 98vw;
        max-height: 60vh;
        border: none;
        border-radius: 0;
        box-shadow: none; /* Remove shadow on small screens */
    }
    #startScreen h2, #gameOverScreen h2 {
        font-size: 1.8em;
    }
    #startScreen p, #gameOverScreen p {
        font-size: 1em;
    }
    .start-button, .play-again-button {
        font-size: 0.9em;
        padding: 8px 16px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    #gameCanvas {
        max-height: 50vh;
    }
    #startScreen h2, #gameOverScreen h2 {
        font-size: 1.6em;
    }
    #startScreen p, #gameOverScreen p {
        font-size: 0.9em;
    }
}

/* Very short viewports */
@media (max-height: 500px) {
    #gameCanvas {
        max-height: 90vh; /* Allow more height if screen is short but wide */
    }
    h1 {
        margin-bottom: 5px; /* Less margin for title in short viewports */
    }
}