* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #ffffff;
    color: #183d50;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

canvas {
    display: block;
    touch-action: none;
}

/* The element thumbnails in one column, on one see-through panel */
.element-palette {
    position: fixed;
    z-index: 10;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 18px;
    border-radius: 5px;
    background: rgba(190, 215, 230, 0.45);
    user-select: none;
}

.element-tool {
    display: block;
    padding: 0;
    border: none;
    background: none;
    cursor: grab;
    touch-action: none;
}

.element-tool img {
    display: block;
    width: 86px;
    height: 66px;
    object-fit: contain;
    pointer-events: none;
    transition: transform 150ms;
}

/* Hidden until palette.js puts the rendered picture in, so no broken picture shows while the page loads.
   It still takes its space, so the panel keeps its size. */
.element-tool img:not([src]) {
    visibility: hidden;
}

/* A little bigger under the pointer, faded while being dragged out */
.element-tool:hover img {
    transform: scale(1.1);
}

.element-tool.is-dragging img {
    opacity: 0.4;
}

#interaction-hint {
    position: fixed;
    z-index: 5;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 40px);
    padding: 9px 16px;
    border-radius: 20px;
    background: #ffffffdc;
    color: #607f8f;
    font-size: 12px;
    text-align: center;
    pointer-events: none;
}

#drag-preview {
    position: fixed;
    z-index: 30;
    transform: translate(-50%, -50%);
    width: 112px;
    text-align: center;
    pointer-events: none;
}

#drag-preview img {
    width: 100px;
    height: 90px;
    object-fit: contain;
    opacity: 0.8;
    filter: drop-shadow(0 5px 6px #123e6030);
}

#drag-preview span {
    display: block;
    padding: 5px 7px;
    border-radius: 8px;
    background: #fffffff0;
    color: #567586;
    font-size: 11px;
    white-space: nowrap;
}

body.is-placing,
body.is-placing * {
    cursor: grabbing !important;
}

/* Sound on and off, top left */
.sound-button {
    position: fixed;
    z-index: 10;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border: 1px solid #d5dde2;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
}

@media (max-width: 700px) {
    .element-palette {
        left: 12px;
    }

    .lil-gui.lil-root {
        --width: 190px;
    }
}
