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

body {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    width: 1200px;
    max-width: 100vw;
    height: 700px;
    max-height: 100vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    background: #2d2d44;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #3a7bd5;
    background: linear-gradient(180deg, #6dd5fa 0%, #2980b9 100%);
    cursor: none;
}

/* ===== MOBILE CONTROLS ===== */
#mobileControls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none; /* Ẩn trên PC, hiện trên mobile */
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
    pointer-events: none;
}

#mobileControls * {
    pointer-events: auto;
}

/* Joystick */
#joystickArea {
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystickBase {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

#joystickKnob {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #fff 0%, #ddd 100%);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: box-shadow 0.2s;
    cursor: grab;
}

#joystickKnob:active {
    box-shadow: 0 0 30px rgba(255,200,0,0.6);
}

/* Action Buttons */
#actionButtons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-bottom: 10px;
}

.actionBtn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.15s;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    touch-action: manipulation;
}

.actionBtn:active {
    transform: scale(0.88);
    background: rgba(255,255,255,0.35);
}

#btnAttack { background: rgba(255, 70, 70, 0.5); border-color: #ff6b6b; }
#btnSkill { background: rgba(70, 130, 255, 0.5); border-color: #4dabf7; }
#btnBurst { background: rgba(255, 200, 0, 0.5); border-color: #ffd43b; color: #000; }
#btnRun   { background: rgba(0, 230, 118, 0.5); border-color: #69db7c; }

/* Status Bar */
#statusBar {
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 15px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #gameContainer {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }
    
    #mobileControls {
        display: flex !important;
    }
    
    #statusBar {
        font-size: 12px;
        padding: 6px 14px;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .actionBtn {
        width: 60px;
        height: 60px;
        font-size: 12px;
    }
    
    #joystickBase {
        width: 100px;
        height: 100px;
    }
    
    #joystickKnob {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .actionBtn {
        width: 50px;
        height: 50px;
        font-size: 10px;
    }
    #joystickBase {
        width: 80px;
        height: 80px;
    }
    #joystickKnob {
        width: 36px;
        height: 36px;
    }
    #actionButtons { gap: 8px; }
}