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

html, body {
    height: 100%;
    overflow: hidden;
    background: #001122;
    font-family: 'Microsoft JhengHei', 'Segoe UI', Arial, sans-serif;
    touch-action: none;
}

#canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: block;
}

/* HUD - 遊戲進行中 */
.hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    z-index: 150;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 40px;
    border-radius: 50px;
    backdrop-filter: blur(12px);
    color: white;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
}

.label {
    font-size: 18px;
    opacity: 0.85;
}

.value {
    font-size: 36px;
    min-width: 80px;
    text-align: center;
}

/* Overlay 通用 */
.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(1, 22, 48, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: all;
}

/* 開始畫面 */
.start-content {
    text-align: center;
    color: white;
    max-width: 620px;
}

.game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.game-title h1 {
    font-size: 58px;
    font-weight: bold;
    text-shadow: 0 0 30px #00ddff;
}

.subtitle {
    font-size: 24px;
    margin: 20px 0 40px;
    opacity: 0.9;
}

.game-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-bottom: 50px;
}

.info-item {
    background: rgba(255,255,255,0.1);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 22px;
}

.info-item.gold { color: #ffee33; }
.info-item.bomb { color: #ff6666; }

.btn-primary {
    background: linear-gradient(90deg, #00ddff, #ffaa00);
    color: #001122;
    font-size: 28px;
    font-weight: bold;
    padding: 18px 50px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 221, 255, 0.5);
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(0, 221, 255, 0.6);
}

.tip {
    margin-top: 40px;
    font-size: 18px;
    opacity: 0.75;
}

/* 結束畫面 - 專業加強版 */
.end-content {
    text-align: center;
    max-width: 620px;
    padding: 20px;
}

.end-title {
    font-size: 52px;
    margin-bottom: 20px;
    color: #ffeb3b;
    text-shadow: 0 0 25px #ffeb3b;
}

.final-result {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 30px 0 40px;
}

.score-box {
    text-align: center;
}

.score-box .label {
    font-size: 20px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.big-score {
    font-size: 68px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 20px #00ddff;
    line-height: 1;
}

.rank-title {
    font-size: 28px;
    margin: 10px 0 20px;
    color: #ffeb3b;
}

/* 排行榜 */
.leaderboard {
    background: rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 18px 0;
    list-style: none;
    max-width: 420px;
    margin: 0 auto 40px;
    font-size: 23px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.leaderboard li {
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.leaderboard li:last-child {
    border-bottom: none;
}

/* 新增：自己上榜時標紅色 */
.leaderboard li.highlight {
    background: rgba(255, 60, 60, 0.25);
    color: #ff6666;
    font-weight: bold;
}

.actions {
    margin-top: 20px;
}

/* 重新開始按鈕 - 修正位置與大小 */
.btn-primary {
    background: linear-gradient(90deg, #00ffcc, #ffaa00);
    color: #001122;
    font-size: 26px;
    font-weight: bold;
    padding: 16px 60px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 255, 200, 0.5);
    transition: all 0.3s;
    margin: 0 auto;
    display: block;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 255, 200, 0.7);
}

.note {
    margin-top: 25px;
    font-size: 16px;
    opacity: 0.75;
}
