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

html, body {
    width: 100vw;
    height: 100vh;
    
    background: white;

    overflow: hidden;
    user-select: none;
}

/* header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 32px;

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

    padding-left: 12px;
    padding-right: 12px;

    background: #D6D6D6;

    font-family: "Inter", sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
}

#header-left {
    display: flex;
    align-items: center;
    gap: 0;
}

#header-left span {
    padding: 0 8px;
}


/* logs */
#logs-btn {
    text-decoration: none;
    padding: 0 8px;
    cursor: pointer;
}

#logs-btn:hover {
    text-decoration: underline;
}

#logs-btn.active {
    text-decoration: underline;
}

#logs-panel {
    position: fixed;
    top: 32px;
    right: 0px;

    padding-top: 4px;
    padding-right: 16px;

    max-width: 100vw;
    max-height: calc(100vh - 32px);

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

#logs-panel::-webkit-scrollbar {
    display: none;
}

#logs-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.log {
    display: block;
    text-align: right;
    width: 100%;

    color: #97B8C9;

    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 300;
}

/* stage */
#figure-container {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%);

    width: 400px;
    height: 550px;

    pointer-events: none;
    z-index: 10;
}

 #figure-container img { 
    height: 100%; 
    max-height: 100%;
    object-fit: contain; 
    object-position: bottom center;
}

#badge-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}


#badge-layer img {
    position: absolute;
    height: 100%; 
    max-height: 100%;
    object-fit: contain; 
    object-position: bottom center;
}


/* folders */
#folders-container {
    position: absolute;
    inset: 0;
    pointer-events: none;

    height: calc(100vh - 64px);
}

.folder-node {
    position: absolute;

    z-index: 20;
    cursor: pointer;
    pointer-events: auto;

    transition: opacity 0s linear, transform 0s linear;
}

.folder-node.entering {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
}

.folder-node.dragging {
    cursor: grabbing;
    z-index: 999;
    transition: none;
}

.folder-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.folder-glow {
    position: absolute;
    inset: -8px -8px;
    border-radius: 12px;

    filter: blur(5px);
    

    opacity: 0;
    transition: opacity 0.1s ease;

    pointer-events: none;
    z-index: -1;
}

.folder-node:hover .folder-glow {
    opacity: 1;
}

.folder-node.dimmed:hover .folder-glow,
.folder-node.unselected:hover .folder-glow,
.folder-node.selected:hover .folder-glow,
.folder-node.active-root:hover .folder-glow {
    opacity: 0;
}

.folder-icon {
    width: 64px;
    height: 58px;
    flex-shrink: 0;
}

.folder-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* image-rendering: pixelated; */
    display: block;

    pointer-events: none;
}

.folder-label {
    margin-top: 6px;
    
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 300;

    text-align: center;
    color: #000;
    line-height: 1.32;
    max-width: 164px;
}

.folder-node.active-root {
    opacity: 1;
    pointer-events: none;
}

.folder-node.dimmed {
    opacity: 0.15;
    pointer-events: none;
}

.folder-node.selected {
    opacity: 1;
    pointer-events: none;
}

.folder-node.unselected {
    opacity: 0.15;
    pointer-events: none;
}

.folder-node.done-node .folder-label {
    font-style: normal;
    color: #000;
}

.folder-node.image-node .folder-inner {
    width: 120px;
}

.node-image-wrap {
    width: 100px;
    max-height: 90px;

    display: flex;
    justify-content: center;
}

.node-image {
    border: #fff 3px solid;
    border-radius: 2px;
    background-color: white;

    width: auto;
    height: auto;
    max-width: 100px;
    max-height: 90px;
    object-fit: contain;
    display: block;

    image-rendering: pixelated;
}

#ending-btn {
    position: fixed;
    bottom: 0px;
    right: 0px;
    font-family: "Inter", sans-serif;
    font-size: 32px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    z-index: 500;
    letter-spacing: 0.05em;

    padding: 14px;


    background: #97B8C9;
}

#ending-btn:hover {
    text-decoration: underline;
}

img {
    pointer-events: none;
}