@font-face {
    font-family: "JetBrainsMono";
    src: url("JetBrainsMono-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
}

html {
    width: 100%;
    height: 100%;
}

body {
    box-sizing: border-box;
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 1rem;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

#textarea-container {
    position: relative;
    width: 100%;
    height: 100%;
}

textarea {
    z-index: 1;
    resize: none;
    border-width: 0.1rem;
}

#overlay {
    z-index: 2;
    pointer-events: none;
    color: transparent;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.textarea-shared {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 2rem - 0.1rem);
    height: calc(100% - 2rem - 0.1rem);

    padding: 1rem;

    font-size: 1rem;
    line-height: 1.5rem;
    font-family: "JetBrainsMono";
}

.tooltip {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    pointer-events: auto;
}

.error {
    text-decoration: underline 0.25rem red;
}

.message {
    position: absolute;
    pointer-events: none;
    top: 1.5rem;

    display: inline-block;
    width: max-content;
    max-width: 50vw;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    box-sizing: border-box;
}

.error:hover+.message {
    color: initial;
    background-color: red;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}