/* Общие стили */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #FFF5E6;
    color: #5A4A3C;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden;
}

/* Семантические теги */
header, nav, main, footer {
    display: block;
}

/* Шапка */
header {
    text-align: center;
    background: #A52A2A;
    color: #FFF5E6;
    padding: 2rem 1rem;
    border-bottom: 3px solid #8B0000;
    position: relative;
    z-index: 1;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.home-button {
    font-style: italic;
    color: #FFF5E6;
    opacity: 0.9;
    text-decoration: none;
    padding: 0 20px;
}

/* Навигация */
.main-nav {
    background: rgba(165, 42, 42, 0.1);
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid #CD853F;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
}

.nav-link {
    padding: 0.8rem 1.5rem;
    background: #B22222;
    color: #FFF !important;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: bold;
}

.nav-link:hover {
    background: #8B0000;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(139, 0, 0, 0.3);
}

/* Основной контент */
.content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dialogue-container {
    background: #FFF;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px auto;
}

.dialogue {
    margin: 15px 0;
    padding: 1rem;
    background: #FFF9F0;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.dialogue:hover {
    transform: translateX(5px);
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

/* Карточки игр */
.game-card {
    display: block;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 5px;
}

/* Подвал */
footer {
    background: #FFDAB9;
    color: #5A4A3C;
    padding: 2rem 1rem;
    border-top: 3px solid #CD853F;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.mini-link {
    color: #5A4A3C;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mini-link:hover {
    color: #8B0000;
}

/* Кнопка наверх */
#scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 16px;
    background: #B22222;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

#scroll-to-top:hover {
    background: #8B0000;
    transform: translateY(-2px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-link {
        display: block;
        margin: 0.5rem 0;
    }

    .game-cover {
        height: 150px;
    }

    header h1 {
        font-size: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .content {
        max-width: 1100px;
        padding: 2rem;
    }
}

/* Оптимизации */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    -webkit-backface-visibility: hidden;
}

/* Анимации */
.nav-link, .game-card, .dialogue {
    transition:
        transform 0.2s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* Текстуры */
.textured-area::before,
header::before,
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAIklEQVQIW2NkQAKrVq36zwjjgzhhYWGMYAEYB8RmROaABADeOQ8CXl/xfgAAAABJRU5ErkJggg==');
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}