* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    width: 100%;
    overflow-x: hidden;
}
body {
    font-family: 'atkinson hyperlegible', sans-serif;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-repeat: no-repeat;

}
nav {
    background-color: #A82F2F;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}
.logo {
    color: #0affcf;
    font-size: 24px;
    font-weight: bold;
}
.logo img {
    transition: transform 0.6s ease;
}
.logo img:hover{
    transform: scale(0.85);
}
.navlinks {
    list-style: none;
    display: flex;
    gap: 40px;
    justify-content: center;
}
.navlinks a {
    color: #ffe9d9;
    text-decoration: none;
    font-size: 35px;
    display:inline-block;
    transition: transform 0.6s ease;
    margin-right: 23px;
}
.navlinks a:hover {
    color: #0AFFCF;
    transform: scale(0.85);
}
/* burger */
.burgertoggle {
    display: none;
    font-size: 28px;
    color: #ffe9d9;
    cursor: pointer;
}
/*quick scroll*/
#scrollTopBtn {
    position: fixed;
    bottom: 35px;
    right: 30px;
    display: none; /* hidden until scroll */
    background-color: #380f00;
    color: #0AFFCF;
    border: none;
    border-radius: 50%;
    height: 50px;
    width: 50px;
    font-size: 25px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
#scrollTopBtn:hover{
    position: fixed;
    bottom: 35px;
    right: 30px;
    display: none; /* hidden until scroll */
    background-color: #380f00;
    color: #0AFFCF;
    border: none;
    border-radius: 50%;
    height: 50px;
    width: 50px;
    font-size: 25px;
    cursor: pointer;
    transform: scale(1.3);
}
/*footer*/
footer{
    text-align: center;
    padding: 20px;
    background: #a82f2f;
    color: #380f00;
    display: flex;
    flex-direction: column;
    gap: 10px;

}
.footer-links a {
    margin: 0 10px;
    text-decoration: none;
    color: #380f00;
    transition: transform 0.6s ease;

}
.footer-links a:hover{
    text-decoration:underline;
    color: #FFE9D9;
    text-decoration-color:#FFE9D9;
}
footer a{
    margin: 0 10px;
    text-decoration: none;
    color: #380f00;
    transition: transform 0.6s ease;

}
footer a:hover{
    text-decoration:underline;
    color: #FFE9D9;
    text-decoration-color:#FFE9D9;
}
footer a img{
    transition: transform 0.6s ease;
}
footer a img:hover{
    transform: scale(0.85);
}
/* MAIN LAYOUT */
.app {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: 100vh;
    align-items: start;
    background-color: #FFE9D9;
    padding: 10px;
}
/* SIDE PANELS */
.panel {
    background: #380f001f;
    padding: 20px;
    display: flex;
    flex-direction: row;
    margin: 5px;

}
.right{
    display: flex;
    flex-direction: column;
}
.left{
    display: flex;
    flex-direction: column;
}
/* CENTER */
.creator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
    background-color: #380f001f;
    margin:5px;
    height: auto;
}
/* MODE BUTTONS */
.modes {
    display: flex;
    gap: 10px;
}
.modes button {
    padding: 10px;
    cursor: pointer;
}
/* AVATAR PREVIEW*/
.preview {
    position: relative;
    width: 400px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #FFE9D9;
}

/* THIS is the important anchor system */
.avatar-stack {
    position: absolute;
    inset: 0;
}

/* all layers share SAME anchor point */
.avatar-stack img {
    position: absolute;
    left: 50%;
    bottom: 0;

    transform: translateX(-50%);
    transform-origin: bottom center;

    width: 100%;
    height: auto;

    pointer-events: none;
}
#physicaltraits-layer{
    z-index: 1;
}
#pants-layer{
    z-index: 2;
}
#shirts-layer{
    z-index: 3;
}
#overclothes-layer{
    z-index: 4;
}
/* OPTIONS GRID */
.controls {
    flex: 1;
    min-height: 0;
}
.options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #ccc;
    overflow-y:scroll;
    max-height: 150px;
    background-color: #FFF5ED;
    font: inherit;         /* important */

}
.option:hover {
    background: #cccccc;
}
.hidden {
    display: none;
}
.silhouette-mode img {
    filter: grayscale(1) brightness(0);
}
.category-group button.active {
    background: #380f00a1;
    color: #FC6735;
}
.modes button.active {
    background-color: #A86A4A;
    color: #FFE9D9;
}
.category-group button.active {
    background-color: #A86A4A;
    color: #FFE9D9;
}
.options .active {
    background-color: #A86A4A;
    color: #FFE9D9;
}
/*proportion sliders*/
.options input[type="range"] {
    width: 100%;
}
.options label {
    display: block;
    margin-top: 10px;
    font-size: 14px;
}
.option{
    border: 2px solid #A82F2F;
    background-color: #FFF5ED;
    font-family: 'atkinson hyperlegible', sans-serif;
}
.mode{
    border: 2px solid #A82F2F;
    background-color: #FFF5ED;
    font-family: 'atkinson-hyperlegible', sans-serif;
}
.cat{
    border: 1px solid #A82F2F;
    background-color: #FFF5ED;
    font-family: 'atkinson hyperlegible', sans-serif;
}
.option:focus-visible {
    outline: 2px solid #005C47;
    outline-offset: 2px;
    border-radius: 4px;
}
.mode:focus-visible {
    outline: 2px solid #005C47;
    outline-offset: 2px;
    border-radius: 4px;
}
.cat:focus-visible {
    outline: 2px solid #005C47;
    outline-offset: 2px;
    border-radius: 4px;
}
.nd{
    background-color: #A82F2F;
    color: #FC6735
}
/* responsive scale */
@media (max-width: 768px) {
    .burgertoggle {
        display: block;
    }
    .navlinks {
        display: none;
        flex-direction: column;
        background-color: #A82F2F;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 20px;
        z-index: 10;

    }
    .navlinks.active {
        display: flex;
        flex-direction: column;
        align-items: center;
        z-index: 11;
    }


    .left h2,
    .left p {
        margin-bottom: 10px;
    }
    .app {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .left,
    .right,
    .creator {
        width: 100%;
        max-width: 500px;
    }
.left{
    order: 2;
}

.creator{
    order: 1
}

.right{
    order: 3;
}

    footer {
        padding: 20px;
        height: auto;   /* IMPORTANT */
        gap: 15px;
        color: #FFE9D9;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        color: #FFE9D9;
    }
    .footer-links a{
        color: #FFE9D9;
    }
    footer a {
        display: block;
        color: #FFE9D9;
    }
    footer{
        color: #FFE9D9;
    }

}


