/* 螢火蟲點點樂 專用樣式 */
body.page-firefly {
    margin: 0;
    padding: 0;
    background-color: #000215; /* 靜謐的深藍黑色背景 */
    overflow: hidden; /* 隱藏捲軸 */
    position: relative;
    /* 確保文字顏色預設為白色，方便UI顯示 */
    color: white;
    font-family: 'M PLUS Rounded 1c', sans-serif; /* 套用與首頁一致的字體 */
}

/* 遊戲區域 */
.page-firefly #game-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- 【更新】遊戲UI介面容器 --- */
.page-firefly .game-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex; /* 使用 Flexbox 進行排版 */
    justify-content: space-between; /* 讓子元素左右散開 */
    align-items: center; /* 垂直置中 */
    z-index: 10;
    pointer-events: none; /* 讓UI容器本身不接收點擊，只有按鈕可以 */
}

/* --- 【新增】計分板樣式 --- */
.score-display {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.5em; /* 放大字體 */
    font-weight: 700;
    border: 2px solid rgba(255, 215, 0, 0.5);
    text-shadow: 0 0 5px #ffd700; /* 加上文字光暈效果 */
}

/* --- 【新增】右上角控制按鈕群組 --- */
.top-right-controls {
    display: flex;
    gap: 10px; /* 讓按鈕之間有間距 */
}

/* --- 【新增】通用遊戲按鈕樣式 (音樂/返回) --- */
.game-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
    width: 50px; /* 設定固定寬高，讓按鈕變圓形 */
    height: 50px;
    border-radius: 50%; /* 圓形按鈕 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em; /* 放大圖示 */
    cursor: pointer;
    transition: background-color 0.2s;
    pointer-events: auto; /* 讓按鈕可以被點擊 */
}

.game-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* --- 虛擬搖桿樣式 (不變) --- */
#joystick-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 20;
}

#joystick-base {
    position: relative;
    width: 120px;
    height: 120px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-stick {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.1s;
}

/* --- 【新增】右下角動作UI樣式 --- */
.action-ui {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 20;
    display: flex;
    flex-direction: column; /* 讓體力條和按鈕垂直排列 */
    align-items: center;
    gap: 15px; /* 增加間距 */
}

/* 體力條容器 */
.stamina-bar {
    width: 120px;
    height: 25px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 2px;
    display: flex;
    align-items: center;
    position: relative;
}

/* 體力條的填充部分 */
.stamina-fill {
    height: 100%;
    width: 100%; /* 預設滿體力 */
    background: linear-gradient(to right, #a8e063, #56ab2f); /* 綠色漸層 */
    border-radius: 20px;
    transition: width 0.2s linear; /* 讓體力變化更平滑 */
}

/* "體力" 文字標籤 */
.stamina-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9em;
    font-weight: 700;
    text-shadow: 1px 1px 2px black;
}

/* 奔跑按鈕 */
.sprint-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 215, 0, 0.5); /* 金黃色 */
    font-size: 2.5em;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
}

/* 按鈕按下的效果 */
.sprint-button:active {
    transform: scale(0.9);
    background-color: rgba(255, 215, 0, 0.8);
}


/* --- 【新增】遊戲結算視窗樣式 --- */
.summary-value {
    font-weight: 700;
    font-size: 1.2em;
    color: #56ab2f; /* 綠色，代表收穫 */
}

#level-up-message {
    background-color: #fff8e1;
    border: 2px dashed #ffda77;
    border-radius: 10px;
    padding: 5px 15px;
    margin-top: 15px;
}