/*Общие стили для управления выравниваниями, шрифтами, размерами и прочим */
.text-center { text-align: center;}
.fs-20 {font-size: 20px;}

/* --- Сетка для элементов похожих игр --- */
.related-games-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
    grid-template-columns: 1fr; 
    
    @media (min-width: 480px) {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    @media (min-width: 768px) {
         grid-template-columns: repeat(3, 1fr); 
     }

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

/* --- Стилизация одной карточки игры --- */
.related-game-item {
    background-color: #ffffff; 
    border: none; 
    border-radius: 8px;        
    overflow: hidden;          
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.related-game-item:hover {
    transform: translateY(-4px); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* --- Ссылка внутри карточки --- */
.related-game-link {
    display: block; 
    text-decoration: none;
    color: inherit; 
    height: 100%;   
    display: flex;        
    flex-direction: column; 
}

/* --- Контейнер изображения --- */
.related-game-figure {
    margin: 0; 
    padding: 0;
    line-height: 0; 
}

/* --- Изображение игры --- */
.related-game-image {
    display: block;  
    width: 100%;     
    height: auto;    
    aspect-ratio: 16 / 11;
    object-fit: cover; 
}

/* --- Заголовок игры --- */
.related-game-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;         
    padding: 0.8rem 1rem; 
    text-align: center; 
    line-height: 1.3;  
    color: #333;
    background-color: #ffffff;
    border-radius: 0 0 8px 8px;
    flex-grow: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/*Стили вида материала */
#allEntries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.layout.layout [id^=entryID] + [id^=entryID] {
    margin-block: 0;
}

.game-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    height: 320px;
}

.game-card:hover {
    border-color: #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.game-card__image-wrapper {
    position: relative;
    height: 216px;
    overflow: hidden;
}

.game-card__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.game-card__content {
    background-color: #fff;
    padding: 0.75rem;
    text-align: center;
    color: #333;
    font-weight: 500;
    border-radius: 0 0 4px 4px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Стили для ссылки внутри контента */
.game-card__content a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}

.game-card__content a:hover {
    color: #555;
}

/* ИСПРАВЛЕННЫЙ стиль заголовка - убираем конфликтующие правила */
.game-card__title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
    color: #2c3e50; /* темный синий для глубины */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); /* мягкая тень для читаемости */
    max-height: 4.2em; /* немного больше строк */
    overflow: hidden;
    word-wrap: break-word;
    text-align: center;
    transition: color 0.3s ease;
}
.game-card__content a:hover .game-card__title {
    color: #e74c3c; /* фирменный акцент, совпадает с заголовками разделов */
}

/* For screens smaller than 768px, use 2 columns */
@media (max-width: 768px) {
    #allEntries {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-card {
        height: 300px;
    }
    
    .game-card__image-wrapper {
        height: 180px;
    }
}

/* For screens smaller than 480px, use 1 column */
@media (max-width: 480px) {
    #allEntries {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        height: 280px;
    }
    
    .game-card__image-wrapper {
        height: 160px;
    }
}

/*Стили страницы с материалом */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
}

