/* Make unselectable */
#characterCreator {
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}

/* Mobile header */
@media (max-width: 430px) {
    #header {
        height: 17.5vw;
    }
    #header a {
        font-size: 7.5vw;
    }
}

#pageContainer {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    height: calc(100vh - 75px);
}

#characterCreator {
    /* Transform */
    /* margin-top: 75px; */

    /* Appearance */

    /* Display */
    display: flex;
    flex-direction: column;
    align-items: center;
}

#characterPreview {
    position: relative;
}

#characterPreview:hover #characterPreviewImage {
    /* Appearance */
    filter: brightness(50%) drop-shadow(0 0 10px rgba(0,0,0,0.5));
    
    /* Animation */
    animation: shake 1.75s;
    animation-direction: alternate;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

#characterPreviewImage {
    transition: filter 0.15s;
    filter: brightness(100%) drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

#characterPreviewButton {
    /* Transform */
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

    /* Appearance */
    border: none;
    background: none;
    color: white;
    z-index: 1;
    opacity: 0;

    /* Font */
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: bold;

    /* Animation*/
    transition: opacity 0.15s;
}

#characterPreviewButton:hover {
    opacity: 100%;
    cursor: pointer;
}

.backdrop {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
}

#characterSelectionContainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

#characterSelector {
    position: absolute;
    width: 50%;
    height: 75%;
    top: 12.5%;
    background-color: #03a1fc;
    border-radius: 25px 25px 15px 15px;
    z-index: 1;
    padding: 35px;
    padding-bottom: 0;
    overflow: hidden;
}

/* Mobile character selection */
@media (max-width: 650px) {
    #characterSelector {
        position: absolute;
        left: 0;
        top: 0;
        border-radius: 0;
        width: 100%;
        height: 100%;
        padding: 0;
    }

    #characters {
        position: absolute;
        margin: 0;
        left: 0;
        top: 0;
        /* background-color: red; */

        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    #characterSelectionButtons {
        position: absolute;
        left: 0;
        bottom: 0;
    }
}

#characters {
    height: calc(100% - 80px - 35px);
    padding-bottom: 35px;
    overflow-y: auto;
}

#characters button {
    border: none;
    background: none;
    width: max(8vw, 100px);
    height: max(8vw, 100px);
    border-radius: 15px;
    margin: 3px;

    /* Animation */
    transition: background 0.1s;
}

#characters button:hover {
    cursor: pointer;
}

#characters button:not(.selected):hover {
    background-color: rgba(255,255,255,0.25);
}

.characterButton:hover .characterButtonImage {
    transform: scale(1);
    filter: none;
}

#characters .selected {
    background-color: rgba(255,255,255,0.35);
}

.characterButtonImage {
    width: max(6vw, 80px);
    height: max(6vw, 80px);
    object-fit: contain;
    transition: transform 0.15s;
    transform: scale(0.8);
}

#characterSelectionButtons {
    background: rgba(255,255,255,0.2);
    left: 0;
    bottom: 0;
    width: calc(100% - 30px);
    height: 80px;
    margin-left: -35px;
    padding-left: 50px;
    padding-right: 50px;
    display: flex;
    justify-content: space-between;
}

#characterSelectionButtons button {
    border: none;
    padding-left: 35px;
    padding-right: 35px;
    height: 50px;
    margin-top: auto;
    margin-bottom: auto;
    border-radius: 10px;
    font-size: 22px;
    color: white;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.15s;
}

#characterSelectionButtons button:hover {
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

#usernameContainer {
    margin-top: 25px;
    /* margin-bottom: 25px; */

    display: flex;
    flex-direction: column;
    align-items: center;
}

#usernameContainer p {
    /* Transform */
    margin-bottom: 5px;

    
    /* Appearance */
    color: rgba(255,255,255,0.75);

    /* Font */
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

#usernameContainer input {
    /* Transform */
    width: max(200px, 15%);
    padding: 1em;
    padding-top: 0.75em;
    padding-bottom: 0.75em;

    /* Appearance */
    border: none;
    color: rgba(255,255,255,0.75);
    background-color: rgba(255,255,255,0.2);
    border-radius: 10px;

    /* Font */
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    text-align: center;

    /* Animation */
    transition: background 0.15s, color 0.15s;
}

#usernameContainer input:hover {
    background-color: rgba(255,255,255,0.25);
}

#usernameContainer input:focus {
    background-color: rgba(255,255,255,0.3);
    color: white;
}

/* Mobile game buttons */
@media (max-width: 430px) {
    #gameButtons {
        display: flex;
        flex-direction: column;
    }

    #gameButtons button {
        margin: 10px;
    }
}

#gameButtons button {
    background-color: rgba(255,255,255,0.25);
    border-style: solid;
    border-width: 5px;
    border-radius: 10px;
    padding: 0.5em;
    padding-left: 1em;
    padding-right: 1em;
    margin-left: min(25px, 2vw);
    margin-right: min(25px, 2vw);
    color: white;
    border-color: rgba(255,255,255,0.125);
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    transition: background 0.15s;
}

#gameButtons button:hover {
    cursor: pointer;
    background-color: rgba(255,255,255,0.5);
    border-color: rgba(255,255,255,0.25);
}

#joinGameContainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

#joinGame {
    position: absolute;
    width: 300px;
    height: 220px;
    top: calc(50% - 120px);
    background-color: #03a1fc;
    border-radius: 25px 25px 15px 15px;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
}

#joinGame p {
    text-align: center;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    margin-top: 0.5em;
    margin-bottom: 0.25em;
}

#joinGame input {
    /* Transform */
    width: 250px;
    margin-bottom: 0.4em;

    /* Appearance */
    border: none;
    color: rgba(255,255,255,0.75);
    background-color: rgba(255,255,255,0.2);
    border-radius: 10px;

    /* Font */
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    text-align: center;
    text-transform: uppercase;

    /* Animation */
    transition: background 0.15s, color 0.15s;
}

#joinGame input:hover {
    background-color: rgba(255,255,255,0.25);
}

#joinGame input:focus {
    background-color: rgba(255,255,255,0.3);
    color: white;
}

#joinGame button {
    /* Transform */
    padding-left: 20px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-right: 20px;
    margin-left: 20px;
    margin-right: 20px;

    /* Appearance */
    background-color: rgba(255, 255, 255, 0.35);
    color: white;
    border: none;
    border-radius: 10px;

    /* Font */
    font-family: 'Poppins', sans-serif;
    font-size: 24px;

    /* Animation */
    transition: background 0.15s;
}

#joinGame button:hover {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.5);
}

/* Shake animation */
@keyframes shake {
    25% {transform: rotate(-3deg)}
    50% {transform: rotate(3deg)}
    75% {transform: rotate(-3deg)}
    100% {transform:  rotate(3deg)}
    /* 0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); } */
}