/* =========================================
   遊戲一：慢思快選樣式（覆蓋全畫面）
   - 橫排文字，計時圓環，四選一
   ----------------------------------------
   ⚠️ 介面「上半部」（overlay 背景、頂列、分數、控制鈕、難度標籤、
   紅心副標）之樣式已抽至 theme_xuanzhi.css 的 .fm-* 共用區塊。
   本檔僅保留 .game1-area 及其以下的遊戲區私有樣式。
   ========================================= */

/* 顯示／隱藏控制 */
.hidden {
    display: none !important;
}

/* 遊戲主區域 */
.game1-area {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 10px;
    width: 100%;
}



/* 問題區域 */
.game1-question-area {
    text-align: center;
    width: 100%;
    margin: 1px 0;
    padding: 1px 20px;
    color: var(--fm-ink, #2e241b);

    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.game1-question-lines {
    font-size: 50px;
    /*根據字數自動調整，請參考game1.js 動態縮小字體程式碼*/
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: 6px;
    color: var(--fm-ink, hsl(28, 26%, 14%));
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    /* 宣紙上採暖色淺陰影營造墨痕層次，不用純黑重影 */
    text-shadow: var(--fm-text-shadow, 0 1px 2px hsla(38, 50%, 31%, 0.18));
}

.game1-question-lines span.hidden-char {
    color: var(--fm-cinnabar-bright, #c94f3d);
    border-radius: 2px;
    padding: 0 2px;
}

.game1-question-lines span.correct-char {
    color: var(--fm-celadon, #3a7d5c);
    font-weight: bold;
    text-shadow: var(--fm-text-shadow, 0 1px 2px rgba(120, 90, 40, 0.18));
}

/* 詩句每一行墨字（前綴化後不再受 game4/12/13 的舊 .poem-lines 全域污染）*/
.game1-poem-lines {
    color: var(--fm-ink, #2e241b);
}

.game1-poem-lines span.hidden-char {
    color: var(--fm-cinnabar-bright, #c94f3d);
}

.game1-poem-lines span.correct-char {
    color: var(--fm-celadon, #3a7d5c);
}

/* 詩詞出處連結：樣式已上移至 theme_xuanzhi.css 的 .fm-poem-info（位於 fm-sub-header 右側）*/

/* 答案區域 */
.game1-answer-area {
    padding-top: 20px;
    /*答案區上緣與問題區的距離*/
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 96%;
    /* ⚠️ 修正水平居中：外層 .game1-area 為 flex column（cross-axis = 水平）
       且 align-items 預設為 stretch，加上 max-width 後會靠左對齊。
       用 align-self: center 讓 .game1-answer-area 依自身寬度居中。 */
    align-self: center;
}

/* ⚠️ 三層同心圓結構：
   ① 最外圈：紅色 SVG timer path（10px stroke），畫在 .game1-answer-grid-container 的外緣
   ② 5px 間隔（由 container padding 提供）
   ③ 中間圈：3px 邊框 + 徑向漸層底 + border-radius 20px（.game1-answer-inner-ring）
   ④ 20px 間隔（由 inner-ring padding 提供）
   ⑤ 內圈：4 個答案卡（.game1-answer-grid） */
.game1-answer-grid-container {
    position: relative;
    display: inline-block;
    /* 讓外層 padding = 10px（timer 環寬）+ 5px（間隔）= 15px */
    padding: 15px;
    /* 徑向漸層底 + 3px 邊框搬到中間圈（.game1-answer-inner-ring），本層純粹只框住 timer */
    background: transparent;
    border: none;
    border-radius: 0;
}

.game1-answer-inner-ring {
    background: radial-gradient(hsla(0, 0%, 100%, 0.0) 60%, rgba(0, 0, 0, 0.1)) 100%;
    border: 3px solid var(--fm-border, #d8c193);
    border-radius: 20px;
    /* ⚠️ 內圈邊框到答案卡之間的 20px 間隔 */
    padding: 20px;
}

/* 計時器外環／計時框：樣式已移至 theme_xuanzhi.css 的 .fm-timer-ring / .fm-timer-path
   （紅→黃即時色由 game1.js updateTimerRing 逐格插值）。*/

.game1-answer-grid {
    display: grid;
    margin: 0;
    /* ⚠️ 內外邊距改由 .game1-answer-inner-ring 統一提供 20px 邊距 */
    padding: 0;
    gap: 2px;
    /* 答案按鍵之間的間距，請設定0，讓按鍵ans-btn的 margin 自行設定即可 */
    justify-content: center;
    justify-items: center;
    align-items: center;
}

.game1-option-btn {
    margin: 10px 10px;
    /*答案按鍵與邊框(另一個答案按鍵)之間的距離*/
    padding: 0px 20px;
    /*按鍵內文字左右空白寬度*/
    background: var(--fm-paper-card, #fbf5e6);
    color: var(--fm-ink, #2e241b);
    border: 4px solid var(--fm-border, #d8c193);
    border-radius: 12px;
    font-size: 40px;
    /*根據字數自動調整，請參考game1.js 動態縮小字體程式碼*/
    letter-spacing: 6px;
    line-height: 1;
    min-height: 66px;
    max-height: 66px;
    min-width: 300px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: var(--fm-shadow-btn, 0 4px 5px rgba(120, 90, 40, 0.22));
    white-space: nowrap;
    overflow: hidden;
}

.game1-option-btn:hover {
    border-color: var(--fm-border-strong, #b98e50);
    background: #fffdf3;
}

/* ⚠️ 答案卡出場動畫：以自身中心點同時向上/向下 Y 放大（0.1 → 1.0），每片動畫 0.5s。
   ⚠️ 動畫延遲由 JS 依「所有卡片啟動時機一律壓進 0~0.5 秒之間」規則設定，
   卡片再多也不會拖長整體出場時間（例如 4 片 → 延遲 0 / 0.167 / 0.334 / 0.5）。
   ⚠️ animation-fill-mode: both — 延遲期間即套用 from 狀態（scaleY 0.1），
   避免「先完整顯示 → 又壓縮」的閃爍。 */
.game1-option-btn.game1-option-appear {
    transform-origin: center center;
    animation: game1-option-grow 0.5s ease-out both;
}

@keyframes game1-option-grow {
    from {
        filter: brightness(0.66);
        transform: scaleY(0.0);
    }

    to {
        filter: brightness(1);
        transform: scaleY(1);
    }
}

.game1-option-btn.correct {
    background: var(--fm-correct-bg, #e4f0e2);
    border-color: var(--fm-correct-border, #7cbf93);
    color: var(--fm-correct-text, #245c3c);
}

.game1-option-btn.wrong {
    background: var(--fm-wrong-bg, #f9e3df);
    border-color: var(--fm-wrong-border, #dd8a80);
    color: var(--fm-wrong-text, #8a2b20);
    animation: shake 0.5s;
}

.game1-option-btn.hint {
    background: var(--fm-hint-bg, #e2eaf4);
    border-color: var(--fm-hint-border, #8ba6cf);
    color: var(--fm-hint-text, #2d3f66);
}

/* 抖動動畫 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@media (max-width: 240px) {
    .game1-poem-lines {
        font-size: inherit;
    }

    .option-btn {
        font-size: 30px;
        padding: 10px 10px;
    }
}