/* ending-ui.css */
@import url("fonts.css");

#ending-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 1;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#ending-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    text-align: center;
    z-index: 2;
}

#ending-text {
    color: white;
    font-family: AvenirLTStd-Roman;
    font-size: clamp(16px, 4.5vw, 24px);
    line-height: 1.4;
    margin-bottom: 30px;
    text-align: center;
}

#ending-book-title {
    font-style: italic;
    font-family: AveriaSerifLibre-Italic;
}

#ending-book-cover {
    width: clamp(200px, 50vw, 300px);
    height: auto;
    aspect-ratio: 2/3;
    /* Typical book cover ratio */
    margin: 30px auto;
    background-image: url('../images/book-cover.webp');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

#ending-restart-button {
    position: relative;
    width: clamp(250px, 60vw, 400px);
    height: auto;
    aspect-ratio: 1084/225;
    /* Same ratio as other menu buttons */
    margin: 30px auto 0;
    background-image: url('../images/TableOfContents_Option.webp');
    background-repeat: no-repeat;
    background-size: 100%;
    background-position: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#ending-restart-button:hover {
    transform: scale(1.05);
}

#ending-restart-button:active {
    transform: scale(0.98);
}

#ending-restart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: auto;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    font-family: Iowan;
    font-size: clamp(14px, 5vw, 20px);
    color: white;
    text-align: center;
    pointer-events: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Responsive adjustments */
@media screen and (max-height: 600px) {
    #ending-content {
        transform: scale(0.9);
    }

    #ending-book-cover {
        margin: 20px auto;
    }

    #ending-restart-button {
        margin: 20px auto 0;
    }
}