* {
    padding: 0;
    margin: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: black;
}

.background {
    position: fixed;
    /* width: 100dvw;
    height: 100dvh; */
    z-index: -1;
    overflow: hidden;

    img {
        width: 100dvw;
        height: 100dvh;
        object-fit: cover;
    }
}

#canvas {
    position: fixed;
    /* border: 10px, #CCC, solid; */
    image-rendering: pixelated;
    width: 100dvw;
    height: 100dvh;
    align-items: center;
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
    z-index: 1;
}

.startscreen {
    width: 100dvw;
    height: 100dvh;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(2px);
    background-color: rgba(0, 0, 0, 0.149);
    z-index: 2;

    .background {
        position: absolute;
        width: 100dvw;
        height: 100dvh;
        z-index: -2;
    }
}

.personalizeRocketButtonClass {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    cursor: pointer;
    right: 100%;
    translate: 110% 10%;
    background: transparent;
    border: none;
    width: 130px;
    height: 130px;
}

.personalizeRocketButton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

span {
    font-family: Poppins, sans-serif;
    font-weight: 600;
    color: rgb(144, 19, 253);
    font-size: 14px;
}

#personalizeImg {
    rotate: 45deg;
    transition: all 0.3s ease;
}

.personalizeRocketButton:hover #personalizeImg {
    scale: 1.2;
}


#logo {
    width: 100dvh;
    max-width: 500px;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 5%;
}

#nickname {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    border: rgba(89, 8, 140, 0.816) 2px solid;
    background: rgba(72, 6, 129, 0.395);
    color: rgb(249, 249, 249);
    box-shadow: 0 0 8px rgba(141, 12, 255, 0.5);
    outline: none;
    min-width: 20%;
    height: 2%;
    transition: all 0.3s ease;
    margin-bottom: 50px;
    transform: scale(1.05);
}

#nickname::placeholder {
    color: rgba(255, 255, 255, 0.742);
    font-family: Poppins;
    font-size: 100%;
}

#nickname:focus {
    border-color: rgb(141, 12, 255);
    box-shadow: 0 0 15px rgba(141, 12, 255, 0.8);
    transform: scale(1.10);
    border-bottom-left-radius: 8px;
    border-top-left-radius: 8px;
}

/* Remove o estilo padrão do preenchimento automático do Chrome */
input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 0s 600000s, color 0s 600000s !important;
}



#jogar {
    padding: 1dvh;
    width: 30%;
    max-width: 200px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: rgba(72, 6, 129, 0.395);
    border: 2px solid rgba(89, 8, 140, 0.816);
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 5px rgb(141, 12, 255), 0 0 10px rgb(141, 12, 255), 0 0 15px rgb(71, 6, 129);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

#jogar:hover {
    background-color: rgb(141, 12, 255);
    color: #fff;
    box-shadow: 0 0 20px rgb(141, 12, 255), 0 0 30px rgb(71, 6, 129);
    transform: scale(1.05);
}

.loadingScreen {
    width: 100dvw;
    height: 100dvh;
    position: absolute;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgb(0, 0, 0);
    z-index: 998;
    transition: all 0.5s ease;

    img {
        width: 300px;
        height: 300px;
        align-items: center;
    }

    h2 {
        font-family: Poppins, sans-serif;
        color: white;
        font-size: 30px;
    }

}

.rotateDevice {
    width: 100dvw;
    height: 100dvh;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgb(0, 0, 0);
    z-index: 999;
    color: white;
    font-size: 30px;
    font-family: Poppins, sans-serif;
    padding: 30px;
    text-align: center;


    img {
        width: 300px;
        height: 300px;
        align-items: center;
    }
}

.moveButtons {
    top: 65dvh;
    left: 5dvw;
    display: none;
    flex-direction: column;
    row-gap: 10px;
    position: absolute;
    width: fit-content;
    height: fit-content;
    z-index: 5;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    button {
        width: 50px;
        height: 50px;
        border-radius: 10px;
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        background-color: rgba(0, 0, 0, 0);
        color: white;
        font-weight: 300;
    }

    .lineButtons {
        display: flex;
        flex-direction: row;
        column-gap: 10px;
    }
}

.shoot {
    width: 10%;
    height: 250%;
    position: absolute;
    display: none;
    top: 50%;
    left: 90%;
    z-index: 6;
}

