/* --- 背景設定：自動捲動星空 --- */
body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #000000 100%);
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    background-repeat: repeat;
    background-size: 400px;
    animation: scroll-space 60s linear infinite;
    z-index: -1;
}

@keyframes scroll-space {
    from { background-position: 0 0; }
    to { background-position: -4000px 0; }
}

/* --- 開頭影片提示框 --- */
#intro-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    font-family: 'Consolas', monospace;
}

.intro-box h1 {
    font-size: 3vw;
    text-shadow: 0 0 15px #ff843c;
}

.intro-box button {
    padding: 15px 30px;
    font-size: 24px;
    margin: 0 20px;
    cursor: pointer;
    background-color: #555;
    color: #fff;
    border: 1px solid #888;
    transition: all 0.2s ease;
}
.intro-box button:hover {
    background-color: #fff;
    color: #000;
}

/* --- 遊戲主容器 --- */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    cursor: none;
}

/* --- 鋼彈設定 --- */
#gundam {
    position: absolute;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%) scaleX(-1);
    pointer-events: none;
    z-index: 10;
    transition: filter 0.1s ease, width 0.2s ease, height 0.2s ease;
}

#gundam.hit {
    filter: brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(5);
}

#gundam.exploding {
    width: 600px;
    height: 600px;
    transition: none;
    filter: none;
}

/* --- 敵人通用樣式 --- */
.enemy-container {
    position: absolute;
}
.enemy {
    width: 300px;
    height: 300px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}
.enemy.hit {
    transform: scale(0.9) rotate(5deg);
    opacity: 0.7;
}

/* --- 血條 --- */
.hp-bar-container {
    width: 100px;
    height: 10px;
    border: 1px solid #fff;
    background-color: #555;
    margin: 0 auto -15px;
    position: relative;
    z-index: 5;
}
.hp-bar {
    width: 100%;
    height: 100%;
    background-color: #ff4141;
    transition: width 0.2s ease;
}

/* --- 雷射光束 --- */
#laser-beam {
    position: absolute;
    height: 10px;
    width: 100vw;
    background: linear-gradient(90deg, rgba(137,255,255,1) 0%, rgba(0,212,255,0.5) 80%, rgba(0,212,255,0) 100%);
    box-shadow: 0 0 15px #89ffff, 0 0 20px #89ffff;
    border-radius: 5px;
    pointer-events: none;
    z-index: 9;
}

/* --- 大絕招容器 (用來旋轉) --- */
#ultimate-container {
    position: absolute;
    width: 2500px;
    height: 2500px;
}

/* --- 大絕招雷射的通用樣式 --- */
.ultimate-laser {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 12px;
    width: 50%;
    background: linear-gradient(90deg, rgba(255,255,150,1) 0%, rgba(255,100,100,1) 80%, rgba(255,0,0,0) 100%);
    box-shadow: 0 0 10px #ffdd3c, 0 0 20px #ff843c;
    border-radius: 6px;
    transform: translateY(-50%);
    transform-origin: 0 50%;
}

.ultimate-laser.opposite {
    transform: translateY(-50%) rotate(180deg);
}

/* --- HUD 顯示資訊 --- */
#hud {
    position: fixed;
    bottom: 10px;
    left: 10px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #444;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 16px;
    z-index: 100;
}
#hud div {
    margin-bottom: 5px;
}
#score-display {
    font-weight: bold;
    color: #ffdd3c;
    font-size: 18px;
}

/* --- 機槍子彈 --- */
.bullet {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: yellow;
    border-radius: 50%;
    z-index: 9;
}

/* --- 飛彈 --- */
.missile {
    position: absolute;
    width: 70px;
    height: auto;
    z-index: 9;
}

/* --- 敵人雷射彈樣式 --- */
.enemy-projectile {
    position: absolute;
    width: 25px;
    height: 8px;
    background-color: #ff4747;
    border-radius: 4px;
    box-shadow: 0 0 15px #ff4747;
    pointer-events: none;
    z-index: 8;
}

/* --- 遊戲結束畫面樣式 (已修正) --- */
#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Consolas', monospace;
}
#game-over-screen h1 {
    font-size: 8vw;
    text-shadow: 0 0 20px #ff4141;
}
#restart-button {
    padding: 15px 30px;
    font-size: 24px;
    background-color: #ff4141;
    color: #000;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
#restart-button:hover {
    background-color: #fff;
    box-shadow: 0 0 20px #fff;
}

/* --- 通用隱藏樣式 --- */
.hidden {
    display: none;
}

/* --- 音樂按鈕樣式 --- */
#music-toggle-button {
    margin-top: 10px;
    padding: 5px 10px;
    width: 100%;
    background-color: #555;
    color: #fff;
    border: 1px solid #888;
    cursor: pointer;
    font-size: 14px;
}
#music-toggle-button:hover {
    background-color: #777;
}

/* --- 開頭影片樣式 --- */
#intro-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

/* --- 關卡過關畫面樣式 --- */
#level-clear-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9998;

    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-family: 'Consolas', monospace;
}
#level-clear-screen h1 {
    font-size: 7vw;
    text-shadow: 0 0 20px #ffdd3c, 0 0 30px #89ffff; /* 金色與青色光暈 */
}

#level-clear-screen p {
    font-size: 1.5vw;
    margin-top: -20px;
    color: #ddd;
}

#next-level-button {
    padding: 15px 30px;
    font-size: 24px;
    background-color: #3c7cff; /* 亮藍色按鈕 */
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 30px;
    border-radius: 5px;
}

#next-level-button:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 0 0 20px #fff;
}


#countdown-timer {
    font-weight: bold;
    color: #89ffff; /* 使用青色以突顯 */
    font-size: 18px;
    margin-top: 5px; /* 與上方分數拉開一點距離 */
}