:root {
    /* 全域變數 - 自然晨曦主題 (Nature Morning) */
    --bg-color: #fdfbf7; 
    --text-color: #2d3748; /* 更深的文字顏色，確保在亮背景上清晰 */
    --primary-color: #e67e22; 
    --secondary-color: #d35400; 
    --accent-color: #f1c40f; 
    --surface-color: rgba(255, 255, 255, 0.75); /* 加強不透明度 */
    
    /* 曼陀羅主題色 */
    --mandala-color-background: transparent; 
    --mandala-color-inner: #81d4fa; 
    --mandala-color-middle: #29b6f6; 
    --mandala-color-outer: #0288d1; 

    /* 緊急著陸 */
    --grounding-bg: #8d6e63; 
    --grounding-text: #fff;
    
    /* HUD */
    --hud-border: 1px solid rgba(255, 255, 255, 0.5);
    --hud-glow: 0 8px 32px rgba(0, 0, 0, 0.1); /* 加深陰影 */
    --glass-bg: rgba(255, 255, 255, 0.65); /* 濃度更高的毛玻璃，避免背景干擾 */
    --card-bg: rgba(255, 255, 255, 0.8);
}

/* ... (保留原本的主題覆寫) ... */
body.theme-calm { --mandala-color-inner: #4dd0e1; --mandala-color-middle: #00acc1; --mandala-color-outer: #006064; }
body.theme-energy { --mandala-color-inner: #ffd54f; --mandala-color-middle: #ff8f00; --mandala-color-outer: #bf360c; }
/* 洞察模式：切換回深色宇宙背景 */
body.theme-insight { 
    --mandala-color-inner: #00bcd4; --mandala-color-middle: #ab47bc; --mandala-color-outer: #4a148c; 
    --bg-color: #050510; 
    --text-color: #e0e0e0; 
    background-image: none !important; /* 移除風景圖 */
    background-color: #050510 !important;
}
body.theme-creativity { --mandala-color-inner: #ff80ab; --mandala-color-middle: #00b0ff; --mandala-color-outer: #aa00ff; }

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 自然風景背景 */
body {
    font-family: "Helvetica Neue", Arial, "Heiti TC", sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    
    /* 背景設為黑色，等待影片載入（影片載入後會覆蓋） */
    background: #000;
    
    position: relative;
    overflow-x: hidden;
    transition: all 0.8s ease;
}

/* 動態背景影片容器 */
#video-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* 在最底層，但在 body 背景之上 */
    overflow: hidden;
    /* background-color: #000; 移除黑底，讓它更自然 */
}

#bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 改回 cover：全螢幕沈浸體驗 */
    transition: opacity 1s ease; /* 影片淡入淡出 */
    opacity: 0; /* 預設隱藏，JS 控制顯示 */
}

/* 影片遮罩 (可選：用於調整亮度) */
#video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1); /* 輕微變暗，讓文字更清晰 */
    pointer-events: none;
}

/* 疊加一層暖色濾鏡，讓圖片更柔和，適合做背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 移除暖色濾鏡，讓影片原色呈現 */
    background: transparent;
    /* background: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,240,220,0.4)); */
    z-index: -1;
    pointer-events: none;
}

/* 陽光動態光暈 (Sun Flares) */
body::after {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 80%;
    height: 80%;
    /* 移除光暈效果，避免霧感 */
    background: transparent;
    /* background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 70%);
    filter: blur(40px);
    opacity: 0.6;
    animation: sunMove 20s infinite alternate ease-in-out; */
    z-index: -1;
    pointer-events: none;
}

@keyframes sunMove {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    100% { transform: translate(50px, 30px) scale(1.1); opacity: 0.7; }
}

