/* 像素飞刀大师 - 8位像素风格样式 */

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

body {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: #1a1a2e;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* UI覆盖层 */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 分数和关卡显示 */
.score, .level, .knives {
    position: absolute;
    color: #FFD700;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
}

.score {
    top: 20px;
    left: 20px;
}

.level {
    top: 20px;
    right: 20px;
}

.knives {
    top: 50px;
    left: 20px;
}

/* 开始界面 */
.start-screen, .game-over-screen, .level-complete-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 10;
}

.start-screen h1, .game-over-screen h1, .level-complete-screen h1 {
    color: #FFD700;
    font-size: 32px;
    text-shadow: 4px 4px 0 #8B4513;
    margin-bottom: 20px;
    text-align: center;
}

.game-over-screen h1 {
    color: #FF4444;
    text-shadow: 4px 4px 0 #8B0000;
}

.level-complete-screen h1 {
    color: #44FF44;
    text-shadow: 4px 4px 0 #008800;
}

.start-screen p, .game-over-screen p, .level-complete-screen p {
    color: #FFFFFF;
    font-size: 14px;
    margin: 10px 0;
    text-align: center;
}

.btn {
    background: #FFD700;
    color: #1a1a2e;
    border: 4px solid #8B4513;
    padding: 15px 40px;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    margin: 10px;
    text-transform: uppercase;
    transition: all 0.1s;
    box-shadow: 4px 4px 0 #8B4513;
}

.btn:hover {
    background: #FFA500;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #8B4513;
}

.btn:active {
    background: #FF8C00;
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* 最高分显示 */
.high-score {
    color: #C0C0C0;
    font-size: 12px;
    margin: 20px 0;
}

/* 暂停按钮 */
.pause-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #FFD700;
    border: 3px solid #8B4513;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 0 #8B4513;
}

/* 暂停界面 */
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 15;
}

.pause-screen h2 {
    color: #FFD700;
    font-size: 24px;
    margin-bottom: 30px;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .score, .level, .knives {
        font-size: 12px;
    }

    .start-screen h1, .game-over-screen h1, .level-complete-screen h1 {
        font-size: 24px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

@media (max-height: 600px) {
    .score, .level, .knives {
        font-size: 12px;
        top: 10px;
    }

    .knives {
        top: 30px;
    }
}
