:root {
    --background-color: rgb(255, 230, 79);
    --text-color: rgb(0, 0, 0);
    --text-color: rgb(244, 244, 244);
    --demphasis-color: #ffffff80;
    --border-color: #7b7b7b;
    --color-01: #383838;
    --color-02: #616161;
    --color-02: #fdfdfd;
    --animation-speed-short: 200ms;
    --animation-speed-mid: 400ms;
    --animation-speed-long: 600ms;
    --animation-curve: cubic-bezier(0, .8, .27, .99);
    --animation-curve: cubic-bezier(0.81, 0.06, 0.01, 1.01);
    --animation-curve: cubic-bezier(0.59, 0.06, 0.33, 0.93);
    --animation-curve: cubic-bezier(0.15, 0.51, 0.5, 0.93);
    --animation-curve: cubic-bezier(0, 0.84, 0.5, 0.93);
    --font-height: 1.75em;
    --options-area-height: 5em;
    --radius: 20px;
    --back-button-width: 20px;
    --input-height: 1.2em;
    --spacing: 10px;
    --small-font: .6em;
    --clipboard-height: 17.5rem;
}

/*
This one is a little cute and cartoony
@font-face {
    font-family: 'GowunDodum';
    src: url(/resource/font/GowunDodum-Regular.ttf);
}
*/

/*
@font-face {
    font-family: 'NotoSansKR-Light';
    src: url(/resource/font/NotoSansKR-Light.otf);
}
*/

*, *::before, *::after {
    transition: transform var(--animation-speed-mid) var(--animation-curve), opacity var(--animation-speed-mid) var(--animation-curve);
    box-sizing: border-box;
    position: relative;
    padding: 0;
    margin: 0;
}

form {
    width: inherit;
}

input, textarea, button {
    font-size: inherit;
    font-family: inherit;
    background: transparent;
    color: var(--text-color);
    border: none;
    max-width: 100%;
}

input {
    border-bottom: 1px solid var(--text-color);
}

textarea {
    background-color: var(--background-color);
    color: var(--text-color);
    border-radius: 2px;
    resize: none;
    font: inherit;
    padding: var(--spacing);
}

textarea:focus, input:focus {
    outline: none;
}

body {
    /* background-color: var(--background-color); */
    background-color: white;
    font-size: var(--font-height);
    font-family: 'NotoSansKR-Light', sans-serif;
    background-color: var(--color-01);
}

body>div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none;
}

.loading {
    opacity: .5;
    pointer-events: none;
}

/*
NAV / TITLE STYLES
*/


#site-title {
    background-image: url(/resource/img/clyyp_logo.svg);
    background-repeat: no-repeat;
    background-position: center;
    min-width: 180px;
    height: 3em;
    margin-top: -4em;
}


/*
PAGE STYLES
*/

.page {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    width: 100%;

    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page>* {
    width: 100%;
}

.show-message-area .page, .show-message-area #nav-bar {
    opacity: .75;
}

.section-divider {
    border-bottom: solid 1px var(--text-color);
    margin: calc(var(--spacing)*1.5) 20%;
    opacity: .5;
}

#body:not(.edit) .edit-only, .conversation.show-message-area .edit-only, #body:not(.user) .user-only, #body.user .guest-only {
    display: none;
}

/**** NAV BAR ****/
#nav-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing);
    background-color: var(--background-color);
    border-radius: 0 0 var(--radius) var(--radius);
}

/**** CONVERSATION CONTAINER ****/

#conversation-container {
    padding: 0 var(--spacing);
}

/*** USER ***/
.conversation {
    color: var(--text-color);
    margin: var(--spacing) 0;
    overflow: hidden;
    border-radius: var(--radius);
    z-index: 1;
    /* Appears to help with hiding overflow during animations*/
}

#perspective-container {
    position: fixed;
    height: 100%;
    width: 100%;
    perspective: 800px;
    transition-duration: var(--animation-speed-short);
}

