body {
    font-family: Arial, sans-serif;
    background-color: #35354d;
    color: #e0e0e0;
    padding: 20px;
    display: flex;
    justify-content: center;
}
h1, h2 {
    text-align: center;
}
#game-container {
    max-width: 1000px;
}
#map-selection-screen {
    background-color: #2b2b49;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
#map-selection-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.map-button {
    background-color: #32325a;
    border: 1px solid #4a4a7e;
    text-align: left;
    padding: 15px;
}
.map-button:hover {
    background-color: #3a3a6e;
    border-color: #7a7aff;
}
.map-button strong {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}
.map-button small {
    font-size: 0.9rem;
    color: #c4bebe;
}
#stats-bar {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}
.stat-card {
    background-color: #292948;
    border: 1px solid #54548e;
    border-radius: 8px;
    padding: 10px 20px;
    text-align: center;
    min-width: 120px;
}
.stat-card div:first-child {
    font-size: 0.9rem;
    color: #aba5a5;
}
.stat-card div:last-child {
    font-size: 1.5rem;
    font-weight: bold;
}
#main-content {
    display: flex;
    gap: 20px;
}
canvas {
    background-color: #2a2a4e;
    border: 2px solid #494971;
    border-radius: 8px;
}
#ui-panel {
    background-color: #242442;
    border-radius: 8px;
    padding: 20px;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
button {
    background-color: #4a4a7e;
    color: #ffffff;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    width: 100%;
}
button:hover {
    background-color: #5a5a9e;
}
button.selected {
    background-color: #7a7aff;
    box-shadow: 0 0 10px #7a7aff;
}
button:disabled {
    background-color: #3e3e5e;
    color: #757474;
    cursor: not-allowed;
}
#message-box {
    text-align: center;
    color: #ffc107;
    height: 20px;
    font-size: 0.9rem;
}
.interest-message {
    color: #4CAF50;
    font-weight: bold;
}
.hidden {
    display: none;
}
.sell-button {
    background-color: #a04040;
}
.sell-button:hover {
    background-color: #c05050;
}
#upgrade-menu-container h3 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.1rem;
}
#tower-stats-display {
    background-color: #2c2c56;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}
#spell-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    border-top: 1px solid #3f3f6e;
    padding-top: 15px;
}
.spell-button {
    position: relative;
    background-color: #391c68;
    overflow: hidden;
}
.spell-button:hover {
    background-color: #5a3a9e;
}
.spell-button:disabled {
    background-color: #3a3a5e;
    color: #797676;
    cursor: not-allowed;
}
.spell-text {
    position: relative;
    z-index: 2;
}
.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 3;
    transition: height 0.1s linear;
}
.cooldown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    display: none;
    pointer-events: none;
}
.spell-button.on-cooldown {
    background-color: #3a3a5e;
}
.meteor-target {
    cursor: crosshair;
}
#targeting-section {
    margin-top: 8px;
    border-top: 1px solid #3f3f6e;
    padding-top: 10px;
}
#targeting-section h4 {
    text-align: center;
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #cfcfe6;
}
#targeting-section {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
#targeting-section .target-button {
    background-color: #37376c;
    padding: 6px 8px;
    font-size: 0.85rem;
}
#targeting-section .target-button:hover {
    background-color: #5a5a9e;
}
#targeting-section .target-button.selected {
    background-color: #7a7aff;
    box-shadow: 0 0 8px #7a7aff;
}
#knowledge-panel-button {
    background:#37376c;
    padding: 8px 10px;
    font-size: 0.75rem;
    flex: 1 1 160px;
}
#knowledge-panel button:hover {
    background:#5a5a9e;
}
#knowledge-panel button:disabled {
    background:#2d2d48;
    color:#767373;
    cursor: not-allowed;
}
#initial-start-screen {
    background:#313151;
    border: 1px solid #4a4a7e;
    border-radius: 10px;
    padding: 40px 30px 50px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 25px;
}
#initial-start-screen h1 {
    font-size: 3rem;
    letter-spacing: 2px;
}
#initial-start-screen button {
    font-size: 1rem;
}
#initial-start-screen #how-to-button {
    background:#3d3d7a;
}
#initial-start-screen #how-to-button:hover {
    background:#5a5a9e;
}
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
#overlay.hidden {
    display: none;
}
#overlay-content {
    width: 520px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: auto;
    background: #242442;
    border: 1px solid #4a4a7e;
    border-radius: 10px;
    padding: 16px 16px 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
#overlay-content h3 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.1rem;
}
#overlay-close {
    position: absolute;
    margin-left: calc(520px - 40px);
    background: #3a3a6e;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
}
#overlay-close:hover { 
    background:#5a5a9e;
}
.wave-preview {
    line-height: 1.2;
    text-align: left;
    color:#d9d9ff;
}