/**
 * =======================================
 * 自訂樣式檔案 - v1.3.3 (參考 v4.2.0)
 * 
 * 此檔案合併了自訂實作和Monogatari範本結構
 * 基礎設定參考 v4.2.0 的成功經驗
 * =======================================
 **/

/**
 * ===========================
 * Foundational Styling (參考 v4.2.0)
 * ===========================
**/
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/**
 * ===========================
 * General Styling
 * ===========================
**/
body {}
button {}
button:hover {}
[data-screen] {}

/* ========================================
   主選單背景設定
   ======================================== */
main-screen {
    background-image: url('../assets/scenes/main_menu_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

main-screen main-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

main-screen main-menu button {
    background-color: var(--main-color) !important;
    opacity: 1 !important;
}

main-screen main-menu button:hover {
    background-color: var(--main-color) !important;
    opacity: 1 !important;
}

main-menu button[data-action="start"],
main-menu button[data-action="open-screen"],
main-menu button[data-open="load"],
main-menu button[data-open="settings"] {
    background-color: rgba(0, 0, 0, 0.7) !important;
    opacity: 1 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

main-menu button[data-action="start"]:hover,
main-menu button[data-action="open-screen"]:hover,
main-menu button[data-open="load"]:hover,
main-menu button[data-open="settings"]:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    opacity: 1 !important;
    color: #ffffff !important;
}

/**
 * ===========================
 * Main Menu Styling
 * ===========================
**/
[data-screen="main"] {}
[data-screen="main"] button {}

/**
 * ===========================
 * Save and Load Menus Styling
 * ===========================
**/
[data-component="save-slot"] figure {}
[data-component="save-slot"] img {}
[data-component="save-slot"] figcaption {}
[data-component="save-slot"] button {}

/**
 * ===========================
 * Game Elements Styling
 * ===========================
**/
[data-component="choice-container"] button {}
[data-component="choice-container"] button:hover {}
[data-component="text-box"] {}
[data-ui="who"] {}
[data-component="centered-dialog"] {}
[data-screen="game"] [data-character] {}
[data-screen="game"] [data-image] {}

/**
 * ===========================
 * Quick Menu Styling (參考 v4.2.0)
 * ===========================
**/

/* 統一容器背景 */
quick-menu,
[data-component="quick-menu"] {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* 針對按鈕本身 (桌面版 <button> 和 手機版 <span>) */
quick-menu button,
[data-component="quick-menu"] > span {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    transition: background-color 0.3s ease;
    white-space: nowrap !important;
}

/* 懸停效果 */
quick-menu button:hover,
[data-component="quick-menu"] > span:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* 對齊圖示與文字 */
quick-menu .fa,
[data-component="quick-menu"] .fa {
    vertical-align: middle;
}

/* Quick Menu Buttons Icon Style */
[data-component="quick-menu"] > span > .fa {
    /* 可在此添加快捷選單圖示樣式 */
}

/* ========================================
   動態標題系統
   ======================================== */
.dynamic-title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.dynamic-main-title {
    font-size: 5rem;
    font-weight: 900;
    margin: 0;
    color: #ffffff;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(255, 255, 255, 0.3);
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
    letter-spacing: 0.1em;
    animation: titleSlideIn 1.2s ease-out;
}

/**
 * ===========================
 * Range Styling
 * ===========================
**/
input[type=range]:focus::-webkit-slider-runnable-track {}
input[type=range]::-webkit-slider-runnable-track {}
input[type=range]:focus::-ms-fill-upper {}
input[type=range]:focus::-ms-fill-lower {}
input[type=range]::-moz-range-track {}
input[type=range]::-ms-fill-lower {}
input[type=range]::-ms-fill-upper {}

/* ========================================
   動畫關鍵幀定義
   ======================================== */
@keyframes titleSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   多選題模組樣式 (參考 v4.2.0)
   ======================================== */
.mc-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.mc-container {
    background: white;
    border-radius: 12px;
    padding: clamp(20px, 4vw, 40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: min(800px, 90vw);
    max-height: min(90vh, 800px);
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.mc-question {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: bold;
    color: #333;
    margin-bottom: clamp(15px, 3vh, 25px);
    line-height: 1.4;
    word-wrap: break-word;
}

.mc-options-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: clamp(15px, 3vh, 25px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 12px);
    padding-right: 5px;
}

.mc-option-wrapper {
    display: flex;
    align-items: center;
    padding: clamp(10px, 2vw, 15px);
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 50px;
    box-sizing: border-box;
}

.mc-option-wrapper:hover {
    background: #e9e9e9;
    border-color: #cccccc;
}

.mc-option-wrapper.is-selected {
    background: #4a90e2;
    border-color: #2c5aa0;
}

.mc-option-wrapper.is-selected .mc-option-label {
    color: white;
}

.mc-option-checkbox {
    width: clamp(18px, 3vw, 24px);
    height: clamp(18px, 3vw, 24px);
    cursor: pointer;
    margin-right: clamp(10px, 2vw, 15px);
    flex-shrink: 0;
}

.mc-option-label {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
    flex: 1;
    transition: color 0.3s ease;
}

.mc-submit-button {
    background: #28a745;
    color: white;
    border: none;
    padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 30px);
    border-radius: 6px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mc-submit-button:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* ========================================
   響應式設計
   ======================================== */
@media screen and (min-width: 37.56255em) {}
@media screen and (min-width: 62em) {}
@media screen and (max-width: 768px) {
    .dynamic-main-title {
        font-size: 3.5rem;
    }
}
@media screen and (min-width: 75em) {}
@media screen and (max-width: 480px) {
    .dynamic-main-title {
        font-size: 2.5rem;
    }
}
@media screen and (min-width: 120em) {}
@media screen and (min-width: 160em) {}
@media screen and (min-width: 240em) {}
@media screen and (min-width: 312.5em) {}
@media screen and (min-width: 500em) {}

/* ========================================
   版本資訊
   
   v1.3.3 - 基於 v4.2.0 的修正版本
   - ✅ 採用 v4.2.0 的 html/body 基礎設定
   - ✅ 多選題使用 position: fixed (如 v4.2.0)
   - ✅ 多選題標題字體統一為與選項相同大小
   - ✅ Quick Menu 透明按鈕設計
   - ✅ 保留主選單背景和動態標題功能
   ======================================== */