:root {
    --primary-color: #ff0077;
    --primary-hover: #ff3399;
    --bg-color: #0d0d0d;
    --card-bg: #111;
    --text-color: #fff;
    --border-radius: 14px;
}

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

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* ===== STATUS BAR ===== */
#statusBar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
    background: #111;
    border-bottom: 1px solid #222;
}

.status-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    transition: 0.2s;
}

.status-dot.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 119, 0.6);
}

/* ===== PAGES ===== */
.page {
    display: none;
    padding: 20px;
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ГЛОБАЛЬНАЯ СЕТКА ===== */
.grid {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

/* СТРАНИЦА 1: Две колонки (для видео) */
.cols-2 { 
    grid-template-columns: repeat(2, 1fr); 
}

/* СТРАНИЦА 2: ВЕРТИКАЛЬНЫЙ СПИСОК (Desktop + Mobile) */
/* Делаем флекс-колонку по центру */
.vertical-list {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 20px;
}
.vertical-list .select-block {
    width: 100%;
    max-width: 500px; /* Ограничение ширины на ПК, чтобы не было слишком широко */
}
.vertical-list .select-block img {
    max-height: 300px; /* Ограничение высоты картинки, чтобы было красиво */
    object-fit: cover;
    object-position: top;
}

/* СТРАНИЦЫ 3 и 5: 4 колонки на ПК */
.cols-4-mobile-2 { 
    grid-template-columns: repeat(4, 1fr); 
}

/* СТРАНИЦА 4: 3 колонки на ПК */
.cols-mobile-3 { 
    grid-template-columns: repeat(3, 1fr); 
}

/* ===== SELECT BLOCKS ===== */
.select-block {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    background: #000;
}

.select-block img, .select-block video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.select-block p {
    position: absolute;
    bottom: 0;
    width: 100%;
    margin: 0;
    padding: 8px 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.select-block.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 0, 119, 0.4);
    transform: scale(1.02);
}

/* Специфичные фиксы для Страницы 1 */
#page1 .grid { display: flex; justify-content: center; gap: 24px; }
#page1 .select-block { max-width: 250px; aspect-ratio: 9 / 16; }
#page1 .select-block video { height: 100%; }

/* Voice Grid (Страница 5) - ПК */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    justify-items: center;
}
.voice-grid .select-block { width: 100%; }

/* Relationship Small Images */
.relationship-small .select-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
}
.relationship-small .select-block img { width: 60px; margin-bottom: 5px; }
.relationship-small .select-block p { position: static; background: none; padding: 0; font-size: 13px; }

/* ===== SUMMARY (Страница 6) - ПК ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 10px;
}

.summary-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid #333;
    text-align: center;
    padding: 10px;
}
.summary-card .media-wrapper {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}
.summary-card img, .summary-card video {
    max-height: 180px;
    object-fit: contain;
}

/* ===== BUTTONS ===== */
.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}
button {
    padding: 12px 30px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: background 0.2s;
}
button:hover:not(:disabled) { background: var(--primary-hover); }
button:disabled { opacity: 0.4; cursor: not-allowed; background: #333; color: #888; }
button.back { background: #333; }

/* ===== SLIDER ===== */
.age-slider { margin: 40px auto 20px; max-width: 400px; text-align: center; }
.age-slider-track { position: relative; padding-top: 30px; }
.age-bubble {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
}
input[type="range"] { width: 100%; accent-color: var(--primary-color); cursor: pointer; }

/* ========================================= */
/* ===== АДАПТИВНОСТЬ (MOBILE / iPHONE) ==== */
/* ========================================= */

@media (max-width: 768px) {
    
    /* Страница 2: Она уже адаптивная благодаря .vertical-list, 
       но можно чуть уменьшить ширину */
    .vertical-list .select-block {
        max-width: 100%; /* На мобильном на всю ширину */
    }

    /* Страницы 3 и 5: Принудительно 2 колонки */
    .cols-4-mobile-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Страница 4 (Hair): ПРИНУДИТЕЛЬНО 3 колонки */
    .cols-mobile-3 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px; /* Уменьшаем отступ, чтобы влезло */
    }
    /* Уменьшаем текст для 3-х колонок */
    .cols-mobile-3 .select-block p {
        font-size: 11px;
        padding: 4px 0;
    }

    /* Страница 5 (Voice): Принудительно 2 колонки */
    .voice-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Страница 6 (Summary): ПРИНУДИТЕЛЬНО 2 колонки */
    .summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Компактный вид саммари */
    .summary-card p { font-size: 12px; }
    .summary-card img, .summary-card video { max-height: 120px; }
}
