/* Empyrea Civilization Styling */

/* Text brightness breathing animation */
@keyframes textBrightnessBreath {
    0% {
        filter: brightness(0.9);
    }
    50% {
        filter: brightness(1.4);
    }
    100% {
        filter: brightness(0.9);
    }
}

@keyframes fall {
    0% {
        transform: translateY(0) translateX(0) rotate(var(--rotation, 0deg)) scaleX(var(--scaleX, 1));
        opacity: 1;
    }
    50% {
        transform: translateY(145vh) translateX(var(--drift)) rotate(calc(var(--rotation, 0deg) + 180deg)) scaleX(var(--scaleX, 1));
        opacity: 1;
    }
    80% {
        transform: translateY(232vh) translateX(0) rotate(calc(var(--rotation, 0deg) + 360deg)) scaleX(var(--scaleX, 1));
        opacity: 1;
    }
    100% {
        transform: translateY(290vh) translateX(0) rotate(calc(var(--rotation, 0deg) + 360deg)) scaleX(var(--scaleX, 1));
        opacity: 0;
    }
}

#leaf-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.falling-leaf {
    position: fixed;
    width: 50px;
    height: 50px;
    background: url('../images/leaf.png') center/contain no-repeat;
    pointer-events: none;
    z-index: 0;
    margin: 0;
    padding: 0;
    margin-left: -25px;
    top: 0;
}

