/* static/style.css */

:root {
    --bg-color: #000000;
    --block-bg: #1b1b1b;
    --accent-color: #ff9900; /* Фирменный оранжевый */
    --text-main: #ffffff;
    --text-secondary: #cccccc;
    --hover-bg: #2b2b2b;
    --border-color: #333333;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* --- ШАПКА --- */
header {
    background-color: var(--block-bg);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 26px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    margin-right: 10px;
}

.logo span {
    background-color: var(--accent-color);
    color: black;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 2px;
}

.header-tagline {
    color: #666;
    font-size: 14px;
}

/* --- КОНТЕЙНЕР --- */
.container {
    display: flex;
    max-width: 1300px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 15px;
}

/* --- КОНТЕНТНАЯ ОБЛАСТЬ --- */
.main-content {
    flex: 1;
}

/* --- ХЛЕБНЫЕ КРОШКИ (Исправлено: возвращены серые цвета) --- */
.breadcrumb {
    margin-bottom: 15px;
    font-size: 13px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #333;
}

.breadcrumb a:last-of-type {
    color: var(--accent-color); /* Категория оранжевая */
}

/* --- ОБЛАСТЬ ПЛЕЕРА (Размеры из твоего 1-го промпта) --- */
.game-player-area {
    position: relative;
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    line-height: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    transition: 0.3s;
}

/* Твоя оригинальная кнопка "Играть сейчас" */
.play-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 15px 30px;
    font-weight: bold;
    font-size: 20px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: 0.2s;
    text-transform: none; /* Убираем капс, если он был */
}

.play-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

/* Кнопка полноэкранного режима (появляется после клика "Играть") */
.fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 100;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-player-area:hover .fullscreen-btn {
    opacity: 1;
}

.game-player-area iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- ДЕТАЛИ ИГРЫ (Под плеером) --- */
.game-details {
    background: var(--block-bg);
    padding: 25px;
    margin-top: 20px;
    border-radius: 4px;
}

.game-details h1 {
    margin-top: 0;
    color: var(--accent-color);
    font-size: 28px;
}

.description-text {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

.tag-badge {
    display: inline-block;
    background: #333;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #aaa;
    margin-top: 20px;
}

/* --- SEO СЕКЦИЯ --- */
.seo-section {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px dotted #333;
    color: #555;
    font-size: 14px;
}

.seo-section h3 {
    color: #888;
}

/* --- СЕТКА ИГР (Главная) --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 15px;
}

.game-card {
    background: var(--block-bg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s;
    border: 1px solid transparent;
}

.game-card:hover {
    transform: scale(1.02);
    border-color: #444;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #333;
}

.thumbnail-container img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 12px;
}

.game-title {
    text-decoration: none;
    color: var(--text-main);
    font-weight: bold;
    font-size: 15px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    transition: color 0.2s;
}

.game-card:hover .game-title {
    color: var(--accent-color);
}

/* --- САЙДБАР --- */
.sidebar {
    width: 280px;
    background: var(--block-bg);
    padding: 15px;
    border-radius: 4px;
    height: fit-content;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: 0.2s;
}

.category-link:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.category-link.active {
    color: var(--accent-color);
    font-weight: bold;
    border-left: 3px solid var(--accent-color);
    background: var(--hover-bg);
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 1024px) {
    .container { flex-direction: column; }
    .sidebar { width: auto; order: -1; }
}

@media (max-width: 768px) {
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .game-player-area { aspect-ratio: 4 / 3; }
    .fullscreen-btn { opacity: 1; } /* На мобилках кнопку видно всегда */
}
/* --- САЙДБАР (Исправляем размеры иконок) --- */
.sidebar {
    width: 280px;
    background: var(--block-bg);
    padding: 15px;
    border-radius: 4px;
    height: fit-content;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: 0.2s;
    overflow: hidden; /* Чтобы ничего не вылетало */
}

/* Вот этот блок вернет иконкам нормальный вид */
.category-icon {
    width: 20px;
    height: 20px;
    min-width: 20px; /* Запрещаем сжиматься */
    max-width: 20px; /* Запрещаем расширяться */
    object-fit: contain;
    display: block;
}

.category-link:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.category-link.active {
    color: var(--accent-color);
    font-weight: bold;
    border-left: 3px solid var(--accent-color);
    background: var(--hover-bg);
}

/* --- ЗАГОЛОВОК КОНТЕНТА И СЧЕТЧИК --- */
.content-header {
    display: flex;
    justify-content: space-between; /* Заголовок влево, счетчик вправо */
    align-items: flex-end;          /* Выравнивание по нижней линии */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color); /* Опционально: тонкая линия для красоты */
}

