html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;

    overflow: hidden;

    background: #111;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Hiragino Kaku Gothic ProN",
        "Hiragino Sans",
        "Yu Gothic",
        Meiryo,
        sans-serif;
}


/* ========================================
   VIEWER
======================================== */

#viewer {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    background: #111;

    overflow: hidden;

    touch-action: none;
}


#viewer canvas {
    display: block;

    width: 100%;
    height: 100%;

    outline: none;
}


/* ========================================
   LOADING
======================================== */

#loading {
    position: fixed;
    inset: 0;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #111;

    transition:
        opacity 0.4s ease,
        visibility 0.4s ease;
}


#loading.is-hidden {
    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


.loading-box {
    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 12px;

    color: #fff;
}


.spinner {
    width: 38px;
    height: 38px;

    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: #fff;

    border-radius: 50%;

    animation: spin 0.85s linear infinite;
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.loading-title {
    margin-top: 6px;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.16em;

    opacity: 0.8;
}


#loading-percent {
    font-size: 13px;
    font-weight: 500;

    opacity: 0.9;
}


/* ========================================
   GUIDE
======================================== */

#guide {
    position: fixed;

    left: 50%;
    bottom: 18px;

    z-index: 20;

    transform: translateX(-50%);

    padding: 8px 14px;

    border: 1px solid rgba(255, 255, 255, 0.16);

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.48);

    color: rgba(255, 255, 255, 0.88);

    font-size: 12px;

    letter-spacing: 0.02em;

    white-space: nowrap;

    pointer-events: none;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}


.guide-mobile {
    display: none;
}


/* ========================================
   RESET
======================================== */

#reset-view {
    position: fixed;

    top: 18px;
    right: 18px;

    z-index: 30;

    padding: 9px 13px;

    border: 1px solid rgba(255, 255, 255, 0.18);

    border-radius: 6px;

    background: rgba(0, 0, 0, 0.5);

    color: #fff;

    font-size: 11px;

    letter-spacing: 0.08em;

    cursor: pointer;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


#reset-view:hover {
    background: rgba(0, 0, 0, 0.72);

    border-color: rgba(255, 255, 255, 0.34);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 767px) {

    #guide {
        bottom: 14px;

        max-width: calc(100vw - 34px);

        padding: 7px 11px;

        font-size: 11px;
    }


    .guide-pc {
        display: none;
    }


    .guide-mobile {
        display: inline;
    }


    #reset-view {
        top: 12px;
        right: 12px;

        padding: 8px 10px;

        font-size: 10px;
    }

}