/* ============================================================
   ОСНОВНЫЕ СТИЛИ (ОБЩИЕ)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

.home-card {
    background: rgba(0, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    padding: 25px;
    margin: 0 auto 5px auto;
    max-width: 950px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.7);
    width: 100%;
}

/* Специальный класс для плашек без заголовка */
.no-title-card {
    padding: 12px 15px !important; /* Уменьшаем внутренние отступы, так как нет h2 */
}

.no-title-card .youtube-grid {
    margin-top: 0 !important; /* Убираем верхний отступ сетки */
}

.home-card h1, .home-card h2 {
    font-family: "Machina", Arial, sans-serif;
    margin: 0 0 5px 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.home-card h1 { font-size: 32px; }
.home-card h2 { 
    font-size: 24px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding-bottom: 8px; 
}

.home-card p { line-height: 1.4; margin: 10px 0; }

/* ============================================================
   СЕТКА КНОПОК ПЛАТФОРМ
   ============================================================ */
.youtube-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.yt-item {
    background: transparent;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.2s;
}

.home-card:not(.split-card) .yt-item {
    flex: 1 1 280px;
}

.yt-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.yt-img-box {
    width: 60px; height: 60px;
    flex-shrink: 0; border-radius: 8px; overflow: hidden;
}

.yt-img-box img { width: 100%; height: 100%; object-fit: cover; }

.yt-info { display: flex; flex-direction: column; overflow: hidden; }
.yt-title { font-weight: bold; font-size: 18px; margin-bottom: 4px; }
.yt-desc { font-size: 13px; color: #aaa; line-height: 1.2; }

/* ============================================================
   КОНТЕЙНЕРЫ (Ряды)
   ============================================================ */
.horizontal-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 950px;
    margin: 0 auto 5px auto;
}

.horizontal-container .home-card {
    margin-bottom: 0 !important;
}

.double-layout .split-card {
    flex: 1 1 calc(50% - 2.5px);
}

.triple-layout .split-card {
    flex: 1 1 calc(33.333% - 3.4px);
}

.split-card .yt-item {
    flex: 1 1 100% !important;
}

.title-with-icon { display: flex; align-items: center; gap: 12px; }
.h2-icon { width: 32px; height: 32px; flex-shrink: 0; }

/* ============================================================
   ЦВЕТА ПЛАТФОРМ
   ============================================================ */
.yt-main .yt-title    { color: #d8a400 !important; }
.yt-pirate .yt-title  { color: #ffffff !important; }
.yt-archive .yt-title { color: #cf4100 !important; }
.vk-plat-vk .yt-title { color: #0077ff !important; }
.vk-plat-live .yt-title { color: #ff2b42 !important; }
.vk-plat-twitch .yt-title { color: #a970ff !important; }
.discord-plat .yt-title { color: #5865F2 !important; }
.tg-plat .yt-title      { color: #26A5E4 !important; }
.obsolete .yt-title   { color: #8d8d8d !important; }

/* ============================================================
   АЛЕРТ / НОВОСТИ
   ============================================================ */
.alert-box {
    display: none;
    background: #ffcc00; color: #000; padding: 15px; 
    text-align: center; font-weight: bold; border-radius: 12px; 
    margin: 0 auto 5px auto;
    position: relative; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.4); border: 2px solid #e6b800;
    max-width: 950px;
}

.alert-box .timer { 
    margin-top: 8px; font-family: 'Courier New', monospace; font-size: 22px; 
    background: rgba(0,0,0,0.07); display: inline-block; padding: 2px 10px; border-radius: 4px; 
}

.alert-close { 
    position: absolute; right: 12px; top: 10px; background: none; 
    border: none; font-size: 24px; cursor: pointer; opacity: 0.6; 
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 940px) {
    .horizontal-container {
        flex-direction: column;
        gap: 5px;
    }
    
    .double-layout .split-card,
    .triple-layout .split-card {
        flex: 1 1 100% !important;
        margin-bottom: 0 !important;
    }
}

body.is-mobile .home-card {
    width: 95%;
    padding: 15px !important;
    margin-bottom: 5px !important;
}

body.is-mobile .no-title-card {
    padding: 8px 10px !important;
}


/* ============================================================
   КНОПКА ПЕРЕХОДА НА СТАРУЮ СТРАНИЦУ
   ============================================================ */
/* Контейнер строки */
.news-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 5px;
}

#news-block {
    flex: 1;
    margin: 0 !important;
}

/* Обновленная кнопка «Старая версия» */
.old-version-card {
    display: flex;
    align-items: center;
    background: rgba(0, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 25px; /* Увеличили размер за счет отступов */
    color: #fff !important;
    text-decoration: none !important;
    transition: 0.2s;
    margin-left: 5px;
    min-width: 280px; /* Сделали кнопку шире */
    gap: 15px; /* Расстояние между картинкой и текстом */
}

.old-version-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Контейнер для иконки */
.old-v-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.old-v-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.old-v-content {
    display: flex;
    flex-direction: column;
    text-align: left; /* Текст теперь по левому краю от иконки */
}

.old-v-title {
    font-weight: bold;
    font-size: 16px; /* Чуть крупнее заголовок */
    color: #fff;
}

.old-v-desc {
    font-size: 12px;
    color: #aaa;
}

/* Адаптив */
@media (max-width: 940px) {
    .news-row {
        flex-direction: column;
        gap: 5px;
    }
    .old-version-card {
        margin-left: 0;
        min-width: auto;
        width: 100%;
    }
}