.conversation.show-message-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background-color: var(--background-color);
    margin: 0;
    /* Cancel .conversation margins */
    animation: expand-to-fullscreen var(--animation-speed-long) var(--animation-curve);
}

.conversation.show-message-area .conversation-header, .conversation.show-message-area>*>* {
    animation: fade-in var(--animation-speed-mid) calc(var(--animation-speed-mid) - 200ms) both;
}

.conversation.hide-message-area .conversation-header, .conversation.hide-message-area>*>* {
    animation: fade-in var(--animation-speed-mid) var(--animation-speed-mid) both reverse;
}

/* Move all following siblings down smoothly when message notifications appear or when the user profile is expanded */

.conversation.animate-down-message~.conversation, .conversation.animate-down-message .message-received-indicator {
    animation: slide-down-for-message var(--animation-speed-mid) var(--animation-curve);
}

.conversation.animate-up-message~.conversation, .conversation.animate-up-message .message-received-indicator {
    animation: slide-up-for-message var(--animation-speed-mid) var(--animation-curve);
}

/* WHEN a profile opens, animate down everything following it and everything following the profile area within it.
ALSO, since the user is in a separate section, do the same for everything following that section
(Same for closing the profile with "animate up" below
*/
.conversation.animate-down-profile~*, .conversation.animate-down-profile .options-area, .conversation.animate-down-profile .message-received-indicator, #user-section.animate-down-profile~div {
    animation: slide-down-for-profile var(--animation-speed-mid) var(--animation-curve);
}

.conversation.animate-down-profile {
    animation: interact-wiggle var(--animation-speed-short) var(--animation-curve)
}

.conversation.animate-up-profile~*, .conversation.animate-up-profile .options-area, .conversation.animate-up-profile .message-received-indicator, #user-section.animate-up-profile~div {
    animation: slide-up-for-profile var(--animation-speed-mid) var(--animation-curve);
}

/* Change (shrink) the border radius of the header element once the element below it has transform animated up under it to hide any gaps */
.conversation.animate-up-profile .conversation-header {
    animation: close-border-radius var(--animation-speed-mid) var(--animation-curve);
}

.conversation.animate-up-profile .options-area>* {
    /* I find the appearance of the buttons just disappearing better than sliding up (but a fade out would be prefereable) */
    display: none;
}

/*
.conversation.show-message-area .message-area {
    animation: slide-down-for-message-area var(--animation-speed-mid) var(--animation-curve);
}
*/

/*** ANIMATION-RELATED ADAPTATIONS ***/

.conversation-header {
    z-index: 10;
    align-items: center;
    justify-content: space-between;
}

.conversation-header div {
    /* Keep everything on one line */
    word-break: keep-all;
}

.conversation-header, .message-received-indicator, .options-area, .message-area, .add-reject-conversation-area {
    background-color: var(--background-color);
    /* border: solid 1px rgb(2, 6, 87); */
    border-radius: var(--radius);
    padding: var(--spacing);
}

/* BOTTOM AREAS */
.message-received-indicator, .options-area, .message-area, .add-reject-conversation-area {
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 1;
}

.conversation.message-received.conversation.show-profile-area .options-area {
    border-bottom: none;
    border-radius: 0;
}

