/* --- Общие элементы страниц --- */
/* Брейкпоинты: 600px — телефоны (типографика); 768px — главная/инфо; 900px — сетки, планшет */
:root {
    --font-determination: 'DeterminationRusFont', monospace;
    --color-link: rgb(251, 255, 0);
    --color-link-hover: rgb(251, 204, 0);
}

@font-face {
    /*original src: https://fonts-online.ru/fonts/determination-monorus-lyajk*/
    font-family: 'DeterminationRusFont';
    src: url('../fonts/determinationmonorusbylyajk.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: black;
}

#backgroundHeight {
    background-image: url("../images/CHAOTICVERSE_1.webp");
    background-repeat: no-repeat;
    background-position: center top;
}

/* Полноширинные картинки только внутри оверлея (lightbox и прочее вне .fixed-overlay не ломаются) */
.fixed-overlay img {
    width: 99.2vw;
    height: auto;
    display: block;
}

h1 {
    margin-top: 40px;
    margin-bottom: 5px;
}

h2 {
    margin-top: 20px;
    margin-bottom: 5px;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

hr.divider {
    border: none;
    height: 2px;
    background-color: white;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
}

.fixed-overlay {
    position: fixed;
    top: 10%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    width: auto;
    max-height: 90vh;
    max-width: 90vw;
    background-color: rgba(0, 0, 0, 0.85);
    border: 2px solid white;
    box-sizing: border-box;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
}

.fixed-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.fixed-overlay::-webkit-scrollbar {
    width: 8px;
}
.fixed-overlay::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.overlay-footer-text {
    text-align: center;
    color: white;
    font-family: var(--font-determination);
    font-size: 16px;
    opacity: 0.75;
    margin-top: 20px;
}

.minimize-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: rgb(255,255,250);
    font-family: var(--font-determination);
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
}

.restore-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgb(255,255,250);
    border-radius: 0;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-family: var(--font-determination);
    color: black;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 0 10px rgba(255,255,206, 0.6);
    display: none;
}

.lang-toggle-button {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    padding: 4px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid white;
    cursor: pointer;
    font-family: var(--font-determination);
    transition: background-color 0.3s;
}

.lang-toggle-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 0 10px;
}

.nav-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-button img {
    width: 250px;  /* размер кнопки */
    height: auto;
    max-width: 100%;
    transition: transform 0.2s ease;
}

.nav-button:hover img {
    transform: scale(1.1); /* эффект при наведении */
}

.nav-long-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    max-width: 100%;
    display: inline-block;
}

.nav-long-button img {
    width: auto;
    height: 70px;
    max-height: 100%;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.nav-long-button:hover img {
    transform: scale(1.1); /* эффект при наведении */
}

@media (max-width: 768px){
    .nav-button img {
        width: 140px;
    }

    .nav-long-button img {
        height: 30px;
    }
}

.image-title {
    display: block;
    max-width: 80%;
    height: auto;
    margin: 5px auto auto auto;
}

@media (max-width: 900px){
    .image-title {
        max-width: 90%;
    }
}

/* --- Типовая колонка контента в оверлее --- */
.overlay-content-characters-page,
.overlay-content-information-page,
.overlay-content-contents-page,
.overlay-content-about-us-page,
.overlay-content-progress-page,
.overlay-content-artworks-page {
    font-family: var(--font-determination);
    font-size: 26px;
    color: white;
    text-align: center;
    padding: 40px;
    line-height: 1.6;
    margin-bottom: 5px;
}

.overlay-content-home-page {
    font-family: var(--font-determination);
    font-size: 28px;
    color: white;
    text-align: center;
    padding: 20px;
    line-height: 1.6;
    margin-bottom: 5px;
}

@media (max-width: 900px) {
    .overlay-content-characters-page {
        font-size: 18px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .overlay-content-information-page {
        font-size: 18px;
        padding: 20px;
    }

    .overlay-content-home-page {
        font-size: 20px;
        padding: 20px;
    }
}

/* --- Общие блоки: список персонажей и страница «О нас» --- */
.character-info-section,
.people-info-section {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.character-info-block,
.person-info-block {
    display: flex;
    align-items: center;
    gap: 80px;
    flex-wrap: nowrap;
}

/* Узкий экран: две колонки — слева картинка и имя столбиком, справа описание на всю высоту */
@media (max-width: 900px) {
    .character-info-block,
    .person-info-block {
        display: grid;
        /* Левая колонка под аватар + имя; правая — текст (не меньше ~55% под описание) */
        grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
        column-gap: 14px;
        row-gap: 10px;
        align-items: start;
    }

    .character-info-block > :nth-child(1),
    .person-info-block > :nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
    }

    .character-info-block > :nth-child(2),
    .person-info-block > :nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        text-align: center;
        width: 100%;
        min-width: 0;
    }

    .character-info-block > :nth-child(3),
    .person-info-block > :nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: start;
        min-width: 0;
    }

    .character-info-block .character-icon,
    .person-info-block .person-icon {
        width: min(150px, 100%);
        height: auto;
        aspect-ratio: 1;
        max-width: 100%;
    }
}

