body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: white;
    background-color: rgb(22, 22, 22);
}
.color-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.canvas-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.zoom-control {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 10px;
    z-index: 10;
}

.zoom-control button {
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 1;
    background: rgb(200, 200, 200);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#zoomSlider {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 24px;
    height: 110px;
    touch-action: none;
}

.pan-joystick {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.3);
    touch-action: none;
    z-index: 10;
}

.pan-joystick-stick {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    transform: translate(-50%, -50%);
    touch-action: none;
}

#skinCanvas {
    width: 400px;
    height: 400px;
    touch-action: none;
}

#color_canvas,
#hueCanvas {
    touch-action: none;
}

.editor {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool {
    width: 50px;
    height: 50px;
    cursor: pointer;
}

.tool.active {
    outline: 4px solid black;
}

.skin-parts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.number-skin {
    width: 220px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    padding: 5px;
    border: 3px solid #3b3b3b;
    background: rgb(11, 11, 11);
    cursor: pointer;
}

.number-skin input {
    font-size: 18px;
}

.skin-part {
    width: 80px;
    height: 80px;

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

    padding: 5px;
    border: 1px solid #242424;
    background: rgb(200, 200, 200);
    cursor: pointer;
    overflow: hidden;
}

.skin-part canvas {
    width: 50px;
    height: 50px;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.skin-part.active {
    background-color: #b4b4b4;
    border: 3px solid rgb(3, 67, 26);
}

.skin-part.main {
    border: 3px solid rgb(172, 148, 70);
}

.export {
    width: 220px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    padding: 5px;
    border: 3px solid #3b3b3b;
    background: rgb(11, 11, 11);
}

.export-skin {
    cursor: pointer;
    width: 220px;
    height: 60px;
}

.export-skin svg {
    width: 30px;
    height: 30px;
}

#pencilTool {
    position: relative;
}

#pencilTool::after {
    content: "";
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pencil-color);
}

@media (max-width: 700px) {
    body {
        padding: 10px;
        box-sizing: border-box;
        gap: 8px;
    }

    .editor {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
    }

    .canvas-container {
        width: 100%;
        max-width: 400px;
        aspect-ratio: 1 / 1;
        height: auto;
        order: -1;
    }

    #skinCanvas {
        width: 100%;
        height: 100%;
    }

    .skin-parts {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .color-selector {
        width: 100%;
        max-width: 400px;
        align-items: center;
    }

    .color-selector canvas {
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    .tool {
        width: 44px;
        height: 44px;
    }

    .skin-part {
        width: 64px;
        height: 64px;
    }

    .zoom-control {
        display: flex;
    }

    .pan-joystick {
        display: block;
    }
}