.game-header {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.poster-container {
    aspect-ratio: 16 / 9;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    gap: 10px;
}

.info-label {
    font-weight: bold;
    min-width: 120px;
    color: #7f8c8d;
}

.section {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
}

.section-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.screenshots {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.screenshots.grid-3 { grid-template-columns: repeat(3, 1fr); }
.screenshots.grid-4 { grid-template-columns: repeat(4, 1fr); }
.screenshots.grid-6 { grid-template-columns: repeat(3, 1fr); }
.screenshots.grid-8 { grid-template-columns: repeat(4, 1fr); }
.screenshots.grid-12 { grid-template-columns: repeat(4, 1fr); }

.screenshot {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
}

.screenshot:hover {
    transform: scale(1.05);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    margin: 30px 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.download-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s;
    text-align: center;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

@media (max-width: 968px) {
    .game-header {
        grid-template-columns: 1fr;
    }

    .poster-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .screenshots {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .container {
        padding: 15px;
    }
}/*Общие стили для управления выравниваниями, шрифтами, размерами и прочим */
.text-center { text-align: center;}
.fs-20 {font-size: 20px;}

/* --- Сетка для элементов похожих игр --- */
.related-games-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
    grid-template-columns: 1fr; 
    
    @media (min-width: 480px) {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    @media (min-width: 768px) {
         grid-template-columns: repeat(3, 1fr); 
     }

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

/* --- Стилизация одной карточки игры --- */
.related-game-item {
    background-color: #ffffff; 
    border: none; 
    border-radius: 8px;        
    overflow: hidden;          
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.related-game-item:hover {
    transform: translateY(-4px); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* --- Ссылка внутри карточки --- */
.related-game-link {
    display: block; 
    text-decoration: none;
    color: inherit; 
    height: 100%;   
    display: flex;        
    flex-direction: column; 
}

/* --- Контейнер изображения --- */
.related-game-figure {
    margin: 0; 
    padding: 0;
    line-height: 0; 
}

/* --- Изображение игры --- */
.related-game-image {
    display: block;  
    width: 100%;     
    height: auto;    
    aspect-ratio: 16 / 11;
    object-fit: cover; 
}

/* --- Заголовок игры --- */
.related-game-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;         
    padding: 0.8rem 1rem; 
    text-align: center; 
    line-height: 1.3;  
    color: #333;
    background-color: #ffffff;
    border-radius: 0 0 8px 8px;
    flex-grow: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/*Стили вида материала */
#allEntries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.layout.layout [id^=entryID] + [id^=entryID] {
    margin-block: 0;
}

.game-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    height: 320px;
}

.game-card:hover {
    border-color: #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.game-card__image-wrapper {
    position: relative;
    height: 216px;
    overflow: hidden;
}

.game-card__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.game-card__content {
    background-color: #fff;
    padding: 0.75rem;
    text-align: center;
    color: #333;
    font-weight: 500;
    border-radius: 0 0 4px 4px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Стили для ссылки внутри контента */
.game-card__content a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}

.game-card__content a:hover {
    color: #555;
}

/* ИСПРАВЛЕННЫЙ стиль заголовка - убираем конфликтующие правила */
.game-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    color: inherit;
    font-weight: inherit;
    word-wrap: break-word;
    /* Ограничиваем только очень длинные заголовки */
    max-height: 4.5em; /* Увеличили до 4.5em для надежности */
    overflow: hidden;
}

/* For screens smaller than 768px, use 2 columns */
@media (max-width: 768px) {
    #allEntries {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-card {
        height: 300px;
    }
    
    .game-card__image-wrapper {
        height: 180px;
    }
}

/* For screens smaller than 480px, use 1 column */
@media (max-width: 480px) {
    #allEntries {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        height: 280px;
    }
    
    .game-card__image-wrapper {
        height: 160px;
    }
}

/*Стили страницы с материалом */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
}

.game-header {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.poster-container {
    aspect-ratio: 16 / 9;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    gap: 10px;
}

.info-label {
    font-weight: bold;
    min-width: 120px;
    color: #7f8c8d;
}

.section {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
}

.section-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.screenshots {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.screenshots.grid-3 { grid-template-columns: repeat(3, 1fr); }
.screenshots.grid-4 { grid-template-columns: repeat(4, 1fr); }
.screenshots.grid-6 { grid-template-columns: repeat(3, 1fr); }
.screenshots.grid-8 { grid-template-columns: repeat(4, 1fr); }
.screenshots.grid-12 { grid-template-columns: repeat(4, 1fr); }

.screenshot {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
}

.screenshot:hover {
    transform: scale(1.05);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    margin: 30px 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.download-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s;
    text-align: center;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

@media (max-width: 968px) {
    .game-header {
        grid-template-columns: 1fr;
    }

    .poster-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .screenshots {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .container {
        padding: 15px;
    }
}