/* Instances where the bottom of the header should NOT be rounded (because there is another element following it that it should appear to connect with) */
.conversation.message-received .conversation-header, .conversation.show-profile-area .conversation-header, .conversation.show-message-area .conversation-header, .conversation.pending-conversation .conversation-header {
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

/*** USER HEADER ***/
.conversation-header, .compose-message-area, .add-reject-conversation-input-area {
    display: flex;
    flex-direction: row;
}

.conversation.show-message-area .conversation-header>*, .conversation.show-profile-area .conversation-header>* {
    transform: translateX(0);
}

.conversation:not(.show-message-area):not(.show-profile-area) .conversation-header>*, .conversation.animate-up-profile .conversation-header>* {
    transform: translateX(calc(-1 * var(--back-button-width)));
}

/*** USER BACK BUTTON ***/
.conversation-back-button {
    opacity: 0;
    pointer-events: none;
    width: var(--back-button-width);
}

.conversation.show-profile-area:not(.animate-up-profile) .conversation-back-button, .conversation.show-message-area .conversation-back-button {
    opacity: 1;
    pointer-events: initial;
}

/*** PROFILE AREA ***/
.conversation:not(.show-profile-area) .options-area, .conversation.show-message-area .options-area {
    display: none;
}

.options-area, .add-reject-conversation-input-area {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    height: var(--options-area-height);
}

.conversation.show-profile-area .options-area>* {
    animation: fade-in var(--animation-speed-mid) both;
}

.conversation-header input {
    display: none;
    border: none;
    width: 100%;
}

.profile-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: var(--input-height);
    width: var(--input-height);
    overflow: hidden;
    border-radius: 100vw;
    margin: 0 var(--spacing);
}

.profile-image-container.empty-image img {
    display: none;
}

.profile-image-container.empty-image::after {
    content: 'ㅇ';
}

.profile-image-container img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}


/*** MESSAGE INDICATOR ***/
.conversation:not(.message-received) .message-received-indicator, .conversation.pending-conversation .message-received-indicator, .conversation.show-message-area .message-received-indicator {
    display: none;
    animation: none;
}

.conversation.message-received .message-received-indicator::before {
    animation: fade-in var(--animation-speed-mid) both;
}

.message-received-indicator {
    display: block;
}

.message-received-indicator::before {
    content: '✉️';
}

/*** MESSAGE AREA ***/

.conversation:not(.show-message-area) .message-area {
    display: none;
}

.message-area {
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */
    height: calc(100% - var(--font-height));
}


.messages-container {
    overflow-y: auto;
    overflow-x: hidden;
}

.message-date {
    text-align: center;
    font-size: .75rem;
    color: var(--demphasis-color);
}


/****** RECEIVED MESSAGES *******/

.conversation.message-received .incoming-message-container:not(.message-quote):empty::before {
    content: '✉️'
}

.incoming-message-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-x: auto;
    word-break: break-word;
    flex: 1;
}

.incoming-message-container>*>* {
    height: fit-content;
    width: fit-content;
}

/*
.incoming-message-container>*>* {
    max-height: 100%;
    max-width: 100vw;
}
*/

.incoming-message-container.message-quote {
    flex: none;
    max-height: calc(100% / 3);
    min-height: var(--font-height);
    margin-top: var(--spacing);
    padding-bottom: initial;
    font-size: calc(var(--font-height) * .4);
    color: var(--demphasis-color);
    quotes: "“""”";
}

.incoming-message-container.message-quote:empty {
    display: none;
}

.message-quote:not(:empty)::before, .message-quote:not(:empty)::after {
    font-size: 2em;
    top: 50%;
    transform: translateY(-50%);
}

.message-quote:not(:empty)::before {
    content: open-quote;
    left: calc(var(--spacing) * -1);
}

.message-quote:not(:empty)::after {
    content: close-quote;
    right: calc(var(--spacing) * -1);
}

.message-quote .message-media-container {
    filter: grayscale(.5);
}

.message-media-container {
    /* display: flex; */
    overflow: hidden;

    width: 6rem;
    height: 7rem;
    margin: 10px;
}

.message-media-container>* {
    object-fit: contain;
    height: 100%;
    width: 100%;
    font-size: 6rem;
}

/*** MESSAGES ***/
.message {
    display: flex;
    align-items: center;
    margin-top: 2em;
}

.message.self {
    justify-content: flex-end;
}

.message .content {
    padding: var(--spacing);
    background-color: var(--color-02);
    border-radius: var(--radius);
    align-self: flex-start;
    order: 1;
}

