@import url('https://fonts.googleapis.com/css2?family=Fondamento:ital@0;1&display=swap');

:root {
    --button-background: #04100d;
    --background: radial-gradient(#18221a, #04100d);
    --color: white;
    --container-background: rgba(216, 215, 202, 1);
    --text-color: #04100d;
}

* {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    font-family: 'Fondamento';
}

html,
body {
    background: radial-gradient(#18221a, #04100d);
    height: 100vh;
}

h1 {
    color: #18221a;
}

/* Modal login/signup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--background);
    padding: 1rem 2rem;
    border-radius: 8px;
    max-width: 300px;
    width: 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modalInput {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
}

.passwordWrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#passwordInput {
    padding-right: 2rem;
}

#togglePassword {
    position: absolute;
    right: 0.7rem;
    cursor: pointer;
    color: gray;
    bottom: 25px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

#suggestMonsterSideBar{
    display:none;
}
.suggestContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 15px;
}

.suggestContainer * {
    margin:0;
}

.suggestContainer .select2-search__field{
    border:none !important;
}

.monsterNameHumanoidContainer {
    display: flex;
    gap: 15px;
}

#isHumanoid {
    width: 9%;
    padding: 5px;
    transform: scale(1);
}

.modal button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 200ms ease-in-out;
}

.modal button:hover {
    background-color: var(--button-background);
    color: white;
    transform: scale(1.1);
}

.title {
    color: white;
    margin: 0 auto;
    margin-bottom: 10px;
    width: fit-content;
}

.register {
    cursor:pointer;
    position: relative;
    width: fit-content;
    display: flex;
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease;
    margin: 0 auto;
    margin-top: 7px;
}

.register:hover {
    transform: scale(1.1);
}

.register::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.register:hover::before {
    width: 100%;
}

/* end modal login/signup */

#loading-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 8px solid var(--container-background);
    border-top: 8px solid #18221a;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 500ms ease-in infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.username{
    position: fixed;
    right: 3rem;
    top: 3%;
    color: white;
}
.userLoginControl {
    height: 20px;
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 1rem;
    top: 2%;
    z-index: 1000;
    transform: scale(2);
    transition: transform 200ms ease-in-out;
    margin-top: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

.userLoginControl::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: white;
    z-index: -1;
    transition: height 200ms ease-in-out;
}

.userLoginControl:hover::before {
    height: 100%;
}

.userLoginControl * {
    cursor: pointer;
    color: white;
    background-color: transparent;
    z-index: 1;
    position: relative;
}

.userLoginControl:hover * {
    color: #18221a;
}

.correct {
    background-color: lightgreen !important;
}

.partial {
    background-color: orange !important;
}

.wrong {
    background-color: red !important;
}

#mainGame {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.border,
.select2,
.select2-dropdown,
.select2-search__field {
    border-image: url('../img/border.png') 45% !important;
    border-image-width: 15px !important;
    border-image-outset: 2px !important;
}

.select2-dropdown {
    background: var(--background);
    color: white;
}

.select2-results__option--highlighted {
    background: var(--container-background) !important;
    color: var(--text-color);
}

#container {
    width: 90%;
    max-width: 700px;
    padding: 20px;
    padding-bottom: 0px;
    max-height: 400px;
    background-color: var(--container-background);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

#guessInput {
    background-color: gainsboro;
    color: black;
    padding: 2px;
    width: 60%;
}

input:focus {
    outline: none;
}

.rowsContainer {
    display: grid;
    grid-auto-rows: auto;
    width: 100%;
    margin-bottom: 15px;
    max-height: 145px;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.4) var(--container-background);
    scrollbar-gutter: stable always;
    -webkit-overflow-scrolling: touch;
    background: var(--background);
}

#streakDisplay {
    position: fixed;
    width: 700px;
    left: 50%;
    transform: translateX(-50%);
    color: black;
}

