/* game5.css - 詩詞小精靈 (Poetry Pac-Man) */

.game5-overlay {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    /*background: radial-gradient(circle at center, hsl(210, 30%, 25%) 0%, hsl(0, 0%, 5%) 100%);*/
    background: radial-gradient(circle at center, hsl(210, 30%, 5%) 0%, hsl(0, 0%, 0%) 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: hsl(40, 50%, 80%);
    font-family: 'Noto Serif TC', serif;
    overflow: hidden;
}

/* 頁首：分數與控制按鈕列 */
.game5-header {
    padding: 2px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
    width: 100%;
    height: 50px;
}

/*分數*/
.game5-score-board {
    color: hsl(50, 70%, 60%);
    font-size: 24px;
    font-weight: bold;
    padding-left: 50px;
}

/*控制按鈕*/
.game5-controls .nav-btn {
    padding: 0px 10px;
    background: hsl(0, 60%, 25%);
    border: 0.6px solid hsla(40, 100%, 80%, 0.3);
    color: hsl(45, 80%, 70%);
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
}

.game5-controls .nav-btn:hover {
    background: hsl(0, 60%, 50%);
    color: hsl(45, 80%, 90%);
}

.game5-controls .nav-btn:disabled {
    background: hsl(0, 0%, 50%);
    color: hsl(45, 0%, 90%);
}

/* 紅心生命條（詩詞收集進度提示區，位於頂部約 10% 區域，包含頁首） */
.game5-sub-header {
    display: flex;
    justify-content: center;
    align-items: center;
    /* 垂直居中 */
    background: rgba(0, 0, 0, 0.4);
    z-index: 9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    height: 40px;
}

.game5-hearts {
    display: flex;
    gap: 2px;
    justify-content: center;
    flex-wrap: wrap;
}

.game5-hearts .heart {
    color: hsl(4, 90%, 60%);
    font-size: 32px;
}

.game5-hearts .heart.empty {
    opacity: 0.8;
}

/*目標詩句*/
.game5-target-poem {
    font-size: 24px;
    letter-spacing: 0.6px;
    display: flex;
    gap: 0.6px;
    margin-bottom: 6px;
}

/*提示字*/
.game5-char-hint {
    padding: 0 2px;
    opacity: 0.4;
    transition: all 0.3s;
}

/*提示*/
.game5-char-hint.prompt {
    opacity: 0.8;
}

/*下一個答案*/
.game5-char-hint.answer.active {
    opacity: 1;
    color: hsl(45, 100%, 60%);
    text-shadow: 0 0 6px hsl(45, 100%, 50%);
    transform: scale(1.2);
    font-weight: bold;
}

/*已收集*/
.game5-char-hint.answer.collected {
    opacity: 1;
    color: #fff;
}

/* 尚未收集且非目前目標的答案字，顯示為底線佔位 */
.game5-char-hint.answer:not(.collected):not(.active) {
    color: transparent;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    min-width: 24px;
    display: inline-block;
}

/* 迷宮遊戲區域（佔畫面高度約 70%） */
.game5-maze-container {
    width: 100%;
    height: 70%;
    position: relative;
    background: rgba(10, 10, 10, 0.5);
    display: flex;
    align-items: center;
    /* 居中擺放 */
    justify-content: center;
    overflow: hidden;
    /* 不需要捲動軸 */
}

/* 難度標籤 */
.game5-difficulty-tag {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 20px;
    color: hsl(45, 30%, 85%);
    border: 0.6px solid hsla(40, 100%, 80%, 0.1);
    z-index: 100;
    cursor: pointer;
    transition: all 0.2s;
}

.game5-difficulty-tag[data-level="小學"] {
    background: linear-gradient(135deg, hsl(100, 40%, 40%) 0%, hsl(120, 40%, 30%) 100%);
}

.game5-difficulty-tag[data-level="中學"] {
    background: linear-gradient(135deg, hsl(210, 40%, 50%) 0%, hsl(230, 40%, 40%) 100%);
}

.game5-difficulty-tag[data-level="高中"] {
    background: linear-gradient(135deg, hsl(0, 50%, 50%) 0%, hsl(0, 50%, 35%) 100%);
}

.game5-difficulty-tag[data-level="大學"] {
    background: linear-gradient(135deg, hsl(290, 50%, 50%) 0%, hsl(270, 50%, 35%) 100%);
}

.game5-difficulty-tag[data-level="研究所"] {
    background: linear-gradient(135deg, hsl(50, 80%, 50%) 0%, hsl(40, 80%, 35%) 100%);
}

.game5-difficulty-tag:hover {
    box-shadow: 0 0px 8px rgba(255, 255, 255, 0.9);
    filter: brightness(1.5);
}

#game5-timer-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#game5-timer-path {
    fill: none;
    stroke: hsl(0, 50%, 22%);
    /* 初始暗紅色（由 JS 插值到鮮紅）*/
    stroke-width: 4px;
    stroke-linecap: round;
    stroke-dasharray: 10000;
    /* 預設隱藏：JS 初始化前不顯示框線，避免閃爍 */
    stroke-dashoffset: 10000;
    /* 預設隱藏：offset=dasharray → 完全不可見 */
    /*transition: stroke-dashoffset 0.1s linear, stroke 0.4s ease;*/
}

#game5-canvas {
    display: block;
    /* 水墨感背景 */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="f"><feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="3" /><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" /></filter><rect width="100" height="100" filter="url(%23f)" fill="white" opacity="0.05"/></svg>');
}

/* 底部控制區域（佔畫面高度約 10%，顯示計時器與操作說明） */
.game5-ui-area {
    width: 100%;
    height: 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.game5-timer-container {
    margin-bottom: 10px;
    font-size: 20px;
    color: hsl(0, 80%, 60%);
}

.game5-instruction {
    font-size: 18px;
    opacity: 0.6;
    text-align: center;
}

/* .game5-message 樣式已移除 - 改用統一的 GameMessage 元件 */

/* 動畫效果 */
@keyframes glow {
    0% {
        filter: drop-shadow(0 0 2px gold);
    }

    50% {
        filter: drop-shadow(0 0 6px gold);
    }

    100% {
        filter: drop-shadow(0 0 2px gold);
    }
}

/* 套用於需要金色光暈提示的文字（例如下一個待收集的目標字） */
.char-glow {
    animation: glow 1.5s infinite;
}

@keyframes shake {

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

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

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

/* 套用於收集順序錯誤時的畫面震動提示效果 */
.shake {
    animation: shake 0.2s;
}