:root {
    font-family: monospace;
    touch-action: none;

    --caption-font-family: "SCDF";  
}

html, body {
    overflow: hidden;

    margin: 0; padding: 0;
    width: 100%; height: 100%;

    font-family: "Chiaro";
}

#full-container video, #full-container img {
    width: 100%; height: 100%;
    object-fit: cover;

    background-color: black;
}

#safe-container {
    padding: 1rem;

    width: 640px; height: 480px;
}

#background-video {
    z-index: -100;
    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    height: 100%;
}

#background-video img, #background-video video {
    object-fit: cover;
    width: 100%;
    height: 100%;

    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    height: 100%;
}

.panel {
    display: flex;
    font-size: 14px;

    background: #2f100e;
    color: #f2d0b6;

    outline: 2px solid #122c27;

    contain: paint;
}

.epilogueX .panel, .epilogueY .panel {
    font-size:24px;

    background: #fff;
    color: #000;
}

.epilogueX .panel .char-reveal, .epilogueY .panel .char-reveal {
    animation-name: char-reveal-end;
    animation-direction: alternate;
    animation-duration: .35s;
    position: relative;
}

.epilogueX .panel {

    outline: 4px solid rgb(7, 81, 165);
}

.epilogueY .panel {

    outline: 4px solid #25a50b;
}

.log-cell {
    width: 100%; height: 100%;
}

.portrait-right {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 8px;
}

.portrait-left {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

img {
    display: flex;
}

.text {
    padding: .5rem .7rem;
    padding-bottom: .7rem;
    padding-right: calc(.7rem + 1ch);
}

.dialogue-pages {
    display: grid;
}

.dialogue-page {
    grid-area: 1 / 1 / 2 / 2;
}

.choice {
    display: flex;
    flex-direction: column;

    padding: 0.25rem;
    margin: 0;

    background: #2f100e;
    color: #f2d0b6;
    text-align:center;
}

.choice label {
    position: relative;
}

.choice-label {
    padding: .25rem .5rem;
}

.choice input {
    -moz-appearance: none;
    margin: 0;

    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;

    opacity: 0;
    
    pointer-events: all;
    cursor: pointer;
}

:checked+.choice-label {
    color: #2f100e;
    background: #f2d0b6;
}

:disabled+.choice-label {
    text-decoration: line-through;
}

.hidden {
    /* color: transparent; */
    visibility: hidden;
}

.cursor {
    position: absolute;
    color: transparent;
    box-shadow: inset 0px 0px 0 .5px #f2d0b6;

    top: 0;
    left: 0;
    transform: translate(100%, 0);

    animation-name: char-cursor;
    animation-direction: alternate;
    animation-duration: .5s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.epilogueX .panel .dialogue-page .char-reveal .cursor, .epilogueY .panel .dialogue-page .char-reveal .cursor {
    box-shadow: inset 0px 0px 0 .5px #000;

    animation-name: char-cursor-end;
}

.char-hidden {
    visibility: hidden;
    position: relative;
}

.panel .char-reveal {
    animation-name: char-reveal;
    animation-direction: alternate;
    animation-duration: .35s;
    position: relative;
}

.info-text {
    padding: .25em;
    text-shadow: 1px 1px 1px #000;
    font-family: var(--caption-font-family);
    text-transform: uppercase;

    filter: drop-shadow(0 0 1px black);
}

.info-text .char-reveal {
    animation-name: caption-char-reveal;
    animation-direction: alternate;
    animation-duration: .5s;
}

.info-text .cursor {
    all: revert;

    position: absolute;
    color: transparent;
    border-bottom: solid white .5px;

    top: 0;
    left: 0;
    transform: translate(100%, 0);
}

.info-text-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    /* text-align: center; */
}

.info-text-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    /* text-align: center; */
}

.name {
    position: absolute;
    bottom: 0;
    left: 0;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-container {
    width: 100%;
    height: 100%;

    display: flex;

    overflow: hidden;
}

.log-content {
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 1em;
    text-align:center;
}

.log-wipe {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    margin: 1px;
    border-top: 1px solid currentColor;
    background: black;
}

@keyframes char-reveal {
    0% {
        box-shadow: inset 0px 0px 0 .5px #f2d0b6;
        color: transparent;
    }

    45% {
        color: #f2d0b6;
    }

    100% {
        box-shadow: inset 0px 0px 0 .5px transparent;
        color: #f2d0b6;
    }
}

@keyframes char-reveal-end {
    0% {
        box-shadow: inset 0px 0px 0 .5px #000;
        color: transparent;
    }

    45% {
        color: #000;
    }

    100% {
        box-shadow: inset 0px 0px 0 .5px transparent;
        color: #000;
    }
}

@keyframes char-cursor {
    0% {}

    100% {
        background: #f2d0b6;
    }
}

@keyframes char-cursor-end {
    0% {}

    100% {
        background: #000;
    }
}

@keyframes caption-char-reveal {
    0% {
        color: #FFFFFF00;
        text-shadow: 1px 1px 1px #0000;
    }

    100% {
        color: #FFFFFFFF;
        text-shadow: 1px 1px 1px #000F;
    }
}

@keyframes caption-fadeout {
    0% {
        opacity: 100%;
    }

    100% {
        opacity: 0%;
    }
}

@keyframes grow-in {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes grow-out {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 100%;
    }
}

@keyframes fade-out {
    0% {
        opacity: 100%;
    }

    100% {
        opacity: 0;
    }
}

@keyframes dim {
    100% {
        filter: saturate(0);
    }
}

@keyframes dim-out {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
        filter: saturate(0);
    }
}

@keyframes log-wipe {
    0% {
        height: 0;
    }

    100% {
        height: 100%;
    }
}

.flip img {
    transform: scale(100%, -100%);
}

.mirror img {
    transform: scale(-100%, 100%);
}

