body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
}
canvas {
    display: block;
}

/* UI Top Bar */
#top-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    background: rgba(44, 62, 80, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #34495e;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}
.income {
    color: #2ecc71;
    font-size: 14px;
    margin-left: 5px;
}
.tool-btn {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    margin-left: 20px;
}
.tool-btn:hover {
    background: #c0392b;
}
.tool-btn.active {
    background: #f1c40f;
    color: black;
    border-color: #f39c12;
}

/* UI Panel styles (Sidebar) */
#build-panel {
    position: absolute;
    top: 80px;
    right: 10px;
    bottom: 70px;
    width: 240px;
    background: rgba(44, 62, 80, 0.95);
    border: 2px solid #34495e;
    border-radius: 12px;
    padding: 20px;
    color: white;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: -5px 0 20px rgba(0,0,0,0.4);
    z-index: 1000;
    overflow-y: auto;
}
#build-panel h3 {
    margin: 0;
    text-align: center;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
#build-panel button {
    color: white;
    border: none;
    padding: 12px 5px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
#build-panel button .key-hint {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    color: rgba(255,255,255,0.7);
}
#build-panel button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
#close-panel {
    display: none;
}
#build-panel button.active {
    outline: 3px solid #f1c40f;
    box-shadow: 0 0 15px #f1c40f;
    transform: scale(1.05);
    z-index: 2;
}
#close-panel:hover {
    background: #c0392b !important;
}

/* News Ticker */
#news-ticker {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.9);
    padding: 8px 30px;
    border-radius: 20px;
    border: 2px solid #34495e;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    gap: 10px;
    min-width: 400px;
    max-width: 80%;
}
.news-label {
    color: #f1c40f;
    font-weight: bold;
}
#news-text {
    flex: 1;
    text-align: center;
    transition: opacity 0.5s ease-in-out;
}

/* Locked Buttons */
#build-panel button.locked {
    background: #7f8c8d !important;
    color: #bdc3c7 !important;
    cursor: not-allowed;
    filter: grayscale(1) opacity(0.6);
}
#build-panel button.locked:hover {
    filter: grayscale(1) opacity(0.6);
}

/* Responsive Sidebar */
@media (max-width: 1200px) {
    #build-panel {
        width: 200px;
        padding: 15px;
    }
}

@media (max-width: 800px) {
    #build-panel {
        top: auto;
        bottom: 70px;
        right: 10px;
        left: 10px;
        width: auto;
        height: 200px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
    #build-panel.hidden {
        transform: translateY(280px);
    }
    .button-group {
        display: flex;
        gap: 10px;
    }
    #build-panel button {
        min-width: 80px;
        height: 80px;
    }
}