:root {
    --bg: #f4f7f9;
    --card-bg: #ffffff;
    --text-main: #333b4d;
    --text-muted: #7a869a;
    --accent: #0066ff;
    --radius: 18px;
    --border: rgba(0, 0, 0, 0.05);
    --sidebar-bg: #ffffff;
    --tag-bg: #f1f3f6;
    /* ... твои текущие переменные ... */
    
    /* Переменные хедера */
    --header-bg: #ffffff;
    --header-text: #333b4d;
    --nav-border: #f0f0f0;
    --input-bg: #f5f7f9;
    --content-width: 1100px;

            --card: #ffffff;
           
}

[data-theme="dark"] {
    --bg: #12141c;
    --card-bg: #1e212a;
    --text-main: #eef2ff;
    --text-muted: #8e99ab;
    --accent: #3b82f6;
    --border: rgba(255, 255, 255, 0.08);
    --sidebar-bg: #1e212a;
    --tag-bg: #2d323e;
    --header-bg: #1e212a;
    --input-bg: #2d323e;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}



.theme-toggle-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--accent);
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.section-header {
    margin: 30px 0 15px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    margin: 30px 0 20px;
}

.cat-title i {
    background: var(--tag-bg);
    color: var(--accent);
    padding: 8px;
    border-radius: 8px;
    font-size: 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.cat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.cat-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.cat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
}

