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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 游戏容器 */
.game-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 游戏头部 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #4ade80;
    font-size: 2.5rem;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

/* 分数板 */
.score-board {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
}

.score-label {
    color: #94a3b8;
    font-size: 1rem;
}

.score-value {
    color: #fbbf24;
    font-size: 1.8rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

/* Canvas 包装器 */
.canvas-wrapper {
    position: relative;
    display: inline-block;
}

#gameCanvas {
    display: block;
    border-radius: 10px;
    background: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #334155;
}

/* 游戏遮罩层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
}

.overlay-content h2 {
    color: #4ade80;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.overlay-content p {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* 开始按钮 */
.start-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #0f172a;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 222, 128, 0.4);
}

.start-btn:active {
    transform: translateY(0);
}

/* 游戏底部 */
.game-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.controls-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-key {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-label {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 1.8rem;
    }

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

    .game-footer {
        flex-direction: column;
        gap: 15px;
    }

    .overlay-content {
        padding: 20px;
    }

    .overlay-content h2 {
        font-size: 1.8rem;
    }

    .overlay-content p {
        font-size: 1rem;
    }
}
