* {
    box-sizing: border-box;
}

html, body {
    image-rendering: pixelated;
    height: 100%;
    width: 100%;
    margin: 0;
    border: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    background-image: url(/blueprint.png);
    background-size: 128px;
}

input[type=range] {
    -webkit-appearance: none; /* Chrome/Safari */
    height: 20px;
    background: gray;
    outline: none;
    margin: 4px;
    width: 80%;
}

#highlights {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    outline: none;
}

.color-grid {
    margin: 4px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1fr 1fr;
    min-height: 100px;
}

.color-picker {
    grid-column: 1 / 3;
    border: none;
    position: relative;
    transition: border 0.2s ease, transform 0.2s ease;
}

.color-picker:hover {
    border: 4px solid white;
    transform: scale(1.1);
}

#colorPreview {
    position: absolute;
    width: 100%;
    height: 100%;
}

#colorPreview img {
    aspect-ratio: 1/1;
    height: 100%;
    object-fit: contain;
}

#bgColor {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-grid button {
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: gray;
    transition: border 0.2s ease, transform 0.2s ease;
}

.color-grid button:hover {
    border: 4px solid white;  /* bordo bianco quando hover */
    transform: scale(1.1);    /* piccolo ingrandimento per feedback */
}

#title {
    font-size: 30px;
    display: block;
    width: 100%;
    text-align: center;
    color: white;
}

#content {
    flex: 1;
    display: flex;
    overflow: hidden;
}



#skinUpload {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

#preview {
    aspect-ratio: 1/1;
    height: 100%;
    object-fit: contain;
}

#input {
    aspect-ratio: 1 / 1;
    min-width: 320px; /* scegli tu */
    min-height: 320px;
    background-color: var(--color-fb);
    display: flex;
    flex-direction: column;
    font-family: "MinecraftTen";
    font-size: 30px;
    border-radius: 16px;
}

.subtitle {
    margin: 4px;
}

/* OUTPUT: quadrato, ma può ridursi */
#output {
    aspect-ratio: 1 / 1;
    height: 100%;
    flex: 0 1 auto;
    overflow: hidden;
    margin-left: auto;
}

#output-frame {
    aspect-ratio: 1/1;
    position: relative;
    background-color: var(--color-cf);
    object-fit: contain;
    border-radius: 16px;
    overflow: hidden;
}

canvas {
    position: absolute;
    width: 100%;
    height: 100%;
}

#output-frame img {
    position: absolute;
    width: 100%;
    height: 100%;
}

#downloadIcon {
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

#downloadIcon:hover {
    opacity: 1;
}


@media(max-aspect-ratio: 1/1) {
    #content {
        flex-direction: column-reverse;
    }

    #output {
        width: 100%;
        height: auto;
        padding-left: 0px;
    }

    html, body {
        height: auto;
    }

}