/* ═══════════════════════════════════════════════
   AVG Game Engine — 遊戲引擎樣式
   ═══════════════════════════════════════════════ */

#gamePreview {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

/* 單段呼叫的疊加層（小遊戲上疊播劇情段）。
   ⚠ 必須掛在「主畫面的 .ge-viewport 內部」而不是外層容器：
   第二引擎會用自己 container 的 clientWidth/Height 再算一次等比縮放與置中，
   掛在外層就是兩套獨立算出來的縮放＋定位，於是疊出來的段跟底下的畫面對不齊，
   而且會隨視窗/窗格大小改變而漂移。掛在 viewport 內時，它的 clientWidth/Height
   正好等於設計解析度（transform 不影響 client 尺寸）→ 第二引擎算出 scale=1，
   整層再跟著主 viewport 的 transform 一起縮放，兩邊必然像素對齊。 */
.gp-call-overlay {
    position: absolute;
    inset: 0;
    z-index: 80;
    overflow: hidden;
}

.ge-viewport {
    position: relative;
    transform-origin: center center;
    overflow: hidden;
    background: #0a0a1a;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

/* ─── Background ─── */
.ge-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.6s ease;
}

/* 放圖的欄位收所有格式（2026-10-10，S4；player-core/media-el.js）：動畫圖／影片以子元素鋪滿原本寫 CSS background 的容器 */
.ge-bgmedia { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
/* 介面物件（ui-paint.js）底圖是動畫圖／影片：墊在文字底下（容器 isolation:isolate，負 z 只相對自己） */
.ge-ui-bgmedia { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; display: block; }

/* ─── Sprites ─── */
.ge-sprites {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.ge-sprite {
    position: absolute;
    bottom: 0;
    transform-origin: bottom center;
}
.ge-sprite img, .ge-sprite video, .ge-sprite canvas {
    max-height: 80%;
    height: auto;
    width: auto;
    max-width: none;
    display: block;
}

/* 立繪動態已改由 stage-fx/stage-fx.css 接手（2026-08-23，舊 .ge-anim-* 用 margin 做、只認 4 個中文名） */

/* ─── 舞台包層：背景／立繪／配圖／特效槽。全畫面效果（震動、濾鏡）套在這裡，不動 .ge-viewport 的縮放 ─── */
.ge-stage-wrap {
    position: absolute;
    inset: 0;
    transform-origin: center center;
}
.ge-fx-slot {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.ge-fx-slot:empty { display: none; }

/* ─── 配圖層（立繪之上、對話框之下；定位同立繪：底部中央錨點） ─── */
.ge-illustrations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.ge-ill {
    position: absolute;
    bottom: 0;
    transform-origin: bottom center;
}
.ge-ill img, .ge-ill video, .ge-ill canvas {
    height: auto;
    width: auto;
    max-width: none;
    display: block;
}

/* ─── Dialog Box（容納 3 列文字） ─── */
.ge-dialog-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 190px;
    background: linear-gradient(0deg, rgba(10,10,30,0.95) 0%, rgba(10,10,30,0.85) 100%);
    border-top: 1px solid rgba(106,158,255,0.3);
    box-sizing: border-box;
    z-index: 5;
}

.ge-dialog-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    height: 100%;
    padding: 0 30px 16px 30px;
}

/* 頭像：突出在對話框上方，邊框加粗 */
/* 尺寸與對話框（190px）看齊：176 + 邊框 4×2 = 184，視覺上幾乎同高。
   原本 100px 在 1920 寬的畫面上明顯偏小（2026-08-22 Jin 回報）。 */
.ge-face {
    width: 176px;
    height: 176px;
    border-radius: 50%;
    background: rgba(74,111,165,0.3);
    flex-shrink: 0;
    overflow: hidden;
    border: 4px solid rgba(106,158,255,0.7);
    margin-top: -48px;
}
.ge-face img, .ge-face video, .ge-face canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ge-dialog-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 4px;
}

/* 人名：往上突出，不透明底板 */
.ge-speaker-name-box {
    font-size: 28px;
    font-weight: bold;
    color: #6adfff;
    background: rgba(15,15,50,0.95);
    border: 2px solid rgba(106,223,255,0.5);
    border-radius: 6px;
    padding: 4px 20px;
    display: inline-block;
    align-self: flex-start;
    margin-top: -30px;
    margin-bottom: 8px;
}

