:root {
    --bg-color: #000; /* ЧИСТИЙ ЧОРНИЙ ФОН */
    --main-text-color: #368600; /* Зелений термінальний текст */
    --link-button-color: var(--bg-color); 
    --link-button-shadow-color: var(--main-text-color); 
    --back-button-color: #ff0000; 
    --social-icon-color: var(--main-text-color);
}

html {
    height: 100%;
}

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--main-text-color);
    height: 100%;
    overflow-x: hidden;
}

.main-logo-image {
    width: 100%; 
    max-width: 180px; /* Зменшено на 40% (180px) */
    height: auto;
    image-rendering: pixelated;
}

/* БАЗОВИЙ ЛАЙАУТ */
.site-section {
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 100vw;
    min-height: 100vh;
    padding: 10px 20px;
    box-sizing: border-box;
    text-align: center;
}

.main-section {
    justify-content: flex-start;
}

.helper-section, .forum-section, .support-section, .sklad-section, .ada-section, .ex-section {
    justify-content: center; 
    padding-top: 50px; 
}

.main-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center; 
    height: 100%;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    flex-grow: 1;
}

.site-header {
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

/* СТИЛІ ДЛЯ КНОПКИ "НАЗАД" */
.back-button {
    background-color: transparent; 
    border: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease;
    text-decoration: none;
    border-radius: 0;
    margin-left: auto;
    margin-right: 0;
}

.back-button:hover {
    transform: scale(1.05); 
}

.custom-back-icon {
    display: block; 
    width: 50px; 
    height: 50px; 
    image-rendering: pixelated; 
    filter: drop-shadow(2px 2px 0 #333); 
}

/* ФІКС: СТИЛІ ДЛЯ ЗМЕНШЕНИХ КВАДРАТНИХ СОЦІАЛЬНИХ ІКОНОК (ЗМЕНШЕНО НА 35%) */
.social-icons-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 15px; /* Зменшимо відстань між іконками, щоб відповідати новому розміру */
}

.social-icon-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32.5px; /* ЗМІНЕНО: 50px зменшено на 35% */
    height: 32.5px; /* ЗМІНЕНО: 50px зменшено на 35% */
    color: var(--social-icon-color); 
    border: 3px solid var(--social-icon-color); 
    box-shadow: 6px 6px 0 var(--link-button-shadow-color);
    transition: all 0.1s ease;
    text-decoration: none;
    font-size: 1.2em; /* Зменшуємо розмір шрифту всередині, щоб відповідати контейнеру */
}

.social-icon-link:hover {
    color: #ffffff;
    box-shadow: 3px 3px 0 var(--link-button-shadow-color);
    transform: translate(3px, 3px);
}
/* КІНЕЦЬ ФІКСУ СОЦІАЛЬНИХ ІКОНОК */


/* РЕТРО-КНОПКИ ТА ІНФО-БОКСИ */
.retro-button {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--link-button-color);
    color: var(--main-text-color);
    text-decoration: none;
    padding: 10px 15px;
    margin: 10px 5px;
    border: none;
    box-shadow: none;
    transition: color 0.1s ease;
    display: inline-block;
    cursor: pointer;
    text-align: center;
    font-size: 0.8em;
    line-height: 1;
}

.external-link-button {
    border: 3px solid var(--main-text-color);
    box-shadow: 6px 6px 0 var(--link-button-shadow-color);
}

.external-link-button:hover {
    box-shadow: 3px 3px 0 var(--link-button-shadow-color);
    transform: translate(3px, 3px);
    color: #ffffff;
}

.retro-button:hover {
    color: #ffffff;
}

.download-apk-button {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 1em;
}

.retro-info-box {
    background-color: var(--bg-color);
    border: none;
    box-shadow: none;
    padding: 10px;
    margin: 20px 0;
    width: 80%;
    max-width: 350px;
    color: var(--main-text-color);
    text-align: center;
}

.main-nav-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px;
    text-align: center;
    background-color: transparent;
    color: var(--main-text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.8em;
    font-weight: 600;
    border: none;
    box-shadow: none;
    position: relative;
    cursor: pointer;
    min-width: 80px;
}

.main-nav-link:hover {
    color: #ffffff;
}

.button-sub-caption {
    display: block;
    font-size: 0.45em;
    margin-top: 2px;
    color: var(--main-text-color);
}

