/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Press Start 2P', monospace;
    background-color: #1a1a1a;
}

/* 游戏容器 */
#gameContainer {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* 画布 */
#gameCanvas {
    background-color: #2C3E50;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    max-height: 100%;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 加载提示 */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 16px;
    text-align: center;
    z-index: 1000;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    #gameContainer {
        padding: 0;
    }

    #gameCanvas {
        width: 100%;
        height: 100%;
    }
}

/* 触摸设备优化 */
@media (pointer: coarse) {
    #gameCanvas {
        touch-action: none;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    #gameCanvas {
        image-rendering: auto;
    }
}

/* 横屏提示（移动端） */
@media (max-width: 768px) and (orientation: portrait) {
    #gameContainer::after {
        content: "建议横屏游玩以获得最佳体验";
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: #ffffff;
        font-size: 12px;
        text-align: center;
        padding: 10px 20px;
        background-color: rgba(0, 0, 0, 0.7);
        border-radius: 10px;
        z-index: 100;
    }
}

/* 禁用文本选择 */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 焦点样式移除（用于键盘导航） */
button:focus,
canvas:focus {
    outline: none;
}

/* 打印样式 */
@media print {
    #gameContainer {
        display: none;
    }
}
