/* =========================================
   遊戲十三：人事時地樣式
   - 全獨立樣式表，供 game13.js 相關功能使用
   ========================================= */

/* ⚠️ 介面「上半部」（overlay 背景、頂列、分數、控制鈕、難度標籤、
   紅心副標）之樣式已抽至 theme_xuanzhi.css 的 .fm-* 共用區塊。
   本檔僅保留 .game13-area 及以下的遊戲區私有樣式。 */

/* 通用隱藏工具類：用於整體遊戲容器初始隱藏 */
.hidden {
    display: none !important;
}

/* 遊戲主要區域：垂直排列（題目區在上、答案按鈕池在下） */
.game13-area {
    display: flex;
    flex: 1;
    flex-direction: column;
    position: relative;
    padding: 0px;
    width: 100%;
}

/* 難度標籤樣式已上移至 theme_xuanzhi.css 的 .fm-difficulty-tag */

/* 題目展示區 */
.game13-question-area {
    text-align: center;
    width: 100%;
    padding: 4px 20px;
    color: hsl(40, 50%, 80%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-bottom: 2px;
}

/*朝代、作者、詩名*/
.game13-meta-info {
    font-size: 36px;
    margin-bottom: 2px;
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.meta-box {
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.0);
    font-weight: bold;
    text-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meta-box.hidden-meta {
    /*color: hsl(36, 80%, 50%);*/
    color: var(--fm-cinnabar, hsl(6, 63%, 46%));
    border: 2px dashed var(--fm-cinnabar, hsl(6, 63%, 46%));
}

.meta-box.correct {
    color: var(--fm-celadon, hsl(150, 37%, 40%));
    border: 2px solid var(--fm-celadon, hsl(150, 37%, 40%));
}

.meta-box.wrong {
    color: hsl(0, 80%, 60%);
    border: 2px solid hsl(0, 80%, 60%);
}

/*詩句（宣紙墨字；狀態色沿用米色主題）*/
.game13-poem-lines {
    font-size: 50px;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 2px;
    letter-spacing: 4px;
    color: var(--fm-ink, #2e241b);
    text-align: center;
}

.game13-poem-lines span.hidden-char {
    color: var(--fm-cinnabar-bright, hsl(8, 56%, 51%));
    font-weight: bold;
    /*border-bottom: 2px solid var(--fm-cinnabar-bright, #c94f3d);*/
    padding: 0 2px;
    margin: 0 2px;
}

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

/* 答案區域 */
.game13-answer-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* ⚠️ 水平置中保底：見 game1 同款修正說明 */
    align-self: center;
}

/* ⚠️ 三層同心圓結構（同 game1）：
   ① 最外圈：紅色 SVG timer path（10px stroke）
   ② 5px 間隔（由本層 padding 提供）
   ③ 中間圈：3px 邊框 + 徑向漸層底 + border-radius 20px（.game13-answer-pool-inner-ring）
   ④ 20px 間隔（由中間圈 padding 提供）
   ⑤ 內圈：答案字/元資訊按鈕池（.game13-answer-pool） */
.game13-answer-pool-container {
    position: relative;
    padding: 15px;
    box-sizing: border-box;
}

.game13-answer-pool-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;
    padding: 20px;
    box-sizing: border-box;
}

.game13-answer-pool {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 10px;
    /* ⚠️ 邊距改由 .game13-answer-pool-inner-ring 統一提供 20px */
    margin: 0;
    padding: 0;
    max-width: 100%;
    /* 限制最大高度為約 8 行按鈕的高度，超過則捲動 */
    height: 500px;
    /*overflow-y: auto;*/
}

/* 緊湊模式：當按鈕過多時自動觸發 */
.game13-answer-pool.compact-layout {
    gap: 6px;
    padding: 6px;
}

.game13-answer-pool.compact-layout .ans-btn-13 {
    height: 56px;
    font-size: 40px;
    padding-bottom: 4px;
}

.game13-answer-pool.compact-layout .ans-btn-13.char-btn {
    width: 52px;
    height: 56px;
}

.game13-answer-pool.compact-layout .ans-btn-13.meta-btn {
    height: 56px;
    font-size: 40px;
}

/* 針對非單字按鈕（元數據按鈕）的樣式 */
.ans-btn-13.meta-btn {
    height: 56px;
    font-size: 40px;
    padding: 0 12px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
    /* 修正文字下偏問題，將其向上推 */
}

/* ⚠️ 答案卡出場動畫：中心點整體 XY 放大（scale 0→1），每片 0.5s；
   延遲由 JS 依「所有卡片啟動時機壓進 0~0.5 秒」規則設定（同 game1/game2/game4/game12）。 */
.ans-btn-13.ans-btn-13-appear {
    transform-origin: center center;
    animation: game13-ans-grow 0.5s ease-out both;
}

@keyframes game13-ans-grow {
    from {
        filter: brightness(0.66);
        transform: scale(0);
    }

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

/* 答案候選按鈕基本樣式（未答對／未答錯的預設狀態） */
.ans-btn-13 {
    background: hsl(40, 50%, 88%);
    border: none;
    border-radius: 12px;
    font-size: 30px;
    padding: 10px 10px;
    color: hsl(210, 30%, 24%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s, background 0.2s;
    white-space: nowrap;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
    transition: all 0.2s;
}

.ans-btn-13:hover {
    filter: brightness(1.2);
    box-shadow: 0 0px 8px rgba(255, 255, 255, 0.5);
}

.ans-btn-13.char-btn {
    font-size: 40px;
    width: 60px;
    height: 56px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
    /* 修正文字下偏 */
}

.ans-btn-13:active {
    transform: scale(0.9);
}

/* 已停用（答對後鎖住）的按鈕：略降不透明度並停用滑鼠事件 */
.ans-btn-13.disabled {
    opacity: 0.9;
    pointer-events: none;
}

/* 答對狀態：綠色背景 */
.ans-btn-13.correct {
    background: hsl(145, 68%, 36%) !important;
    color: white !important;
}

/* 答錯狀態：紅色背景並觸發搖晃動畫提示 */
.ans-btn-13.wrong {
    background: hsl(0, 80%, 60%) !important;
    color: white !important;
    animation: game13-shake 0.4s;
}

@keyframes game13-shake {

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

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

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

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