/* --- Base Styles --- */
body {
    font-family: serif;
    margin: 0;
    display: flex;
    height: 100vh;
    background-color: #1a1a1a;
    color: #e0e0e0;
    
    /* Background Image Handling */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
}

#sidebar {
    width: 300px;
    background-color: rgba(34, 34, 34, 0.95); /* Dark semi-transparent box */
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
}

#story-section {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    line-height: 1.6;
    max-width: 800px;
    
    /* Text Overlay Box (Makes text readable on images) */
    margin: 20px auto;
    background-color: rgba(0, 0, 0, 0.85); 
    border-radius: 10px;
    border: 1px solid #444;
}

/* --- Avatar & Info --- */
#character-display {
    width: 150px;
    height: 150px;
    background-color: #444;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid #555;
    overflow: hidden;
    flex-shrink: 0; /* Prevents squishing */
}

#character-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#character-info {
    width: 100%;
    margin-bottom: 20px;
}

#character-info p {
    margin: 5px 0;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* --- Buttons --- */
.sidebar-button {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #3a3a3a;
    color: #e0e0e0;
    border: none;
    border-left: 4px solid transparent;
    text-align: left;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-button:hover {
    background-color: #505050;
    border-left-color: #a0a0a0;
    padding-left: 20px;
}

#sidebar-bottom-buttons {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Story & Choices --- */
.chapter-title {
    color: #ffd700;
    text-align: center;
    text-shadow: 2px 2px 4px #000;
}

.choice-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background-color: rgba(51, 51, 51, 0.9);
    color: #fff;
    border: 1px solid #555;
    cursor: pointer;
}

.choice-btn:hover {
    background-color: #666;
    border-color: #999;
}

/* --- Inventory Grid --- */
.inventory-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.inventory-item {
    display: flex;
    align-items: center;
    background-color: #333;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
}

.inventory-item-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border: 1px solid #555;
}

.inventory-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- MOBILE MENU BUTTON (Fixed & Small) --- */
#mobile-menu-btn {
    display: none; /* 1. HIDDEN ON PC by default */
    position: fixed; /* 2. FLOATS on top (removes it from flex layout) */
    top: 10px;
    left: 10px;
    z-index: 2000; /* Stays above everything */
    
    /* Small, Clean Styling */
    background-color: #222;
    color: #ffd700;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 5px 8px; /* Small padding */
    font-size: 1.2rem; /* Icon size */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* --- MOBILE SPECIFIC STYLES --- */
@media (max-width: 768px) {
    
    /* 1. Show the button ONLY on mobile */
    #mobile-menu-btn {
        display: block; 
    }

    /* 2. Sidebar Logic (Hidden by default on mobile) */
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        background-color: rgba(20, 20, 20, 0.98);
        
        /* Slide logic */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1500;
        box-shadow: 2px 0 10px rgba(0,0,0,0.8);
    }

    /* Class added by JS to show sidebar */
    #sidebar.active {
        transform: translateX(0);
    }

    /* 3. Adjust Story Section for Mobile */
    #story-section {
        margin: 0; /* Reset margins */
        padding: 60px 20px 20px 20px; /* Add top padding so text isn't behind the button */
        width: 100%;
        max-width: none;
    }

    /* 4. Readable Text Sizes */
    body { font-size: 16px; }
    .chapter-title { font-size: 1.8em; }
    .choice-btn { padding: 12px; }
}