/* Общие стили и переменные */
:root {
    --bg-dark: #090014;
    --neon-purple: #bc13fe;
    --neon-blue: #00f3ff;
    --text-color: #ffffff;
    --glass-bg: rgba(20, 0, 30, 0.6);
    --glass-border: rgba(188, 19, 254, 0.3);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: var(--text-color);
    overflow: hidden; /* Скрываем скролл, фон фиксированный */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* --- СИСТЕМА ФОНОВ --- */

#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: #000;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 5s linear; 
    pointer-events: none;
}

.bg-layer.active {
    opacity: 1;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(10px);
    transform: scale(1.05);
}

/* --- НАСТРОЙКИ ФОНА 0 (ФИГУРЫ) --- */

.shape-layer {
    background: linear-gradient(45deg, #1a0b2e, #160030, #0f0518);
    overflow: hidden;
}

.shape-inner-wrapper {
    width: 100%;
    height: 100%;
    animation: pulse-opacity 8s ease-in-out infinite;
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.6;
}

.shape1 {
    width: 50vh;
    height: 50vh;
    background: var(--neon-purple);
    top: -10%;
    left: -10%;
    animation: float1 20s infinite alternate ease-in-out;
}

.shape2 {
    width: 60vh;
    height: 60vh;
    background: #4c00ff;
    bottom: -10%;
    right: -10%;
    animation: float2 25s infinite alternate ease-in-out;
}

.shape3 {
    width: 40vh;
    height: 40vh;
    background: var(--neon-blue);
    top: 40%;
    left: 40%;
    animation: float3 22s infinite alternate ease-in-out;
}

@keyframes float1 { from { transform: translate(0, 0); } to { transform: translate(100px, 150px); } }
@keyframes float2 { from { transform: translate(0, 0); } to { transform: translate(-150px, -100px); } }
@keyframes float3 { from { transform: translate(-50%, -50%); } to { transform: translate(-30%, -30%); } }

/* --- ШУМ --- */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1000 1000' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    z-index: -1;
    pointer-events: none;
}

/* --- КОНТЕНТ --- */
.content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.button-grid {
    display: grid;
    /* Адаптивная сетка */
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 800px;
    justify-items: center;
}

/* --- НЕОНОВЫЕ КНОПКИ --- */
.button {
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    width: 130px;
    height: 130px;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(188, 19, 254, 0.1);
    text-shadow: 0 0 5px rgba(188, 19, 254, 0.5);
    /* Запрет выделения текста на мобилках */
    -webkit-tap-highlight-color: transparent; 
    user-select: none;
}

.button i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--neon-blue);
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.6));
    transition: transform 0.3s ease;
}

.button span {
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 0 5px;
}

/* Ховер эффекты */
.button:hover {
    background-color: rgba(40, 10, 60, 0.8);
    border-color: var(--neon-purple);
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.6), 0 0 40px rgba(188, 19, 254, 0.3), inset 0 0 20px rgba(188, 19, 254, 0.2);
}

.button:hover i {
    color: #fff;
    filter: drop-shadow(0 0 8px #fff);
    transform: scale(1.1);
}

.button:active {
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.8);
}

.minecraft-cluster {
    display: contents; /* Позволяет детям участвовать в grid */
}

/* --- КНОПКИ MeshAgent (Слева снизу) --- */

/* Контейнер для кнопок, закреплен слева снизу */
.floating-group-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column-reverse; /* Чтобы они росли вверх или row для в ряд */
    gap: 10px;
    z-index: 100;
}

/* Общий стиль для мини-кнопок */
.mini-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Круглые кнопки */
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none; /* Убираем подчеркивание у ссылок */
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    position: relative;
}

.mini-btn i {
    font-size: 1.2rem;
}

/* Текст версий (64/32) */
.mini-btn .ver {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: bold;
    color: #fff;
    background: #000;
    padding: 1px 3px;
    border-radius: 4px;
    line-height: 1;
}

/* Ховер эффекты */
.mini-btn:hover {
    background-color: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.8);
    transform: scale(1.1);
}
.mini-btn:hover .ver {
    color: var(--neon-blue); /* Инверсия цвета текста при наведении */
    background: #000;
}

.mini-btn:active {
    transform: scale(0.95);
}

/* АДАПТАЦИЯ ПОД ТЕЛЕФОНЫ */
@media (max-width: 600px) {
    .floating-group-left {
        bottom: 15px;
        left: 15px;
        flex-direction: row; /* На телефоне лучше в ряд, чтобы не перекрывать контент */
    }
    .mini-btn {
        width: 40px;
        height: 40px;
    }
    .mini-btn i {
        font-size: 1rem;
    }
}

/* --- ФУТЕР --- */
footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    margin: 0;
}

/* --- АДАПТАЦИЯ ПОД ТЕЛЕФОНЫ --- */
@media (max-width: 600px) {
    /* Меняем размер кнопок */
    .button {
        width: 100px;
        height: 100px;
        font-size: 0.8rem;
    }

    .button i {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    /* Настройка сетки: принудительно 2 или 3 колонки, уменьшаем отступы */
    .button-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
        padding-bottom: 60px; /* Место для футера/кнопки, если экран маленький */
        max-height: 80vh;
        overflow-y: auto; /* Если кнопок много, можно скроллить саму сетку */
    }

    .content {
        padding: 1rem;
    }
    
    /* Скрываем футер или поднимаем его, если мешает, но лучше оставить */
    footer {
        bottom: 10px;
    }
    
    footer p {
        font-size: 0.7rem;
    }

    /* Кнопка mesh agent чуть меньше */
    .floating-btn-left {
        width: 40px;
        height: 40px;
        bottom: 15px;
        left: 15px;
    }
    .floating-btn-left i {
        font-size: 1.2rem;
    }
}

/* Для очень маленьких экранов (iPhone SE и т.п.) */
@media (max-width: 350px) {
    .button-grid {
        grid-template-columns: repeat(2, 1fr); /* Строго 2 колонки */
    }
}