* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #111;
    overflow: hidden;
    font-family: 'Bangers', cursive;
    color: white;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    background: #000;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    padding: 2vw;
    display: flex;
    flex-direction: column;
}

/* Health Bars */
.health-bar-container {
    position: absolute;
    top: 3vh;
    width: 35%;
    background: rgba(0,0,0,0.6);
    border: 3px solid #D4AF37;
    border-radius: 5px;
    padding: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.health-bar-container.p1 {
    left: 5%;
}

.health-bar-container.p2 {
    right: 5%;
    transform: scaleX(-1);
}

.health-bar-container.p2 .player-info, 
.health-bar-container.p2 #p2-name {
    transform: scaleX(-1);
    text-align: right;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 24px;
    text-shadow: 2px 2px 0 #000;
}

.round-indicators {
    display: flex;
    gap: 5px;
}

.round-circle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid #D4AF37;
    background: transparent;
}

.round-circle.filled {
    background: #D4AF37;
    box-shadow: 0 0 8px #D4AF37;
}

.health-bar-bg {
    width: 100%;
    height: 25px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #000;
}

.health-fill {
    height: 100%;
    width: 100%;
    transition: width 0.2s ease-out;
}

.p1-color { background: linear-gradient(to bottom, #4A90D9, #2244CC); }
.p2-color { background: linear-gradient(to bottom, #D94A4A, #CC2222); }

/* Timer */
#timer {
    position: absolute;
    top: 2vh;
    left: 50%;
    transform: translateX(-50%);
    font-size: 60px;
    font-weight: bold;
    color: #F8D030;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    background: rgba(0,0,0,0.5);
    padding: 0 20px;
    border-radius: 10px;
    border: 3px solid #D4AF37;
}

/* Super Meter */
#super-meter-container {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 15px;
    background: rgba(0,0,0,0.7);
    border: 2px solid #D4AF37;
    border-radius: 8px;
    overflow: hidden;
}

#super-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #FFD700, #FFA500);
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Combo Text */
.combo-text {
    position: absolute;
    top: 30%;
    font-size: 40px;
    font-style: italic;
    color: #FF5733;
    text-shadow: 2px 2px 0 #FFF, 4px 4px 0 #000;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

#p1-combo { left: 10%; }
#p2-combo { right: 10%; }

.combo-active {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
    animation: comboPulse 0.5s infinite alternate;
}

@keyframes comboPulse {
    0% { transform: translateY(-20px) scale(1.2); }
    100% { transform: translateY(-20px) scale(1.3); color: #FFD700; }
}

/* Messages */
#game-message {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: #FFF;
    text-shadow: 4px 4px 0 #CC2222, 8px 8px 0 #000;
    text-align: center;
    letter-spacing: 5px;
}

.hidden { display: none !important; }

/* Mobile Controls */
#mobile-controls {
    display: none; /* Hidden on desktop */
    position: absolute;
    bottom: 2vh;
    left: 0;
    width: 100%;
    height: 35vh;
    pointer-events: auto;
}

@media (max-width: 1024px) {
    #mobile-controls {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        padding: 0 5vw;
    }
}

.d-pad {
    position: relative;
    width: 160px;
    height: 160px;
}

.d-btn {
    position: absolute;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(200, 200, 200, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.7);
    outline: none;
}

.d-btn:active { background: rgba(255, 255, 255, 0.8); }

.d-btn.up { top: 0; left: 52px; }
.d-btn.down { bottom: 0; left: 52px; }
.d-btn.left { top: 52px; left: 0; }
.d-btn.right { top: 52px; right: 0; }

.action-buttons {
    position: relative;
    width: 200px;
    height: 160px;
}

.a-btn {
    position: absolute;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.8);
    font-family: 'Bangers', cursive;
    font-size: 24px;
    color: #FFF;
    text-shadow: 1px 1px 0 #000;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
}

.a-btn:active { transform: scale(0.9); }

.a-btn.light { width: 50px; height: 50px; bottom: 80px; left: 50px; background: #FFD700; }
.a-btn.medium { width: 60px; height: 60px; bottom: 40px; left: 110px; background: #FF8C00; }
.a-btn.heavy { width: 70px; height: 70px; bottom: -10px; left: 170px; background: #CC2222; }
.a-btn.special { width: 65px; height: 65px; top: 0; left: 150px; background: #D4AF37; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: none; }
.a-btn.block { width: 55px; height: 55px; bottom: 20px; left: -10px; background: #2244CC; }
