body {
    margin: 0;
    overflow: hidden;
    background-color: #222;
    color: white;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

canvas {
    background-color: #333;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    cursor: crosshair;
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    pointer-events: none;
    z-index: 10;
}

#level-up-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border: 2px solid #fff;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.upgrade-btn {
    background: #444;
    color: white;
    border: 1px solid #fff;
    padding: 10px 20px;
    cursor: pointer;
    pointer-events: auto;
}

.upgrade-btn:hover {
    background: #666;
}

.upgrade-btn.selected {
    background: #666;
    border-color: #ffd700;
    box-shadow: 0 0 6px #ffd700;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(128, 0, 0, 0.8);
    padding: 40px;
    text-align: center;
    display: none;
    z-index: 100;
}

#game-clear {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(60, 0, 90, 0.9);
    border: 2px solid #ffd700;
    padding: 40px;
    text-align: center;
    display: none;
    z-index: 100;
}

#game-clear h1 {
    color: #ffd700;
}

#npc-select-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border: 2px solid #ffd700;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

#npc-info {
    margin-top: 6px;
}

#toast-message {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 8px 16px;
    pointer-events: none;
    z-index: 50;
    display: none;
}

#debug-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 260px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #0f0;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 200;
}

#debug-menu h3 {
    margin: 8px 0 2px;
    color: #0f0;
    font-size: 13px;
}

.debug-btn {
    background: #222;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 4px 8px;
    cursor: pointer;
    pointer-events: auto;
    font-size: 12px;
    text-align: left;
}

.debug-btn:hover {
    background: #044;
}

.debug-btn.selected {
    background: #044;
    border-color: #ff0;
    box-shadow: 0 0 6px #ff0;
}

#battle-log {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 380px;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid #666;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: auto;
    z-index: 40;
}

#battle-log div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-badge {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 28px;
    margin-right: 4px;
}

.icon-badge img {
    width: 100%;
    height: 100%;
    display: block;
}

.icon-badge-level {
    position: absolute;
    right: -2px;
    bottom: -2px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 3px;
    pointer-events: none;
}