body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    touch-action: none; /* 防止移动端长按选中文本或滚动 */
    user-select: none;
    -webkit-user-select: none;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#score {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 60px;
    color: #333;
    z-index: 10;
    pointer-events: none;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
}

#power-bar-container {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    overflow: hidden;
    z-index: 10;
    pointer-events: none;
}

#power-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.05s linear, background-color 0.2s;
}

#instructions {
    position: absolute;
    bottom: 10%;
    width: 100%;
    text-align: center;
    color: rgba(0,0,0,0.5);
    font-size: 16px;
    pointer-events: none;
    z-index: 5;
}

#game-over {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 30px 50px;
    border-radius: 15px;
    text-align: center;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 200px;
}

#game-over h2 {
    margin-top: 0;
    color: #f44336;
    font-size: 28px;
}

#game-over p {
    font-size: 22px;
    margin: 20px 0;
}

#restart-btn {
    padding: 12px 30px;
    font-size: 18px;
    cursor: pointer;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    margin-top: 10px;
    transition: background 0.2s;
    font-weight: bold;
}

#restart-btn:hover {
    background: #45a049;
}

#restart-btn:active {
    transform: scale(0.95);
}

#high-score-container {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 16px;
    color: #333;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    pointer-events: auto;
}

#clear-high-score-btn {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background 0.2s;
    font-weight: normal;
}

#clear-high-score-btn:hover {
    background: #d32f2f;
}

#clear-high-score-btn:active {
    transform: scale(0.95);
}
