@media (max-width: 700px) {
    /* mobile */
    :root {
        --section-width: 30vh;
        --blur-width: 20px;
        --section-inner-width: calc(var(--section-width) - var(--blur-width))
    }
}

@media (min-width: 700px) {
    /* pc */
    :root {
        --section-width: 30vw;
        --blur-width: 20px;
        --section-inner-width: calc(var(--section-width) - var(--blur-width))
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Sans", sans-serif;
}

.mono {
    font-family: monospace;
    font-size: 16px;
}

.spacer {
    height: 10px;
}

html, body, main {
    width: 100%;
    height: 100%;
}

main {
    background-image: url("./assets/web/background.png");
    background-size: cover;
    background-position: center bottom;
    background-color: #287dff;
    background-blend-mode: multiply;
}

summary {
    cursor: pointer;
}

@media (min-width: 700px) {
    /* pc */
    section {
        padding: 5px;
        padding-right: calc(var(--blur-width) + 5px);

        position: fixed;
        left: 0;
        top: 0;
        width: calc(var(--section-width) - 5px);
        height: 100%;
    }

    #canvas-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: calc(100vw - var(--section-width));
        height: 100%;
    }

    #preview-wrapper {
        width: calc(var(--section-inner-width) - 15px);
        height: calc(var(--section-inner-width) - 15px);
        margin: 5px;

        position: relative;
    }

    canvas#canvas {
        width: 100%;
    }

    .white-overlay {
        background: #ffffff8a;
        background: linear-gradient(90deg, #ffffff8a var(--section-inner-width), #ffffff00 calc(var(--section-width) - 5px));
    }
}

@media (max-width: 700px) {
    /* mobile */
    section {
        padding: 5px;
        padding-bottom: calc(var(--blur-width) + 5px);

        position: fixed;
        left: 0;
        top: 0;
        height: calc(var(--section-width) - 5px);
        width: 100%;

        overflow-y: scroll;
    }

    #canvas-wrapper {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: calc(100dvh - var(--section-width));
    }

    canvas#canvas {
        height: 100%;
    }

    #preview-wrapper, #preview-scale {
        display: none;
    }

    .white-overlay {
        background: #ffffff8a;
        background: linear-gradient(180deg, #ffffff8a var(--section-inner-width), #ffffff00 calc(var(--section-width) - 5px));
    }
}


#preview-scale {
    position: absolute;
    bottom: 5px;
    font-size: 18px;
}

canvas#preview, canvas#preview2 {
    position: absolute;
    transform-origin: top left;
}

.title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gh-icon {
    width: 1.5em;
    height: 1.5em;
}

.mono.legacy-doesnt-exist {
    font-size: 0px;
}

.mono.legacy-doesnt-exist::after {
    content: "(None)";
    font-size: 16px;
}

#search-wrap {
    position: fixed;
    top: -70px;
    right: 5px;

    transition: translate .2s linear;

    background-color: #ffffff8a;
}

#search-wrap:has(#search-bar[data-state="active"]) {
    translate: 0px 75px;
}

#search-bar {
    width: 250px;
    height: 30px;

    padding: 5px;
}

#search-dropdown {
    list-style: none;
    margin: 0;
    padding: 5px;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #ccc;
}

#search-dropdown li {
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
}

#search-dropdown li:hover {
    background-color: #f0f0f0;
}

#search-dropdown li.selected {
    background-color: #e0e0e0;
    font-weight: bold;
}

#search-info {
    width: 250px;
    padding: 5px;
}

label {
    user-select: none;
}

#physical-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
}

#physical-buttons > button {
    height: 30px;
    flex: 1 1 160px;
}