.message.self .content {
    align-self: flex-end;
    order: 2;
}

.message .content::after {
    content: '';
    position: absolute;
    top: 5px;
    left: -5px;
    border-top: 0px solid transparent;
    border-bottom: 25px solid transparent;
    border-right: 20px solid var(--color-02);
    transform: rotate(3deg);
    z-index: -1;
}

.message.self .content::after {
    left: unset;
    right: -5px;
    border-right: none;
    border-top: 0px solid transparent;
    border-bottom: 25px solid transparent;
    border-left: 20px solid var(--color-02);
    transform: rotate(-3deg);
}

.date {
    font-size: var(--small-font);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: var(--spacing);
}

.message .date {
    opacity: .5;
    order: 2;
    white-space: initial;
    word-break: keep-all;
    align-self: flex-end;
}

.message.self .date {
    order: 1;
    text-align: right;
}

/*** COMPOSE MESSAGE AREA ***/

.interface-container {
    overflow-y: auto;
}

.interface-messages-container:not(.interface-selection-made)~.interface-confirmation {
    display: none;
}

.interface-selection-made .interface-message:not(.interface-selected) {
    opacity: .25;
}

.interface-message-container {
    margin: var(--font-height) 0;
}

.interface-message-container:not(:last-of-type)::after {
    content: '';
    border-bottom: solid 1px var(--text-color);
    position: absolute;
    width: 50%;
    left: 50%;
    bottom: calc(var(--font-height) / 2 * -1);
    transform: translateX(-50%);
}

.interface-message {
    margin-top: var(--spacing);
    padding: var(--spacing);
    border-radius: var(--radius);
    background-color: var(--color-02);
}

.interface-message input {
    text-align: center;
}

.interface-message input[type="number"] {
    width: 3em;
}

.interface-confirmation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #4b4747ab;
    border-radius: var(--radius);
}

.interface-confirmation button {
    margin: 10px;
}

.compose-message-area {
    width: 100%;
    display: flex;
    /* Have everything rest on the bottom of the div (as the textarea grows)*/
    align-items: flex-end;
    /* Make a little room from the bottom of the screen */
    padding-bottom: calc(var(--spacing) * 2)
}

.compose-message-area form {
    display: flex;
    align-items: flex-end;
}

.compose-message-area form>*:not(:last-child) {
    margin-right: var(--spacing);
}

.compose-message-area textarea, .compose-message-area button, .compose-message-area input {
    height: var(--input-height);
}

.compose-message-area textarea {
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
    max-height: calc(4 * var(--font-height));
}

.compose-message-area button {
    width: var(--input-height);
}

.compose-message-area button {
    /* Center text & icons */
    display: flex;
    justify-content: center;
    align-items: center;
}

.compose-message-area input[type="file"] {
    width: var(--input-height);
    /* Make a square */
    border: none;
}

.compose-message-area input[type="file"]::before {
    content: '+';
    width: 100%;
    height: 100%;
}

/*** ADD / REJECT conversation AREA ***/

.conversation:not(.pending-conversation) .add-reject-conversation-area {
    display: none;
}

.code-container {
    display: flex;
    justify-content: space-between;
}

/*** MODAL STYLES ***/

.modal {
    position: fixed;
    top: 0;
    left: 0;
    /* padding: 60px; */
    padding: 60px var(--spacing);
    /* thicc padding */
    margin: var(--spacing);
    width: 100%;
    max-height: 100%;
    max-width: calc(100% - 20px);
    /* overflow: hidden; */
    overflow: auto;
    word-break: break-word;
    /* background-color: var(--background-color); */
    background-color: var(--color-01);
    color: var(--text-color);
    border-radius: var(--radius);
    z-index: 1000;
    animation: pop-in var(--animation-speed-mid) var(--animation-curve) both;

    display: flex;
    flex-direction: column;
    /*justify-content: center;*/
    align-items: center;

    box-shadow: 0 0 10px rgba(0, 0, 0, .3);
}

