*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100vh;
    width: 100vw;
    padding: 0;
    margin: 0;
    font-size: 16px;
    overflow: hidden;
}

body {
    font-family: "Kode Mono", monospace;
    font-weight: 400;
    background: #eee;
}

main {
    height: calc(100dvh - 2rem);
    width: calc(100dvw - 2rem);
    margin: 0 auto;
    margin: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

main::after {
    content: 'Loading: ' attr(data-pct) '%';
    position: absolute;
    top: 50dvh;
    left: 50dvw;
    transform: translate(-10rem, -10rem);
    background: #fff;
    width: 20rem;
    height: 20rem;
    border: 1px #000 solid;
    color: #222;
    font-size: 2rem;
    line-height: 1;
    padding: 8rem 1rem;
    text-align: center;
    box-shadow: 0 0 5rem rgba(0, 0, 0, 0.5)
}

body[data-state="loaded"] canvas {
    border-color: #000;
}

body[data-state="loaded"] main::after {
    display: none;
}

canvas {
    display: block;
    width: 100%;
    margin: 0 auto;
    border: 1px transparent solid;
}