/* Обновленные стили для домашней страницы */

/* Контейнер домашней страницы */
.container {
    min-height: 100vh;
    box-sizing: border-box;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: 0;
}

/* Основная карточка матрицы */
.main-matrix-card {
    margin: 20px auto;
    max-width: 480px;
    width: 100%;
    height: auto;
    position: relative;
}

.main-matrix-card .card {
    min-height: auto;
    height: auto;
    padding: 30px 20px;
    display: block;
    text-align: center;
    padding-top: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
}

/* Заголовок основной карточки */
.main-matrix-card h2.title {
    margin-bottom: 0px !important; 
    margin: 0;
    padding: 0;
    font-size: 1.6rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Стили для кнопок матрицы */
.matrix-button {
    width: 100%;
    border: none;
    background: transparent;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    height: auto;
    min-height: 70px;
    display: block; /* Added to ensure consistent block behavior */
}

.matrix-button.half-width {
    width: calc(50% - 6px);
    min-height: 70px;
}

.matrix-button:hover {
    transform: translateY(-2px);
}

.matrix-button .card {
    width: 100%;
    height: 100%;
    transition: box-shadow 0.3s ease;
    padding: 0; /* Reset padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; /* Allow for absolute positioning of children if needed */
}

.matrix-button:hover .card {
    box-shadow: 0 0 15px rgba(161, 138, 255, 0.3);
}

/* Strict card layout for buttons */
.button-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 10px; /* Standard padding for all button cards */
}

.matrix-button .card-icon {
    margin: 0 0 8px 0; /* No top margin, fixed bottom margin */
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-title {
    font-size: 1rem !important;
    margin: 0;
    line-height: 1.3;
    text-align: center;
    width: 100%;
    overflow-wrap: normal;
    word-wrap: normal;
    word-break: keep-all;
    white-space: normal;
    hyphens: none;
}

/* Контейнер для опций матрицы */
.matrix-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin: 20px auto 0;
}

.matrix-options-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
}

.matrix-options-row:last-child {
    margin-bottom: 0;
}

/* Стили заголовков карточек */
.card-title-white {
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    flex-wrap: wrap;
    justify-content: center;
}

/* Иконки в заголовках */
.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.matrix-button .card-icon {
    margin: 0 0 8px 0; /* No top margin, fixed bottom margin */
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Описание под заголовком */
.main-matrix-card .description {
    margin: 8px 0 0;
    padding: 0 15px;
    line-height: 1.4;
}

/* Фон со звездами */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
}

.stars-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../static/star.jpg');
    background-size: cover;
    background-position: center;
    z-index: -2;
    opacity: 0.8; /* Регулировать прозрачность звезд */
}

/* .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    mix-blend-mode: screen; 
} */
.matrix-button .card {
    justify-content: start !important;
}
/* Медиа-запросы для адаптивности */
@media (min-width: 769px) {
    .container {
        justify-content: center;
        /* height: calc(100vh - 80px); */
    }
    
    .main-matrix-card {
        margin: 0 auto 24px;
    }
    
    .button-title {
        font-size: 1rem !important;
    }
    
    .matrix-button .card {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-matrix-card {
        margin: 10px auto 20px;
    }
    
    .main-matrix-card .card {
        padding: 25px 15px;
    }
    
    .matrix-options {
        gap: 10px;
        margin-top: 15px;
    }
    
    .matrix-options-row {
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .matrix-button,
    .matrix-button.half-width {
        min-height: 65px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 12px;
    }
    
    .main-matrix-card { 
        max-width: 100%;
        margin: 5px auto 10px;
    }
    
    .main-matrix-card .card {
        padding: 20px 15px;
    }
    
    .matrix-options {
        gap: 8px;
        margin-top: 12px;
    }
    
    .matrix-options-row {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .matrix-button,
    .matrix-button.half-width {
        min-height: 60px;
    }
    
    .main-matrix-card h2.title {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .main-matrix-card .description {
        font-size: 1rem;
        margin: 5px 0 0 0;
        padding: 0 5px;
    }
    
    .button-title {
        font-size: 0.9rem !important;
        padding: 8px 3px;
    }
    
    .card-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .matrix-button .card {
        padding: 8px 0; /* Smaller standardized padding for mobile */
    }
    
    .matrix-button .card-icon {
        margin: 0 0 6px 0; /* Smaller bottom margin on mobile */
    }
    
    .button-card-content {
        padding: 12px 8px; /* Smaller padding for mobile */
    }
}

@media (max-width: 350px) {
    .container {
        padding: 10px 8px;
    }
    
    .main-matrix-card .card {
        padding: 18px 10px;
    }
    
    .main-matrix-card h2.title {
        font-size: 1.3rem;
    }
    
    .main-matrix-card .description {
        font-size: 0.9rem;
    }
    
    .matrix-options {
        gap: 6px;
    }
    
    .matrix-options-row {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .matrix-button,
    .matrix-button.half-width {
        min-height: 55px;
    }
    
    .button-title {
        font-size: 0.8rem !important;
        padding: 6px 2px;
    }
    
    .card-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .matrix-button .card {
        padding: 6px 0; /* Even smaller standardized padding for tiny screens */
    }
    
    .matrix-button .card-icon {
        margin: 0 0 4px 0; /* Smaller margin on very small screens */
    }
    
    .button-card-content {
        padding: 10px 6px; /* Even smaller padding for tiny screens */
    }
}

/* Для очень низких экранов */
@media (max-height: 550px) {
    .container {
        height: auto;
        min-height: 100vh;
        padding: 10px;
    }
    
    .main-matrix-card .card {
        padding: 15px 10px;
    }
    
    .main-matrix-card h2.title {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .matrix-options {
        margin-top: 10px;
        gap: 6px;
    }
    
    .matrix-options-row {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .matrix-button,
    .matrix-button.half-width {
        min-height: 50px;
    }
}

/* Для устройств с маленькой высотой и шириной (например, в ландшафтной ориентации) */
@media (max-height: 450px) {
    .main-matrix-card .card {
        padding: 12px 8px;
    }
    
    .main-matrix-card h2.title {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }
    
    .main-matrix-card .description {
        font-size: 0.85rem;
        margin: 3px 0 0;
    }
    
    .matrix-options {
        gap: 5px;
        margin-top: 8px;
    }
    
    .matrix-options-row {
        gap: 5px;
        margin-bottom: 5px;
    }
    
    .matrix-button,
    .matrix-button.half-width {
        min-height: 45px;
    }
    
    .button-title {
        padding: 4px 2px;
    }
    
    .matrix-button .card {
        padding: 4px 0; /* Minimal padding for low height screens */
    }
    
    .matrix-button .card-icon {
        margin: 0 0 3px 0; /* Minimal margin for low height */
    }
    
    .button-card-content {
        padding: 8px 5px; /* Minimal padding for low height screens */
    }
}