/* --- CẤU HÌNH CHUNG --- */
:root {
    --deep-red: #4a0000;
    --bright-red: #b30000;
    --gold: #ffcc00;
    /* Gradient mới: Bỏ màu nâu đất, thay bằng Vàng chanh và Trắng để bắt sáng */
    --gold-gradient: linear-gradient(to bottom, #ffffff 0%, #ffecb3 20%, #ffcc00 50%, #ffdb4d 100%);
}

body {
    margin: 0; padding: 0;
    background-color: #050000;
    color: white;
    font-family: 'Roboto Condensed', sans-serif;
    height: 100vh;
    /* Trên mobile dùng 100dvh để tránh thanh địa chỉ che mất nút */
    height: 100dvh; 
    overflow: hidden;
}

/* --- VIDEO BACKGROUND (FULL MÀN HÌNH) --- */
.video-container {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    overflow: hidden;
    z-index: -99;
}

#bgVideo {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    object-fit: cover;
    z-index: 1;
}

.red-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    /* Giảm độ đen, tăng độ đỏ để nền tươi hơn */
    background: linear-gradient(to bottom, rgba(100, 0, 0, 0.4) 0%, rgba(30, 0, 0, 0.9) 100%);
}

/* --- INTRO LAYER --- */
#intro-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s;
    overflow-y: auto; /* Cho phép cuộn nếu màn hình quá bé */
}

.main-frame {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    width: 100%;
    padding: 10px; /* Thêm đệm để không sát lề điện thoại */
    box-sizing: border-box;
}

/* Logo */
.emblem-container {
    position: relative;
    width: 140px; height: 140px;
    margin-bottom: 15px;
    display: flex; justify-content: center; align-items: center;
    flex-shrink: 0; /* Không bị bóp méo */
}
.main-logo {
    max-width: 100%; max-height: 100%;
    object-fit: contain; z-index: 2;
    filter: drop-shadow(0 0 15px rgba(255, 200, 0, 0.6)); /* Tăng sáng logo */
}
.spinning-ring {
    position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px;
    border: 2px dashed var(--gold); border-radius: 50%;
    animation: spin 20s linear infinite; opacity: 0.8;
}

/* --- KHẮC PHỤC CHỮ TỐI --- */
.gold-text {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem; /* Giảm chút cho gọn */
    margin: 10px 0;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    font-weight: 900;
    /* Thêm Drop Shadow trắng nhẹ để tách chữ khỏi nền */
    filter: drop-shadow(0 2px 0px rgba(0,0,0,0.8)); 
    line-height: 1.2;
}

.sub-title {
    color: #ffecb3; /* Vàng nhạt dễ đọc hơn vàng đậm */
    letter-spacing: 2px;
    font-size: 1rem;
    text-shadow: 0 2px 4px black;
    text-transform: uppercase;
    font-weight: bold;
}

/* Authors List */
.authors-list {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 15px; margin-bottom: 20px;
    width: 100%; max-width: 1200px;
}
.metal-card {
    background: rgba(20, 0, 0, 0.7); /* Trong suốt hơn để thấy video */
    border: 1px solid var(--gold);
    width: 200px; padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px); /* Làm mờ hậu cảnh */
}
.auth-name { margin: 5px 0; font-weight: bold; color: white; font-size: 1rem; }
.rank-badge { color: var(--gold); font-size: 0.8rem; font-weight: bold; text-transform: uppercase; }
.auth-role { font-size: 0.8rem; color: #ddd; font-style: italic; }

/* Button */
.epic-button {
    padding: 12px 40px; font-size: 1.1rem;
    font-family: 'Cinzel'; font-weight: bold;
    color: white; /* Chữ trắng cho nổi */
    background: rgba(180, 0, 0, 0.6); /* Nền đỏ trong suốt */
    border: 2px solid var(--gold);
    cursor: pointer; transition: 0.3s;
    box-shadow: 0 0 15px var(--gold);
    text-shadow: 0 0 5px black;
}
.epic-button:hover {
    background: var(--gold); color: black; text-shadow: none;
}

/* --- READER LAYER --- */
#reader-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 200; display: none; opacity: 0;
    background: rgba(0,0,0,0.95);
    justify-content: center; align-items: center;
}

.screen-frame {
    width: 100%; height: 100%; /* Full màn hình Reader */
    display: flex; flex-direction: column;
    position: relative;
    background: black;
}

.top-left-btn {
    position: absolute; top: 10px; left: 10px; z-index: 300;
    background: rgba(0,0,0,0.5); border: 1px solid var(--gold); color: var(--gold);
    font-family: 'Cinzel'; cursor: pointer; padding: 5px 10px;
    font-size: 0.8rem;
}

.image-viewer {
    flex-grow: 1; width: 100%;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.image-viewer img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}

.control-bar {
    height: 60px; display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #333; padding: 0 10px;
    background: #111; flex-shrink: 0;
}
.nav-btn {
    background: var(--deep-red); color: white; border: 1px solid var(--gold);
    width: 40px; height: 40px; /* Nút vuông dễ bấm trên mobile */
    cursor: pointer; font-size: 1.2rem; display: flex; justify-content: center; align-items: center;
    border-radius: 4px;
}
.page-counter { color: var(--gold); font-family: 'Cinzel'; font-size: 0.9rem; }


/* --- MOBILE RESPONSIVE (TỐI ƯU ĐIỆN THOẠI) --- */
@media screen and (max-width: 768px) {
    /* 1. Thu nhỏ Text */
    .gold-text { font-size: 1.5rem; margin: 5px 0; }
    .sub-title { font-size: 0.8rem; letter-spacing: 1px; }
    
    /* 2. Thu nhỏ Logo */
    .emblem-container { width: 100px; height: 100px; margin-bottom: 10px; }
    
    /* 3. Danh sách tác giả: Chuyển thành dạng lưới nhỏ hoặc xếp dọc */
    .authors-list {
        gap: 8px; margin-bottom: 15px;
        /* Trên điện thoại chỉ hiện tối đa 2 cột */
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }
    .metal-card {
        width: auto; /* Tự co giãn theo lưới */
        padding: 8px;
    }
    .auth-name { font-size: 0.85rem; }
    .auth-role { font-size: 0.7rem; display: none; /* Ẩn chức vụ trên mobile cho đỡ rối (tùy chọn) */ }
    
    /* 4. Tùy chỉnh nút bấm to ra cho ngón tay */
    .epic-button { width: 80%; padding: 15px 0; font-size: 1rem; margin-top: 10px;}

    /* 5. Reader Control */
    .control-bar { height: 70px; padding: 0 15px; }
    .nav-btn { width: 50px; height: 50px; font-size: 1.5rem; } /* Nút Next/Prev to hơn */
    .top-left-btn { font-size: 0.9rem; padding: 8px 15px; }
    
    /* 6. Fix lỗi bị che bởi thanh công cụ trình duyệt */
    #intro-layer { align-items: flex-start; padding-top: 20px; }
    .main-frame { justify-content: flex-start; overflow-y: auto; padding-bottom: 50px;}
}

/* Animation */
@keyframes spin { 100% { transform: rotate(360deg); } }