.content-title {
    margin: 0;
    font-size: 24px;
    color: var(--text-main);
}

.game-count {
    font-size: 13px;
    color: #666;
    white-space: nowrap; /* Чтобы текст не переносился */
}

/* --- СТИЛИ ДЛЯ ССЫЛКИ-ОБЕРТКИ --- */
.game-card-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* --- СООБЩЕНИЕ ОБ ОТСУТСТВИИ ИГР --- */
.no-games-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #666;
}

.category-tag {
    font-size: 12px;
    color: var(--accent-color);
    margin-top: 4px;
    opacity: 0.8;
}
/* --- МОБИЛЬНЫЕ СТОРЫ (В КАРТОЧКЕ ИГРЫ) --- */
.mobile-stores {
    margin-top: 25px;
    padding: 20px;
    background: var(--block-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.stores-title {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.store-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.store-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: 0.2s;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    background: var(--hover-bg);
}

.store-link:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* Иконки или специфичные цвета для сторов (опционально) */
.store-link::before {
    content: "↓"; /* Маленькая стрелочка перед текстом */
    margin-right: 8px;
    color: var(--accent-color);
}
.store-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0; /* Чтобы иконка не сжималась, если текст длинный */
    display: block;
}

.store-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start; /* Теперь можно просто прижать к левому краю */
    gap: 12px;
    padding: 8px 16px;
    min-width: 170px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.2s ease;
}

.store-link:hover {
    border-color: var(--accent-color);
    background: #222;
}
/* Контейнер секции */
.game-screenshots-section {
    margin: 35px 0;
}

/* Заголовок секции */
.screenshots-section-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 600;
}


/* Умная CSS-сетка, которая сама решает сколько скриншотов поместится в ряд */
.screenshots-gallery {
    display: grid;
    /* На мобилках карточки будут минимум 260px, на десктопах расширяться до заполнения ряда */
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

/* Ограничитель для самого скриншота */
.screenshot-item {
    width: 100%;
    aspect-ratio: 16 / 9; /* Жестко держим пропорции игрового экрана */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background-color: #1b1b1b; /* Флбэк на время загрузки тяжелой картинки */
}

/* Правильное сжатие 1920-пиксельной картинки */
.screenshot-item img {
    width: 100%;
    height: 100%;
    /* Сжимает картинку без деформации (лишнее аккуратно подрезается, если пропорции не идеальны) */
    object-fit: cover;
    display: block;
    /* Оптимизация сжатия в браузерах, чтобы картинка оставалась четкой */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
}

/* Опционально: легкий брейкпоинт для совсем маленьких экранов (смартфоны вертикально) */
@media (max-width: 480px) {
    .screenshots-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 15px;
    }
}
/* --- ЗАГОЛОВОК В САЙДБАРЕ --- */
.sidebar-title {
    font-size: 18px; /* Аккуратный размер, как и был у h3 */
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-main);
    font-weight: bold;
}
/* --- ПЛАШКА "НОВАЯ ИГРА" НА МИНИАТЮРЕ --- */
.badge-new {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--accent-color); /* Твой фирменный оранжевый (как в логотипе) */
    color: #000000;                       /* Черный текст для идеального контраста */
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;            /* Все буквы заглавные */
    border-radius: 4px;                   /* Закругление в тон кнопкам сайта */
    z-index: 2;                           /* Гарантирует, что плашка будет поверх картинки */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); /* Густая тень, чтобы текст читался на любой картинке */
    letter-spacing: 0.5px;                /* Легкий отступ между буквами */
    line-height: 1;
}