/* 像素虫群入侵 - 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1a1a1a;
    font-family: 'Courier New', monospace;
    touch-action: none;
    overscroll-behavior: none;
    /* 安全区域适配 */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    touch-action: none;
}

.pixel-button {
    background-color: #4a4a4a;
    border: 2px solid #8B4513;
    color: #ffffff;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    cursor: pointer;
    image-rendering: pixelated;
}

.pixel-button:hover {
    background-color: #5a5a5a;
}

.pixel-button:disabled {
    background-color: #2a2a2a;
    border-color: #666666;
    color: #666666;
    cursor: not-allowed;
}

@media (max-width: 360px) {
    #gameCanvas {
        width: 100%;
        height: auto;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    #gameCanvas {
        height: 100vh;
        width: auto;
    }
}
