body {
    margin: 0;
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.game-container {
    display: flex;
    border: 2px solid #0f0;
    position: relative;
}

.ui-panel {
    width: 250px;
    padding: 20px;
    background-color: #111;
    border-right: 2px solid #0f0;
    display: flex;
    flex-direction: column;
}

.game-title {
    color: #0f0;
    text-align: center;
    margin-top: 0;
    border-bottom: 1px solid #0f0;
    padding-bottom: 10px;
}

.stats-container {
    margin: 15px 0;
}

.stats-container h2 {
    font-size: 1.1em;
    margin: 8px 0;
}

.hearts-display {
    display: flex;
    align-items: center;
}

.hearts-display h2 {
    margin-right: 10px;
}

#hearts {
    color: #ff4d4d;
    font-size: 1.2em;
}

.shop-btn {
    background-color: #0f0;
    color: #000;
    border: none;
    padding: 15px;
    font-size: 1.2em;
    font-family: inherit;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.shop-btn:hover {
    background-color: #3f3;
}

.controls-info {
    margin-top: auto;
}

.controls-info h3 {
    color: #0f0;
    border-bottom: 1px solid #0f0;
    padding-bottom: 5px;
}

.controls-info p {
    margin: 5px 0;
}

canvas {
    background-color: #000;
    display: block;
}


.modal-hidden {
    display: none;
}

#upgrades-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* display: flex; <-- This was the error */
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Use this to show the modal */
#upgrades-modal:not(.modal-hidden) {
    display: flex;
}


.modal-content {
    background-color: #1a1a1a;
    border: 2px solid #0f0;
    width: 80%;
    max-width: 800px;
    padding: 20px;
    box-shadow: 0 0 20px #0f0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #0f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #0f0;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.upgrades-grid button {
    background-color: #222;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 15px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    font-size: 1em;
    line-height: 1.4;
}

.upgrades-grid button:hover {
    background-color: #0f0;
    color: #000;
}

.upgrades-grid button:disabled {
    background-color: #1a1a1a;
    color: #555;
    border-color: #555;
    cursor: not-allowed;
}