/* ФІКС: ПРИМУСОВИЙ ЗЕЛЕНИЙ КОЛІР ДЛЯ ЗОБРАЖЕНЬ */
.nav-image {
    max-width: 50px;
    height: auto;
    margin-bottom: 5px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 0 var(--main-text-color));
}

.text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.1;
}

/* ДІАЛОГОВИЙ СТИЛЬ: ПОВНЕ ЦЕНТРУВАННЯ НА ПК ТА МОБІЛЬНИХ */
.folder-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 100%;
    max-width: 600px; 
    margin: 0 auto; 
    gap: 20px; 
}

.dialog-link.main-nav-link {
    flex-direction: row;
    align-items: center;
    padding: 12px 15px; 
    width: 100%; 
    max-width: 350px; 
    background-color: var(--link-button-color);
    color: var(--main-text-color);
    border: none;
    box-shadow: none;
    font-size: 0.9em;
    transition: color 0.1s ease;
    margin: 0; 
    align-self: center; 
}

.dialog-link:hover {
    color: #ffffff;
}

.dialog-link .nav-image {
    margin-bottom: 0;
}

/* НОВІ СТИЛІ: КНОПКИ В КІМНАТАХ (EX, ADA, SKLAD) В СТОВПЧИК */
.ex-section .link-container,
.ada-section .link-container,
.sklad-section .link-container {
    display: flex;
    flex-direction: column; /* Кнопки в стовпчик */
    align-items: center; /* Центрування кнопок по горизонталі */
    width: 100%;
    max-width: 350px; /* Обмеження ширини контейнера для кращого вигляду */
    margin: 20px auto 0; /* Відступ зверху, центрування контейнера */
}

/* Забезпечення повної ширини кнопок всередині контейнера та правильних відступів */
.ex-section .link-container .retro-button,
.ada-section .link-container .retro-button,
.sklad-section .link-container .retro-button {
    width: 100%;
    margin: 8px 0; /* Вертикальний відступ між кнопками, горизонтальний - нуль */
    box-sizing: border-box;
}


/* ВНУТРІШНІЙ ПОРЯДОК ІКОНОК/ТЕКСТУ (СВАП) */
.dialog-link.align-left .nav-image {
    order: 0;
}

.dialog-link.align-left .text-group {
    order: 1;
    align-items: flex-start; 
    margin-left: 5px; 
    flex-grow: 1;
}

.dialog-link.align-right .text-group {
    order: 0;
    align-items: flex-end; 
    margin-right: 5px; 
    flex-grow: 1;
}

.dialog-link.align-right .nav-image {
    order: 1;
}


.row-bottom-links {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    max-width: 450px;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 10px;
    align-self: center;
}

.row-bottom-links .main-nav-link {
    min-width: 100px;
    border: none;
    box-shadow: none;
    background-color: var(--link-button-color);
}

.row-bottom-links .main-nav-link:hover {
    color: #ffffff;
}

.section-image {
    max-width: 300px;
    height: auto;
    image-rendering: pixelated;
}


/* МОБІЛЬНА АДАПТАЦІЯ */
@media (max-width: 768px) {
    body {
        font-size: 0.9em;
    }

    .main-logo-image {
        max-width: 150px;
    }
    
    /* ЗМЕНШЕННЯ СОЦІАЛЬНИХ ІКОНОК НА МОБІЛЬНИХ ТЕЖ */
    .social-icon-link {
        width: 32.5px;
        height: 32.5px;
    }

    .folder-container {
        gap: 10px;
    }
    
    .dialog-link.main-nav-link {
        font-size: 0.8em;
        max-width: 300px; 
        padding: 10px; 
    }

    .dialog-link.align-left .text-group {
        margin-left: 3px; 
    }
    .dialog-link.align-right .text-group {
        margin-right: 3px; 
    }

    .dialog-link .nav-image {
        max-width: 45px; 
    }
    
    .dialog-link.align-left .text-group,
    .dialog-link.align-right .text-group {
        align-items: center; 
        flex-grow: 0; 
    }
    
    .row-bottom-links {
        max-width: 300px;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .row-bottom-links .main-nav-link {
        width: 45%;
    }

    .section-image {
        max-width: 50%;
    }
}