/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MedievalSharp', cursive;
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.language-switcher a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.language-switcher a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.language-switcher a.active {
    background-color: #e0e0e0;
    color: #1a1a1a;
}

/* Header with Parallax */
header.parallax {
    height: 100vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

header.parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.header-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.header-content p {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
}

.scroll-down {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    margin-top: 20px;
    animation: bounce 2s infinite;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* Navigation */
nav {
    background-color: #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex-wrap: wrap;
}

.nav-menu li {
    margin: 5px 15px;
}

.nav-menu a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 5px 10px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.nav-menu a:hover {
    color: #c0a062;
}

.nav-menu a.active {
    color: #c0a062;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #c0a062;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

section {
    margin-bottom: 60px;
}

h2 {
    font-size: 2.2rem;
    color: #c0a062;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background-color: #c0a062;
    margin: 15px auto;
}

h3 {
    font-size: 1.8rem;
    color: #c0a062;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Feature Cards */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background-color: #2a2a2a;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    text-align: center;
}

.feature-card h3 {
    text-align: center;
    margin-bottom: 15px;
}

/* Bio Section */
.bio-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    margin-top: 30px;
}

.bio-image {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin: auto;
    max-width: 500px;
  }
  
/* Timeline */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #c0a062;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-date {
    color: #c0a062;
    font-weight: bold;
    margin-bottom: 10px;
}

.timeline-content {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #c0a062;
    border-radius: 50%;
    top: 30px;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -10px;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

/* Gallery */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-item p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px;
    margin: 0;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover p {
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    margin: auto;
}

.close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #c0a062;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close:hover {
    color: #e0e0e0;
}

#caption {
    color: #e0e0e0;
    text-align: center;
    padding: 10px 0;
    font-size: 1.2rem;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
}

/* World Page Styles */
.world-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
}

.location-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.location-card {
    background-color: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.location-card:hover {
    transform: translateY(-5px);
}

.location-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.location-card h4 {
    padding: 15px;
    text-align: center;
    color: #c0a062;
    margin: 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    word-break: break-word;
    hyphens: auto;
}

.location-info {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
}

.location-info h4 {
    color: #c0a062;
    margin-bottom: 10px;
}

.faction-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 10px 20px;
    background-color: #2a2a2a;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
}

.tab-button:hover {
    background-color: #3a3a3a;
}

.tab-button.active {
    background-color: #c0a062;
    color: #1a1a1a;
}

.tab-content {
    display: none;
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    animation: fadeIn 0.5s ease;
}

.tab-content h4 {
    color: #c0a062;
    margin-bottom: 10px;
}

.monster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.monster-card {
    background-color: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.monster-card:hover {
    transform: translateY(-5px);
}

.monster-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.monster-card h4 {
    padding: 15px;
    text-align: center;
    color: #c0a062;
    margin: 0;
}

.see-more {
    display: block;
    margin: 20px auto 0;
    padding: 12px 25px;
    background-color: #c0a062;
    color: #1a1a1a;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'MedievalSharp', cursive;
    font-size: 1.1rem;
}

.see-more:hover {
    background-color: #d8b878;
}

/* Footer */
footer {
    background-color: #2a2a2a;
    padding: 20px;
    text-align: center;
    margin-top: 50px;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #c0a062;
    color: #1a1a1a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    z-index: 99;
    transition: background-color 0.3s ease;
}

.back-to-top:hover {
    background-color: #d8b878;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    .header-content p {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-menu li {
        margin: 5px 0;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .bio-content {
        flex-direction: column;
    }
    
    .timeline-container::before {
        left: 31px !important;
    }
    
    .timeline-item {
        width: 100% !important;
        padding-left: 70px !important;
        padding-right: 25px !important;
    }
    
    .timeline-item:nth-child(even) {
        left: 0 !important;
    }
    
    .timeline-item::after {
        left: 

        /* FIX для карточек локаций */
.location-cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: stretch; /* Важно! */
}

.location-card {
    height: 100%; /* Занимает всю доступную высоту */
    display: flex;
    flex-direction: column;
    min-height: 350px; /* Фикс для IE */
}

.location-card img {
    height: 200px !important; /* Переопределяем все возможные другие стили */
    min-height: 200px;
    object-fit: cover;
    flex-shrink: 0; /* Запрещаем сжатие */
}

.location-card h4 {
    flex: 1;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
}

/* Показываем открытое окно с фотографией */
#imageModal {
    opacity: 1;
}

/* Подпись не перехватывает нажатие на фото */
.gallery-item p {
    pointer-events: none;
}
