body {
    padding: 12px;
    margin: 0;
    border: none;
    height: calc(100vh - 24px);
    display: flex;
    overflow: hidden;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    flex: 6;
    gap: 12px;
    padding-right: 12px;
    overflow-y: auto;
}

.item {
    background-color: #f0f0f0;
    width: 100%;
    height: 100%;
    border: 2px dashed #ccc;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 200px;
}

.item-content {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    width: 100%;
    height: 100%;
}

.img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.img-small {
    width: 48px;
    height: 48px;
    opacity: 0.5;
    cursor: pointer;
}

.item-content:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.pane {
    flex: 2;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 12px;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
}

button {
    width: 100%;
    height: 30px;
}

#speed {
    margin: 12px 0;
    width: 80%;
    display: inline-block;
    position: relative;
    left: -20px;
}

#speed::after {
    content: "delay:" attr(data-speed);
    position: relative;
    left: 55px;
}

#clear,
#reset {
    margin: 12px 0;
}

#result {
    margin-top: 20px;
    display: none;
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

h1,
p {
    color: white;
}

h1 {
    text-align: center;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block !important;
    animation: spin 3s linear infinite;
    width: 200px !important;
    height: 200px !important;
    border: none !important;
}

p {
    margin: 4px;
}

.forkme {
    position: absolute;
    right: 0;
    top: 0;
    cursor: pointer;
}