.modal-window {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background-color: #2b2b50;
    border-radius: 20px;
    padding: 2rem;
    z-index: 1200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-window::-webkit-scrollbar {
    width: 6px;
}

.modal-window::-webkit-scrollbar-thumb {
    background: #8D86C9;
    border-radius: 10px;
}

.modal-window .modal-title {
    color: #FBF6E9;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.modal-window .close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #8D86C9;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}

body.open-login .login-modal,
body.open-quiz .quiz-modal,
body.open-notification .notification-modal {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

body.open-login,
body.open-quiz,
body.open-notification {
    overflow: hidden;
}

.truncate-text {
    display: inline-block;
    max-width: 200px;
    vertical-align: bottom;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

@media (max-width: 600px) {
    .modal-window {
        width: 95%;
        padding: 1.5rem 1.2rem;
    }

    .modal-window .modal-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .modal-window .close-modal-btn {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
    }
}

@media (max-height: 450px) and (orientation: landscape) {
    .modal-window {
        padding: 1rem !important;
        max-height: 96vh;
        transform: translate(-50%, -50%) scale(1);
    }

    .modal-window .modal-title {
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }

    .modal-window .close-modal-btn {
        top: 5px;
        right: 10px;
    }
}