.character-icon,
.person-icon,
.second-character-icon,
.person-group-icon {
    width: 150px;
    height: 150px;
    background-color: white;
    border: 2px solid #ccc;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.character-icon,
.person-icon {
    flex-shrink: 0;
}

.person-group-icon {
    transition: border-color 0.3s ease;
}

.person-group-icon:hover {
    border-color: rgb(251, 204, 0);
}

.character-icon img,
.person-icon img,
.second-character-icon img,
.person-group-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-name,
.person-name {
    color: white;
    font-weight: bold;
    font-size: 32px;
    min-width: 150px;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .character-name,
    .person-name {
        font-size: 24px;
        min-width: auto;
        white-space: normal;
    }
}

.character-description,
.person-description {
    color: white;
    font-size: 24px;
    flex-grow: 1;
    word-wrap: break-word;
    margin-left: -50px;
}

@media (max-width: 900px) {
    .character-description,
    .person-description {
        margin-left: 0;
        font-size: 18px;
    }
}

.link-text,
.titles-text {
    font-size: 20px;
}

@media (max-width: 900px) {
    .link-text,
    .titles-text {
        font-size: 16px;
    }
}

.second-characters-grid,
.people-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 100px;
    margin-top: 30px;
}

.second-character-card,
.person-group-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.second-character-card {
    margin-bottom: -50px;
}

.second-character-text,
.person-group-text {
    text-align: center;
    margin-top: 10px;
}

.char-name,
.person-group-name {
    color: white;
    font-weight: bold;
    font-size: 28px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .second-character-card,
    .person-group-card {
        width: 100px;
    }

    .second-character-icon,
    .person-group-icon {
        width: 100px;
        height: 100px;
    }

    .char-name,
    .person-group-name {
        font-size: 20px;
    }
}

/* --- Телефоны (узкий экран): компактнее шрифты для чтения --- */
@media (max-width: 600px) {
    .fixed-overlay {
        padding: 12px;
    }

    .overlay-footer-text {
        font-size: 12px;
    }

    .lang-toggle-button {
        font-size: 18px;
        padding: 3px 8px;
    }

    .minimize-button {
        font-size: 22px;
    }

    .overlay-content-characters-page,
    .overlay-content-information-page,
    .overlay-content-contents-page,
    .overlay-content-about-us-page,
    .overlay-content-progress-page,
    .overlay-content-artworks-page {
        font-size: 15px;
        padding: 12px 8px;
        line-height: 1.5;
    }

    .overlay-content-home-page {
        font-size: 16px;
        padding: 12px 8px;
        line-height: 1.5;
    }

    .character-name,
    .person-name {
        font-size: 17px;
    }

    .character-description,
    .person-description {
        font-size: 14px;
    }

    .link-text,
    .titles-text {
        font-size: 13px;
    }

    .char-name,
    .person-group-name {
        font-size: 16px;
    }

    .overlay-content-about-us-page h2,
    .overlay-content-information-page h2 {
        font-size: 20px;
        margin-top: 22px;
    }
}
