html, body {
    margin: 0;
    padding: 0;
    background: #111;
    overflow: hidden;
    font-family: sans-serif;
}

canvas {
    display: block;
    background: #222;
}

#game {
    margin-left: 200px;
    margin-top: 50px;
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 16px;
}

#endScreen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 18px;
    padding: 20px;
}

#joystick {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    touch-action: none;
}

#stick {
    width: 30px;
    height: 30px;
    background: rgba(0,255,0,0.5);
    border-radius: 50%;
    position: absolute;
    left: 25px;
    top: 25px;
}

#controls {
    position: absolute;
    bottom: 50px;
    right: 50px;
    display: flex;
    justify-content: flex-end;
    width: 150px; /* Enough space for a large button */
}

#attackButton {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.5);
    border: none;
    color: white;
    font-size: 18px;
    font-weight: bold;
    position: absolute;
    bottom: 50px;
    right: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

    #attackButton:hover {
        background-color: rgba(255, 0, 0, 1); /* Hover effect */
    }

#cooldownWrapper {
    position: absolute;
    bottom: 160px;
    right: 50px;
    width: 120px;
    height: 120px;
    /* pointer-events: none; <-- REMOVE THIS LINE */
}

#cooldownCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

#cooldownButton {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 165, 0, 0.5);
    border: none;
    color: white;
    font-size: 14px;
    font-weight: bold;
    left: 10px;
    top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.3s;
}

    #cooldownButton.disabled {
        background: rgba(100, 100, 100, 0.4);
        cursor: default;
    }

    #cooldownButton::after {
        content: '';
        position: absolute;
        width: 110px;
        height: 110px;
        border-radius: 50%;
        border: 4px solid rgba(255, 165, 0, 0.7);
        box-sizing: border-box;
        top: -5px;
        left: -5px;
        clip-path: inset(0 0 0 0 round 50%);
        transform: rotate(-90deg);
        transform-origin: center;
        pointer-events: none;
        animation-play-state: paused;
    }

@keyframes cooldownTimer {
    from {
        stroke-dasharray: 0 100;
    }

    to {
        stroke-dasharray: 100 0;
    }
}
