body {
    font-family: 'Cinzel', serif; /* Medieval-style font */
    text-align: center;
    background: url('images/medieval-bg.jpg') repeat-y center top; /* Allows vertical repeating */
    background-size: cover; /* Ensures full-screen width */
    background-attachment: scroll; /* Allows scrolling with the page */
    margin: 0;
    padding: 0;
}


/* Content Wrapper - Ensures Padding & Proper Wrapping */
.container {
    max-width: 80%;
    margin: 0 auto; /* Centers content */
    padding: 40px;
    box-sizing: border-box;
}

/* Heading Styles */
h1 {
    margin-top: 20px;
    font-size: 4rem; /* Adjusted for balance */
    color: #fff8dc;
    text-shadow: 2px 2px 5px #000;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* Paragraph Styling - Ensures Proper Text Wrapping */
p {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #3d2611;
    padding: 20px;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* 🔥 Fixed Button Styling - Consistent Width Across All Devices */
button, .btn, a.btn {
    display: inline-block;
    padding: 12px 20px; /* Standardized padding */
    font-size: 1rem;
    background: #6b4226;
    color: #fff8dc;
    border: 2px solid #8b5a2b;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
    width: auto; /* Ensures button fits text */
    min-width: 140px; /* Standardizes minimum size */
    text-align: center;
    white-space: nowrap;
}

/* Button Hover Effect */
button:hover, .btn:hover, a.btn:hover {
    background: #8b5a2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
    color: #ffffff;
}

/* 🔥 Mobile Button Fix - Consistent Button Width in Portrait & Landscape */
@media screen and (max-width: 768px) {
    button, .btn, a.btn {
        width: fit-content; /* Ensures buttons match text size */
        min-width: 120px; /* Prevents buttons from becoming too small */
        padding: 10px 16px;
    }
}

/* 🔥 Landscape Mode Fix (Prevents Overly Wide Buttons) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    button, .btn, a.btn {
        width: auto;
        min-width: 120px;
        padding: 10px 16px;
    }
}

/* List Styles */
ul {
    list-style: none;
    padding: 0;
}

/* List Item Styling - Adds Spacing */
li {
    margin: 15px;
    font-size: 1.2rem;
    color: #3d2611;
}

/* Ensure Text Does Not Touch Edges */
h1, li, button, .btn {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Centered Image Scaling */
.center-image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    padding-bottom: 5px;
}

/* Back Button Styling */
.back-btn {
    background: #444;
    border: 2px solid #666;
    margin-top: 25px;
}

.back-btn:hover {
    background: #666;
    color: white;
}

/* ============================= */
/* 🔥 RESPONSIVE DESIGN FIXES 🔥 */
/* ============================= */

/* Small screens (Phones & Small Tablets) */
@media screen and (max-width: 768px) {
    body {
        background-size: cover;
    }
    
    .container {
        max-width: 95%;
        padding: 20px;
    }

    h1 {
        font-size: 2.5rem;
    }

    p {
        font-size: 1.2rem;
        max-width: 90%;
    }

    button, .btn, a.btn {
        width: fit-content;
        min-width: 120px;
        padding: 12px 16px;
    }
}

/* Extra Small Screens (Narrow Phones) */
@media screen and (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    p {
        font-size: 1rem;
    }
}
