body { 
    margin: 0; 
    overflow: hidden; 
    background: #2c3e50; 
    font-family: 'Courier New', monospace; 
    color: #ecf0f1; 
    
    /* NEW: Disable Text Selection */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
}

canvas { 
    display: block; 
    cursor: crosshair; 
}

/* C&C Style Sidebar */
#sidebar {
    position: absolute; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    width: 200px;
    background: #1a252f; 
    border-left: 2px solid #7f8c8d;
    padding: 10px; 
    box-sizing: border-box;
    display: flex; 
    flex-direction: column; 
    gap: 10px;
    z-index: 10; /* Ensure sidebar stays on top of canvas */
}

h3 { 
    margin: 0 0 10px 0; 
    text-align: center; 
    color: #2ecc71; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
}

.stat-box { 
    background: #000; 
    padding: 5px; 
    border: 1px solid #2ecc71; 
    margin-bottom: 20px; 
    text-align: right; 
}

.section-title {
    text-align: center; 
    margin-bottom: 5px; 
    color: #7f8c8d;
}

.btn {
    background: #34395e; 
    border: 1px solid #7f8c8d; 
    color: #ecf0f1;
    padding: 15px; 
    cursor: pointer; 
    text-align: center;
    font-size: 12px; 
    transition: 0.2s;
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.btn:hover { 
    background: #2c3e50; 
    border-color: #2ecc71; 
}

.btn:active { 
    background: #2ecc71; 
    color: #000; 
}

/* NEW: Highlight for affordable items */
@keyframes pulse-green {
    0% { box-shadow: 0 0 5px rgba(46, 204, 113, 0.2); }
    50% { box-shadow: 0 0 15px rgba(46, 204, 113, 0.6); }
    100% { box-shadow: 0 0 5px rgba(46, 204, 113, 0.2); }
}

.btn.affordable {
    border-color: #2ecc71;
    color: #fff;
    /* NEW: Dark Green background for affordable items */
    background: rgba(46, 204, 113, 0.15); 
    animation: pulse-green 2s infinite;
}

/* NEW: Slightly brighter green on hover for affordable items */
.btn.affordable:hover {
    background: rgba(46, 204, 113, 0.3);
}

.btn small { 
    font-size: 0.8em; 
    color: #95a5a6; 
    margin-top: 5px; 
}

/* Active building mode indicator */
.active-build { 
    border-color: #f1c40f; 
    color: #f1c40f; 
}

.placeholder-text {
    font-size: 18px; /* Increased from 10px */
    color: #95a5a6;  /* Slightly lighter gray for better visibility */
    text-align: center;
    margin-top: 50px;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.4;
}

#messages {
    position: absolute; 
    top: 10px; 
    left: 10px;
    font-size: 14px; 
    color: #e74c3c; 
    font-weight: bold; 
    pointer-events: none;
    text-shadow: 1px 1px 0 #000;
    z-index: 20;
}

/* DEV TOOLS STYLES */
.dev-panel {
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border: 1px dashed #c0392b;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
}

.dev-toggle {
    border-color: #c0392b !important;
    color: #e74c3c !important;
    font-weight: bold;
}

.dev-toggle:hover {
    background: #c0392b !important;
    color: #fff !important;
}

.active-dev {
    background: #c0392b !important;
    color: #fff !important;
}

.cheat-btn {
    padding: 8px !important;
    font-size: 11px !important;
}

/* scripts/style.css */

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #2c3e50;
    border: 2px solid #7f8c8d;
    padding: 20px;
    width: 300px;
    color: #fff;
}

.modal-content h2 {
    text-align: center;
    color: #2ecc71;
    margin-top: 0;
}

.difficulty-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.diff-btn {
    flex: 1;
    padding: 10px;
}

.overlay-screen {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(15, 20, 25, 0.95); /* Dark semi-transparent bg */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200; /* On top of everything */
}

.game-title {
    font-size: 60px;
    color: #f1c40f;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.5);
    margin-bottom: 50px;
    letter-spacing: 10px;
    font-weight: bold;
    border-bottom: 2px solid #f1c40f;
    padding-bottom: 20px;
}

.start-btn {
    width: 250px;
    font-size: 24px;
    padding: 20px;
    border: 2px solid #2ecc71;
    color: #2ecc71;
    background: transparent;
    font-weight: bold;
    letter-spacing: 2px;
}

.start-btn:hover {
    background: #2ecc71;
    color: #000;
    box-shadow: 0 0 20px #2ecc71;
}

/* NEW MENU STYLES */

.menu-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns */
    gap: 15px;
    margin-bottom: 20px;
}

.level-btn {
    width: 60px;
    height: 60px;
    border: 2px solid #2ecc71;
    background: rgba(26, 204, 113, 0.1);
    color: #2ecc71;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.level-btn:hover {
    background: #2ecc71;
    color: #000;
}

/* Locked Level Style */
.level-btn.locked {
    border-color: #7f8c8d;
    background: rgba(0,0,0,0.5);
    color: #7f8c8d;
    cursor: not-allowed;
}

/* Selected Level Style */
.level-btn.selected {
    border-color: #f1c40f;
    color: #f1c40f;
    box-shadow: 0 0 15px #f1c40f;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.diff-btn {
    padding: 10px 20px;
    border: 1px solid #555;
    color: #777;
    cursor: pointer;
}

.diff-btn.active-diff {
    border-color: #f1c40f;
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
}

.option-placeholder {
    padding: 10px;
    border: 1px dashed #555;
    color: #555;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
    pointer-events: none;
}

/* NEW: Minimap Styles */
#minimap {
    position: absolute;
    bottom: 20px;
    right: 220px; /* 200px Sidebar + 20px gap */
    width: 200px;
    height: 200px;
    background: #111;
    border: 2px solid #7f8c8d;
    z-index: 50;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    /* Make sure it captures clicks */
    pointer-events: auto; 
}

/* Add to scripts/style.css */

.tooltip {
    position: fixed;
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid #7f8c8d;
    padding: 10px;
    z-index: 1000;
    pointer-events: none; /* Mouse ignores it so we can click behind */
    opacity: 0;
    transition: opacity 0.1s;
    min-width: 150px;
    max-width: 250px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border-left: 3px solid #f1c40f;
}

.tt-title {
    color: #f1c40f;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    border-bottom: 1px solid #333;
    padding-bottom: 3px;
}

.tt-desc {
    font-size: 0.9em;
    color: #bdc3c7;
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.3;
}

.tt-stats {
    font-size: 0.85em;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    color: #fff;
}

/* FIX: Ensure GFX Modal is above the Main Menu (which is z-index 200) */
#gfx-settings-modal {
    z-index: 300 !important;
}

/* FIX: Ensure FPS Counter is above everything */
#fps-display {
    position: absolute;
    top: 10px;
    right: 210px; /* 200px Sidebar + 10px buffer */
    font-size: 16px;
    color: #f1c40f; 
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    z-index: 2000; 
    pointer-events: none;
    font-family: 'Courier New', monospace;
    display: none; 
    text-align: right;
}

/* FIX: Styling for the Toggle Button */
.toggle-btn {
    width: 80px;
    padding: 10px;
    border: 1px solid #7f8c8d;
    cursor: pointer;
    text-align: center;
    background: rgba(0,0,0,0.3);
    transition: all 0.2s;
}

/* Active State (Green) */
.toggle-btn.active {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
}


/* Settings Row Layout */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
    color: #ecf0f1;
}