body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('bgrandom8.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
}

.game-container {
    text-align: center;
    position: relative;
    background-color: rgba(255, 255, 255, 0.9); /* 白色半透明背景，确保游戏内容清晰可见 */
    padding: 40px; /* 放大两倍 */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); /* 添加轻微阴影以增强对比度 */
}

#gameCanvas {
    border: 2px solid #ccc; /* 放大边框 */
    background-color: #f7f7f7;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.score {
    font-size: 40px; /* 放大两倍 */
    margin-bottom: 20px; /* 放大两倍 */
    display: inline-block;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px; /* 放大两倍 */
    color: #ff0000;
    font-weight: bold;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.5); /* 放大阴影效果 */
}

.instructions {
    margin-top: 40px; /* 放大两倍 */
    text-align: center;
}

.instructions p {
    margin: 20px 0; /* 放大两倍 */
    font-size: 32px; /* 放大两倍 */
    line-height: 1.5;
}

#restartBtn {
    padding: 30px 60px; /* 放大两倍 */
    font-size: 36px; /* 放大两倍 */
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 20px; /* 放大两倍 */
    min-width: 240px; /* 放大两倍 */
}

#restartBtn:hover {
    background-color: #45a049;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        min-height: 100vh;
        height: auto;
    }
    
    .game-container {
        padding: 10px;
        background-color: rgba(255, 255, 255, 0.9); /* 移动端同样保持白色半透明背景 */
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 500px; /* 设置最大宽度以适应较小的移动设备 */
        border-width: 2px; /* 在移动设备上增加边框宽度以提高可见性 */
    }
    
    .score {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .game-over {
        font-size: 32px;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    .instructions p {
        font-size: 18px;
        margin: 15px 0;
    }
    
    #restartBtn {
        padding: 12px 24px;
        font-size: 16px;
    }
}