.headerContainer {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--container-background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.columns {
    display: grid;
    grid-template-columns: repeat(7, minmax(65px, 1fr));
    background-color: var(--container-background);
    white-space: nowrap;
    position: sticky;
    top: 0;
    height: fit-content;
    z-index: 1;
}

.rowGuessed {
    display: grid;
    grid-template-columns: repeat(7, minmax(65px, 1fr));
    gap: 0.5rem;
    align-items: center;
    padding: 0.2rem 0.5rem;
}

.item,
.flip-card {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.column-title {
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    text-align: center;
    font-weight: bold;
    color: black;
}

@media (max-width: 480px) {

    .columns,
    .rowGuessed {
        grid-template-columns: repeat(7, minmax(50px, 1fr));
    }

    .column-title {
        font-size: 0.6rem;
    }
}

.column {
    display: flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
}

.column-title {
    width: 100%;
    text-align: center;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: black;
    font-size: 11px;
}

.rowsContainer::-webkit-scrollbar {
    width: 8px;
}

.rowsContainer::-webkit-scrollbar-track {
    background: var(--container-background);
}

.rowsContainer::-webkit-scrollbar-thumb {
    background-color: var(--container-background);
    border-radius: 4px;
    border: 2px solid var(--container-background);
    background-clip: content-box;
}

.rowGuessed {
    display: flex;
    flex-wrap: nowrap;
    padding: 0.3rem 0.2rem;
    gap: 1rem;
    justify-content: start;
    align-items: center;
}

#firstGuessText {
    margin: 30px 0;
}

.item {
    min-width: 65px;
    flex: 1 1 75px;
    max-width: 125px;
    aspect-ratio: 1/1;
}

.textFitted {
    padding: 2px !important;
    display: flex !important;
}

.itemImg {
    min-width: 65px;
    flex: 1 1 75px;
    max-width: 125px;
    aspect-ratio: 1 / 1;
}

.btn {
    padding: 8px;
    margin-top: 15px;
    margin-bottom: 15px;
    background: var(--background);
    color: white;
    cursor: pointer;
    transition: 200ms ease-in-out;
    font-size: 14px;
}

.btn:hover {
    font-size: 16px;
}

.disabled:hover {
    font-size: 14px !important;
    cursor: default;
}

.center {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    color: white;
}

#resetTimer,
#amountsGuessed {
    color: black;
    white-space: nowrap;
}

.flip-card {
    flex: 1 1 75px;
    min-width: 65px;
    max-width: 125px;
    aspect-ratio: 1 / 1;
    position: relative;
    perspective: 1000px;
}

.flip-card-inner {
    position: absolute;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateY(0deg);
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: inherit;
    box-sizing: border-box;
}

.flip-card-front {
    background: var(--background);
}

.flip-card-back {
    transform: rotateY(180deg);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--background);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 200ms;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
    .fab-main:hover {
        transform: scale(1.1);
        background: var(--container-background);
    }

    .fab-main:hover span {
        color: black;
    }
}

.fab-icon {
    font-size: 32px;
    color: #fff;
    display: inline-block;
    transition: transform .3s ease;
    font-family: Arial, Helvetica, sans-serif;
}

.fab-actions {
    position: absolute;
    bottom: 70px;
    right: 5px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease;
}

.fab-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform .2s ease;
}

.fab-item:hover {
    transform: scale(1.1);
}

.fab-item img {
    max-width: 50px;
    min-width: 30px;
}

.fab-container.open .fab-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fab-container.open .fab-icon {
    transform: rotate(90deg);
}

/* Sidebar */
#hamburger {
    position: absolute;
    left: 1rem;
    top: 5%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 999;
}

#hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background: var(--container-background);
    transition: 0.3s;
}

#sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    width: 240px;
    height: 100%;
    padding: 2px;
    background: #f5f5f5;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    z-index: 1000;
}

#sidebarOptions li {
    padding: 1rem;
    cursor: pointer;
}

#sidebarOptions li:hover {
    background-color: white;
}

#sidebar.open {
    left: 0;
}

#sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar nav ul li button {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 900;
}

#overlay.visible {
    opacity: 1;
    visibility: visible;
}