
/* =========================================================
   AUTH CHARA INTRO CARD YCAP
   Yakuza-style character introduction cards for cutscenes.
   ========================================================= */

.auth-chara-intro-card-ycap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    background: #000;
}

/* Scene image fills the component's 16:9 frame. */
.auth-chara-intro-scene-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(0);
}

/* Fade into monochrome during the opening sequence. */
.auth-chara-intro-card-ycap.is-playing
.auth-chara-intro-scene-image {
    animation: auth-chara-intro-monochrome-in
        0.41s linear 0.19s forwards;
}

@keyframes auth-chara-intro-monochrome-in {
    from {
        filter: grayscale(0);
    }

    to {
        filter: grayscale(1);
    }
}

/* Restore color as the audio ends. */
.auth-chara-intro-card-ycap.is-ending
.auth-chara-intro-scene-image {
    animation: auth-chara-intro-monochrome-out
        0.65s ease forwards;
}

@keyframes auth-chara-intro-monochrome-out {
    from {
        filter: grayscale(1);
    }

    to {
        filter: grayscale(0);
    }
}

/* Overlay shares the scene image's boundaries. */
.auth-chara-intro-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}

.auth-chara-intro-overlay[hidden] {
    display: none;
}

/* Character title PNG. */
.auth-chara-intro-caption {
    position: absolute;
    left: 50%;
    bottom: 8%;
    z-index: 1;
    display: block;
    width: 85%;
    height: auto;
    max-width: 95%;
    max-height: 45%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%);
    transition: opacity 0.3s ease;
}

/* Reveal caption after the monochrome transition. */
.auth-chara-intro-card-ycap.is-playing
.auth-chara-intro-caption {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
    transition-delay: 0.5s;
}

/* Fade caption out as the scene returns to color. */
.auth-chara-intro-card-ycap.is-ending
.auth-chara-intro-caption {
    visibility: visible;
    opacity: 0;
    transition: opacity 0.65s ease;
    transition-delay: 0s;
}

/* Replay button. */
.auth-chara-intro-trigger {
    position: absolute;
    left: 50%;
    bottom: 4%;
    z-index: 5;
    transform: translateX(-50%);
    padding: 8px 18px;
    min-width: 150px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #fff;
    border-radius: 0;
    font-family: "Tojo Captioner", sans-serif;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.auth-chara-intro-trigger:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.auth-chara-intro-trigger:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.auth-chara-intro-trigger:disabled {
    cursor: default;
    opacity: 0;
}

@media (max-width: 620px) {
    .auth-chara-intro-caption {
        width: 88%;
        max-width: 95%;
        max-height: 40%;
        bottom: 8%;
    }

    .auth-chara-intro-trigger {
        bottom: 3%;
        min-width: 120px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}
