body {
    margin: 0;
    padding: 0;
    background-color: #050505;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
#gameContainer {
    position: relative;
    border: 4px solid #666;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    image-rendering: pixelated;
    background: #000;
}
canvas { display: block; background-color: #000; }
#ui-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    padding: 10px; box-sizing: border-box;
    text-shadow: 2px 2px 0 #000;
}

/* Clickable UI links (override the UI layer's pointer-events:none)
   Note: game.js toggles visibility so this only shows on the TITLE screen. */
.menu-links {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
    pointer-events: auto;
    z-index: 50;
}

.ui-link {
    display: inline-block;
    padding: 8px 14px;
    background: rgba(0,0,0,0.75);
    border: 2px solid #0F0;
    color: #0F0;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
}

.ui-link:hover {
    background: #0F0;
    color: #000;
}

.hud-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-weight: bold; font-size: 16px; color: #EEE; }
.hud-label { color: #88F; }
.ability-box {
    position: absolute; bottom: 10px; left: 10px;
    display: flex; gap: 20px;
    font-size: 14px; background: rgba(0,0,0,0.5); padding: 5px; border-radius: 5px;
}
.ab-ready { color: #0F0; } .ab-cool { color: #F00; } .ab-lock { color: #555; }
.alert { 
    color: #F00; animation: blink 0.5s infinite; width: 100%; text-align: center; 
    position: absolute; top: 250px; font-size: 24px; background: rgba(0,0,0,0.6); padding: 10px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Shop Button */
.shop-button {
    position: absolute;
    padding: 10px 20px;
    background-color: #004400;
    color: #0F0;
    border: 2px solid #0F0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    z-index: 100; /* Ensure it's above the canvas */
}
.shop-button:hover {
    background-color: #0F0;
    color: #000;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #111;
    border: 2px solid #0F0;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    position: relative;
    text-align: center;
}

.modal-content h2 {
    color: #0F0;
    text-transform: uppercase;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: #0F0;
    border: 1px solid #0F0;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
}

.modal-close-btn:hover {
    background: #F00;
    color: #FFF;
    border-color: #F00;
}

.cargo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #333;
    background-color: #000;
}

.cargo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #222;
    padding: 10px 5px;
    border: 1px solid #555;
    font-size: 14px;
    color: #EEE;
    text-transform: uppercase;
}

.cargo-item span {
    margin-top: 5px;
    font-weight: bold;
}

.cargo-sprite-canvas {
    background-color: #000; /* Transparent background for sprites */
    image-rendering: pixelated;
    border: 1px solid #444;
}

/* Developer Tool Styles */
.dev-tool-modal {
    max-width: 700px;
    width: 90%;
}

.dev-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-height: 450px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #333;
    background-color: #000;
}

.dev-tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #222;
    padding: 10px;
    border: 1px solid #555;
    font-size: 14px;
    color: #EEE;
    text-transform: uppercase;
}

.dev-tool-item label {
    margin-top: 5px;
    font-weight: bold;
    color: #0F0;
    font-size: 12px;
}

.dev-tool-item input {
    width: 80px;
    padding: 5px;
    margin-top: 5px;
    background-color: #111;
    color: #0F0;
    border: 1px solid #0F0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    text-align: center;
}

.dev-tool-item input:focus {
    outline: none;
    border-color: #0FF;
    box-shadow: 0 0 5px #0FF;
}

.dev-tool-item .threshold-info {
    font-size: 10px;
    color: #888;
    margin-top: 3px;
}