/* =========================================
   独立难度选择组件
   - 全局共享，供所有游戏使用
   ========================================= */

/* 难度选择器覆盖层 */
.difficulty-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    background: hsl(0, 60%, 24%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* 高於所有 Overlay 與選單 */
}

.difficulty-selector-overlay.hidden {
    display: none !important;
}

/* 难度选择器容器 */
.difficulty-selector-container {
    background: linear-gradient(135deg, hsl(270, 34%, 36%) 0%, hsl(228, 34%, 30%) 100%);
    padding: 40px 20px;
    /* 內部邊框*/
    border-radius: 30px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 80%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-60px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/*請選擇難度*/
.difficulty-selector-container h2 {
    color: hsl(32, 30%, 90%);
    font-size: 32px;
    margin-bottom: 16px;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.25em;
}

/* 难度按钮容器 */
.difficulty-buttons {
    display: flex;
    flex-direction: column-reverse;
    /* 由下至上排列 */
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* 难度按钮 - 寬度相同 */
.difficulty-btn {
    background: rgba(255, 255, 255, 0.95);
    color: hsl(45, 30%, 85%);
    border: 4px solid transparent;
    margin: 4px auto;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 80%;
    /* 每個按鍵寬度相同 */
    max-width: 200px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.66);

    /* 水平文字 */
    text-align: center;
    letter-spacing: 0.2em;
}

.difficulty-btn:hover {
    transform: translateY(-6px) scale(1.1);
    background: white;
    border-color: #ffd700;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.66);
}

.difficulty-btn:active {
    transform: translateY(-10px) scale(0.9);
}

/* 不同难度的颜色主题 */
.difficulty-btn[data-level="小學"] {
    background: linear-gradient(135deg, hsl(100, 40%, 40%) 0%, hsl(120, 40%, 30%) 100%);
}

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

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

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

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

/*
.difficulty-btn[data-level="小學"] {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.difficulty-btn[data-level="中學"] {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.difficulty-btn[data-level="高中"] {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.difficulty-btn[data-level="大學"] {
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
}

.difficulty-btn[data-level="研究所"] {
    background: linear-gradient(135deg, #fdcbf1 0%, #e6dee9 100%);
}
*/

.difficulty-btn[data-level="小學"]:hover {
    border-color: hsl(100, 80%, 40%);
}

.difficulty-btn[data-level="中學"]:hover {
    border-color: hsl(210, 80%, 50%);
}

.difficulty-btn[data-level="高中"]:hover {
    border-color: hsl(0, 80%, 50%);
}

.difficulty-btn[data-level="大學"]:hover {
    border-color: hsl(290, 80%, 50%);
}

.difficulty-btn[data-level="研究所"]:hover {
    border-color: hsl(60, 80%, 50%);
}

/* 响应式适配 */
@media (max-width: 288px) {
    .difficulty-selector-container {
        padding: 40px 20px;
    }

    .difficulty-selector-container h2 {
        font-size: 40px;
        margin-bottom: 16px;
    }

    .difficulty-btn {
        font-size: 36px;
        padding: 8px 12px;
        width: 85%;
    }

    .difficulty-buttons {
        gap: 20px;
    }
}

/* 關卡挑戰按鈕 */
.level-challenge-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    display: flex;
    justify-content: center;
}

.level-challenge-btn {
    background: hsl(45, 80%, 85%);
    color: hsl(0, 70%, 33%);
    border: 4px solid transparent;
    margin: 4px auto;
    padding: 8px 4px;
    border-radius: 20px;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    /* 每個按鍵寬度相同 */
    max-width: 200px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.66);
    /* 水平文字 */
    text-align: center;
    letter-spacing: 0.1em;
}

.level-challenge-btn:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}

.new-tag {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #ff0000;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    padding-bottom: 4px;
    padding-left: 4px;
    border: 1px solid white;
    font-weight: bold;
}