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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background-color: #8b4513;
    border: 2px solid #5d4037;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#game-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 5px;
}

#game-info div {
    margin: 5px 0;
    font-size: 18px;
}

#tower-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 5px;
    width: 150px;
}

#tower-menu h3 {
    text-align: center;
    margin-bottom: 10px;
}

.tower-option {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px;
    margin: 5px 0;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
}

.tower-option:hover {
    background: rgba(255,255,255,0.3);
}

.tower-option.selected {
    background: rgba(0,255,0,0.3);
    border-color: rgba(0,255,0,0.5);
}

#start-wave {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#start-wave:hover {
    background: #45a049;
}

#start-wave:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

#message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 100;
}

#message.show {
    display: block;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background-color: #8b4513;
    border: 2px solid #5d4037;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    color: white;
    text-shadow: 1px 1px 2px black;
    /* Allow clicks to pass through to elements underneath */
    pointer-events: none;
}

/* But allow pointer events on actual UI elements */
#tower-menu,
#start-wave,
.tower-option,
#message {
    pointer-events: all;
}

/* Make canvas clickable for placing towers - use !important to override any potential conflicts */
#game-canvas {
    pointer-events: all !important;
    cursor: crosshair !important;
}

/* Ensure the container doesn't block events */
#game-container {
    pointer-events: all;
}

/* But allow pointer events on actual UI elements */
#tower-menu,
#start-wave,
.tower-option,
#message {
    pointer-events: all;
}

#game-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 5px;
}

#game-info div {
    margin: 5px 0;
    font-size: 18px;
}

#tower-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 5px;
    width: 150px;
}

#tower-menu h3 {
    text-align: center;
    margin-bottom: 10px;
}

.tower-option {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px;
    margin: 5px 0;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
}

.tower-option:hover {
    background: rgba(255,255,255,0.3);
}

.tower-option.selected {
    background: rgba(0,255,0,0.3);
    border-color: rgba(0,255,0,0.5);
}

#start-wave {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#start-wave:hover {
    background: #45a049;
}

#start-wave:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

#message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 100;
}

#message.show {
    display: block;
}