/* intro_char_select_styles.css */

/* --- 介紹區塊 --- */
#intro-section {
    background-image: url('../images/intro.png');
    background-size: cover;
    background-position: center center; 
    background-repeat: no-repeat;
    padding: 40px;
    border-radius: 8px;
    color: white;
    position: relative;
    min-height: 300px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: transparent; /* Override default .container background */
    box-shadow: none;
}

#intro-section h1 { /* Page title specific to intro section */
    color: #FFFFFF; 
    font-size: 3em;  
    font-weight: bold; 
    margin-bottom: 25px; 
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.7),
        -1px -1px 0 #000,                
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;                
    position: relative; 
    z-index: 5; /* Above story text animations */
}

#story-text { /* Container for animated story paragraphs */
    position: relative; 
    min-height: 100px; 
    overflow: hidden; 
    width: 80%; 
    max-width: 600px; 
    margin-top: 20px; 
    z-index: 5; 
}

#story-text p { /* Individual story paragraph */
    font-size: 1.2em; 
    background-color: rgba(0, 0, 0, 0.65); 
    padding: 15px; 
    border-radius: 8px;
    position: absolute; 
    width: calc(100% - 30px); 
    left: 15px;
    top: 0;
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    color: #f0f0f0; 
    line-height: 1.5;
}

#story-text p.active-story-line { 
    opacity: 1;
    transform: translateY(0);
}

#story-text p.fading-out { 
    opacity: 0;
    transform: translateY(-20px); 
    transition: opacity 0.4s ease-in, transform 0.4s ease-in; 
}

/* --- 角色選擇區塊 --- */
#character-selection-section {
    /* Add any specific styles for the entire character selection section if needed */
    /* For example, padding or margin if it's not handled by .container */
}

.character-select-header { /* 新增：包裹標題和重置按鈕的容器 */
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; /* 與下方角色網格的間距 */
}

.character-select-header h2 { /* 角色選擇標題 */
    margin: 0; 
    flex-grow: 1; /* 讓標題佔據空間，幫助居中（如果按鈕靠右） */
    text-align: center; /* 確保標題文本自身是居中的 */
    /* 繼承 general_styles.css 中的 h2 顏色，如果需要特定顏色再覆蓋 */
}

/* 新增：重置按鈕樣式 */
.reset-button {
    padding: 8px 15px;
    background-color: #dc3545; /* 紅色背景 */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* 防止文字換行 */
    flex-shrink: 0; /* 防止按鈕在 flex 佈局中被過度壓縮 */
}

.reset-button:hover {
    background-color: #c82333; /* 紅色加深 */
}


.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px;
    margin-top: 20px; /* 如果 .character-select-header 的 margin-bottom 已經足夠，這裡可以調整或移除 */
}

.character-card {
    position: relative; 
    border: 3px solid transparent;
    border-radius: 10px; 
    overflow: hidden;   
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    aspect-ratio: 3 / 4; 
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    background-color: #333; 
}

.character-card:hover,
.character-card:focus {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: #bcaaa4;
    outline: none;
}

.character-card.selected {
    border-color: #ffc107; 
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.5);
    transform: scale(1.05);
}

.character-image-full { 
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block; 
    transition: transform 0.3s ease; 
}

.character-card:hover .character-image-full,
.character-card:focus .character-image-full {
    transform: scale(1.1); 
}

.character-overlay-info { 
    position: absolute; 
    bottom: 0;          
    left: 0;
    width: 100%;
    padding: 15px 10px; 
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,0) 100%); 
    color: white;
    text-align: center; 
    box-sizing: border-box; 
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1; 
    transform: translateY(0);
}

.character-overlay-info h3 { 
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.3em; 
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7); 
    color: #ffffff; 
}

.character-overlay-info .ability { 
    font-size: 0.9em;
    line-height: 1.3;
    margin-bottom: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); 
}

.character-card.selected .character-overlay-info { 
    background: linear-gradient(to top, rgba(255,193,7,0.85) 0%, rgba(255,193,7,0.6) 60%, rgba(0,0,0,0) 100%);
    color: #212529; 
}
.character-card.selected .character-overlay-info h3,
.character-card.selected .character-overlay-info .ability {
    text-shadow: none; 
}

/* 確認角色按鈕 (如果使用 class 'confirm-button') */
/* 如果 #confirm-character-btn 在 style.css 中已有通用樣式，這裡可以不重複 */
/* 但如果希望它有特定於此頁面的微調，可以在此定義 */
#confirm-character-btn.confirm-button, /* 或者直接用ID #confirm-character-btn */
.confirm-button { /* 通用 class，如果 #confirm-character-btn 也用了這個 class */
    display: block;
    margin: 30px auto 20px auto; /* 上下邊距調整 */
    padding: 12px 25px;
    background-color: #795548; 
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}
#confirm-character-btn.confirm-button:hover,
.confirm-button:hover {
    background-color: #5d4037;
}