@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Mono:ital,wght@0,200..800;1,200..800&display=swap');

html, body {
    width: 100%;
    margin: 0;
    font-family: 'Atkinson Hyperlegible Mono', monospace;
    font-size: 15px;
}

body {
    height: 100vh;
}
body.grabbing, body.grabbing * {
    cursor: grabbing;
}
body.selecting, body.selecting * {
    cursor: crosshair;
}

* {
    user-select: none;
    -webkit-user-select: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    background: unset;
    border: none;
    cursor: pointer;
}

input {
    position: absolute;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    overflow: visible;
    font-style: italic;
    color: gray;
    background: none;
    border: 1px solid transparent;
}
body.letter-rejected input {
    color: red;
    border-color: red;
}

.word {
    position: absolute;
    cursor: grab;
    z-index: 2;
}
.word.new {
    animation: flash-word 1.5s;
}
@keyframes flash-word {
    0% {
        background: yellow
    }
    100% {
        background: transparent
    }
}
body:not(.grabbing) .word.hover, .word.grab, .word.might-attach {
    background: blue !important;
    color: white;
    z-index: 3;
}
body.might-eat .word.grab {
    background: red !important;
}
.word-group {
    position: absolute;
    pointer-events: none;
    border: 1px solid lightgray;
}

.customer {
    border: 1px solid currentColor;
    color: lightgray;
    border-radius: 50%;
    aspect-ratio: 1;
    padding: 0;
    position: absolute;
    transform: translate(-50%, -50%) rotate(90deg);
    animation: flash-customer 500ms;
    background: white;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;
}
.customer:hover {
    color: gray;
}
.customer:active {
    color: blue;
}
@keyframes flash-customer {
    0% {
        color: blue;
        box-shadow: 0 0 10px currentColor;
    }
    100% {
        color: lightgray;
    }
}
.customer.might-serve {
    color: blue;
    box-shadow: 0 0 10px currentColor;
}
.customer.leaving {
    color: red;
    pointer-events: none;
    animation: customer-leave 3s;
}
@keyframes customer-leave {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
.customer.served {
    color: blue;
}

.customer-dialogue {
    position: absolute;
    transform: translate(-50%, -50%);
}

#main_zone {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
}
#main_zone header button {
    background-color: white;
    border: 1px solid red;
    color: red;
    border-bottom: none;
}
#main_zone header button.selected {
    background-color: red;
    color: white;
    pointer-events: none;
}
#main_zone > div {
    position: relative;
    background-color: white;
    border: 1px solid red;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.interaction-point, #selection-area {
    position: absolute;
    border: 1px solid blue;
}
#selection-area {
    pointer-events: none;
    background-color: rgba(0, 255, 255, .1);
    z-index: 10;
}

#eat_zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    font-weight: bold;
    color: red;
    word-break: break-all;
    padding: 20px;
    line-height: 1em;
    box-sizing: border-box;
    overflow: hidden;
    overflow-y: scroll;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
#eat_zone span {
    opacity: .1;
    animation: flash-letter 500ms;
}
@keyframes flash-letter {
    0% {
        opacity: 1;
        background: red;
        color: white;
    }
    100% {
        opacity: .1;
        background: transparent;
        color: red;
    }
}