:root {
    --grid-size: 10; /* 10x10 grid */
    --cell-size: 50px;
    --game-width: calc(var(--grid-size) * var(--cell-size));
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding-top: 20px;
}

#game-grid {
    position: relative;
    width: var(--game-width);
    height: var(--game-width);
    border: 5px solid #333;
    background-color: #555; /* Base color for the grid/road */
    overflow: hidden; /* Crucial for keeping obstacles contained */
}

/* Lane Styles - Define alternating environments */
.lane {
    position: relative;
    width: 100%;
    height: var(--cell-size);
    box-sizing: border-box;
}

.start-finish-lane {
    background-color: #5cb85c; /* Green for safe zone */
}

.road-lane {
    background-color: #333; /* Darker for road */
    border-top: 1px dashed #666;
    border-bottom: 1px dashed #666;
}

.river-lane {
    background-color: #4682b4; /* Blue for water */
}

/* * Player and Obstacle Styles
 */
.character {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    transition: transform 0.1s linear; /* Smooth movement transition */
    box-sizing: border-box;
    z-index: 10;
}

#player {
    background-color: #008000; /* Frog color */
    border: 2px solid #004d00;
}

.obstacle {
    position: absolute;
    height: var(--cell-size);
    box-sizing: border-box;
    z-index: 5; /* Below the player */
}

.car {
    background-color: #ff4500; /* Red car */
}

.log {
    background-color: #a0522d; /* Brown log */
}

/*
 * Info and Button
 */
#game-info {
    margin-bottom: 15px;
    text-align: center;
}

#message {
    font-weight: bold;
    color: #d9534f;
}

#start-button {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
}