.modal>* {
    animation: fade-in var(--animation-speed-mid) var(--animation-speed-mid) var(--animation-curve) both;
}

.modal>div:not(:first-of-type) {
    margin-top: var(--font-height);
}

.share-modal {
    height: calc(100% - var(--spacing) * 2);
    justify-content: space-between;
    text-align: center;
}

.share-modal>div {
    border-top: solid 1px var(--text-color);
    width: 100%;
    padding: 1em 0 calc(var(--spacing) * 2) 0;
}

.share-modal>div>h1 {
    background-color: var(--background-color);
    position: absolute;
    top: 0;
    left: 50%;
    font-size: .5em;
    padding: 0 var(--spacing);
    transform: translate(-50%, -50%);
}

.share-modal input, .share-modal button {
    height: 4rem;
    text-align: inherit;
}

.share-modal .code-container input {
    width: 1.2rem;
    margin: 5px;
    border-radius: 0;
}

.share-link::after {
    content: '⤴';
    display: inline;
    margin-left: var(--spacing);
}

.modal~* {

    z-index: 0;
}

.modal~.modal {
    z-index: 900;
}

/* De-emphasize everything "behind" the modal except their containers */
.modal~*>* {
    opacity: .2 !important;
    /* override animations, etc. */
}

.modal .close-button {
    position: absolute;
    top: var(--spacing);
    right: var(--spacing);
    border-radius: 13px;
    width: 3rem;
    height: 3rem;
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
}

/* CONFIRM MODAL OPTIONS */
.modal-options-container button {
    padding: var(--spacing);
    border-radius: var(--radius);
    /* color: var(--background-color);
    background-color: var(--text-color); */
}

/* USER OPTIONS MENU */
.modal.user-options-modal div button {
    display: block;
    width: 100%;
}

.modal.user-options-modal div button:not(:last-of-type) {
    margin-bottom: var(--font-height);
}

.modal.user-options-modal div button:not(:last-of-type)::after {
    content: '';
    width: 50%;
    border-bottom: solid 1px var(--text-color);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--font-height) / 2 * -1);
    opacity: .5;
}

/*** NOTIFICATION STYLES ***/

.notification {
    position: fixed;
    bottom: 0px;
    width: 100vw;
    padding: var(--spacing);
    background-color: darkseagreen;
    z-index: 9999;
    height: auto;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, .3);
    text-align: center;

    font-size: .75em;

    display: flex;
    justify-content: center;
    align-items: center;
}

#connected-text, #disconnected-text {
    position: absolute;
}

#connection-status {
    /* Translate off screen */
    transform: translateY(100%);
    padding: 1em;
    background-color: rgb(177, 0, 0);
}

#body:not(.disconnected) #disconnected-text, #body.disconnected #connected-text {
    opacity: 0;
}

#body.disconnected #connection-status>* {
    transition-delay: var(--animation-speed-mid);
    opacity: 1;
}

#body.disconnected #connection-status {
    /* Un-translate back on screen */
    transform: translateY(0%);
}

#body:not(.disconnected) #connection-status {
    transition-delay: var(--animation-speed-mid);
}

/*************** LOGIN / JOIN STYLES ********************/

label, button, h1, h2 {
    text-transform: capitalize;
}

button#user-button {
    text-transform: none;
    text-overflow: ellipsis;
    overflow: hidden;
}

form {
    display: flex;
    flex-direction: column;
    padding: 10px;
    max-width: 100%;
}

form>* {
    /* Space every first child that follows something to have a top margin */
    margin-top: 1em;
}

input:invalid,
input.invalid {
    border-color: red;
}

form label {
    font-family: system-ui, sans-serif;
    font-size: 1em;
    font-weight: bold;
    line-height: 1.1;
}

input {
    font-size: 1em;
    max-width: 100%;
    padding: 0;
}