.ge-text {
    font-size: 26px;
    color: #e8e8e8;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow: hidden;
    flex: 1;
}

.ge-text.ge-typing::after {
    content: '▌';
    color: rgba(106,223,255,0.7);
    animation: geTypingCursor 0.6s infinite;
}
@keyframes geTypingCursor {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* 語音按鈕 */
.ge-voice-btn {
    position: absolute;
    top: 8px;
    right: 106px;
    background: rgba(106,158,255,0.3);
    border: 1px solid rgba(106,158,255,0.5);
    color: #6a9eff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    transition: background 0.2s;
    pointer-events: auto;
}
.ge-voice-btn:hover {
    background: rgba(106,158,255,0.5);
}

/* ─── 對話介面「自由版面」（pd.settings.dialogUI）─────────────────────────
   啟用後 .ge-dialog-box 退化成滿版透明容器，各部件走設計座標絕對定位。
   未設定 dialogUI 的專案不會加上 .ge-dlg-free，維持上方的固定 flex 版面。 */
.ge-dialog-box.ge-dlg-free {
    inset: 0;
    height: auto;
    background: none;
    border-top: none;
    pointer-events: none;
}
.ge-dlg-free > * { position: absolute; box-sizing: border-box; }
/* 對話框框體：預設沿用原本的漸層＋上緣細線（未設底色/外框時） */
.ge-dlg-panel {
    background: linear-gradient(0deg, rgba(10,10,30,0.95) 0%, rgba(10,10,30,0.85) 100%);
    border-top: 1px solid rgba(106,158,255,0.3);
}
.ge-dlg-face {
    background: rgba(74,111,165,0.3);
    border: 4px solid rgba(106,158,255,0.7);
    overflow: hidden;
}
.ge-dlg-face-img { position: absolute; height: auto; }
.ge-dlg-namebox {
    background: rgba(15,15,50,0.95);
    border: 2px solid rgba(106,223,255,0.5);
    border-radius: 6px;
}
.ge-dlg-nametext {
    color: #6adfff;
    font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    pointer-events: none;
}
.ge-dlg-nametext[style*="text-align: left"] { justify-content: flex-start; }
.ge-dlg-nametext[style*="text-align: right"] { justify-content: flex-end; }
.ge-dlg-text { overflow: hidden; pointer-events: none; }
/* 部件的圖片繪製方式 */
.ge-dlg-imgtext { background-size: 100% 100%; background-repeat: no-repeat; }
.ge-dlg-imgonly { background: none !important; border: none !important; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ge-dlg-imgonly img, .ge-dlg-imgonly video, .ge-dlg-imgonly canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
/* 功能鈕（下一句/自動播放/語音/設定/存檔/讀檔） */
.ge-dlg-btn {
    pointer-events: auto;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.3);
    color: #dfe6f5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
    overflow: hidden;
}
.ge-dlg-btn:hover { background: rgba(255,255,255,0.25); border-color: #fff; }
.ge-dlg-btn.ge-auto-active { background: rgba(106,158,255,0.35); border-color: rgba(106,158,255,0.6); color: #6a9eff; }
.ge-dlg-menu { position: absolute; pointer-events: auto; }
.ge-dlg-menu .ge-dlg-btn { position: absolute; }
.ge-dlg-label { pointer-events: none; }

/* ─── Choices ─── */
/* 提示/選項改「可定位」：覆蓋整個畫面、子元素絕對定位（設計座標）；空白處不吃事件 */
.ge-choices {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}
.ge-choice-prompt {
    position: absolute;
    pointer-events: auto;
    background: rgba(10,10,30,0.85);
    border: 1px solid rgba(106,223,255,0.4);
    border-radius: 8px;
    padding: 12px 24px;
    color: #6adfff;
    font-size: 24px;
    font-weight: bold;
    box-sizing: border-box;
}
.ge-choice-btn {
    position: absolute;
    box-sizing: border-box;
    pointer-events: auto;
    display: flex; align-items: center; justify-content: center;
    background: rgba(30,30,60,0.9);
    border: 2px solid #6a9eff;
    color: #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 22px;
    transition: background 0.2s, border-color 0.2s, filter 0.2s;
    text-align: center;
    overflow: hidden;
}
.ge-choice-btn:hover:not(:disabled) { background: rgba(106,158,255,0.3); border-color: #8ab8ff; }
.ge-choice-btn:disabled { opacity: 0.4; cursor: default; }
/* 圖片選項：以圖為面 */
.ge-choice-img, .ge-choice-img:hover:not(:disabled) { background: none; border-color: transparent; padding: 0; width: auto; height: auto; }
.ge-choice-img img, .ge-choice-img video, .ge-choice-img canvas { display: block; }
/* 圖片底圖選項：圖為底、文字疊上 */
.ge-choice-imgtext, .ge-choice-imgtext:hover:not(:disabled) { background-color: transparent; border-color: transparent; background-size: contain; background-position: center; background-repeat: no-repeat; text-shadow: 0 2px 6px rgba(0,0,0,0.85); }

/* ─── System Message ─── */
.ge-system-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30,30,60,0.85);
    border: 1px solid #4a4a5a;
    border-radius: 8px;
    padding: 16px 28px;
    color: #aaa;
    font-size: 13px;
    text-align: center;
    max-width: 400px;
    white-space: pre-wrap;
    z-index: 10;
}
.ge-system-msg.ge-condition-msg {
    padding: 40px 60px;
    max-width: 80%;
}
.ge-end-menu-btn {
    display: block;
    margin: 16px auto 0;
    padding: 10px 28px;
    font-size: 18px;
    background: #3a4a6a;
    color: #fff;
    border: 1px solid #6a7a9a;
    border-radius: 8px;
    cursor: pointer;
}
.ge-end-menu-btn:hover:not(:disabled) { background: #4a5a7a; }
.ge-end-menu-btn:disabled { opacity: 0.5; cursor: default; }
.ge-system-msg.ge-condition-msg .ge-sys-type {
    font-size: 42px;
    margin-bottom: 16px;
}
.ge-system-msg.ge-condition-msg .ge-cond-detail {
    font-size: 32px;
    color: #ccc;
    margin-bottom: 20px;
}
.ge-system-msg.ge-condition-msg .ge-cond-test {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.ge-system-msg.ge-condition-msg .ge-cond-test label {
    font-size: 24px;
    color: #8ab8ff;
    white-space: nowrap;
}
.ge-system-msg.ge-condition-msg .ge-cond-test input {
    font-size: 24px;
    padding: 8px 14px;
    background: #1e1e2f;
    border: 1px solid #4a4a5a;
    border-radius: 6px;
    color: #eee;
    width: 200px;
    text-align: center;
}
.ge-system-msg.ge-condition-msg .ge-cond-test button {
    font-size: 24px;
    padding: 8px 24px;
    background: #4a7aff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.ge-system-msg.ge-condition-msg .ge-cond-test button:hover {
    background: #6a9aff;
}
.ge-sys-type { color: #6a9eff; font-weight: bold; margin-bottom: 6px; }

/* ─── Navigation ─── */
.ge-nav {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}
.ge-nav-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    padding: 4px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    pointer-events: auto;
}
.ge-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.25); color: #fff; }
.ge-nav-btn:disabled { opacity: 0.3; cursor: default; }
/* AUTO button inside dialog box */
.ge-auto-btn {
    position: absolute;
    top: 8px;
    right: 54px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.5);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.ge-auto-btn:hover { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }
.ge-auto-btn.ge-auto-active { background: rgba(106,158,255,0.35); border-color: rgba(106,158,255,0.6); color: #6a9eff; }

/* ▼ advance indicator */
.ge-advance-indicator {
    position: absolute;
    bottom: 8px;
    right: 12px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    animation: ge-blink 1s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ge-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === 解鎖系統（成就 / 收藏圖鑑）=== */
/* 左上角返回鈕（節點畫面唯一的 meta 入口） */
.ge-meta-bar { position: absolute; top: 16px; left: 16px; display: flex; gap: 10px; z-index: 60; }
.ge-meta-btn { padding: 8px 20px; border-radius: 24px; border: 2px solid rgba(255,255,255,0.5); background: rgba(0,0,0,0.45); font-size: 22px; cursor: pointer; color: #fff; }
.ge-meta-btn:hover { background: rgba(0,0,0,0.7); border-color: #fff; }
/* 對話框內右上「設定」鈕群（⚙ 展開存/讀，往上長出） */
.ge-dlg-settings { position: absolute; right: 12px; bottom: 148px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ge-settings-menu { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ge-settings-btn { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); background: rgba(0,0,0,0.45); font-size: 18px; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.ge-settings-btn:hover { background: rgba(0,0,0,0.7); border-color: #fff; }
.ge-meta-btn.ge-meta-icon, .ge-settings-btn.ge-meta-icon { padding: 0; width: auto; height: auto; background: transparent; border: none; border-radius: 0; }
.ge-meta-icon img, .ge-meta-icon video, .ge-meta-icon canvas { display: block; max-height: 48px; max-width: 180px; object-fit: contain; }

/* 主選單畫面 */
.ge-mainmenu { position: absolute; inset: 0; z-index: 40; }
.ge-mm-bg { position: absolute; inset: 0; }
.ge-mm-btn {
    position: absolute;
    background: rgba(20,20,40,0.72);
    border: 2px solid rgba(255,255,255,0.55);
    border-radius: 10px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ge-mm-btn:hover:not(:disabled) { background: rgba(70,90,160,0.85); border-color: #fff; transform: scale(1.03); }
.ge-mm-btn:disabled { opacity: 0.45; cursor: default; }

/* 標題圖片圖層（背景之上、按鈕之下，不吃滑鼠事件） */
.ge-mm-title { position: absolute; pointer-events: none; }
.ge-mm-title img, .ge-mm-title video, .ge-mm-title canvas { width: 100%; height: 100%; object-fit: contain; }

/* 圖片按鈕：以圖為面，不畫預設底/框（置於 .ge-mm-btn:hover 之後以覆蓋 hover 底色）
   大小 = 原圖 × 縮放%（img 於載入後定尺寸）；background-size 僅供 Spine 佔位框使用 */
.ge-mm-btn-img,
.ge-mm-btn-img:hover:not(:disabled) {
    background-color: transparent;
    border-color: transparent;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 0;
}
.ge-mm-btn-img img, .ge-mm-btn-img video, .ge-mm-btn-img canvas { display: block; }
.ge-mm-btn-img:hover:not(:disabled) { transform: scale(1.03); filter: brightness(1.15); }
/* 圖片底圖：w×h 框以圖為底、文字（程式繪製）疊在上，text-shadow 保可讀性 */
.ge-mm-btn-imgtext,
.ge-mm-btn-imgtext:hover:not(:disabled) {
    background-color: transparent;
    border-color: transparent;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.ge-mm-btn-imgtext:hover:not(:disabled) { filter: brightness(1.12); }
/* 結束節點：結局圖片/影片（全螢幕、點擊可跳過），播完顯示結束畫面 */
.ge-end-media { position: absolute; inset: 0; background: #000; z-index: 74; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ge-end-media-content { max-width: 100%; max-height: 100%; object-fit: contain; }

/* 過場影片（執行節點 playVideo）：字幕與「點擊跳過」提示疊在影片上 */
.ge-cutscene-sub {
    position: absolute; left: 6%; right: 6%; bottom: 7%;
    z-index: 2; pointer-events: none;         /* 不擋「點擊跳過」 */
    text-align: center; color: #fff; font-size: 28px; line-height: 1.5;
    /* 描邊式陰影：任何底色的畫面上都讀得到，不必壓一層黑幕蓋住畫面 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.95), 0 0 10px rgba(0,0,0,0.85);
    white-space: pre-wrap;
}
.ge-cutscene-skip {
    position: absolute; right: 24px; top: 20px; z-index: 2; pointer-events: none;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.85); font-size: 14px;
}

/* 工作人員名單：全螢幕由下往上自動捲動，捲完淡出回主選單。可選背景影片 + BGM */
.ge-credits-overlay { position: absolute; inset: 0; background: #000; overflow: hidden; z-index: 75; cursor: pointer; }
.ge-credits-bgvideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.ge-credits-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.42); z-index: 1; }
.ge-credits-scroll { position: absolute; left: 8%; width: 84%; top: 0; z-index: 2; color: #eee; font-size: 24px; line-height: 1.9; text-align: center; will-change: transform; }

/* 成就/收藏提示條：預設右上角（對話框之外）。位置/寬度由 pd.settings.achToast 覆寫（見 _pushToast）。 */
.ge-ach-toasts { position: absolute; top: 20px; right: 20px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; z-index: 80; pointer-events: none; }
.ge-ach-toast { display: flex; align-items: center; gap: 12px; background: rgba(20,20,35,0.92); border: 1px solid #c9a94f; border-radius: 10px; padding: 10px 22px; color: #fff; font-size: 22px; animation: geAchIn 0.35s ease-out; background-repeat: no-repeat; box-sizing: border-box; }
.ge-ach-toast-icon img { width: var(--ge-ach-icon, 40px); height: var(--ge-ach-icon, 40px); object-fit: contain; }
.ge-ach-toast-out { opacity: 0; transition: opacity 0.5s; }
@keyframes geAchIn { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

.ge-sys-window { position: absolute; inset: 40px; background: rgba(15,15,28,0.96); border: 1px solid #4a4a6a; border-radius: 12px; z-index: 70; display: flex; flex-direction: column; overflow: hidden; }
.ge-sysw-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid #3a3a4f; flex-shrink: 0; }
.ge-sysw-title { font-size: 30px; color: #fff; font-weight: bold; }
.ge-sysw-close { background: none; border: none; color: #aaa; font-size: 30px; cursor: pointer; }
.ge-sysw-close:hover { color: #fff; }
.ge-sysw-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px; }

.ge-ach-total { font-size: 22px; color: #c9a94f; margin-bottom: 12px; }
.ge-ach-layout { display: flex; gap: 18px; height: calc(100% - 40px); }
.ge-ach-tags { width: 220px; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.ge-ach-tag { display: flex; justify-content: space-between; padding: 12px 14px; background: #26263a; border-radius: 8px; cursor: pointer; color: #ccc; font-size: 22px; }
.ge-ach-tag.active { background: #3d3d5c; color: #fff; outline: 2px solid #6a8aff; }
.ge-ach-tag-pct { color: #c9a94f; }
.ge-ach-bars { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ge-ach-bar { display: flex; align-items: center; gap: 16px; background: #222232; border-radius: 10px; padding: 12px 18px; }
.ge-ach-bar.done { background: #28304a; }
.ge-ach-bar-icon { width: 56px; height: 56px; font-size: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ge-ach-bar-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ge-ach-bar-info { flex: 1; color: #fff; font-size: 22px; min-width: 0; }
.ge-ach-bar-info small { display: block; color: #9a9ab5; font-size: 17px; margin-top: 2px; }
.ge-ach-claim { flex-shrink: 0; padding: 8px 20px; border-radius: 8px; border: none; font-size: 20px; background: #3a3a4f; color: #777; }
.ge-ach-claim.ready { background: #c9a94f; color: #1e1e2f; cursor: pointer; }
.ge-ach-claim.ready:hover { background: #e0c060; }
.ge-ach-claim.claimed { background: #2c4a2c; color: #99cc99; }
.ge-ach-empty { color: #666; text-align: center; padding: 40px; font-size: 22px; grid-column: 1 / -1; }
/* n×n 格狀成就卡（縱向版式，套統一外框外觀）*/
.ge-ach-card { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; padding: 14px; border: 1px solid #3a3a4a; }
.ge-ach-card .ge-ach-bar-icon { width: 100%; height: 64px; font-size: 40px; }
.ge-ach-card .ge-ach-bar-info { flex: none; text-align: center; }
.ge-ach-card .ge-ach-claim { align-self: center; }
.ge-ach-bars .gp-save-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 0 2px; color: #ccc; font-size: 20px; }
.ge-ach-bars-wrap .gp-save-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 0 2px; color: #ccc; font-size: 20px; }
.ge-ach-bars-wrap .gp-save-pager button { background: #3a3a4f; border: none; color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 20px; cursor: pointer; }
.ge-ach-bars-wrap .gp-save-pager button:disabled { opacity: 0.4; cursor: default; }

.ge-col-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ge-col-type-card { background: #222232; border-radius: 10px; padding: 14px; cursor: pointer; text-align: center; }
.ge-col-type-card:hover { outline: 2px solid #6a8aff; }
.ge-col-type-card.locked { cursor: default; opacity: 0.55; }
.ge-col-type-card.locked:hover { outline: none; }
.ge-col-type-img { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.ge-col-type-img img, .ge-col-type-img video, .ge-col-type-img canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.ge-col-type-name { color: #fff; font-size: 22px; margin-top: 8px; }
.ge-col-full { color: #7ec97e; font-size: 16px; }
.ge-col-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: #ccc; font-size: 20px; }
.ge-col-toolbar button { background: #3a3a4f; border: none; color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 20px; cursor: pointer; }
.ge-col-toolbar button:disabled { opacity: 0.4; cursor: default; }
.ge-col-sub { background: #26263a; color: #fff; border: 1px solid #4a4a6a; border-radius: 6px; font-size: 20px; padding: 4px 8px; }
.ge-col-pageinfo { margin-left: auto; }
.ge-col-grid { display: grid; gap: 12px; height: calc(100% - 60px); }
.ge-col-cell { background: #222232; border-radius: 8px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; min-height: 0; }
.ge-col-cell:hover { outline: 2px solid #6a8aff; }
.ge-col-cell.locked { opacity: 0.5; }
.ge-col-cell-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.ge-col-cell-img img, .ge-col-cell-img video, .ge-col-cell-img canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.ge-col-cell-name { color: #ddd; font-size: 17px; text-align: center; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 重玩關卡（2026-10-17）：沿用收藏格子，分類卡多一行關數、關卡格多一行成績 */
.gp-replay-count { display: block; color: #9aa; font-size: 13px; }
.gp-replay-rec { color: #9cf; font-size: 13px; text-align: center; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-replay-empty { color: #aaa; text-align: center; padding: 40px; font-size: 18px; }
.ge-col-detail { display: flex; flex-direction: column; align-items: center; gap: 16px; height: 100%; }
.ge-col-detail-img { max-width: 100%; max-height: 70%; object-fit: contain; border-radius: 8px; }
.ge-col-detail-text { color: #ddd; font-size: 22px; line-height: 1.6; max-width: 80%; }
.ge-col-detail .ge-col-back { background: #3a3a4f; border: none; color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 20px; cursor: pointer; }

/* 選項出現時：對話框維持上一句的完整內容（頭像框/人名框都在、位置不變），
   只整體壓暗並吃掉點擊；功能鈕由渲染端不畫。 */
.ge-dialog-box.ge-dlg-dimmed { opacity: var(--ge-dim-opacity, 1); filter: brightness(var(--ge-dim-brightness, 0.45)); }
/* 選項期間對話框只是背景，不該能點（按鈕也一律不顯示，兩種版面的 class 都涵蓋） */
.ge-dialog-box.ge-dlg-dimmed { pointer-events: none; }
.ge-dialog-box.ge-dlg-dimmed .ge-auto-btn,
.ge-dialog-box.ge-dlg-dimmed .ge-voice-btn,
.ge-dialog-box.ge-dlg-dimmed .ge-dlg-btn { display: none; }

/* 小遊戲載入中提示（外觀由節點的 loadingBtn 設定；未設定則走 .ge-system-msg） */
.ge-mg-loading { position: absolute; z-index: 62; display: flex; align-items: center; justify-content: center; text-align: center; pointer-events: none; }

/* 結局畫面（自訂版）：標題與返回鈕各自定位；未設定則走 .ge-system-msg 的內建樣式 */
.ge-end-custom { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.ge-end-custom-item { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; }

/* ═══════════════════════════════════════════════
   按鈕互動回饋（hover / 按住）
   ───────────────────────────────────────────────
   遊戲內的按鈕原本只有音效、沒有任何視覺回饋，按下去看不出有沒有按到
   （實測回報：AUTO 鈕其實有作用，但因為沒有「按住」的樣子而被當成壞掉）。
   一律用 filter 做，不動 transform／位置：這些按鈕的定位、縮放各自不同
   （圖片按鈕用原圖尺寸×縮放%、選項可自由定位），動 transform 會把版面弄歪。
   圖片按鈕也吃得到 —— 不必另外準備 hover／按下的圖。
   ═══════════════════════════════════════════════ */
.ge-choice-btn, .ge-dlg-btn, .ge-nav-btn, .ge-meta-btn, .ge-auto-btn, .ge-voice-btn,
.ge-settings-btn, .ge-end-menu-btn, .ge-mm-btn, .gp-choice-btn, .gp-voice-btn, .gp-map-uibtn {
    /* transform ＝五態的「偏移」；時間由 ui-paint.js 寫進 --ui-offset-ms（沒設＝0ms＝瞬間） */
    transition: filter 90ms ease-out, transform var(--ui-offset-ms, 0ms) ease-out;
}
.ge-choice-btn:hover, .ge-dlg-btn:hover, .ge-nav-btn:hover, .ge-meta-btn:hover, .ge-auto-btn:hover,
.ge-voice-btn:hover, .ge-settings-btn:hover, .ge-end-menu-btn:hover, .ge-mm-btn:hover,
.gp-choice-btn:hover, .gp-voice-btn:hover, .gp-map-uibtn:hover {
    filter: brightness(1.18);
}
/* 按住：明顯壓暗 + 內陰影，放開就恢復 */
.ge-choice-btn:active, .ge-dlg-btn:active, .ge-nav-btn:active, .ge-meta-btn:active, .ge-auto-btn:active,
.ge-voice-btn:active, .ge-settings-btn:active, .ge-end-menu-btn:active, .ge-mm-btn:active,
.gp-choice-btn:active, .gp-voice-btn:active, .gp-map-uibtn:active {
    filter: brightness(0.72) saturate(1.1);
}
/* 停用中的按鈕不給回饋（例如載入中的 ▶） */
.ge-choice-btn:disabled, .ge-dlg-btn:disabled, .ge-nav-btn:disabled, .ge-meta-btn:disabled,
.ge-auto-btn:disabled, .ge-voice-btn:disabled, .ge-settings-btn:disabled, .ge-end-menu-btn:disabled {
    filter: grayscale(0.6) brightness(0.7);
    cursor: default;
}
/* AUTO 開啟中：本來就有 .ge-auto-active 的高亮，按住時仍看得出被壓暗 */
.ge-auto-btn.ge-auto-active:active { filter: brightness(0.8) saturate(1.2); }

/* 地圖上的章／段節點、選擇畫面的卡片也是「按鈕」，同樣要有按住的樣子 */
.gp-cmap-node, .gp-select-card, .gp-chapter-card, .gp-save-slot, .gp-col-card, .gp-ach-card {
    transition: filter 90ms ease-out, transform var(--ui-offset-ms, 0ms) ease-out;
}
.gp-cmap-node:not(.locked):hover, .gp-select-card:hover, .gp-chapter-card:hover,
.gp-save-slot:hover, .gp-col-card:hover, .gp-ach-card:hover { filter: brightness(1.15); }
.gp-cmap-node:not(.locked):active, .gp-select-card:active, .gp-chapter-card:active,
.gp-save-slot:active, .gp-col-card:active, .gp-ach-card:active { filter: brightness(0.75); }

/* 閘道模式等待伺服器（判斷求值／段內容載入）：右上角小提示，畫面不變、只是點了不會動（第 87 輪 P8） */
.ge-wait {
    position: absolute; top: 12px; right: 16px; z-index: 60;
    min-width: 28px; height: 28px; padding: 0 10px; border-radius: 14px;
    background: rgba(0, 0, 0, .55); color: #fff; font-size: 18px; line-height: 28px; text-align: center;
    letter-spacing: 2px; pointer-events: none;
    animation: ge-wait-blink 1s ease-in-out infinite;
}
@keyframes ge-wait-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.ge-viewport.ge-waiting { cursor: progress; }