.gameOver {
    display: none;
    position: fixed;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    width: 100dvw;
    height: 100dvh;
    z-index: 999;

    #restart {
        width: 6dvw;
        height: 6dvw;
    }

    #gameOverImage {
        width: 30dvw;
    }

    #restart:hover {
        width: 8dvw;
        height: 8dvw;
        cursor: pointer;
    }
}

.costumizer-container {
    display: none;
    flex-direction: column;
    position: absolute;
    left: 50%;
    translate: -50% -50%;
    top: 50%;
    z-index: 3;
    background: rgb(35, 35, 35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-family: Poppins, sans-serif;
    padding: 20px 30px;
    color: #fff;
    max-width: 800px;
    max-height: 650px;
    margin: auto;
    border-radius: 12px;

    h2 {
        margin-bottom: 14px;
    }

    p {
        opacity: .8;
        margin-bottom: 20px;
    }
}

.costumizer-parts {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 20px;
    background: #1a1a1a;
    padding: 30px 40px;

    h3 {
        margin: 0;
    }
}

.costumizer-parts>div {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: center;
    width: 500px;
    height: auto;
}

.controls {
    display: flex;
    height: fit-content;
    align-items: center;
    justify-content: center;
    gap: 8px;

    button {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: #333;
        color: #fff;
        font-size: 18px;
        cursor: pointer;
        transition: background .3s;

        &:hover {
            background: #555;
        }
    }
}

#preview-top {
    width: 200px;
    aspect-ratio: 200 / 140;
    image-rendering: pixelated;
}

.colorPalleteDiv {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.color-swatch {
    width: 20px;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.color-swatch.selected {
    border: 1px solid #fff;
    transform: scale(1.1);
}

.actions {
    display: flex;
    justify-content: end;
    gap: 20px;
    margin-top: 20px;
}

#cancel-custom,
#save-custom {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #333;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all .3s;
}

#save-custom {
    background: rgb(144, 19, 253);
}

#save-custom:hover {
    background: rgb(165, 65, 252);
    box-shadow: 0 0 15px 5px rgba(146, 25, 253, 0.781);
}

#cancel-custom:hover {
    background: #3a3a3a;
}

/* ===== RESPONSIVIDADE PARA CELULARES ===== */
@media (max-width: 900px) {
    .costumizer-container {
        width: 90vw;
        height: 90vh;
        padding: 15px;
        overflow-y: auto;
    }

    .costumizer-parts {
        padding: 20px;
    }

    .costumizer-parts>div {
        width: 100%;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 20px;
        margin-bottom: 20px;

        canvas {
            width: 120px !important;
            height: auto !important;
        }
    }

    .controls button {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    h2 {
        text-align: center;
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    .actions {
        flex-direction: column;
        align-items: center;
    }

    #cancel-custom,
    #save-custom {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }
}

/* ===== RESPONSIVIDADE PARA TELAS MENORES (CELULAR PEQUENO) ===== */
@media (max-width: 480px) {
    .costumizer-container {
        width: 95vw;
        height: 90vh;
    }

    canvas {
        width: 100px !important;
    }

    .color-swatch {
        width: 18px;
    }
}

.chooseGamemodeBtn {
    width: 100px;
    height: 100px;
    position: absolute;
    left: 100%;
    top: 100%;
    translate: -120% -110%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    cursor: pointer;

    img {
        width: 100%;
        height: 100%;
        align-items: center;
        transition: all 0.3s ease;
    }

    h2 {
        width: max-content;
        font-family: Poppins, sans-serif;
        color: white;
        font-size: 10px;
        font-weight: 600;
    }
}

.chooseGamemodeBtn img:hover {
    scale: 1.2;
}

.chooseGamemodeContainer {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 4;
    background: rgb(35, 35, 35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-family: Poppins, sans-serif;
    padding: 20px 30px;
    border-radius: 20px;
    transition: all 2s ease;
}

.chooseGamemodeContainer div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: Poppins, sans-serif;
    font-size: 12px;
    color: #fff;
}

.chooseGamemodeContainer div img {
    width: 150px;
    height: 150px;
    border-radius: 30px;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.chooseGamemodeContainer div:hover img {
    box-shadow: 0 0 15px 5px rgba(146, 25, 253, 0.781);
    transform: scale(1.05);
}

.gamemode-selected {
    border: 3px solid white;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgb(144, 19, 253);
    transform: scale(1.05);
}