.empyrea-body {
    background: linear-gradient(135deg, #1a2620 0%, #0f1815 50%, #1a2620 100%);
    background-attachment: fixed;
}

.empyrea-body::before {
    animation: breathing 6s ease-in-out infinite;
}

/* Empyrea Theme Colors */
.empyrea-body .navbar {
    background: rgba(15, 24, 21, 0.95);
    border-bottom-color: #d4af37;
}

.empyrea-body footer {
    background: rgba(15, 24, 21, 0.98);
    border-top-color: #d4af37;
}

.empyrea-body footer a {
    color: #d4af37;
}

.empyrea-body footer a:hover {
    color: #f5c547;
}

/* Staggered Image Layout */
.staggered-image-left,
.staggered-image-right {
    width: 100%;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    background: transparent;
}

.staggered-image-left {
    justify-content: flex-start;
}

.staggered-image-left img {
    width: 45%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.staggered-image-left img:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.staggered-image-right {
    justify-content: flex-end;
}

.staggered-image-right img {
    width: 45%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.staggered-image-right img:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.image-text {
    flex: 1;
    padding: 1rem;
    text-align: center;
}

.image-text h3 {
    color: #5faa6f;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(95, 170, 111, 0.5), 0 0 20px rgba(95, 170, 111, 0.3);
    animation: textBrightnessBreath 6s ease-in-out infinite;
}

.image-text p {
    color: #d0d0d0;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* God-rays effect */
.god-rays {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    animation: godRays 8s ease-in-out 3s infinite;
    pointer-events: none;
}

@keyframes godRays {
    0%, 100% {
        opacity: 0;
        background: none;
    }
    50% {
        opacity: 0.15;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 25%,
            transparent 40%,
            rgba(255, 255, 255, 0.08) 60%,
            transparent 80%,
            rgba(255, 255, 255, 0.1) 100%
        );
    }
}

/* Empyrea Header */
.empyrea-header {
    position: relative;
    overflow: hidden;
}

.empyrea-header .container {
    max-width: 55%;
    margin-left: 0;
    text-align: left;
}

.empyrea-header .god-rays {
    animation: godRays 10s ease-in-out 2s infinite;
}

.empyrea-header h1 {
    color: #5faa6f;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 10px rgba(95, 170, 111, 0.6), 0 0 20px rgba(95, 170, 111, 0.4), 0 0 30px rgba(95, 170, 111, 0.2);
}

.empyrea-header p {
    color: #7dd185;
}

/* Intro Section */
.empyrea-intro {
    background: #0f1815;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" result="noise" seed="2" /></filter><rect width="100" height="100" fill="%230f1815" filter="url(%23noise)" opacity="0.08"/></svg>');
    border-bottom: 2px solid rgba(95, 170, 111, 0.3);
}

.empyrea-intro .container {
    max-width: 55%;
    text-align: left;
    margin-left: 0;
}

.empyrea-intro h2 {
    color: #5faa6f;
}

.empyrea-intro p {
    color: #d8e8dc;
}

/* Features Section */
.empyrea-features {
    background: #0f1815;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" result="noise" seed="2" /></filter><rect width="100" height="100" fill="%230f1815" filter="url(%23noise)" opacity="0.08"/></svg>');
    border-top: 2px solid rgba(95, 170, 111, 0.3);
    border-bottom: 2px solid rgba(95, 170, 111, 0.3);
}

.empyrea-features h2 {
    color: #5faa6f;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.empyrea-features .feature-box {
    background: linear-gradient(135deg, rgba(95, 170, 111, 0.15) 0%, rgba(26, 38, 32, 0.8) 100%);
    border-left: 4px solid #5faa6f;
    border-radius: 4px;
    padding: clamp(1rem, 3vw, 2rem);
    transition: all 0.3s ease;
}

.empyrea-features .feature-box:hover {
    background: linear-gradient(135deg, rgba(95, 170, 111, 0.25) 0%, rgba(26, 38, 32, 0.9) 100%);
    box-shadow: 0 8px 20px rgba(95, 170, 111, 0.2);
    transform: translateY(-3px);
}

.empyrea-features .feature-box h3 {
    color: #7dd185;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.empyrea-features .feature-box p {
    color: #d8e8dc;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
}

@media (min-width: 1135px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Magic Section */
.empyrea-magic {
    background: #0f1815;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.empyrea-magic h2 {
    color: #5faa6f;
    text-align: center;
    margin-bottom: 1rem;
}

.empyrea-magic > .container > p {
    text-align: center;
    color: #d8e8dc;
    margin-bottom: 2rem;
}

.magic-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.magic-spell {
    background: rgba(95, 170, 111, 0.1);
    border: 2px solid rgba(95, 170, 111, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.magic-spell:hover {
    background: rgba(95, 170, 111, 0.2);
    border-color: #5faa6f;
    box-shadow: 0 4px 15px rgba(95, 170, 111, 0.2);
}

.magic-spell h3 {
    color: #7dd185;
    margin-bottom: 0.5rem;
}

.magic-spell p {
    color: #d8e8dc;
    font-size: 0.95rem;
}

/* Territory Section */
.empyrea-territory {
    background: #0f1815;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" result="noise" seed="2" /></filter><rect width="100" height="100" fill="%230f1815" filter="url(%23noise)" opacity="0.08"/></svg>');
    border-top: 2px solid rgba(95, 170, 111, 0.3);
    border-bottom: 2px solid rgba(95, 170, 111, 0.3);
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.empyrea-territory h2 {
    color: #5faa6f;
    text-align: center;
    margin-bottom: 1rem;
}

.empyrea-territory > .container > p {
    text-align: center;
    color: #d8e8dc;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.territory-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.territory-item {
    background: rgba(95, 170, 111, 0.08);
    border: 1px solid rgba(95, 170, 111, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.territory-item:hover {
    background: rgba(95, 170, 111, 0.15);
    border-color: #5faa6f;
}

.territory-item h3 {
    color: #7dd185;
    margin-bottom: 0.5rem;
}

.territory-item p {
    color: #d8e8dc;
    font-size: 0.95rem;
}

/* Roles Section */
.empyrea-roles {
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.empyrea-roles h2 {
    color: #5faa6f;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(95, 170, 111, 0.5), 0 0 20px rgba(95, 170, 111, 0.3);
    animation: textBrightnessBreath 6s ease-in-out infinite;
}

.empyrea-roles > .container > p {
    text-align: center;
    color: #d8e8dc;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.role {
    background: rgba(95, 170, 111, 0.1);
    border: 2px solid rgba(95, 170, 111, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.role:hover {
    background: rgba(95, 170, 111, 0.2);
    border-color: #5faa6f;
    box-shadow: 0 6px 20px rgba(95, 170, 111, 0.2);
}

.role h3 {
    color: #7dd185;
    margin-bottom: 0.5rem;
}

.role p {
    color: #d8e8dc;
    font-size: 0.95rem;
}

.cta-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(95, 170, 111, 0.3);
}

.cta-section .cta-button {
    background: linear-gradient(135deg, #5faa6f 0%, #3d7a4d 100%);
    border-color: #5faa6f;
    color: #fff;
}

.cta-section .cta-button:hover {
    background: linear-gradient(135deg, #7dd185 0%, #5faa6f 100%);
    box-shadow: 0 6px 20px rgba(95, 170, 111, 0.4);
}

@media (max-width: 768px) {
    .empyrea-header h1 {
        font-size: 2.5rem;
    }

    .magic-types {
        grid-template-columns: 1fr;
    }

    .territory-list {
        grid-template-columns: 1fr;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }
}

/* Flip Card Animation */
@keyframes flipCard {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(180deg);
    }
}

.flip-card {
    perspective: 1000px;
    margin: 1rem auto 0;
    cursor: pointer;
    display: inline-block;
}

.flip-card-inner {
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateX(180deg);
}

.flip-card-front, .flip-card-back {
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-front {
    color: #000;
    padding: 1rem 5rem;
    background: linear-gradient(135deg, #5faa6f 0%, #3d7545 100%);
    border: 2px solid #5faa6f;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(95, 170, 111, 0.3);
    font-weight: bold;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 30%),
                linear-gradient(225deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
                linear-gradient(135deg, #1a2620 0%, #0f1815 20%, #050a08 50%, #0f1815 80%, #1a2620 100%);
    color: #5faa6f;
    transform: rotateX(180deg);
    padding: 1rem 5rem;
    border: 2px solid rgba(95, 170, 111, 0.5);
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
}
