/* ====== 全域基礎 ====== */
* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft JhengHei', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background: #050608; color: #fff;
    overflow: hidden;
    display: flex; justify-content: center; align-items: center;
    height: 100vh;
    user-select: none;
}
input, textarea, select { user-select: auto; }

/* ====== 遊戲容器 ====== */
#game-container {
    position: relative; width: 960px; height: 540px;
    box-shadow: 0 0 35px rgba(0,0,0,0.9), 0 0 15px rgba(212,175,55,0.3);
    border: 2px solid #5a4b32; border-radius: 12px;
    overflow: hidden; background: #000; visibility: hidden;
}
/* 1920×1080（同 16:9 比例）：由 src/scenes/PlayScene.js 依設定加上 .hd */
#game-container.hd { width: 1920px; height: 1080px; }
#bgImage {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; pointer-events: none; z-index: 0;
    filter: brightness(0.95);
}
canvas {
    background: transparent !important;
    display: block; position: relative; z-index: 1;
}

/* ====== 工具 ====== */
.hidden { display: none !important; }
.mt-20 { margin-top: 20px; }
.spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #ffd700; border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Loading Overlay ====== */
#loadingOverlay {
    display: none; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; z-index: 9999;
    background: rgba(5,6,8,0.92);
    justify-content: center; align-items: center;
    flex-direction: column; text-align: center;
}
#loadingOverlay.active { display: flex; }
#loadingOverlay .spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: #ffd700; border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
#loadingOverlay .loading-text {
    margin-top: 16px; font-size: 14px;
    color: #ffd700; letter-spacing: 2px;
    font-weight: bold;
}

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
