:root {
    --bg-dark: #0a0b0f; --bg-panel: #14161d; --bg-panel-light: #1c1f28;
    --border-color: #2a2f3a; --text-main: #e0e0e0; --text-muted: #8b8e99;
    --accent-gold: #c5a065; --accent-gold-glow: rgba(197, 160, 101, 0.2);
    --accent-red: #b93434;
}
* { box-sizing: border-box; }
body { margin: 0; background-color: var(--bg-dark); color: var(--text-main); font-family: 'Inter', sans-serif; overflow-x: hidden; }
.watermark { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="800" viewBox="0 0 800 800"><path fill="%2314161d" d="M400 100 L450 200 L550 200 L470 270 L500 400 L400 330 L300 400 L330 270 L250 200 L350 200 Z"/></svg>'); background-repeat: no-repeat; background-position: center; background-size: 600px; opacity: 0.4; z-index: -1; pointer-events: none; }
#app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background-color: #08090c; border-right: 1px solid var(--border-color); padding: 30px 20px; display: flex; flex-direction: column; }
.logo { 
    font-family: 'Cinzel', serif; 
    font-size: 24px; 
    color: var(--accent-gold); 
    margin-bottom: 5px; 
    text-align: center; 
    text-shadow: 0 0 10px var(--accent-gold-glow); 
}

.logo-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 35px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav ul li { padding: 12px 20px; margin-bottom: 3px; color: var(--text-muted); cursor: pointer; border-radius: 4px; font-weight: 600; border-left: 3px solid transparent; font-size: 14px; }
.sidebar nav ul li:hover, .sidebar nav ul li.active { color: var(--accent-gold); background-color: var(--bg-panel); border-left: 3px solid var(--accent-gold); }
.sidebar-footer { margin-top: auto; text-align: center; font-size: 12px; }
.sidebar-footer a { color: var(--text-muted); text-decoration: none; }
.main-content { flex: 1; padding: 30px 40px; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.player-info { display: flex; align-items: center; gap: 15px; }
.level-badge { background-color: var(--accent-gold); color: #000; padding: 5px 10px; border-radius: 4px; font-weight: 700; font-size: 14px; }
.xp-bar-container { width: 250px; height: 8px; background-color: var(--bg-panel); border-radius: 4px; overflow: hidden; }
.xp-bar-fill { height: 100%; width: 0%; background-color: var(--accent-gold); box-shadow: 0 0 10px var(--accent-gold-glow); transition: width 0.5s ease; }
.xp-text { font-size: 12px; color: var(--text-muted); }
.resources-bar { display: flex; gap: 20px; }
.resource-item { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.r-icon { font-size: 18px; color: var(--accent-gold); }
.tab-content { display: none; }
.tab-content.active-tab { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.content-grid { display: flex; gap: 30px; }
.column { flex: 1; }
.main-column { flex: 2; }
.side-column { flex: 1; }
.panel { background-color: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; padding: 25px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.panel-title { font-family: 'Cinzel', serif; color: var(--accent-gold); margin-top: 0; margin-bottom: 20px; font-size: 18px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.loader { color: var(--text-muted); text-align: center; padding: 20px; }
.scripture-text {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    border-left: 2px solid var(--accent-gold);
    padding-left: 20px;
    margin: 0 0 15px 0;
    display: block;
}
.scripture-ref {
    display: block;
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}
.action-area { margin-top: 25px; display: flex; gap: 15px; }
.btn-primary { background-color: var(--accent-gold); color: #000; border: none; padding: 12px 24px; cursor: pointer; border-radius: 4px; font-weight: 700; transition: all 0.2s; }
.btn-primary:hover { box-shadow: 0 0 15px var(--accent-gold-glow); transform: translateY(-1px); }
.btn-secondary { background-color: transparent; color: var(--text-muted); border: 1px solid var(--border-color); padding: 12px 24px; cursor: pointer; border-radius: 4px; font-weight: 600; }
.btn-secondary:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.stat-box { background-color: var(--bg-panel-light); padding: 15px; border-radius: 4px; text-align: center; border: 1px solid var(--border-color); }
.stat-box span { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 5px; }
.stat-box strong { font-size: 20px; color: var(--accent-gold); }
.leaderboard { padding: 0; margin: 0; list-style: none; }
.leaderboard li { padding: 10px 0; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; font-size: 14px; }
.chat-box { height: 250px; overflow-y: auto; background-color: var(--bg-panel-light); border-radius: 4px; padding: 15px; margin-bottom: 15px; font-size: 13px; }
.chat-box div { margin-bottom: 8px; line-height: 1.4; }
.chat-box b { color: var(--accent-gold); }
.chat-input-area { display: flex; gap: 10px; }
.chat-input-area input { flex: 1; background-color: var(--bg-panel-light); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px; border-radius: 4px; }
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar input { flex: 1; background-color: var(--bg-panel-light); border: 1px solid var(--border-color); color: var(--text-main); padding: 12px; border-radius: 4px; }
.bible-reader-text { line-height: 1.8; font-family: 'Cinzel', serif; font-size: 16px; max-height: 60vh; overflow-y: auto; padding-right: 15px; }
.bible-reader-text p { margin-bottom: 12px; }
.bible-reader-text sup { color: var(--accent-gold); font-size: 12px; font-weight: 700; margin-right: 6px; font-family: 'Inter', sans-serif; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border-color); }
#pagination-info { font-family: 'Cinzel', serif; color: var(--accent-gold); font-size: 14px; }
.deeds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.deed-card { background-color: var(--bg-panel-light); border: 1px solid var(--border-color); padding: 20px; border-radius: 8px; }
.deed-card h4 { color: var(--accent-gold); margin-top: 0; margin-bottom: 10px; font-family: 'Cinzel', serif; }
.deed-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; min-height: 35px; }
.deed-stats { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 12px; }
.deed-cost { color: #ff4d4d; } .deed-reward { color: var(--accent-gold); }
.deed-btn { width: 100%; background: var(--accent-gold); color: #000; border: none; padding: 10px; border-radius: 4px; font-weight: bold; cursor: pointer; }
.deed-btn:disabled { background: var(--border-color); color: var(--text-muted); cursor: not-allowed; }
.quest-container { display: flex; gap: 30px; }
.map-panel { flex: 2; } .quest-log-panel { flex: 1; }
.map-visual { height: 200px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--border-color); }
.quest-tile-desc { line-height: 1.6; font-style: italic; margin-bottom: 30px; min-height: 60px; }
.compass-container { display: flex; flex-direction: column; align-items: center; }
.compass-middle { display: flex; align-items: center; gap: 40px; }
.compass-btn { background: var(--bg-panel-light); border: 1px solid var(--border-color); color: var(--accent-gold); width: 50px; height: 50px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.compass-btn:hover { border-color: var(--accent-gold); box-shadow: 0 0 15px var(--accent-gold-glow); }
.compass-center { width: 40px; height: 40px; background: var(--accent-gold); border-radius: 50%; box-shadow: 0 0 20px var(--accent-gold); }
.quest-content { text-align: center; } .quest-desc { color: var(--text-muted); margin-bottom: 20px; }
.quest-bar-container { width: 100%; height: 12px; background: var(--bg-panel-light); border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.quest-bar-fill { height: 100%; background: var(--accent-gold); width: 0%; transition: width 0.5s; }
.quest-reward { font-family: 'Cinzel', serif; color: var(--accent-gold); margin-bottom: 20px; display: block; }
.btn-claim-quest { width: 100%; background: var(--accent-gold); color: #000; border: none; padding: 12px; border-radius: 4px; font-weight: bold; cursor: pointer; }
.pvp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pvp-card { background: var(--bg-panel-light); border: 1px solid var(--border-color); padding: 20px; border-radius: 8px; text-align: center; }
.pvp-card h4 { color: var(--accent-gold); margin-top: 0; }
.pvp-attack-btn { background: var(--accent-red); color: #fff; border: none; padding: 10px; width: 100%; border-radius: 4px; font-weight: bold; cursor: pointer; margin-top: 10px; }
.raid-panel { text-align: center; }
.boss-name { font-family: 'Cinzel', serif; font-size: 28px; color: var(--accent-red); margin-bottom: 10px; }
.boss-hp-bar { height: 20px; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--accent-red); margin-bottom: 20px; }
.boss-hp-fill { height: 100%; background: var(--accent-red); width: 100%; transition: width 0.5s; }
.forge-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.forge-btn { background: var(--bg-panel-light); border: 1px solid var(--border-color); color: var(--accent-gold); padding: 15px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.forge-btn:hover { border-color: var(--accent-gold); }
.bank-grid { display: flex; gap: 40px; justify-content: center; margin-bottom: 20px; }
.bank-grid h4 { color: var(--text-muted); }
.combat-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 100; justify-content: center; align-items: center; }
.combat-overlay.active { display: flex; }
.combat-modal { background: #1a0505; border: 2px solid #b93434; box-shadow: 0 0 30px rgba(185, 52, 52, 0.3); width: 100%; max-width: 500px; padding: 30px; border-radius: 8px; text-align: center; }
.combat-title { color: #ff4d4d; font-family: 'Cinzel', serif; font-size: 26px; }
.combat-intro { color: #ccc; font-style: italic; margin-bottom: 20px; font-size: 14px; }
.hp-bar { height: 12px; background: #000; border-radius: 6px; overflow: hidden; margin-bottom: 20px; border: 1px solid #333; }
.hp-bar-fill { height: 100%; transition: width 0.3s; }
.enemy-hp { background: #b93434; }
.combat-log { color: #e0e0e0; min-height: 40px; margin-bottom: 20px; font-size: 14px; }
.combat-verse-list { display: flex; flex-direction: column; gap: 10px; max-height: 200px; overflow-y: auto; }
.combat-verse-btn { background: #14161d; border: 1px solid #c5a065; color: #c5a065; padding: 10px; border-radius: 4px; cursor: pointer; font-family: 'Cinzel', serif; }
::-webkit-scrollbar { width: 5px; } ::-webkit-scrollbar-track { background: var(--bg-dark); } ::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
/* --- MOBILE RESPONSIVENESS --- */

.mobile-toggle {
    display: none; /* Hidden on desktop */
    font-size: 24px;
    cursor: pointer;
    color: var(--accent-gold);
    margin-right: 15px;
}

.mobile-header-left {
    display: flex;
    align-items: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 40;
}
.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    
    /* Sidebar becomes a slide-out drawer */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 250px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.active {
        transform: translateX(0);
    }

    /* Main content takes full width */
    .main-content {
        padding: 15px;
        width: 100%;
    }

    /* Top bar stacks */
    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .mobile-header-left {
        justify-content: space-between;
    }
    .xp-bar-container {
        width: 100%;
        flex: 1;
    }
    .resources-bar {
        justify-content: space-around;
    }

    /* All Grids stack into 1 column */
    .content-grid, .quest-container {
        flex-direction: column;
    }
    .stats-grid, .deeds-grid, .pvp-grid, .forge-grid {
        grid-template-columns: 1fr;
    }

    /* Panels get less padding */
    .panel {
        padding: 15px;
    }

    /* Scripture font slightly smaller */
    .scripture-text {
        font-size: 18px;
    }

    /* Combat modal fits screen */
    .combat-modal {
        width: 95%;
        padding: 20px;
    }
    
    /* Pagination bar stacks */
    .pagination-bar {
        flex-direction: column;
        gap: 10px;
    }

    /* Bank grid stacks */
    .bank-grid {
        flex-direction: column;
        gap: 20px;
    }

    /* Search bar stacks */
    .search-bar {
        flex-direction: column;
    }
    .search-bar button {
        width: 100%;
    }
}
/* NPC Ministry System */
.npc-overlay {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.9); z-index:100; justify-content:center; align-items:center;
}
.npc-overlay.active { display:flex; }
.npc-modal {
    background: #0a0b0f; border: 2px solid #c5a065;
    box-shadow: 0 0 30px rgba(197, 160, 101, 0.3);
    width: 100%; max-width: 500px; padding: 30px; border-radius: 8px; text-align: center;
}
.npc-title { color: #c5a065; font-family: 'Cinzel', serif; font-size: 26px; margin-bottom: 15px; }
.npc-visual {
    height: 120px; border-radius: 8px; margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: background 1s ease;
}
.npc-desc { color: #ccc; font-style: italic; margin-bottom: 25px; font-size: 14px; line-height: 1.6; }
.npc-actions { display: flex; flex-direction: column; gap: 10px; }
.npc-choice-btn {
    background: #14161d; border: 1px solid #c5a065; color: #e0e0e0;
    padding: 12px; border-radius: 4px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.npc-choice-btn:hover { background: #c5a065; color: #000; }
.npc-result-text { color: #c5a065; font-family: 'Cinzel', serif; font-size: 16px; margin: 20px 0; }
.daily-item {
    display: flex; justify-content: space-between; padding: 15px; 
    background: var(--bg-panel-light); border: 1px solid var(--border-color); 
    border-radius: 4px; margin-bottom: 10px; font-weight: 600;
}
/* --- AUTH PAGES (LOGIN / REGISTER) --- */

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 350px; /* Keeps it neat on desktop */
}

.auth-panel {
    padding: 30px 25px;
}

.auth-panel h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--text-main);
    font-family: 'Cinzel', serif;
}

.auth-form input {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel-light);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.auth-form .btn-primary {
    width: 100%;
    margin-top: 10px;
}

/* Mobile adjustments for Auth pages */
@media (max-width: 768px) {
    .auth-container {
        max-width: 100%; /* Allow form to use full width on small phones */
    }
    .auth-panel {
        padding: 20px 15px; /* Slightly tighter padding on mobile */
    }
}

/* Guild List & Profiles */
.guild-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.guild-card { background: var(--bg-panel-light); padding: 15px; border-radius: 6px; border: 1px solid var(--border-color); }
.guild-card h4 { color: var(--accent-gold); margin: 0 0 5px 0; }
.guild-card p { font-size: 12px; color: var(--text-muted); margin: 0 0 10px 0; }
.profile-item-tag { background: var(--bg-panel-light); border: 1px solid var(--accent-gold); color: var(--accent-gold); padding: 5px 10px; border-radius: 4px; font-size: 12px; }
.chat-user { cursor: pointer; text-decoration: underline; }
.chat-user:hover { color: #fff; }



.codex-list { display: flex; flex-direction: column; gap: 20px; }
.codex-item {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-panel-light);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-gold);
    margin-bottom: 15px;
}
.codex-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.codex-stat-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-panel-light);
}

/* Image System */
.page-banner {
    width: 100%;
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.boss-image-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px auto;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 2px solid var(--accent-red);
    box-shadow: 0 0 20px rgba(185, 52, 52, 0.3);
}
.deed-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}
.forge-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    border: 1px solid var(--accent-gold);
}
.stat-icon {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

/* --- MOBILE SCROLL & UI FIXES --- */

/* 1. Fix Sidebar Scrolling on Mobile */
@media (max-width: 768px) {
    .sidebar {
        overflow-y: auto; /* Allow the menu to scroll! */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iPhone */
        padding-bottom: 50px; /* Space at the bottom so it doesn't get stuck */
    }
    
    /* 2. Fix Modals (Profiles, Combat, NPC) cutting off on Mobile */
    .npc-overlay, .combat-overlay {
        align-items: flex-start; /* Align modal to top instead of dead center */
        padding: 20px 0; /* Add space at top/bottom for scrolling */
        overflow-y: auto; /* Allow the overlay to scroll */
        -webkit-overflow-scrolling: touch;
    }
    
    .npc-modal, .combat-modal {
        max-height: 90vh; /* Modal can never be taller than 90% of the screen */
        overflow-y: auto; /* If content is too long, modal scrolls internally */
        width: 95%;
        padding: 20px;
    }
    
    /* 3. Ensure main game content can always scroll */
    .main-content {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }
    
    /* 4. Make sure Profile action buttons are always reachable */
    #profile-actions {
        position: sticky;
        bottom: 0;
        background: #0a0b0f;
        padding-top: 15px;
        margin-top: 20px;
    }
    
    /* 5. Fix the Prayer/Testimony Gates text areas on mobile */
    #gates .quest-container {
        gap: 20px;
    }
    
    /* 6. Fix Forge grids on mobile so they don't squish */
    .forge-grid {
        grid-template-columns: 1fr;
    }
}

/* Armory */
.armory-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.armory-slot { background: var(--bg-panel-light); border: 1px solid var(--border-color); padding: 20px; border-radius: 8px; text-align: center; cursor: pointer; transition: all 0.2s; }
.armory-slot:hover { border-color: var(--accent-gold); }
.armory-slot h4 { color: var(--accent-gold); margin-top: 0; text-transform: capitalize; }
.armory-slot p { font-size: 12px; color: var(--text-muted); margin: 5px 0 0 0; }
.armory-slot.equipped { border-color: var(--accent-gold); background: rgba(197, 160, 101, 0.1); box-shadow: 0 0 10px var(--accent-gold-glow); }

/* Titles */
.title-tag { font-size: 10px; color: var(--accent-gold); font-weight: 700; text-transform: uppercase; margin-right: 5px; }
.title-select { width: 100%; background: var(--bg-panel-light); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px; border-radius: 4px; margin-bottom: 15px; }

    /* 6. Fix Forge grids on mobile so they don't squish */
    .forge-grid,
    .armory-grid {
        grid-template-columns: 1fr;
    }
    
    /* 7. Fix Armory text wrapping */
    .armory-slot {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }























