/* ==========================================================================
   1. ROOT VARIABLES
   ========================================================================== */
:root {
    /* Core colors */
    --main-bg-color: #121212;
    --dark-bg-color: #0a0a0a;
    --text-color: #ffffff;
    --highlight-color: #ff0000;
    --highlight-hover-color: #cc0000;

    /* Secondary colors */
    --border-color: rgba(255, 255, 255, 0.75);
    --overlay-bg: rgba(0, 0, 0, 0.25);
    --overlay-bg-hover: rgba(0, 0, 0, 0.8);
    --content-box-color: rgba(0, 0, 0, 0.65);
    --panel-bg-color: rgba(5, 5, 15, 0.85);

    /* Effects */
    --shadow-color: rgba(255, 0, 0, 0.5);
    --text-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
    --box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    --header-gradient: linear-gradient(90deg, rgba(255, 0, 0, 0.7), rgba(255, 60, 0, 0.9), rgba(255, 0, 60, 0.7));

    /* Input styles */
    --input-bg: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. BASE STYLES
   ========================================================================== */
body {
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--main-bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
    /* Ensure body scrolls for JS */
    font-size: 18px;
    scroll-behavior: smooth;
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */
header {
    background: url('images/SD_Header.png') no-repeat center center/cover;
    text-align: center;
    position: relative;
    height: 500px;
    padding-top: 60px;
    animation: fadeIn 2s ease-in-out;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    transition: background 0.3s;
}

header h1 {
    margin: 10px;
    margin-top: 10px;
    font-size: 5em;
    color: var(--text-color);
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 30px;
    animation: slideIn 1.5s ease-out;
    font-weight: bold;
}

header p {
    font-size: 1.5em;
    color: var(--text-color);
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    width: 75%;
}

/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */
nav {
    position: sticky;
    top: 0;
    background-color: var(--dark-bg-color);
    border-bottom: 1px solid var(--highlight-color);
    border-top: 1px solid var(--highlight-color);
    z-index: 100;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.2);
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 0;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    padding: 10px;
    transition: color 0.3s, transform 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul li a:hover,
nav ul li a:focus {
    color: var(--highlight-color);
    transform: translateY(-5px);
    outline: none;
}

nav #sticky-title {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    visibility: hidden;
    opacity: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-color);
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* ==========================================================================
   5. SECTIONS (General & Specific Backgrounds)
   ========================================================================== */
section {
    padding: 80px 20px;
    animation: fadeIn 2s ease-in-out;
    position: relative;
}

/* Base section style */
.overview,
.features,
.world,
.districts,
.about,
.news,
.newsletter,
.factions {
    position: relative;
    overflow: hidden;
}

/* Common section background effects */
.about,
.news,
.newsletter {
    margin: 0;
    padding: 100px 60px;
    width: 100%;
    min-height: 400px;
    background-color: #050510;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9)),
        url('images/SD_World.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
    will-change: background-position;
}

.about {
    text-align: center;
    padding: 100px 20px;
}

.about p {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
}

.about ul {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    display: inline-block;
}

.news,
.newsletter {
    text-align: center;
}

/* Section background effects */
.about::before,
.news::before,
.newsletter::before,
.features::before,
.world::before,
.districts::before,
.factions::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%,
            rgba(255, 0, 0, 0.05) 0%,
            transparent 50%),
        radial-gradient(circle at 80% 70%,
            rgba(0, 100, 255, 0.05) 0%,
            transparent 50%);
    z-index: 0;
    transition: all 0.5s ease;
}

/* Section hover effects */
.about:hover::before,
.news:hover::before,
.newsletter:hover::before,
.features:hover::before,
.world:hover::before,
.districts:hover::before,
.factions:hover::before {
    background: radial-gradient(circle at 20% 30%,
            rgba(255, 0, 0, 0.08) 0%,
            transparent 60%),
        radial-gradient(circle at 80% 70%,
            rgba(0, 100, 255, 0.08) 0%,
            transparent 60%);
    animation: pulseGradient 3s infinite alternate;
}

/* Section top borders */
.about::after,
.news::after,
.newsletter::after,
.features::after,
.world::after,
.districts::after,
.factions::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--shadow-color), transparent);
    z-index: 1;
}

/* Ensure section content appears above effects */
.about h2,
.about p,
.about ul,
.news h2,
.news p,
.districts h2,
.districts p,
.features h2,
.features p, /* Keep general p style */
.world h2,
.world p,
.newsletter h2,
.newsletter p,
.factions h2,
.factions p {
    position: relative;
    z-index: 2;
    text-shadow: var(--text-shadow);
}

/* Overview section */
.overview {
    background: var(--main-bg-color) url("images/SD_Overview.png") no-repeat center center;
    background-size: 130% auto;
    padding: 50px;
    padding-top: 80px;
    padding-bottom: 80px;
    display: flex;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    background-attachment: fixed;
    background-position: center 50%;
    /* Start at true center */
    min-height: 400px;
    will-change: background-position;
    /* Faster, smoother */
}

.overview::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--shadow-color), transparent);
    z-index: 2;
}

/* Feature section (Now Housing Showcase) */
.features {
    background: var(--main-bg-color) url("images/SD_Home.png") no-repeat center center;
    background-size: 130% auto;
    padding: 0; /* Remove padding, showcase will fill */
    /* display: flex; Removed flex */
    position: relative; /* Keep for absolute positioning children */
    overflow: hidden;
    /* background-attachment: fixed; */
    background-position: center 50%;
    min-height: 65vh; /* Reduced height */
    will-change: background-position;
    box-sizing: border-box;
}

/* Position title absolutely */
.features h2 {
    position: absolute;
    top: 80px; /* Position down from top edge */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3; /* Ensure title is above showcase */
    width: auto; /* Override potential full width from general h2 styles */
    display: inline-block; /* Ensure transform works correctly */
}

/* World section */
.world {
    background: var(--main-bg-color) url("images/SD_World.png") no-repeat center center;
    background-size: 130% auto;
    background-attachment: fixed;
    padding: 80px 50px;
    margin: 0;
    min-height: 400px;
    display: flex;
    justify-content: flex-end;
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
    overflow: hidden;
    background-position: center 50%;
    /* Start at true center */
    will-change: background-position;
}

/* Districts section */
.districts {
    padding: 80px 50px;
    margin: 0;
    color: white;
    text-align: center;
    background: var(--main-bg-color) url("images/SD_District.png") no-repeat center center/cover;
    background-attachment: fixed;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    background-position: center top;
    will-change: background-position;

}

/* Factions section */
.factions {
    padding: 100px 0;
    margin: 0;
    background-color: #050510;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9)),
        url("images/SD_World.png") no-repeat center center/cover;
    background-attachment: fixed;
    background-position: center top;
    min-height: 800px;
    text-align: center;
    position: relative;
    overflow: hidden;
    will-change: background-position;

}

/* Dark overlay for sections with background images */
.overview::before,
.features::before,
.world::before,
.districts::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1;
}

/* ==========================================================================
   6. PANELS AND CONTENT BOXES
   ========================================================================== */
/* Common panel styling */
.panel {
    background: var(--panel-bg-color);
    padding: 20px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 0, 0, 0.2),
        0 0 20px rgba(255, 0, 0, 0.15);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    transform: translateZ(0);
    overflow: hidden;
    z-index: 2;
}

/* Panel hover effects */
.panel:hover {
    transform: translateY(-10px) translateZ(20px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 0, 0, 0.3),
        0 0 30px rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
}

/* Panel header line */
.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--header-gradient);
    opacity: 0.9;
    transition: all 0.4s ease;
    z-index: 10;
}

/* Panel header icon */
.panel::after {
    content: "";
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background-image: url("images/SD_ContainerHeader.png");
    color: var(--border-color);
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 11;
}

.overview-box,
/* Removed .features .content-box */
.world .content-box {
    /* inherits base styles from .panel */
    flex: 1 1 calc(22% - 10px); /* This might need adjustment if overview/world use it */
    margin: 10px;
}

/* Content box hover effects */
/* Removed .features .content-box::after */
.world .content-box::after,
.overview-box::after {
    content: "";
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background-image: url("images/SD_ContainerHeader.png");
    color: var(--border-color);
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 11;
}

/* Shimmer effect for content boxes */
/* Removed .features .content-box::after */
.world .content-box::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 0, 0, 0.1) 50%,
            transparent 100%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Removed .features .content-box:hover::after */
.world .content-box:hover::after {
    opacity: 1;
    animation: shimmerSweepFixed 3s infinite linear;
}

/* Scanning effect */
/* Removed .features .content-box::before */
.world .content-box::before {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 0, 0, 0.1) 49%,
            rgba(255, 0, 0, 0.1) 50%,
            transparent 100%);
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Removed .features .content-box:hover::before */
.world .content-box:hover::before {
    opacity: 1;
    animation: scanLine 4s linear infinite;
}

/* Hover effects */
.overview-box:hover {
    cursor: pointer;
}

.overview-box:hover h3,
/* Removed .features h2:hover */
.world h2:hover {
    color: var(--highlight-color);
}

/* ==========================================================================
   7. HEADINGS
   ========================================================================== */
/* Main section titles */
.about h2,
.news h2,
.districts h2,
.newsletter h2,
.factions h2,
.features h2 { /* Added .features h2 back for the section title */
    text-transform: uppercase;
    font-size: 2em;
    letter-spacing: 8px;
    margin-bottom: 20px;
    transition: transform 0.3s, color 0.3s;
    text-shadow: 0 0 15px var(--shadow-color);
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.about h2 {
    display: block;
    text-align: center;
    width: 100%;
}

/* Secondary titles */
.overview-box h3,
/* Removed .features h2 */
.world h2,
.content-box h3,
.newsletter h3,
.faction-header h3 {
    text-transform: uppercase;
    font-size: 1.4em;
    letter-spacing: 2px;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 0 8px var(--shadow-color);
    position: relative;
    display: inline-block;
    font-weight: 700;
    overflow: hidden;
}

/* Scan effect for headings */
.overview-box h3::after,
.features h2::after, /* Keep general h2 style */
.world h2::after,
.content-box h3::after,
.newsletter h3::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    z-index: 1;
    transition: 0.5s;
}

.overview-box:hover h3::after,
.features:hover h2::after, /* Keep general h2 style */
.world:hover h2::after,
.content-box:hover h3::after,
.newsletter:hover h3::after {
    left: 100%;
}

/* Section title decorative elements */
.news h2::before,
.newsletter h2::before,
.about h2::before,
.districts h2::before,
.factions h2::before,
.features h2::before { /* Added .features h2 */
    content: "";
    position: absolute;
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--highlight-color));
    top: 50%;
    right: 100%;
    margin-right: 20px;
}

.about h2::after,
.news h2::after,
.newsletter h2::after,
.districts h2::after,
.factions h2::after,
.features h2::after { /* Added .features h2 */
    content: "";
    position: absolute;
    height: 1px;
    width: 60px;
    background: linear-gradient(-90deg, transparent, var(--highlight-color));
    top: 50%;
    left: 100%;
    margin-left: 20px;
}

/* Title hover animation */
.about h2:hover::after,
.news h2:hover::after,
.districts h2:hover::after,
.newsletter h2:hover::after,
.factions h2:hover::after,
.features h2:hover::after { /* Added .features h2 */
    opacity: 1;
    animation: scanLine 4s linear infinite;
}

.about h2:hover,
.news:hover h2,
.districts:hover h2,
.newsletter:hover h2,
.factions:hover h2,
.features:hover h2 { /* Added .features h2 */
    /* transform: translateX(10px); Removed transform */
    color: var(--highlight-color);
}

/* Secondary title hover effects */
.overview-box:hover h3,
.content-box:hover h3,
.newsletter:hover h3 {
    color: var(--highlight-color);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

/* ==========================================================================
   8. LISTS
   ========================================================================== */
.about ul,
.overview-box ul,
/* Removed .features ul */
.world ul {
    list-style: none;
    padding: 0;
}

.about ul li,
.overview-box ul li,
/* Removed .features ul li */
.world ul li {
    margin: 10px 0;
    padding-left: 30px;
    position: relative;
}

.about ul li {
    margin: 15px 0;
    line-height: 1.5;
}

.about ul li::before,
.overview-box ul li::before,
/* Removed .features ul li::before */
.world ul li::before {
    content: "◈";
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    color: var(--highlight-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about ul li::before {
    font-size: 1.2em;
    text-shadow: 0 0 5px var(--shadow-color);
}

/* ==========================================================================
   9. CONTENT BOX LAYOUT (World Section Only Now)
   ========================================================================== */
/* Removed .features from this rule */
.world {
    width: 100%;
    padding: 150px 0; /* This padding seems large, might need review */
    position: relative;
}

/* Removed .features .content-box rule */

.world .content-box {
    padding: 20px;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: 5%;
}

/* ==========================================================================
   9a. HOME SHOWCASE HORIZONTAL STYLES (New)
   ========================================================================== */
.home-showcase-horizontal {
    display: flex;
    position: absolute; /* Position absolutely to fill section */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%; /* Fill width */
    /* max-width: 1400px; Remove max-width, let section padding handle if needed */
    /* flex-grow: 1; Not needed with absolute positioning */
    margin: 0; /* Remove margin */
    z-index: 2; /* Below title */
    /* align-self: stretch; Not needed */
    overflow: hidden;
    border: none; /* Remove border, it's edge-to-edge now */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

.home-panel {
    flex: 1; /* Initial equal width */
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    /* filter: brightness(0.6); Removed initial brightness filter */
    transition: flex 0.6s cubic-bezier(0.645, 0.045, 0.355, 1); /* Removed filter transition here */
    cursor: pointer;
    border-right: 1px solid rgba(255, 0, 0, 0.2);
}
.home-panel:last-child {
    border-right: none;
}

/* Assign background images - Removed initial gradient */
.home-panel.low { background-image: url('images/SD_Home_Low.jpg'); }
.home-panel.medium { background-image: url('images/SD_Home_Medium.jpg'); }
.home-panel.high { background-image: url('images/SD_Home_High.jpg'); }

/* Add overlay for non-active/non-hover states */
.home-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.4); /* Adjust opacity as needed */
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: 1; /* Ensure overlay is above background image */
}

.panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: var(--text-color);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 20%, transparent 100%);
    transition: all 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-sizing: border-box;
    z-index: 2; /* Ensure content is above overlay */
}

.panel-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0,0,0,0.9);
    transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform: translateY(100px); /* Initially hidden */
    opacity: 0;
}

.panel-content .details {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease 0.3s, max-height 0.5s ease 0.3s; /* Delay appearance */
}

.panel-content .details p {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #ddd;
}

.panel-content .credit-cost {
    font-weight: bold;
    color: var(--highlight-color);
    text-shadow: 0 0 5px var(--shadow-color);
    font-size: 1.1em;
    text-align: right;
    margin-top: 15px;
}

/* Expanded state */
.home-panel.active {
    flex: 5; /* Grow significantly */
    /* filter: brightness(1); Removed brightness filter */
}
.home-panel.active::before {
    opacity: 0; /* Hide overlay when active */
}

.home-panel.active .panel-content h3 {
    transform: translateY(0);
    opacity: 1;
}

.home-panel.active .panel-content .details {
    opacity: 1;
    max-height: 200px; /* Allow space for details */
}

/* Hover effect for non-touch devices */
@media (hover: hover) {
    .home-panel:hover {
        flex: 5;
        /* filter: brightness(1); Removed brightness filter */
    }
     .home-panel:hover::before {
        opacity: 0; /* Hide overlay on hover */
    }
    .home-panel:hover .panel-content h3 {
        transform: translateY(0);
        opacity: 1;
    }
    .home-panel:hover .panel-content .details {
        opacity: 1;
        max-height: 200px;
    }
    /* Shrink others on hover */
    .home-showcase-horizontal:hover .home-panel:not(:hover) {
        flex: 0.5;
    }
    .home-showcase-horizontal:hover .home-panel:not(:hover) .panel-content h3,
    .home-showcase-horizontal:hover .home-panel:not(:hover) .panel-content .details {
        opacity: 0;
    }
}


/* ==========================================================================
   10. DIVIDERS
   ========================================================================== */
.divider {
    height: 1px;
    margin: 0;
    padding: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 0, 0, 0.7),
            rgba(255, 0, 0, 0.5),
            transparent);
    position: relative;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.divider::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: scanLine 4s linear infinite;
}

/* ==========================================================================
   11. DISTRICTS IMAGE GRID
   ========================================================================== */
.image-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 50px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slanted-container {
    position: relative;
    width: 20%;
    height: 450px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-left: -8%;
    z-index: 1;
    clip-path: polygon(45% 0%, 100% 0%, 55% 100%, 0% 100%);
    transition: width 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
        clip-path 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
        transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: width, clip-path, transform;
}

.slanted-container::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    will-change: opacity;
}

.slanted-container:hover::before {
    opacity: 1;
}

.slanted-container:hover {
    width: 35%;
    clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
    transform: translateY(-10px);
}

.slanted-container .slanted-image {
    position: absolute;
    width: 140%;
    height: 100%;
    object-fit: cover;
    transform: translateX(-15%);
    top: 0;
    left: 0;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    filter: brightness(0.75);
    z-index: 0;
    will-change: transform, filter;
    transform-origin: center center;
}

.slanted-container:hover .slanted-image {
    filter: brightness(1);
    transform: translateX(-15%) scale(1.05);
}

.slanted-container .slanted-text {
    position: absolute;
    text-align: left;
    bottom: 20px;
    left: 15%;
    right: 25%;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
    will-change: opacity, transform;
    pointer-events: none;
    visibility: hidden;
}

.slanted-container:hover .slanted-text {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
    visibility: visible;
}

.slanted-text h2 {
    text-transform: uppercase;
    font-size: 1.4em;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    position: relative;
    display: inline-block;
    font-weight: 700;
    color: var(--text-color);
    padding: 5px 0;
    transition: color 0.3s;
}

.slanted-container:hover .slanted-text h2::before {
    width: 100%;
}

.slanted-text p {
    font-size: 1.05em;
    width: 90%;
    text-align: left;
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   12. FACTION CONTAINER LAYOUT
   ========================================================================== */
.faction-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin: 50px auto;
    position: relative;
    z-index: 5;
    max-width: 1400px;
    padding: 0 30px;
    perspective: 2000px;
}

/* Faction panel styling */
.faction-panel {
    background: var(--panel-bg-color);
    padding: 20px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 0, 0, 0.2),
        0 0 20px rgba(255, 0, 0, 0.15);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    transform: translateZ(0);
    overflow: hidden;
    z-index: 2;
    height: 100%;
}

/* Panel hover effects applied to faction panels too */
.faction-panel:hover {
    transform: translateY(-10px) translateZ(20px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 0, 0, 0.3),
        0 0 30px rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
}

/* Panel header line for faction panels */
.faction-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--header-gradient);
    opacity: 0.9;
    transition: all 0.4s ease;
    z-index: 10;
}

/* Additional faction panel effects */
.faction-panel::after {
    content: "";
    position: absolute;
    bottom: -60%;
    left: -60%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.faction-panel:hover::before {
    background: var(--header-gradient);
    box-shadow: 0 0 20px var(--shadow-color);
}

.faction-panel:hover::after {
    opacity: 1;
    animation: pulseGlow 3s infinite;
}

/* Faction image styling */
.faction-image {
    height: 200px;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.faction-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0), rgba(255, 0, 0, 0.1));
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.faction-panel:hover .faction-image::before {
    opacity: 1;
}

.faction-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(30%) brightness(0.7) contrast(1.2) saturate(1.1);
    transform-origin: center center;
}

.faction-panel:hover .faction-image img {
    transform: scale(1.1);
    filter: grayscale(0%) brightness(1.1) contrast(1.4) saturate(1.4);
}

/* Scanning line effect for faction images */
.faction-image::after {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 0, 0, 0.1) 49%,
            rgba(255, 0, 0, 0.1) 50%,
            transparent 100%);
    z-index: 3;
    opacity: 0;
    animation: scanLine 4s linear infinite;
    pointer-events: none;
    transition: opacity 0.3s;
}

.faction-panel:hover .faction-image::after {
    opacity: 1;
}

/* Faction header */
.faction-header {
    padding: 22px 15px 18px;
    position: relative;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0, 0.3);
}

.faction-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            transparent 30%,
            rgba(255, 0, 0, 0.08) 100%);
    pointer-events: none;
}

.faction-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.4em;
    letter-spacing: 2px;
    position: relative;
    text-transform: uppercase;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    transition: text-shadow 0.3s, color 0.3s;
    text-align: center;
}

.faction-panel:hover .faction-header h3 {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.9);
}

.faction-header::after {
    content: "";
    position: absolute;
    left: 15px;
    bottom: -1px;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, var(--highlight-color), transparent);
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.faction-panel:hover .faction-header::after {
    width: calc(100% - 30px);
}

/* ==========================================================================
   13. FACTION CONTENT STYLING (Tabs, Traits, Panels)
   ========================================================================== */
.faction-content {
    padding: 0;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.faction-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at bottom right,
            rgba(255, 0, 0, 0.05),
            transparent 70%),
        radial-gradient(circle at top left,
            rgba(0, 100, 255, 0.03),
            transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: -1;
}

.faction-panel:hover .faction-content::before {
    opacity: 1;
}

/* Hide original info section */
.faction-info {
    display: none;
}

/* Faction tabs container */
.faction-tabs-container {
    width: 100%;
}

/* Tabbed interface styling */
.faction-tabs {
    display: flex;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
    width: 100%;
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(10, 0, 0, 0.2);
}

.faction-tabs::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 0, 0, 0.7),
            rgba(255, 0, 0, 0.5),
            transparent);
    z-index: 1;
}

.tab-button {
    flex: 1 1 0;
    min-width: 90px;
    max-width: 140px;
    border: none;
    background: rgba(10, 10, 25, 0.4);
    padding: 12px 5px;
    margin: 0;
    color: #ddd;
    font-size: 0.85em;
    font-family: "Rajdhani", sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.8px;
    outline: none;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    z-index: 2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tab-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            transparent 85%,
            rgba(255, 0, 0, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-button:hover::before {
    opacity: 1;
}

.tab-button::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--highlight-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.tab-button.active {
    color: var(--text-color);
    background: rgba(255, 0, 0, 0.15);
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    box-shadow: inset 0 0 15px rgba(255, 0, 0, 0.2);
}

.tab-button.active::after {
    width: 90%;
}

.tab-button:hover {
    color: var(--text-color);
    background-color: rgba(255, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Faction traits styling */
.faction-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    justify-content: flex-start;
}

.faction-traits span {
    background: linear-gradient(135deg,
            rgba(255, 0, 0, 0.15),
            rgba(255, 0, 0, 0.25));
    color: var(--text-color);
    font-size: 0.75em;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

.faction-traits span::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: 0.5s;
}

.faction-traits span:hover {
    background: linear-gradient(135deg,
            rgba(255, 0, 0, 0.2),
            rgba(255, 0, 0, 0.3));
    color: var(--text-color);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    transform: translateY(-2px);
}

.faction-traits span:hover::before {
    left: 100%;
}

/* Tab panel styling */
.tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 20px 18px;
    min-height: 210px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.2);
}

.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.4s ease-out;
    position: relative;
}

.tab-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--highlight-color), transparent);
    z-index: 1;
}

.tab-panel::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), transparent);
    z-index: 0;
    pointer-events: none;
}

.tab-panel.active::before {
    animation: shimmerGlow 3s infinite linear;
}

.tab-panel.active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 0, 0, 0.1) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmerSweepFixed 3s infinite linear;
    pointer-events: none;
    z-index: 1;
}

.tab-content {
    font-size: 1em;
    position: relative;
    max-width: 100%;
    padding: 5px 0;
    z-index: 2;
    pointer-events: auto;
}

.tab-content p {
    color: var(--text-color);
    margin-bottom: 15px;
    text-align: left;
    font-size: 1.05em;
}

.tab-content ul {
    list-style: none;
    padding: 0 0 0 5px;
    text-align: left;
    margin-top: 10px;
}

.tab-content ul li {
    margin: 10px 0;
    position: relative;
    padding-left: 20px;
    color: var(--text-color);
    font-size: 0.95em;
    line-height: 1.5;
}

.tab-content ul li::before {
    content: "›";
    position: absolute;
    left: 0;
    top: -1px;
    color: var(--highlight-color);
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0 0 5px var(--shadow-color);
}

/* ==========================================================================
   14. NEWSLETTER SECTION
   ========================================================================== */
.newsletter form {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.newsletter input {
    padding: 15px;
    width: 300px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    background-color: rgba(5, 5, 15, 0.85);
    color: var(--text-color);
    margin-right: 10px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.1);
    transition: all 0.3s;
    border-radius: 3px;
    font-family: "Rajdhani", sans-serif;
    font-size: 1em;
    letter-spacing: 1px;
}

.newsletter button {
    padding: 15px 30px;
    border: 1px solid rgba(255, 0, 0, 0.5);
    background: linear-gradient(135deg,
            rgba(255, 0, 0, 0.5),
            rgba(255, 0, 0, 0.8));
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    font-family: "Rajdhani", sans-serif;
}

.signup-message {
    margin-top: 10px;
    height: 20px;
}

/* ==========================================================================
   15. FOOTER
   ========================================================================== */
footer {
    background-color: #000;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(5, 0, 5, 1));
    text-align: center;
    padding: 20px;
    width: 100%;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 0, 0, 0.3);
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%,
            rgba(255, 0, 0, 0.05) 0%,
            transparent 50%),
        radial-gradient(circle at 80% 50%,
            rgba(0, 50, 255, 0.05) 0%,
            transparent 50%);
    z-index: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

footer p {
    margin: 0 20px;
}

.footer-donation {
    display: flex;
    align-items: center;
    font-size: 0.85em;
}

.footer-donation span {
    margin-right: 10px;
}

.donation-button-small {
    padding: 5px 10px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 0, 0, 0.5);
    background-color: transparent;
    color: rgba(255, 0, 0, 0.9);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 3px;
    margin: 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.donation-button-small::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: 0.5s;
    z-index: -1;
}

.donation-button-small:hover {
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    transform: translateY(-2px);
    border-color: rgba(255, 0, 0, 0.8);
}

.donation-button-small:hover::before {
    left: 100%;
}

.donation-message-small {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--highlight-color);
    margin-left: 5px;
}

footer .social-icons {
    display: flex;
    margin-right: 20px;
}

footer .social-icons a {
    margin-left: 15px;
    transition: transform 0.3s;
}

footer .social-icons img {
    width: 32px;
    height: 32px;
    transition: background-color 0.3s, transform 0.3s;
}

footer .social-icons a:hover img {
    transform: scale(1.2);
}

/* ==========================================================================
   16. BACK TO TOP BUTTON
   ========================================================================== */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(5, 5, 15, 0.85);
    color: var(--text-color);
    border: 1px solid rgba(255, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

#backToTop::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 0, 0.3);
    animation: pulse 2s infinite;
    z-index: -1;
}

#backToTop:hover {
    background-color: rgba(255, 0, 0, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.4);
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   17. SCAN EFFECTS (Visual Only)
   ========================================================================== */
.scan-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--shadow-color);
    z-index: 100;
    pointer-events: none;
    opacity: 0.7;
    box-shadow: 0 0 10px 2px var(--shadow-color);
}

.panel-scan-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.2), transparent);
    pointer-events: none;
    z-index: 5;
}

/* ==========================================================================
   18. ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scanLine {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(200%);
    }
}

@keyframes scanOverviewPanel {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

@keyframes pulseGradient {
    0% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes shimmerGlow {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes shimmerSweepFixed {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: 0% 0;
    }
}

@keyframes pulseGlow {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes floatHover {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes dataFlow {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

@keyframes glitch {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-5px, 5px);
    }

    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(5px, -5px);
    }

    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-5px, 5px);
    }

    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(5px, -5px);
    }

    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(5px, -5px);
    }

    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(-5px, 5px);
    }
}

@keyframes horizontalScan {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes verticalScan {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

@keyframes shimmerPulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.3;
    }
}

/* ==========================================================================
   19. RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 1400px) {
    .faction-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (max-width: 1200px) {
    .faction-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 0 15px;
    }

    .faction-panel {
        min-width: 0;
    }
    .home-showcase-horizontal {
        max-width: 95%; /* Adjust for slightly smaller screens */
    }
}

@media (max-width: 1000px) {
    .faction-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .home-showcase-horizontal {
        height: 400px; /* Adjust height */
    }
    .panel-content h3 {
        font-size: 1.3em;
    }
}

@media (max-width: 900px) {
    .faction-info {
        flex-direction: column;
        text-align: center;
    }

    .faction-info p {
        margin: 0 0 15px 0;
    }

    .faction-traits {
        justify-content: center;
    }
}

/* Fix black bar on scroll issue */
html,
body {
    height: 100%;
    overflow-x: hidden;
    background-color: var(--main-bg-color);
}

/* Prevent gaps between sections */
.divider {
    margin-bottom: -2px;
    position: relative;
    z-index: 5;
}

section {
    position: relative;
    margin-top: -1px;
    margin-bottom: -1px;
    padding-top: calc(80px + 1px);
    padding-bottom: calc(80px + 1px);
}

/* Small overlap to prevent black bars */
.features::before,
.world::before,
.districts::before,
.about::before,
.news::before,
.newsletter::before,
.factions::before {
    transform: translateY(-1px);
}

@media (max-width: 768px) { /* Adjust breakpoint for horizontal panel stacking */
    .home-showcase-horizontal {
        flex-direction: column;
        height: auto; /* Auto height when stacked */
        max-width: 600px; /* Limit width when stacked */
    }
    .home-panel {
        flex: 1; /* Reset flex basis */
        min-height: 150px; /* Give some initial height */
        border-right: none;
        border-bottom: 1px solid rgba(255, 0, 0, 0.2);
    }
     .home-panel:last-child {
        border-bottom: none;
    }
    .home-panel.active {
        flex: 1; /* Don't need extreme flex grow when stacked */
        min-height: 300px; /* Example expanded height */
    }
    .panel-content h3 {
        transform: translateY(0); /* Show title immediately */
        opacity: 1;
        padding-bottom: 10px; /* Add space below title */
    }
    .panel-content .details {
         transition: opacity 0.5s ease, max-height 0.5s ease; /* Remove delay */
    }
     .home-panel.active .panel-content .details {
        max-height: 300px; /* Adjust as needed */
    }

     /* Remove hover effects for stacked layout if relying on click */
    .home-showcase-horizontal:hover .home-panel:not(:hover) {
        flex: 1;
    }
     .home-showcase-horizontal:hover .home-panel:not(:hover) .panel-content h3,
    .home-showcase-horizontal:hover .home-panel:not(:hover) .panel-content .details {
        opacity: 1; /* Keep content visible */
    }
}


@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    .features,
    .world,
    .about,
    .news,
    .newsletter,
    .districts,
    .factions {
        background-attachment: fixed !important;
        background-size: cover;
        margin-bottom: -2px;
        margin-top: -2px;
        padding-bottom: calc(100px + 2px);
        padding-top: calc(100px + 2px);
        position: relative;
        z-index: 1;
    }

    header {
        height: 220px;
        padding-top: 15px;
    }

    header h1 {
        font-size: 2.5em;
        letter-spacing: 10px;
    }

    header p {
        font-size: 1em;
        width: 90%;
    }

    .slanted-container {
        width: 100%;
        height: auto;
        clip-path: none;
        margin: 20px auto;
        transition: none;
    }

    .slanted-container::before {
        opacity: 1;
        transition: none;
    }

    .slanted-container .slanted-image {
        width: 100%;
        height: auto;
        transform: none;
        filter: brightness(0.85);
        transition: none;
    }

    .slanted-text {
        opacity: 1;
        position: static;
        text-align: center;
        padding-top: 10px;
        transition: none;
    }

    .faction-container {
        grid-template-columns: 1fr;
    }

    .faction-image {
        height: 180px;
    }

    .factions h2 {
        font-size: 2em;
    }

    .factions h2::before,
    .factions h2::after {
        display: none;
    }

    #backToTop {
        bottom: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    /* Accordion mobile adjustments - REMOVED */
    /* Horizontal panel mobile adjustments */
     .home-showcase-horizontal {
        max-width: 90%; /* Further adjust width */
    }
     .panel-content h3 {
        font-size: 1.2em;
    }
     .panel-content .details p {
        font-size: 0.95em;
    }
}

/* Custom class for electronic interference effect */
.electronic-interference {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 2px,
            rgba(255, 0, 0, 0.03) 2px,
            rgba(255, 0, 0, 0.03) 4px);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}