/* ... (淡入動畫與 Header 保持不變) ... */
.fade-in-element { opacity: 0; transform: translateY(20px); animation: fadeInUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

header {
    background-color: transparent; /* 移除背景色，完全透明 */
    backdrop-filter: none; /* 移除模糊效果 */
    padding: 1rem;
    display: flex;
    justify-content: space-between; /* 左側導覽列，右側用戶區域 */
    align-items: center;
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.05); 移除陰影，讓邊界消失 */
    position: fixed; /* 改為固定定位 */
    bottom: 0; /* 移到底部 */
    left: 0;
    right: 0;
    z-index: 10;
    border-bottom: none; /* 移除分隔線 */
    
    /* 沉浸式隱藏邏輯 */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 沉浸式 UI 通用類別 (預設隱藏) */
.immersive-ui {
    opacity: 0;
    pointer-events: none; /* 隱藏時不阻擋點擊 */
    transition: opacity 0.5s ease; /* 平滑過渡 */
}

.immersive-ui.visible {
    opacity: 1;
    pointer-events: all;
}

/* 所有按鈕的隱藏/顯示過渡效果 */
nav a, .minimal-btn, .play-pause-btn, .user-login-btn, .user-logout-btn {
    transition: opacity 0.5s ease, transform 0.3s ease;
}

/* 導覽列在 visible 狀態下可點擊 */
header.immersive-ui.visible,
header.immersive-ui.visible nav,
header.immersive-ui.visible nav ul,
header.immersive-ui.visible nav li,
header.immersive-ui.visible nav a {
    pointer-events: all; /* 只有在 visible 時才可點擊 */
}

/* 當按鈕被隱藏時，強制隱藏 */
nav a.hidden-ui,
.minimal-btn.hidden-ui,
.play-pause-btn.hidden-ui,
.user-login-btn.hidden-ui,
.user-logout-btn.hidden-ui {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease;
}

/* 確保曼陀羅產生器控制面板內的按鈕永遠不受隱藏邏輯影響 */
#mandala-gen-controls button,
#mandala-gen-controls input,
#mandala-gen-controls label,
#mandala-gen-controls .collapsible-header,
#mandala-gen-controls * {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* 確保連結不會顯示 href 內容 */
nav a {
    text-decoration: none;
    display: inline-block;
    cursor: pointer; /* 確保滑鼠指標正確 */
}

/* Motto Text (首頁核心理念) */
.motto-container {
    position: fixed;
    bottom: 30px; /* 移到底部 */
    left: 75%; /* 移至畫面右側 3/4 處 */
    transform: translateX(-50%); /* 自身置中對齊該點 */
    text-align: center;
    z-index: 50;
    pointer-events: none; /* 允許點擊穿透到背景 */
}

.motto-text {
    font-size: 1.2rem; /* 放大標語字體 */
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 4px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
    font-family: "Heiti TC", "Noto Sans TC", sans-serif;
    white-space: nowrap;
    display: flex;
    gap: 2.5rem; /* 段落之間的間距略微加大 */
}

/* 漸顯動畫文字 */
.fade-text {
    opacity: 0;
    animation: fadeInText 2s ease-out forwards;
}

.delay-0 { animation-delay: 0.5s; }
.delay-1500 { animation-delay: 2s; } /* 延遲 1.5s 後 */
.delay-3000 { animation-delay: 3.5s; } /* 延遲 3s 後 */

@keyframes fadeInText {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 極簡控制列 (Minimal Controls) - 移到頂部 */
.minimal-controls {
    position: fixed;
    top: 30px;  /* 距離頂部 */
    left: 30px;    /* 距離左側 */
    transform: translateY(-20px); /* 初始上浮 */
    display: flex;
    gap: 1rem;     /* 間距 */
    z-index: 100;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.minimal-controls.visible {
    transform: translateY(0); /* 浮現 */
}

.minimal-btn {
    width: auto; /* 自動寬度，適應文字 */
    min-width: 40px;
    height: 28px; /* 降低高度，更扁平精緻 */
    border-radius: 4px; /* 改為小圓角方塊 */
    border: 1px solid rgba(255, 255, 255, 0.3); /* 極細的灰白邊框 */
    background: rgba(0, 0, 0, 0.8); /* 深黑背景，不透明度提高 */
    backdrop-filter: blur(5px);
    color: #fff;
    font-size: 0.75rem; /* 精緻小字 */
    font-family: "Heiti TC", "Noto Sans TC", sans-serif;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    padding: 0 10px; /* 左右留白 */
    margin: 0; /* 移除預設邊距 */
}

.minimal-btn:hover, .minimal-btn.active {
    background: #000; /* Hover 變全黑 */
    border-color: #fff; /* 邊框變亮白 */
    transform: translateY(-2px); /* 輕微上浮 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.minimal-btn:hover, .minimal-btn.active {
    background: rgba(0, 0, 0, 0.8); /* Hover 時顏色更深 */
    transform: scale(1.05);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); /* 白色光暈 */
}

/* 播放/暫停按鈕與音量控制 - 移到頂部右側 */
.playback-controls {
    position: fixed;
    top: 90px; /* 在使用者名稱下方，避免重疊 */
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-pause-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3); /* 深色背景，區分功能 */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.play-pause-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

.volume-control {
    width: 110px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-control input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

/* 手機版版面調整：避免情境按鈕與播放控制重疊 */
@media (max-width: 768px) {
    .playback-controls {
        top: 100px; /* 在使用者名稱下方 */
        right: 10px;
        transform: scale(0.9);
        flex-direction: column-reverse; /* 讓音量條在上、暫停鍵在下 */
        align-items: flex-end;
        gap: 6px;
    }
    
    /* 手機版使用者資訊調整 */
    .user-info {
        top: 12px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.75rem;
        min-width: 120px;
    }
    
    .user-info .username {
        font-size: 0.85rem;
    }

    .play-pause-btn {
        width: 44px;
        height: 44px;
    }

    .volume-control {
        width: 110px;
        padding: 4px 8px;
    }

    .minimal-controls {
        top: 72px;          /* 往下移，與播放控制錯開 */
        left: 12px;
        gap: 0.5rem;
        flex-wrap: wrap;    /* 若螢幕太窄，自動換行 */
        max-width: 80%;
    }

    .minimal-btn {
        font-size: 0.7rem;
        padding: 0 8px;
        height: 26px;
    }
}

.emergency-btn { display: none; } /* 隱藏舊的緊急按鈕 */

/* Logo 樣式已移除 */
nav ul { list-style: none; display: flex; gap: 1rem; }
nav a { 
    color: #fff; /* 白色文字 */
    text-decoration: none; 
    padding: 0.5rem 1rem; 
    border-radius: 4px; /* 方形外框，跟下方按鈕一樣 */
    transition: all 0.3s; 
    font-weight: 400; /* 字體改細一點 */
    background: rgba(0, 0, 0, 0.3); /* 黑色背景，30% 透明度 */
    backdrop-filter: blur(5px); /* 輕微模糊效果，增加質感 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* 文字陰影確保可讀 */
    border: 1px solid rgba(255, 255, 255, 0.2); /* 白色邊框 */
}
nav a:hover, nav a.active { 
    background-color: rgba(0, 0, 0, 0.6); /* Hover 時背景更深，60% 透明度 */
    color: #fff; /* 保持白色文字 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* 輕微陰影增加層次感 */
    border-color: rgba(255, 255, 255, 0.3); /* Hover 時邊框更明顯 */
}

/* 鎖定的導航按鈕（需要先靜心才能解鎖） */
nav a.locked-nav {
    display: none; /* 初始隱藏 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* 解鎖後的導航按鈕 */
nav a.locked-nav.unlocked {
    display: inline-block; /* 顯示 */
    opacity: 1;
    pointer-events: all;
}

main { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; position: relative; z-index: 1; }

footer {
    text-align: center;
    padding: 1rem;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.9rem;
    /* background-color: rgba(255, 255, 255, 0.5); 移除背景 */
    background: transparent;
    backdrop-filter: none;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}
section.active-section { 
    display: block; 
    /* 確保在首頁時，其他 section 絕對不顯示，且不佔空間 */
}

/* 強制隱藏首頁不該出現的文字 */
#home-section .instruction {
    display: none !important;
}

/* 修正：確保 .hidden-section 真的隱藏 */
.hidden-section {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Dashboard HUD - 強化的毛玻璃 */
.hud-container {
    background: var(--glass-bg);
    backdrop-filter: blur(25px); /* 高強度模糊 */
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.hud-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; border-bottom: 1px solid rgba(0, 0, 0, 0.08); padding-bottom: 1.5rem; }
.level-badge .label { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; display: block; }
.level-badge h2 { font-size: 2.5rem; font-weight: 700; color: #2c3e50; letter-spacing: 0; }
.level-progress { flex: 1; max-width: 400px; margin-left: 3rem; text-align: right; }
.progress-track { height: 8px; background: rgba(0, 0, 0, 0.1); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #ff9800, #ff5722); width: 0%; transition: width 1s ease-out; box-shadow: 0 0 10px rgba(255, 87, 34, 0.2); }
#next-level-info { color: #555; font-weight: 500; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    text-align: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.9); /* 白色邊框 */
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, var(--primary-color), transparent); }
.stat-card h3 { font-size: 0.9rem; color: #555; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.big-number { font-size: 4rem; font-weight: 700; color: #2c3e50; font-family: 'Helvetica Neue', sans-serif; }
.unit { font-size: 0.9rem; color: #777; margin-top: -5px; }

/* Chart */
.chart-container { height: 100px; display: flex; align-items: flex-end; justify-content: space-around; padding-top: 1rem; }
.chart-bar { width: 10%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-fill { width: 100%; background-color: var(--primary-color); border-radius: 4px 4px 0 0; transition: height 0.5s; min-height: 2px; }
.bar-label { font-size: 0.7rem; color: #666; margin-top: 4px; }

/* Daily Quests */
.daily-quests { background: var(--card-bg); padding: 1.5rem; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.daily-quests h3 { color: #2c3e50; font-size: 1.1rem; margin-bottom: 1rem; font-weight: 700; }
.quest-list li { margin-bottom: 10px; padding: 15px; background: rgba(255, 255, 255, 0.6); border-radius: 12px; display: flex; align-items: center; transition: background 0.2s; border: 1px solid rgba(0,0,0,0.05); }
.quest-list li:hover { background: rgba(255, 255, 255, 0.9); }
.quest-text { color: #444; font-size: 0.95rem; font-weight: 500; }

/* Mandala Controls */
.canvas-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 60vh; position: relative; }
canvas { border-radius: 50%; }
.mandala-controls-panel { text-align: center; margin-bottom: 1rem; background: rgba(255, 255, 255, 0.6); padding: 10px; border-radius: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.theme-buttons button { padding: 8px 20px; margin: 0 5px; border: none; background: transparent; color: #555; cursor: pointer; border-radius: 20px; transition: all 0.3s; font-weight: 600; }
.theme-buttons button:hover, .theme-buttons button.active { background: var(--primary-color); color: #fff; box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3); }
.instruction { position: absolute; bottom: 10%; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); font-size: 1rem; pointer-events: none; text-transform: uppercase; letter-spacing: 2px; animation: breathText 6s infinite ease-in-out; font-weight: bold; }
@keyframes breathText { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* ESP Section - 保持深色 */
.esp-container { max-width: 800px; margin: 0 auto; text-align: center; background: #1a1a1a; color: #ddd; padding: 2rem; border-radius: 16px; border: 1px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.esp-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.esp-info-btn {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.08);
    color: #f1f1f1;
    cursor: pointer;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.esp-info-btn:hover {
    background: rgba(255,255,255,0.16);
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}
.hash-box { background: #000; padding: 1rem; margin: 1rem 0; border-radius: 8px; word-break: break-all; border: 1px solid #333; display: flex; align-items: center; gap: 10px; color: #ccc; }
.card-options { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }
.esp-card-btn { width: 100px; height: 120px; border: 2px solid #444; background: transparent; color: #ccc; border-radius: 8px; cursor: pointer; font-size: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s; }
.esp-card-btn:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); transform: translateY(-5px); }
.primary-btn { background: var(--primary-color); color: #fff; border: none; padding: 12px 30px; font-size: 1.1rem; cursor: pointer; border-radius: 30px; margin-top: 1rem; font-weight: bold; box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4); transition: all 0.3s ease; }

/* ESP 按鈕狀態：未鎖定（灰色，表示需要先連接） */
#start-esp-btn.esp-btn-locked {
    background: #666 !important;
    color: #ccc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer;
}

#start-esp-btn.esp-btn-locked:hover {
    background: #777 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* ESP 按鈕狀態：已鎖定（藍色，可以開始訓練） */
#start-esp-btn.esp-btn-unlocked {
    background: #4a90e2 !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4) !important;
}

#start-esp-btn.esp-btn-unlocked:hover {
    background: #357abd !important;
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5) !important;
    transform: translateY(-2px);
}
.secondary-btn { background: transparent; color: var(--primary-color); border: 1px solid var(--primary-color); padding: 8px 20px; cursor: pointer; border-radius: 4px; margin-top: 10px; }
.secondary-btn:hover { background: rgba(0, 188, 212, 0.1); }
.verification-box { text-align: left; background: #111; padding: 1rem; margin-top: 1rem; border-radius: 4px; }
.verification-box input { width: 100%; background: #222; border: 1px solid #444; color: #ccc; padding: 5px; margin-bottom: 10px; }

/* 「你想做什麼？」對話框樣式 - 極簡版 */
/* 觸發按鈕樣式（靜心完成後顯示） */
.action-trigger-btn {
    position: fixed;
    bottom: 120px; /* 在導航列上方 */
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 99;
    white-space: nowrap;
    max-width: 90%;
    text-align: center;
}

.action-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(-50%) translateY(-2px);
}

.action-trigger-btn.hidden {
    display: none !important;
}

/* 「你想做什麼？」對話框樣式 */
.modal#action-choice-modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.3);
}

/* 確保對話框在 hidden 狀態時完全隱藏 */
.modal#action-choice-modal.hidden {
    display: none !important;
}

.modal-content.action-choice-content {
    max-width: 400px;
    background: rgba(0, 0, 0, 0.8);
    color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
}

/* 對話框關閉按鈕樣式 */
.modal-content.action-choice-content .modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content.action-choice-content .modal-close:hover {
    color: rgba(255, 255, 255, 1);
}

.modal-content.action-choice-content h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #fff;
    font-weight: 400;
}

.action-buttons-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-choice-btn-simple {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

.action-choice-btn-simple:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 手機版：對話框更小 */
@media (max-width: 600px) {
    .modal-content.action-choice-content {
        max-width: 90%;
        padding: 15px;
    }
    
    .modal-content.action-choice-content h2 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .action-choice-btn-simple {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* ESP 說明彈窗 */
.modal.esp-info-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal.esp-info-modal .modal-content.esp-info-content {
    max-width: 640px;
    background: rgba(10,10,10,0.96) !important;
    color: #f5f5f5 !important;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal.esp-info-modal .modal-content.esp-info-content h2 {
    margin-bottom: 1rem;
    color: #ffffff;
}
.modal.esp-info-modal .modal-content.esp-info-content p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    font-size: 0.98rem;
    text-align: left;
    color: #f5f5f5;
}

/* Emergency & Overlay */
.emergency-btn { position: fixed; bottom: 20px; right: 20px; background-color: #d32f2f; color: white; border: none; padding: 12px 24px; border-radius: 50px; font-weight: bold; cursor: pointer; z-index: 1000; box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4); transition: transform 0.2s; }
.emergency-btn:hover { transform: scale(1.05); background-color: #b71c1c; }
#grounding-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--grounding-bg); color: var(--grounding-text); z-index: 2000; display: flex; justify-content: center; align-items: center; text-align: center; }
#grounding-overlay.hidden { display: none; }
.grounding-content { max-width: 600px; padding: 2rem; }
.grounding-content h2 { margin-bottom: 1.5rem; font-size: 2rem; }
.grounding-content button { margin-top: 2rem; padding: 10px 30px; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.5); color: #fff; cursor: pointer; border-radius: 30px; }

/* Mobile Tweaks */
@media (max-width: 600px) {
    .hud-header { flex-direction: column; align-items: flex-start; }
    .level-progress { margin-left: 0; margin-top: 1rem; width: 100%; }
    
    /* 手機版：導航列縮小 */
    nav ul { 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 0.5rem; /* 減少間距 */
        padding: 0.5rem 0; /* 減少上下內距 */
    }
    
    nav a {
        padding: 0.35rem 0.7rem; /* 縮小按鈕內距 */
        font-size: 0.75rem; /* 縮小字體 */
        border-radius: 3px;
    }
    
    header {
        padding: 0.5rem; /* 減少 header 內距 */
    }
    
    .theme-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }

    /* 手機版：標語完全隱藏，減少擁擠感 */
    .motto-container {
        display: none; /* 完全隱藏標語 */
    }

    /* 手機版：聲景按鈕放在頂部左側 */
    .minimal-controls {
        left: 20px;
        top: 20px; /* 移到頂部 */
        bottom: auto; /* 移除底部定位 */
        transform: translateY(0);
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-start;
        max-width: calc(100% - 100px); /* 為播放按鈕留空間 */
    }
    
    /* 手機版：導航列移到底部 */
    header {
        top: auto;
        bottom: 0;
        padding: 0.5rem;
    }

    .minimal-btn {
        font-size: 0.65rem;
        padding: 0 8px;
        min-width: 36px;
        height: 24px;
    }

    /* 手機版：播放按鈕在頂部右側 */
    .play-pause-btn {
        top: 20px; /* 移到頂部 */
        right: 20px;
        bottom: auto; /* 移除底部定位 */
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    /* 手機版：ESP 卡牌橫向排列，稍微縮小 */
    .card-options {
        gap: 0.5rem;
        margin: 1rem 0;
    }
    
    .esp-card-btn {
        width: 70px;
        height: 90px;
        font-size: 0.85rem;
    }
    
    /* 手機版：縮小登入/註冊按鈕 */
    .user-login-btn,
    .user-logout-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* 介紹區塊樣式 - 黑色半透明背景板 + 白色文字 */
#about-section {
    position: relative;
}

#about-section .text-content {
    max-width: 900px;
    margin: 60px auto;
    padding: 50px 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    color: #ffffff;
    transition: all 0.5s ease;
}

/* 統一的功能區塊關閉按鈕 */
.section-close-btn,
.about-close-btn {
    position: fixed;
    top: 80px; /* 放在用戶區域下方，避免重疊 */
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 102;
}

.section-close-btn:hover,
.about-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* 所有文字都是白色 */
#about-section .text-content h2,
#about-section .text-content h3,
#about-section .text-content p {
    color: #ffffff;
}

/* 通用樣式 */
#about-section .text-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    transition: color 0.5s ease;
}

#about-section .text-content h3 {
    font-size: 1.2rem;
    margin-top: 30px;
    margin-bottom: 12px;
    font-weight: 600;
    transition: color 0.5s ease;
}

#about-section .text-content p {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 18px;
    text-align: justify;
    transition: color 0.5s ease;
}

#about-section .text-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    margin: 30px 0;
}

#about-section .text-content p:last-child {
    margin-bottom: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    #about-section .text-content {
        margin: 30px 20px;
        padding: 30px 25px;
    }
    
    #about-section .text-content h2 {
        font-size: 1.5rem;
    }
    
    #about-section .text-content h3 {
        font-size: 1.1rem;
    }
    
    #about-section .text-content p {
        font-size: 0.9rem;
        text-align: left;
    }
    
    /* 手機版：關閉按鈕縮小並調整位置 */
    .section-close-btn,
    .about-close-btn {
        top: 70px; /* 放在用戶區域下方 */
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}