body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Changed to min-height to prevent cutoff on tall screens */
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: #1a1a2e; /* Professional dark navy text for better contrast */
    font-weight: 400; /* Base weight; 600 for headings */
    line-height: 1.6; /* Improved readability */
    background-color: #f8f9fa; /* Light gray fallback for all pages */
}

/* Styling for the background video in all pages */
#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Centers and scales video */
    z-index: -1; /* Behind content */
    opacity: 0.3; /* 30% opacity on desktop */
}

/* Sticky Top Navigation */
.top-nav {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    padding: 1em;
    text-align: center;
    z-index: 10;
}
.top-nav .btn {
    margin: 0 0.5em;
    padding: 0.5em 1em;
    font-size: 14px;
    text-decoration: none;
}

/* Section styling for consistent layout */
.section {
    margin: 2em 0;
    padding: 1.5em;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button classes */
.btn-primary {
    background: #C71585; /* Berry violet-red */
    color: white;
}
.btn-primary:hover {
    background: #A52A2A; /* Darker red */
}
.btn-secondary {
    background: #FF69B4; /* Hot pink accent */
    color: white;
}
.btn-secondary:hover {
    background: #FF1493; /* Deeper pink */
}

/* Mobile adjustments for background visibility and professional look */
@media (max-width: 768px) {
    #background-video {
        opacity: 0.5; /* Increased transparency on mobile for clearer animation view */
    }
    body {
        background-color: #1a1a2e; /* Navy background on mobile for professional dark mode */
        color: #f8f9fa; /* Light text for contrast */
    }
    td.middle {
        background-color: rgba(248, 249, 250, 0.95); /* Near-opaque light gray card on mobile for readability over video */
        padding: 40px; /* Reduced cell padding on mobile for better content fit and visibility without excessive spacing */
        color: #1a1a2e; /* Ensure dark text in middle cell for high contrast on light background */
    }
    button, .top-nav .btn {
        background-color: #1a1a2e; /* Black background on mobile */
        color: white !important; /* White text on mobile - forced visibility */
        display: block !important; /* Ensure button is always visible */
        width: 100%; /* Full-width on mobile */
        margin: 0.5em 0;
    }
    button:active, .btn:active {
        color: #FF69B4 !important; /* Hot pink text on press */
    }
    .metamask-btn {
        background-color: #C71585 !important; /* Berry primary */
        color: white !important; /* White text */
    }
    .metamask-btn:active {
        color: #FF69B4 !important; /* Pink on press */
    }
    .steps li {
        background: rgba(255, 255, 255, 0.9); /* Opaque white background on mobile for clear readability */
        color: #1a1a2e; /* Dark text for high contrast against light background */
        border-left-color: #C71585; /* Maintain berry accent bar */
    }
    .middle div, .steps {
        color: #1a1a2e; /* Override to dark text for all instructional content in middle cell */
    }
}

/* Background color for index.html */
body.index {
    background-color: #C71585; /* Berry violet-red */
    /* background-image: url('BACKGROUND-fallback.jpg'); */ /* Optional fallback */
}

/* Background color for staking.html */
body.staking {
    background-color: #C71585; /* Berry violet-red override */
    /* background-image: url('STAKING-fallback.jpg'); */ /* Optional fallback */
}

/* Background color for contact.html */
body.contact {
    background-color: #C71585; /* Berry violet-red */
    /* background-image: url('CONTACT-fallback.jpg'); */ /* Optional fallback */
}

table {
    width: 100%;
    height: 100%;
    border-spacing: 0;
    padding: 0;
    overflow: auto; /* Allow scrolling if content overflows */
}

td {
    width: 33.3%;
    height: 33.3%;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

td.middle {
    text-align: left;
    background-color: rgba(255, 255, 255, 0.8); /* Slightly less transparent for better readability */
    padding: 30px 20px 20px 30px; /* Adjusted padding for desktop: balanced spacing without excess */
    box-sizing: border-box;
    border-radius: 12px; /* Soft rounded corners for modern feel */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth, like an app card */
}

.middle div {
    margin-left: auto;
    margin-right: auto;
    color: black;
    font-weight: 400; /* Base weight */
}

h1, h2, h3 { 
    color: #C71585; /* Berry primary for headings */
    font-weight: 600; /* Bolder headings */
}
p { 
    line-height: 1.6; /* Better readability */
}

/* General button styling (overrides for mobile in media query) */
button {
    padding: 10px 20px;
    margin: 5px;
    background: #C71585; /* Berry default */
    color: white; /* White text default */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

button:hover {
    background: #A52A2A; /* Darker berry on hover */
}

button:active {
    color: #FF69B4; /* Pink text on press */
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Specific MetaMask connect button */
.metamask-btn {
    background-color: #C71585; /* Berry primary */
    color: white; /* White text */
}

.metamask-btn:active {
    color: #FF69B4; /* Pink on press */
}

/* Navigation buttons (home, contact, etc.) */
.nav-btn {
    background-color: #FF69B4; /* Pink for navigation buttons */
    color: white;
    padding: 8px 16px;
    margin: 5px;
    font-size: 14px;
}

.nav-btn:hover {
    background-color: #FF1493; /* Deeper pink on hover */
}

.nav-btn:active {
    color: #fff; /* White on press for nav */
}

/* Steps list */
.steps {
    list-style-position: inside;
    padding-left: 0;
}
.steps li {
    margin: 10px 0;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    border-left: 4px solid #C71585; /* Berry accent bar */
}