/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    --text-primary: #f0f4ff;
    --text-secondary: #b0bcdb;
    --text-muted: #6a7a9e;
    --glass-bg: rgba(18, 30, 48, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #080c18;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== ОРБЫ ===== */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: floatOrb 12s ease-in-out infinite alternate;
    transform: translateZ(0);
    will-change: transform;
}

.orb--1 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, #4f46e5, #7c3aed);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb--2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #7c3aed, #a78bfa);
    bottom: -150px;
    right: -150px;
    animation-delay: -3s;
}

.orb--3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #a78bfa, #4f46e5);
    top: 40%;
    left: 60%;
    animation-delay: -6s;
}

.orb--4 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #4f46e5, #7c3aed);
    bottom: 20%;
    left: 10%;
    animation-delay: -9s;
    opacity: 0.2;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-30px, 40px) scale(0.95); }
    100% { transform: translate(20px, -20px) scale(1.02); }
}

/* ===== КАРТОЧКА ===== */
.glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 660px;
    height: 100%;
    max-height: 100%;
    padding: 16px 20px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
    will-change: transform, opacity;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: fadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    overflow: hidden;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== БЛОК 1: ВЕРХ ===== */
.block-top {
    flex-shrink: 0;
    padding-bottom: 4px;
}

.header-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.header-logo {
    display: inline-block;
    padding: 4px 16px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.header-logo:hover {
    transform: scale(1.02);
}

.logo-img {
    display: block;
    height: 120px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(79, 70, 229, 0.2));
}

.project-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #e8eeff 0%, #b0bcdb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
    flex-shrink: 0;
    line-height: 1.2;
}

.project-sub {
    font-size: 12px;
    font-weight: 500;
    color: rgba(180, 200, 215, 0.35);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.divider-top {
    width: 100%;
    height: 1px;
    margin: 12px auto 12px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

/* ===== БЛОК 2: СРЕДНИЙ ===== */
.block-middle {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 6px 0 6px 0;
    display: flex;
    flex-direction: column;
}

.divider-middle-top {
    flex-shrink: 0;
    width: 60%;
    height: 1px;
    margin: 0 auto 6px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.app-grid-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===== СЕТКА 3×4 ФИКСИРОВАННАЯ ===== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    height: 100%;
    overflow: hidden;
}

.app-grid::-webkit-scrollbar {
    display: none;
}

.divider-middle-bottom {
    flex-shrink: 0;
    width: 60%;
    height: 1px;
    margin: 6px auto 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

/* ============================================================ */
/* ===== ЯРЛЫКИ — БЕЗ ФОНОВ И РАМОК ===== */
/* ============================================================ */

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    text-decoration: none;
    color: var(--text-primary);
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    animation: fadeInItem 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeInItem {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-item:hover {
    transform: translateY(-2px);
}

.app-item:active {
    transform: scale(0.95);
}

/* ===== ИКОНКА — БОЛЬШАЯ, БЕЗ ФОНА ===== */
.app-icon {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.app-item:hover .app-icon {
    transform: scale(1.05);
}

/* SVG и PNG внутри иконки */
.app-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

.app-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== ПОДПИСЬ ===== */
.app-label {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    letter-spacing: 0.2px;
    transition: color 0.2s ease;
}

.app-item:hover .app-label {
    color: var(--text-primary);
}

/* ===== БЛОК 3: НИЗ ===== */
.block-bottom {
    flex-shrink: 0;
    position: relative;
    height: 44px;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 4px;
}

.ad-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 8px;
    height: 100%;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
}

.ad-scroll::-webkit-scrollbar {
    display: none;
}

.ad-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ad-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.ad-item:active {
    transform: scale(0.92);
}

.ad-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

.ad-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.ad-fade {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(18, 30, 48, 0.9));
    border-radius: 0 12px 12px 0;
}

/* ============================================================ */
/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
/* ============================================================ */

@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .glass-card {
        padding: 12px 14px 10px;
        border-radius: 24px;
        background: rgba(18, 30, 48, 0.92) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: 1px solid rgba(255, 255, 255, 0.04) !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
        max-width: 100%;
    }

    .block-top {
        padding-bottom: 3px;
    }

    .header-logo-wrapper {
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .header-logo {
        padding: 2px 10px;
    }

    .logo-img {
        height: 90px;
    }

    .project-title {
        font-size: 20px;
    }

    .project-sub {
        font-size: 12px;
        letter-spacing: 2px;
        margin-bottom: 3px;
    }

    .divider-top {
        margin: 12px auto;
        width: 100%;
    }

    .block-middle {
        padding: 4px 0 4px 0;
    }

    .divider-middle-top {
        width: 50%;
        margin: 0 auto 4px;
    }

    .divider-middle-bottom {
        width: 50%;
        margin: 4px auto 0;
    }

    .app-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 8px;
    }

    .app-item {
        padding: 2px;
        gap: 4px;
    }

    .app-icon {
        max-width: 80px;
    }

    .app-label {
        font-size: 14px;
    }

    .block-bottom {
        height: 38px;
        border-radius: 10px;
        margin-top: 3px;
    }

    .ad-scroll {
        gap: 5px;
        padding: 2px 6px;
    }

    .ad-item {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }

    .ad-icon {
        width: 18px;
        height: 18px;
    }

    .ad-fade {
        width: 22px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    .glass-card {
        padding: 8px 10px 6px;
        border-radius: 18px;
    }

    .logo-img {
        height: 50px;
    }

    .project-title {
        font-size: 11px;
    }

    .project-sub {
        font-size: 6px;
        letter-spacing: 1.5px;
    }

    .block-middle {
        padding: 3px 0 3px 0;
    }

    .divider-middle-top {
        margin: 0 auto 3px;
        width: 40%;
    }

    .divider-middle-bottom {
        margin: 3px auto 0;
        width: 40%;
    }

    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
        gap: 6px;
    }

    .app-item {
        padding: 2px;
        gap: 3px;
    }

    .app-icon {
        max-width: 60px;
    }

    .app-label {
        font-size: 8px;
    }

    .block-bottom {
        height: 32px;
        border-radius: 8px;
        margin-top: 2px;
    }

    .ad-scroll {
        gap: 4px;
        padding: 2px 4px;
    }

    .ad-item {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }

    .ad-icon {
        width: 16px;
        height: 16px;
    }

    .ad-fade {
        width: 18px;
    }
}