* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Consolas', 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    color: #50fa7b;
    margin-bottom: 12px;
    font-size: 1.5rem;
}

#hud {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 12px;
}

#resources {
    display: flex;
    gap: 16px;
    font-size: 1rem;
}

#wood-display {
    color: #DEB887;
    font-weight: bold;
}

#shop {
    display: flex;
    gap: 8px;
}

#shop button {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 6px 14px;
    border: 2px solid #50fa7b;
    border-radius: 6px;
    background: #16213e;
    color: #50fa7b;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

#shop button:hover:not(:disabled) {
    background: #50fa7b22;
    transform: translateY(-1px);
}

#shop button:disabled {
    border-color: #555;
    color: #555;
    cursor: default;
}

#inventory-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 6px 12px;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 6px;
}

.inv-label {
    color: #888;
    font-size: 0.8rem;
}

#inv-slots {
    display: flex;
    gap: 6px;
}

.inv-slot {
    width: 48px;
    height: 48px;
    background: #0d1b30;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.15s;
    font-family: inherit;
    color: inherit;
    padding: 0;
}

.inv-slot:hover {
    border-color: #50fa7b;
}

.inv-slot.selected {
    border-color: #f1fa8c;
    background: #1a2a4a;
    box-shadow: 0 0 8px rgba(241, 250, 140, 0.2);
}

.inv-slot .inv-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.inv-slot .inv-count {
    font-size: 0.65rem;
    color: #f1fa8c;
    font-weight: bold;
}

.inv-slot.empty {
    border-color: #222;
    cursor: default;
    opacity: 0.3;
}

#main-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

#game-container {
    border: 2px solid #0f3460;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    flex-shrink: 0;
}

#game-canvas {
    display: block;
    cursor: pointer;
}

/* === PANNEAU AMELIORATIONS === */
#upgrades-panel {
    width: 340px;
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#upgrades-panel h2 {
    color: #f1fa8c;
    font-size: 1rem;
    text-align: center;
    margin: 0 0 4px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #0f3460;
}

.upg-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upg-group-title {
    color: #888;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 4px;
    border-bottom: 1px solid #0f3460;
}

.upg-row {
    display: flex;
    gap: 8px;
}

.upgrade-card {
    flex: 1;
    background: #0d1b30;
    border: 1px solid #1a3a5c;
    border-radius: 6px;
    padding: 8px;
    transition: border-color 0.2s;
    min-width: 0;
}

.upgrade-card:hover {
    border-color: #3a5a8c;
}

.upg-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.upg-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.upg-name {
    color: #e0e0e0;
    font-size: 0.72rem;
    font-weight: bold;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upg-level {
    color: #888;
    font-size: 0.65rem;
    white-space: nowrap;
}

.upg-desc {
    color: #aaa;
    font-size: 0.68rem;
    margin-bottom: 6px;
}

.upg-desc strong {
    color: #50fa7b;
}

.upg-btn {
    width: 100%;
    font-family: inherit;
    font-size: 0.68rem;
    padding: 4px 6px;
    border: 1px solid #50fa7b;
    border-radius: 4px;
    background: #16213e;
    color: #50fa7b;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.upg-btn:hover:not(:disabled) {
    background: #50fa7b22;
    transform: translateY(-1px);
}

.upg-btn:disabled {
    border-color: #444;
    color: #444;
    cursor: default;
}

.upg-hidden {
    display: none;
}

#game-log {
    color: #aaa;
    font-size: 0.85rem;
    margin-top: 10px;
    height: 1.2em;
}