.bg-blue { background: rgba(79, 70, 229, 0.1); color: #6366f1; }
.bg-cyan { background: rgba(8, 145, 178, 0.1); color: #22d3ee; }
.bg-red { background: rgba(220, 38, 38, 0.1); color: #f87171; }
.bg-orange { background: rgba(234, 88, 12, 0.1); color: #fb923c; }
.bg-purple { background: rgba(147, 51, 234, 0.1); color: #c084fc; }

.cat-info { flex: 1; }
.cat-name { font-weight: 700; font-size: 15px; }
.cat-count { font-size: 12px; color: var(--text-muted); }
.cat-arrow { color: var(--text-muted); opacity: 0.3; }

.app-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.app-item:hover { transform: translateY(-6px); }

.app-icon-wrapper {
    position: relative;
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
}

.app-icon {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
    border: 1px solid var(--border);
}

.app-title-g {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    color: var(--text-main);
    
    /* Включаем обрезку */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Добавляем стандартное свойство для редактора */
    -webkit-box-orient: vertical;
    
    /* Прячем лишнее */
    overflow: hidden;
    
    /* Заменяем фиксированную высоту на максимальную */
    max-height: 33px; /* 13px * 1.25 * 2 строки = примерно 32.5px */
    
    margin-bottom: 4px;
}

.app-meta-info {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar { position: sticky; top: 90px; }

.sidebar-block {
    background: var(--sidebar-bg);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.sidebar-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-app-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.top-app-counter {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-muted);
    opacity: 0.3;
    margin-right: 12px;
    width: 20px;
}

.top-app-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-right: 12px;
    object-fit: cover;
}

.top-app-name { font-size: 13px; font-weight: 600; }

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    background: var(--tag-bg);
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 11px;
    text-decoration: none;
    color: var(--text-muted);
    transition: 0.2s;
}

.tag-item:hover {
    background: var(--accent);
    color: #fff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin: 30px 0;
    width: 100%;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.fa-android {
    color: #a4c639; /* Зеленый цвет бренда Android */
    margin-right: 2px; /* Небольшой отступ от текста */
}

.app-specs .rating-val[style*="a4c639"] {
    font-weight: 600; /* Немного жирности для текста Android */
    transition: 0.3s;
}

.app-specs .rating-val[style*="a4c639"]:hover {
    filter: brightness(0.9); /* Слегка притемняет при наведении */
}

.feature-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 20px;
}

.icon-mod { background: #fff4d5; color: #f39c12; }
.icon-money { background: #fff9c4; color: #fbc02d; }
.icon-open { background: #f3e5f5; color: #9c27b0; }
.icon-premium { background: #fce4ec; color: #e91e63; }
.icon-ads { background: #ffebee; color: #f44336; }
.icon-fast { background: #e3f2fd; color: #1e88e5; }

.feature-card h3 { font-size: 14px; margin-bottom: 6px; font-weight: 700; }
.feature-card p { font-size: 11px; color: var(--text-muted); line-height: 1.3; margin: 0; }

@media (max-width: 1024px) {
    .app-grid { grid-template-columns: repeat(4, 1fr); }
    .features-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 850px) {
    .main-layout { grid-template-columns: 1fr; }
    .app-grid { grid-template-columns: repeat(5, 1fr); }
    .sidebar { position: static; }
}

@media (max-width: 650px) {
    .app-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

.screenshot-item {
    aspect-ratio: 16 / 9; /* Или 9 / 16 для вертикальных игр */
    width: auto;
    height: 200px;
    background: #eee; /* Заглушка, пока фото грузится */
}

/* Основной контейнер иконки */
.icon-box {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px; /* Мягкие углы как на фото */
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Пастельные пары: фон и цвет иконки */
.bg-soft-blue   { background-color: #eef2ff; color: #4f46e5; }
.bg-soft-red    { background-color: #fef2f2; color: #ef4444; }
.bg-soft-orange { background-color: #fff7ed; color: #f97316; }
.bg-soft-purple { background-color: #f5f3ff; color: #8b5cf6; }
.bg-soft-cyan   { background-color: #ecfeff; color: #0891b2; }
.bg-soft-green  { background-color: #f0fdf4; color: #22c55e; }
.bg-soft-pink   { background-color: #fdf2f8; color: #ec4899; }
.bg-soft-yellow { background-color: #fefce8; color: #ca8a04; }

/* Чтобы иконка FontAwesome наследовала цвет от родителя */
.icon-box i {
    color: inherit; 
}

 .main-header {
        background: var(--header-bg);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        padding: 12px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        transition: 0.3s;
    }

    /* Ограничитель ширины шапки */
    .header-wrapper {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        align-items: center;
        max-width: var(--content-width);
        margin: 0 auto;
        padding: 0 15px;
    }

    .header-left {
        justify-self: start;
    }

    .header-center {
        justify-self: center;
        width: 100%;
        max-width: 400px;
    }

    .header-right {
        justify-self: end;
    }

    .main-logo {
        text-decoration: none;
        font-weight: 800;
        font-size: 24px;
        color: var(--header-text);
        letter-spacing: -1px;
    }

    /* Стили поиска */
    .search-box form {
        display: flex;
        position: relative;
        width: 100%;
    }

    .search-box input {
        width: 100%;
        padding: 10px 45px 10px 18px;
        border: 1px solid var(--nav-border);
        border-radius: 25px;
        background: var(--input-bg);
        color: var(--header-text);
        outline: none;
        font-size: 14px;
        transition: 0.2s;
    }

    .search-box input:focus {
        border-color: var(--accent);
        background: var(--header-bg);
    }

    .search-box button {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--accent);
        cursor: pointer;
        font-size: 16px;
    }

    .theme-trigger {
        cursor: pointer;
        font-size: 20px;
        color: var(--header-text);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: 0.2s;
    }

    .theme-trigger:hover {
        background: var(--input-bg);
    }

    /* Адаптация для телефонов */
    @media (max-width: 768px) {
        .header-wrapper {
            grid-template-columns: auto 1fr auto;
            gap: 10px;
        }

        .main-logo {
            font-size: 20px;
        }

        .search-box input {
            padding: 8px 15px;
            font-size: 12px;
        }
    }

    .tag-cloud {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0;
    }

    .tag-item {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        color: #4a5568;
        padding: 6px 12px;
        border-radius: 10px;
        font-size: 13px;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .tag-item:hover {
        background: #5c8aff;
        color: #ffffff;
        border-color: #5c8aff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(92, 138, 255, 0.25);
    }

            .breadcrumbs {
                padding-top: 25px;
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 25px;
            text-align: left;
        }

        .breadcrumbs a {
            color: var(--text-muted);
            text-decoration: none;
        }

        .app-wrapper {
            position: relative;
            margin-top: 70px;
        }

        .app-icon-floating {
            width: 140px;
            height: 140px;
            border-radius: 32px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
            position: absolute;
            top: -70px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 5;
            background: #fff;
            object-fit: cover;
        }

        .app-card {
            background-color: var(--card);
            border-radius: var(--radius);
            padding: 90px 25px 30px;
            text-align: center;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
        }

        .app-title {
            font-size: 24px;
            font-weight: 700;
            margin: 0 0 8px;
        }

        .app-specs {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
            font-size: 14px;
            color: var(--text-muted);
            margin-bottom: 20px;
        }

        .rating-val {
            color: #ffa726;
            font-weight: 700;
        }

        .app-description {
            font-size: 15px;
            line-height: 1.7;
            text-align: left;
            max-width: 90%;
            margin: 0 auto 20px;
        }

        /* --- ТЕГИ --- */
        .app-tags {
            text-align: left;
            max-width: 700px;
            margin: 0 auto 30px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .tag-pill {
            display: inline-block;
            background: #f0f3f8;
            color: var(--text-muted);
            padding: 5px 12px;
            border-radius: 10px;
            font-size: 13px;
            text-decoration: none;
            font-weight: 500;
            transition: 0.2s;
        }

        .tag-pill:hover {
            background: var(--accent);
            color: #fff;
        }

        /* --- ВАРИАНТ 2: СПИСОК "GOOGLE PLAY STYLE" --- */
        .related-section {
            margin-top: 50px;
            text-align: left;
            max-width: 90%;
            margin: 40px auto 0;
            padding-top: 20px;
            border-top: 2px solid #f1f5f9;
        }

        .related-title {
            font-size: 19px;
            font-weight: 700;
            margin-bottom: 20px;
            color: #1e293b;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .related-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .related-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 12px;
            background: #f8fafc;
            border-radius: 16px;
            text-decoration: none;
            transition: background 0.2s ease;
        }

        .related-item:hover {
            background: #f1f5f9;
        }

        .related-item img {
            width: 58px;
            height: 58px;
            border-radius: 12px;
            object-fit: cover;
            flex-shrink: 0;
        }

        .rel-info {
            overflow: hidden;
            text-align: left;
        }

        .rel-title {
            font-size: 14px;
            font-weight: 700;
            color: #334155;
            display: block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
        }

        .rel-cat {
            font-size: 12px;
            color: #64748b;
            display: block;
            margin-bottom: 3px;
        }

        .rel-rating {
            font-size: 12px;
            color: #f59e0b;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 3px;
        }

        .app-screenshots {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            margin: 20px 0 30px;
            padding-bottom: 10px;
            scrollbar-width: thin;
        }

        .app-screenshots img {
            height: 380px;
            border-radius: 18px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: 0.3s;
        }

        .download-container {
            margin-top: 40px;
            text-align: left;
        }

        .download-box {
            background: #f8fafd;
            border-radius: 20px;
            padding: 8px;
        }

        .download-link {
            background-color: var(--accent);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-radius: 16px;
            text-decoration: none;
            font-weight: 600;
        }

        @media (max-width: 600px) {
            .app-screenshots img {
                height: 260px;
            }

            .related-grid {
                grid-template-columns: 1fr;
            }

            /* На мобилках в один столбик */
        }
@media (max-width: 600px) {
            .app-grid {
                grid-template-columns: 1fr;
            }
        }

        .apps-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 15px;
        }

        .apps-item {
            background: var(--card);
            border-radius: var(--radius);
            padding: 15px;
            display: flex;
            align-items: center;
            text-decoration: none;
            color: inherit;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
            transition: 0.2s;
        }

        .apps-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
        }

        .apps-icon {
            width: 65px;
            height: 65px;
            border-radius: 15px;
            margin-right: 15px;
            object-fit: cover;
        }

        .apps-title {
            font-weight: 600;
            font-size: 15px;
            margin-bottom: 4px;
        }


        .mod-tag {
            background: #e8f5e9;
            color: #2e7d32;
            padding: 2px 6px;
            border-radius: 5px;
            font-size: 10px;
            font-weight: 700;
        }

        /* Стили пагинации */
        .pagination {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 40px 0;
        }

        .page-link {
            padding: 10px 18px;
            background: var(--card);
            border-radius: 12px;
            text-decoration: none;
            color: var(--text);
            font-weight: 600;
            font-size: 14px;
            transition: 0.2s;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .page-link:hover {
            background: var(--accent);
            color: #fff;
        }

        .page-link.active {
            background: var(--accent);
            color: #fff;
        }

        @media (max-width: 600px) {
            .apps-grid {
                grid-template-columns: 1fr;
            }
        }
.rating {
    color: #ffa726;
    font-weight: 700;
}




        