/* 基础文件 */

#kof {
    /* 16:9常规 */
    width: 1280px;
    height: 720px;
    background-image: url('0.gif');
    background-size: 200% 100%;
    background-position: top;

    position: absolute;
}

#kof>.kof-head {
    width: 100%;
    height: 80px;
    
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
}

#kof>.kof-head>.kof-head-hp-0{
    height: 40px;
    width: calc(50% - 60px);
    
    margin-left: 20px;
    border: white 5px solid;
    border-right: none;
    box-sizing: border-box;
}

#kof>.kof-head>.kof-head-timer{
    height: 60px;
    width: 80px;
    background-color: orange;
    border: white 5px solid;
    box-sizing: border-box;
    color: white;
    font-size: 30px;
    font-weight: 800;
    text-align: center;
    line-height: 50px;
    user-select: none;
}

#kof>.kof-head>.kof-head-hp-1{
    height: 40px;
    width: calc(50% - 60px);
    
    border: white 5px solid;
    border-left: none;
    box-sizing: border-box;
}

#kof>.kof-head>.kof-head-hp-0>div {
    background-color: red;
    height: 100%;
    width: 100%;
    float: right;
}

#kof>.kof-head>.kof-head-hp-1>div {
    background-color: red;
    height: 100%;
    width: 100%;
}

#kof>.kof-head>.kof-head-hp-0>div>div {
    background-color: lightgreen;
    height: 100%;
    width: 100%;
    float: right;
}

#kof>.kof-head>.kof-head-hp-1>div>div {
    background-color: lightgreen;
    height: 100%;
    width: 100%;
}
/* 触控界面 */
#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    display: none; /* 默认隐藏 */
    z-index: 100;
    touch-action: none;
    background: rgba(0, 0, 0, 0.5);
    border-top: 2px solid #ffcc00;
}

#mobile-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 101;
    border: 2px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    cursor: pointer;
}

#mobile-toggle.active {
    background: rgba(255, 204, 0, 0.7);
    color: black;
}

.left-controls, .right-controls {
    position: absolute;
    bottom: 20px;
    width: 45%;
    height: 140px;
}

.left-controls {
    left: 10px;
}

.right-controls {
    right: 10px;
}

.d-pad, .arrow-pad {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.d-pad > div, .arrow-pad > div {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 204, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    user-select: none;
}

.d-pad-top {
    top: 0;
    left: 40px;
}

.d-pad-bottom {
    bottom: 0;
    left: 40px;
}

.d-pad-left {
    top: 40px;
    left: 0;
}

.d-pad-right {
    top: 40px;
    right: 0;
}

.d-pad-center {
    top: 40px;
    left: 40px;
    background: rgba(255, 204, 0, 0.3) !important;
}

.arrow-up {
    top: 0;
    left: 40px;
}

.arrow-down {
    bottom: 0;
    left: 40px;
}

.arrow-left {
    top: 40px;
    left: 0;
}

.arrow-right {
    top: 40px;
    right: 0;
}

.arrow-center {
    top: 40px;
    left: 40px;
    background: rgba(255, 204, 0, 0.3) !important;
}

.attack-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 0, 0.3);
    border: 2px solid rgba(255, 0, 0, 0.7);
    border-radius: 50%;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* 激活状态 */
.d-pad > div.active, .arrow-pad > div.active, .attack-btn.active {
    background: rgba(255, 204, 0, 0.7);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.8);
}

/* 媒体查询 - 小屏幕调整 */
@media (max-width: 768px) {
    .left-controls, .right-controls {
        width: 40%;
    }
    
    .d-pad, .arrow-pad {
        width: 100px;
        height: 100px;
    }
    
    .d-pad > div, .arrow-pad > div {
        width: 35px;
        height: 35px;
        font-size: 10px;
    }
    
    .attack-btn {
        width: 60px;
        height: 60px;
        font-size: 12px;
    }
}