input:not([type="checkbox"]) {
    padding: 10px 10px 5px 10px;
}

input:not([type="checkbox"])::placeholder {
    opacity: 0;
}

input:not([type="checkbox"]):not(:placeholder-shown)+label, input:not([type="checkbox"]):placeholder-shown:focus+label {
    transform: translate(10px, -1.4em) scale(.5);
}

.input-container label {
    position: absolute;
    opacity: 50%;
    z-index: 100;
    left: 0px;
    bottom: 10px;
    transform: translate(10px, 0) scale(1);
    transform-origin: left;
    pointer-events: none;
    font-weight: normal;
}

form .checkbox-container label {
    margin-left: 10px;
}

input[type="checkbox"] {
    /* Add if not using autoprefixer */
    -webkit-appearance: none;
    appearance: none;
    /* For iOS < 15 to remove gradient background */
    background-color: var(--text-color);
    /* Not removed via appearance */
    margin: 0;

    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid currentColor;
    border-radius: 0.15em;
    transform: translateY(-0.075em);

    display: grid;
    place-content: center;

    float: left;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    /* box-shadow: inset 1em 1em var(--form-control-color);*/
    box-shadow: inset 1em 1em var(--background-color);

    /* Windows High Contrast Mode */
    background-color: CanvasText;

    /* transform-origin: bottom left; */
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:focus {
    outline: max(2px, 0.15em) solid currentColor;
    outline-offset: max(2px, 0.15em);
}

.checkbox-container+.checkbox-container {
    margin-top: 1em;
}

.tool-tip {
    display: none;
}

.scrollable-text {
    max-height: 6em;
    overflow: auto;
    border: 1px solid;
    margin-bottom: 1em;
    font-size: .5em;
}

/* Styles for agreements (privacy policy, etc.) */
.agreement {
    padding: var(--spacing);
}

.agreement h2 {
    font-size: 1em;
}

.agreement .page-title {
    text-align: center;
    font-weight: bold;
}

.agreement>* {
    margin-top: 10px;
}



@keyframes pop-in {
    0% {
        transform: scale(0);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(.99);
    }

    100% {
        transform: scale(1);
    }
}


@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes expand-to-fullscreen {
    0% {
        transform: rotateX(20deg) translateY(-50%) translateZ(-200px) scale(0);
        transform-origin: bottom;
    }

    25% {
        transform: rotateX(10deg) translateY(0) translateZ(-100px) scale(1);
        animation-timing-function: ease-out;
    }

    100% {
        transform: rotateX(0deg) translateY(0) translateZ(0) scale(1);
    }
}

@keyframes slide-down-for-message {
    0% {
        transform: translateY(calc(-1 * var(--font-height)));
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes slide-up-for-message {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(calc(-1 * var(--font-height)));
    }
}


@keyframes slide-down-for-profile {
    0% {
        transform: translateY(calc(-1 * var(--options-area-height)));
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes slide-up-for-profile {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(calc(-1 * var(--options-area-height)));
    }
}

@keyframes slide-down-for-message-area {
    0% {
        transform: translateY(calc(-1 * (100vh - var(--font-height))));
    }

    100% {
        transform: translateY(0);
    }
}

.bounce {
    animation: bounce var(--animation-speed-long) var(--animation-curve);
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }

    75% {
        transform: scale(.975);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes interact-wiggle {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(.98);
    }

    95% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}

/* Change (shrink) the border radius of the header element once the element below it has transform animated up under it to hide any gaps */
@keyframes close-border-radius {
    0% {
        border-radius: inherit;
    }

    50% {
        border-radius: var(--radius);
    }

    100% {
        border-radius: var(--radius);
    }
}


/* CLYYP */
.clyyp {
    height: var(--clipboard-height);
    display: flex;
    margin: 1em auto;
    width: 95%;
    max-width: 500px;
    box-sizing: border-box;
    transition: transform .5s;
    animation: fade-in .5s;
}

.clyyp>div {
    font-size: 1em;
    box-shadow: 0 0 20px rgba(255, 255, 255, .2) !important;
    float: left;
    width: calc(100% - 126px);
    padding: 1rem;
    /* Account for buttons */
    resize: none;
    height: var(--clipboard-height);
    /* Account for padding */
    overflow: auto;
    box-sizing: border-box;
    color: white;

    background: #2a2a2a;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}


.clyyp>div:empty::after {
    content: attr(data-prompt);
    color: rgba(255, 255, 255, .5);
}

.clyyp>button {
    color: #FFFFFF;
    height: var(--clipboard-height);
    margin: 0;
    padding: 0;
    width: 63px;
    font-size: 3em;
    position: relative;
    overflow: hidden;
}

.clyyp>button::before {
    box-shadow: 0 0 20px rgba(255, 255, 255, .2);
    content: '';
    height: inherit;
    width: inherit;
    display: block;
    border-radius: inherit;
    position: absolute;
    top: 0;
    left: 0;
}

.clyyp>button::after {
    display: block;
    /* height: 63px; */
    height: 1em;
    width: 1em;
    transition: transform .5s;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.clyyp>button.add.loading::after,
.clyyp>button.delete.loading::after {
    content: '÷';
    animation: spin .5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(45deg);
    }

    100% {
        transform: rotate(405deg);
    }
}

.clyyp>button:first-of-type {
    background-image: linear-gradient(#00CCCC 0%, #00FFFF 50%, #00C5C5 105%);
    /*BEFFFF*/
    float: left;
    border-radius: 3em 0 0 3em;
}

.clyyp>button::after {
    content: '';
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.clyyp>button:first-of-type::after {
    /* content: '> <'; */
    background-image: url(/resource/img/right_left.svg);
    /* width: max-content; */
    /* transform: translate(-15%, -50%); */
    transform: translate(-85%, -50%);
}

/* .clyyp>button:first-of-type:has(+ div:empty)::after { */
.clyyp>button:first-of-type:has(+ div.empty)::after, .clyyp>button:first-of-type:has(+ div:empty)::after {
    /* transform: translate(-85%, -50%); Safari appeared to not calculate the :not(:empty) until the element had some kind of interaction UPDATE: :empty does not update without interaction (clicking on element or resizing/minimizing window, but .empty does */
    transform: translate(-15%, -50%);
}

/* .clyyp>button.delete::after { */
.clyyp>div:not(:empty)+button::after {
    transform: translate(-50%, -50%) rotate(45deg);
}

.clyyp>button:last-of-type {
    float: left;
    border-radius: 0 3em 3em 0;
}

.clyyp>button:last-of-type::after {
    /* content: '+'; */
    content:'';
    background-image: url(/resource/img/plus_eks.svg);
    background-size: 0.5em;
}


/* .clyyp>button.add { */
.clyyp>div:empty+button {
    background-image: linear-gradient(#00CC00, #00FF00, #009D00);
    /* linear-gradient(#B8FFB5, #00FF00, #00BD00); */
}

/*.clyyp>button.delete { */
.clyyp>div:not(:empty)+button {
    background-image: linear-gradient(#CC0000, #FF0000, #D00000);
    /* linear-gradient(#FF6969, #FF0000, #D00000) */
    ;
}


/***** DIGIT CODE ENTRY *****/

#confirm_syync-form {
    display: flex;
    justify-content: center;
}

.code-container, #confirm_syync-form {
    display: flex;
    justify-content: space-between;
    max-width: 12em;
}

.code-container input {
    max-width: calc(1.2rem + 20px);
    margin: 5px;

    text-align: center;

    padding: 10px;
    padding-top: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

#confirm_syync-form > button, .modal-options-container button {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    font-weight: 100;
    box-shadow: 0 0 10px rgba(255,255,255,.4);
}

.code-container ~ .identifier {
    font-style: italic;
    font-weight: 100;
}