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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

#game-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 20px;
    margin-bottom: 20px;
    max-width: 1200px;
}

#hud {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.resource {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-weight: bold;
}

.resource-label {
    font-size: 14px;
    margin-bottom: 5px;
}

#gold, #elixir, #troop-count {
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#gameCanvas {
    border: 3px solid #333;
    border-radius: 5px;
    display: block;
    margin: 0 auto 20px;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    cursor: crosshair;
}

#controls {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#controls h3 {
    color: #333;
    margin: 15px 0 10px 0;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

#controls h3:first-child {
    margin-top: 0;
}

.build-btn, .train-btn, #attack-btn, #reset-btn {
    margin: 5px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.build-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.build-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.train-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.train-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#attack-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

#attack-btn:hover {
    transform: scale(1.05);
}

#reset-btn {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    color: white;
}

#reset-btn:hover {
    transform: scale(1.05);
}

.build-btn.selected, .train-btn.selected {
    box-shadow: 0 0 0 3px #FFD700;
    transform: scale(1.1);
}

#instructions {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 800px;
}

#instructions h2 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

#instructions ul {
    list-style-position: inside;
    line-height: 1.8;
}

#instructions li {
    margin-bottom: 10px;
    color: #333;
}

#instructions strong {
    color: #764ba2;
}

@media (max-width: 768px) {
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    #game-container {
        padding: 10px;
    }
    
    .build-btn, .train-btn, #attack-btn, #reset-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}
