.chat {
    width: 100%;
    margin: 0 auto;
    padding: 140px 0 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    box-sizing: border-box;

    overflow-y: auto;
    overflow-x: hidden;

    line-height: 24px;

    position: relative;
}

.chat > .user {
    font-style: italic;
    opacity: 0.5;
}

.chat > .meta {
    font-size: 12px;
    opacity: 0.5;
}

.chat > .meta-button,
.chat > .meta-subbuttons > .meta-subbutton {
    font-family: 'Noto Sans';
    font-size: 12px;
    border-bottom: solid 0.5px white;
    cursor: pointer;
}

.chat > .meta-subbuttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.chat > .meta-button,
.chat > .meta-subbuttons {
    margin-left: auto;
    margin-right: 20px;
}

.chat > .meta-button.meta-button-rulebook,
.chat > .meta-subbuttons > .meta-subbutton.meta-subbutton-rulebook,
.chat > .meta-button.meta-button-errata {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}
.chat > .meta-button.meta-button-rulebook,
.chat > .meta-subbuttons {
    margin-bottom: 15px;
}
.chat > .meta-button.meta-button-rulebook::before,
.chat > .meta-subbuttons > .meta-subbutton.meta-subbutton-rulebook::before,
.chat > .meta-button.meta-button-errata::before {
    content: "";
    background: white;
    mask-repeat: no-repeat;
    mask-position: center center;
    mask-size: contain;
    display: block;
    width: 20px;
    height: 20px;
}
.chat > .meta-button.meta-button-rulebook::before,
.chat > .meta-subbuttons > .meta-subbutton.meta-subbutton-rulebook::before {
    mask-image: url("icons/rulebook.png");
    transform: translateY(-1px);
}
.chat > .meta-button.meta-button-errata::before {
    mask-image: url("icons/errata.png");
}

.footer {
    position: absolute;
    width: calc(100% - (2 * 30px));
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    filter: drop-shadow(0 0 10px black);
}

.footer .flagpanel {
    margin-right: 20px;
}

.request {
    border: none;
    outline: none;
    background: #333;
    padding: 10px;
    border-radius: 7px;
    resize: none;
    /* box-shadow: 0 0 10px black; */
    outline: solid 1.5px #666;
    box-sizing: border-box;

    width: 100%;
    margin-right: 18px;
}

.request.disabled {
    opacity: 0.5;
}

.button-scan {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    mask-image: url("icons/scan.png");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center center;
    background: white;
    cursor: pointer;
}

.chat, .footer {
    max-width: 700px;
}

.request:focus {
    margin: 10px;
    outline: solid 1.5px #AAA;
    /* outline-offset: 0.5px; */
    /* box-shadow: 0 0 20px rgba(255, 255, 255, 0.35), 0 0 40px black; */
}

.face-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    background: linear-gradient(to bottom, #262626, #202020);
    box-shadow: 0 0 10px black;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.face-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.title-top {
    font-family: "SyneMono-Regular";
    font-size: 30px;
    text-transform: uppercase;
}
.title-bottom {
    /* font-family: "SyneMono-Regular"; */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}
.title-bottom::before,
.title-bottom::after {
    content: "";
    height: 0.5px;
    flex-grow: 1;
    background: #aaa;
}

.face {
    background: transparent url("icons/face_ready.png") no-repeat center center / contain;
    width: 70px;
    height: 70px;
    filter: drop-shadow(3px 2px 0px black);
    pointer-events: none;
}
.face.face-thinking {
    background-image: url("icons/face_thinking.png");
}

.chat .thinking {
    position: relative;
    height: 20px;
    margin: 10px auto;
}

.chat .action {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.chat .action .cardfan-wrap {
    flex-shrink: 0;
}

.chat .action .action-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.chat .action .cardfan-wrap {
    cursor: pointer;
}

.chat .action .action-title {
    text-align: center;
}

.chat .action .action-button {
    /* background: white;
    color: black;

    width: 34px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
    font-size: 30px;
    font-family: "NokioSlabAlt-Bold";
    padding-top: 6px;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: 0 0 10px black; */

    --size: 12px;
    width: var(--size);
    height: var(--size);
    border-left: calc(var(--size) / 2) solid transparent;
    border-right: calc(var(--size) / 2) solid transparent;
    border-top: var(--size) solid white;
    box-sizing: border-box;
}

/* .chat .action .action-button.action-button-explain::before {
    content: "?";
} */

.part-id {
    position: relative;
    padding: 0 4px;
    font-size: 11px;
    vertical-align: 1px;
}
.part-id > span {
    position: relative;
}
.part-id::before {
    content: "";
    position: absolute;
    left: 0;
    top: -2px;
    width: 100%;
    height: 130%;
    transform: skewX(-10deg);
    border-radius: 3px;
    background: #555;
    z-index: 0;
}

.assistant {
    position: relative;
}
.assistant .reliability {
    position: absolute;
    bottom: 2px;
    right: 3px;
    color: #555;
    display: block;
    font-size: 8px;
    transform: rotate(-90deg) translate(100%, 100%);
    transform-origin: right bottom;
}

.chat.working::after {
    content: "";
    display: block;
    margin: 5px auto 0;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    border: solid 4px white;
    outline: dashed 1px white;
    outline-offset: -2px;
    box-sizing: border-box;
    animation: workingPulsIn 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 5px white);
    opacity: 0.75;
    flex-shrink: 0;
}

@keyframes workingPulsIn {
    20%, 80% {
        outline-offset: 5px;
    }
    50% {
        transform: scale(0.65) rotate(180deg);
    }
}

/* To make it nice when the keyboard appears on mobile */

body:focus-within .footer {
    position: relative;
    bottom: unset;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Extra things */

.scan-tip {
    position: absolute;
    right: -5px;
    bottom: 40px;
    background: white;
    color: black;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: "Noto Sans";
    font-weight: 400;
    font-size: 15px;
}

.scan-tip::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 13px solid white;
    position: absolute;
    right: 11px;
    bottom: -8px;
}
