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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(to bottom, #0a0a0a 0%, #1a0a2e 50%, #0f0516 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#game-container {
    max-width: 1200px;
    width: 100%;
    background: rgba(20, 10, 30, 0.9);
    border: 3px solid #4a0e4e;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
}

header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #4a0e4e;
    padding-bottom: 15px;
}

h1 {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.8),
                 0 0 20px rgba(138, 43, 226, 0.5);
    font-size: 2.5em;
    margin-bottom: 15px;
    letter-spacing: 3px;
}

#game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.info-item {
    background: rgba(74, 14, 78, 0.5);
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #6a1e6e;
}

.label {
    color: #b388ff;
    margin-right: 8px;
    font-weight: bold;
}

.value {
    font-weight: bold;
}

#gold-value {
    color: #ffd700;
}

#mana-value {
    color: #4dabf7;
}

#hp-value {
    color: #51cf66;
}

#wave-value {
    color: #ff6b6b;
}

#main-game {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

#tower-menu {
    flex: 0 0 220px;
    background: rgba(30, 10, 40, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #4a0e4e;
}

#tower-menu h2 {
    color: #b388ff;
    font-size: 1.2em;
    margin-bottom: 15px;
    margin-top: 20px;
    text-align: center;
    border-bottom: 1px solid #4a0e4e;
    padding-bottom: 8px;
}

#tower-menu h2:first-child {
    margin-top: 0;
}

#tower-menu h3 {
    color: #b388ff;
    font-size: 1em;
    margin-bottom: 10px;
    text-align: center;
}

.tower-button,
.ability-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(74, 14, 78, 0.4);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 2px solid #6a1e6e;
    cursor: pointer;
    transition: all 0.3s;
}

.tower-button:hover,
.ability-button:hover {
    background: rgba(106, 30, 110, 0.6);
    border-color: #8a2be2;
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.tower-button.selected {
    background: rgba(138, 43, 226, 0.6);
    border-color: #b388ff;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.7);
}

.tower-button.disabled,
.ability-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tower-button.disabled:hover,
.ability-button.disabled:hover {
    background: rgba(74, 14, 78, 0.4);
    border-color: #6a1e6e;
    transform: none;
    box-shadow: none;
}

.tower-icon,
.ability-icon {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}

.tower-info,
.ability-info {
    flex: 1;
}

.tower-name,
.ability-name {
    color: #e0e0e0;
    font-weight: bold;
    font-size: 0.9em;
}

.tower-cost,
.ability-cost {
    color: #ffd700;
    font-size: 0.85em;
}

.tower-desc {
    color: #888888;
    font-size: 0.75em;
    font-style: italic;
}

.help-text {
    margin-top: 20px;
    padding: 15px;
    background: rgba(74, 14, 78, 0.3);
    border-radius: 5px;
    border: 1px solid #4a0e4e;
}

.help-text h3 {
    color: #b388ff;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.help-text p {
    color: #aaaaaa;
    font-size: 0.8em;
    line-height: 1.6;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-canvas {
    background: linear-gradient(to bottom, #0f051d 0%, #1a0a2e 100%);
    border: 3px solid #4a0e4e;
    border-radius: 8px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
    cursor: crosshair;
}

#game-controls {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid #8a2be2;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
}

button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(138, 43, 226, 0.4);
}

#game-status {
    text-align: center;
    padding: 15px;
    background: rgba(30, 10, 40, 0.6);
    border-radius: 5px;
    border: 1px solid #4a0e4e;
    color: #b388ff;
    font-style: italic;
}

@media (max-width: 1024px) {
    #main-game {
        flex-direction: column;
    }

    #tower-menu {
        flex: none;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    #tower-menu h2 {
        flex: 1 0 100%;
    }

    .tower-button,
    .ability-button {
        flex: 0 1 calc(33% - 10px);
        min-width: 150px;
    }

    .help-text {
        flex: 1 0 100%;
    }
}
