body {
    background: #000;
    margin: 0;
}

#screen {
    display: block;
    image-rendering: pixelated;
    margin: auto;
    width: 100vw;
    max-height: 100vh;
}

.aspect-4-3 {
    height: 75vw;
    max-width: 133.3vh;
}

.aspect-16-9 {
    height: 56.25vw;
    max-width: 177.7vh;
}

/* 触控控制样式 */
.touch-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    pointer-events: none;
    z-index: 1000;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 在非移动设备上默认隐藏 */
@media (min-width: 1024px) {
    .touch-controls {
        display: none !important;
    }
}

/* 在移动设备上显示 */
@media (max-width: 1023px) {
    .touch-controls {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        padding: 20px;
    }
}

/* 摇杆容器 */
.joystick-container {
    pointer-events: auto;
    width: 120px;
    height: 120px;
    position: relative;
    margin-bottom: 20px;
    margin-left: 20px;
}

.joystick-base {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.4);
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.joystick-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.1s;
}

.joystick-thumb.active {
    background: rgba(255, 255, 255, 0.8);
}

/* 按钮容器 */
.buttons-container {
    pointer-events: auto;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    margin-right: 20px;
}

.touch-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    transition: transform 0.05s, background 0.1s;
}

.touch-button:active {
    transform: scale(0.9);
}

.touch-button.jump {
    background: rgba(255, 100, 100, 0.4);
}

.touch-button.jump.active {
    background: rgba(255, 100, 100, 0.7);
}

.touch-button.turbo {
    background: rgba(100, 100, 255, 0.4);
    width: 55px;
    height: 55px;
    font-size: 12px;
}

.touch-button.turbo.active {
    background: rgba(100, 100, 255, 0.7);
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}