body {
    margin: 0;
    overflow: hidden;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
}

#game-container {
    position: relative;
    border: 2px solid #555;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background-color: #222;
}

#gameCanvas {
    display: block;
    background-color: #77bbee; /* Default day sky */
}

#game-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: white;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 1000;
}

#player-stats p {
    margin: 5px 0;
    background-color: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

#shop-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

#shop-button:hover {
    background-color: #45a049;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #333;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    color: white;
    text-align: right;
}

.modal-content h2 {
    text-align: center;
    color: #4CAF50;
}

.close-button {
    color: #aaa;
    float: left; /* Position on the left for RTL */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: white;
    text-decoration: none;
}

.shop-sections h3 {
    color: #eee;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    margin-top: 15px;
}

.shop-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end; /* Align items to the right for RTL */
}

.shop-item {
    background-color: #555;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
    flex-grow: 1; /* Allow items to grow */
    min-width: 120px; /* Minimum width for items */
    text-align: center;
}

.shop-item:hover:not(:disabled) {
    background-color: #777;
}

.shop-item:disabled {
    background-color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}

#game-over-modal .modal-content {
    text-align: center;
}

#restart-button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 20px;
}

#restart-button:hover {
    background-color: #0056b3;
}
