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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

.game-container {
    position: relative;
    width: 800px;
    height: 500px;
    background: #111;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* 游戏标题 */
.game-title {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    color: #ff8c00;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.7),
                 0 0 20px rgba(255, 140, 0, 0.5),
                 0 0 30px rgba(255, 140, 0, 0.3);
    letter-spacing: 3px;
    z-index: 10;
}

/* 像素背景 */
.pixel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 1;
}

/* 游戏地面 */
.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, #5d4037, #8d6e63);
    z-index: 2;
}

.ground::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #4caf50, #8bc34a, #4caf50);
}

/* 玩家角色 */
.player {
    position: absolute;
    bottom: 40px;
    left: 150px;
    width: 40px;
    height: 60px;
    background: linear-gradient(45deg, #ff5722, #ff9800);
    z-index: 5;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.7);
    transition: transform 0.2s;
}

.player::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 5px;
    width: 30px;
    height: 20px;
    background: #ffccbc;
    border-radius: 5px;
}

.player::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 5px;
    width: 15px;
    height: 25px;
    background: #ff7043;
    border-radius: 5px 5px 0 0;
}

/* 障碍物 */
.obstacle {
    position: absolute;
    bottom: 40px;
    right: -50px;
    width: 30px;
    height: 50px;
    background: linear-gradient(45deg, #9c27b0, #673ab7);
    border-radius: 5px 5px 0 0;
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.7);
    z-index: 4;
}

.obstacle::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 5px;
    width: 20px;
    height: 10px;
    background: #7b1fa2;
    border-radius: 3px 3px 0 0;
}

/* 云朵装饰 */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    filter: blur(2px);
    z-index: 1;
}

/* 游戏UI */
.score-container {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 24px;
    font-weight: bold;
    color: #ffeb3b;
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.3);
    z-index: 10;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.game-over h2 {
    font-size: 60px;
    color: #f44336;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(244, 67, 54, 0.7);
}

.final-score {
    font-size: 36px;
    margin-bottom: 30px;
    color: #4caf50;
}

.btn {
    background: linear-gradient(45deg, #2196f3, #21cbf3);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.6);
}

.btn:active {
    transform: translateY(1px);
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #bdbdbd;
    font-size: 18px;
    z-index: 10;
}

/* 动画效果 */
@keyframes jump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-150px); }
    100% { transform: translateY(0); }
}

.jump {
    animation: jump 0.8s cubic-bezier(0.5, 0.05, 0.5, 1);
}

/* 响应式设计 */
@media (max-width: 850px) {
    .game-container {
        width: 95vw;
        height: 70vh;
    }
    
    .game-title {
        font-size: 32px;
    }
    
    .player {
        width: 30px;
        height: 45px;
    }
    
    .player::before {
        top: 8px;
        left: 4px;
        width: 22px;
        height: 15px;
    }
    
    .player::after {
        left: 4px;
        width: 11px;
        height: 18px;
    }
    
    .obstacle {
        width: 22px;
        height: 38px;
    }
    
    .obstacle::before {
        top: -8px;
        left: 4px;
        width: 15px;
        height: 8px;
    }
    
    .game-title {
        font-size: 28px;
    }
    
    .score-container {
        font-size: 20px;
        padding: 8px 16px;
    }
    
    .game-over h2 {
        font-size: 40px;
    }
    
    .final-score {
        font-size: 28px;
    }
    
    .btn {
        padding: 12px 30px;
        font-size: 18px;
    }
    
    .instructions {
        font-size: 16px;
    }
}
