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

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

html,
body {
    height: 100%;
    width: 100%;
    flex: 1 1;
    overflow: hidden;
}

body {
    background: radial-gradient(circle at center, #18221a, #04100d) no-repeat center center fixed;
    background-size: cover;
    display: flex;
    position: relative;
}

h1 {
    color: #18221a;
}

/* Modal login/signup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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;
    min-height: 260px;
    width: 90%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#loginSignUpModal .modal {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.closeButton {
    color: red;
    position: absolute;
    right: 0%;
    top: 5%;
    font-weight: bolder;
    background-color: transparent !important;
    padding: 0 10px;
    transform: scale(1.2);
}

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

.loggedInContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
    height: 100%;
}

.loggedInContainer * {
    color: white;
}

.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,
.modal-buttons 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);
}

/* 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.main {
    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: 54;
    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;
}

.ad-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex: 1 1;
    min-height: 100vh;
}

.ad-side {
    flex: 0 0 160px;
    min-width: 0px;
    max-width: 200px;
    display: none;
}

#mainGame {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

.footer {
    bottom: 5px;
    position: absolute;
    width: 100%;
    display: flex;
    color: white;
    justify-content: center;
    gap: 5px;
}

.privacyLink {
    text-decoration: none;
    color: white;
    transition: 200ms ease;
    opacity: 0.8;
}

.privacyLink:hover {
    transform: scale(1.04);
    opacity: 1;
}

.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: 600px;
    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: 350px;
    overflow-y: auto;
    background: var(--background);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.4) var(--container-background);
    scrollbar-gutter: stable always;
    position: relative;
}

#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;
}


.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;
}

.customizedScrollbar{
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.4) transparent;
    scrollbar-gutter: stable always;
}

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

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

.rowsContainer::-webkit-scrollbar-thumb,
.leaderboard::-webkit-scrollbar-thumb,
.customizedScrollbar::-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 {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    white-space: nowrap;
}

.tempContainer {
    min-height: 60px;
}

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

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

.itemImg {
    min-width: 50px;
    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: 50px;
    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;
}

.mini-sharko-container {
    position: absolute;
    bottom: 1rem;
    left: -250px;
    width: fit-content;
    z-index: 1;
    animation: moveSharko 40s linear infinite alternate;
    will-change: left;
}

.mini-sharko-container img {
    width: 50px;
    display: block;
    transform-origin: center;
    cursor: pointer;
}

.mini-sharko-container:hover {
    animation-play-state: paused;
}

.mini-sharko.flipped {
    transform: scaleX(-1);
}

.sharko-iteration {
    height: 72px;
}

.sharko-particles {
    position: absolute;
    pointer-events: none;
    overflow: visible;
    z-index: 2000;
}

.sharko-particles .particle {
    position: absolute;
    background-repeat: no-repeat;
    will-change: transform, opacity;
    transition: transform 1200ms cubic-bezier(.2, 1, .3, 1), opacity 1200ms linear;
    transform-origin: center;
    backface-visibility: hidden;
}

@keyframes moveSharko {
    0% {
        left: -250px;
    }

    100% {
        left: calc(100% + 250px);
    }
}

.mini-sharko {
    width: 100%;
    display: block;
}

.fab-container, .chat-container {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 55;
}

.chat-container {
    right:5rem;
}
.chat-main i {
    transform:scale(1.8);
}

.fab-main, .chat-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;
    color:white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.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);
}

@media (max-width: 480px) {

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

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

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

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

/* Chat Sidebar */
#chatSidebar {
    position: fixed;
    right: -70%;
    top: 0;
    max-width: 400px;
    width: 60%;
    height: 100%;
    padding: 2px;
    background: #f5f5f5;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1001;
}
#chatSidebar.open{
    right:0;
}

.chatContainer{
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding:10px;
}

#chat{
    max-height: 655px;
    overflow: auto;
    height: 100%;
    padding-right:8px;
}

#chat p {
    word-break: break-all;
}

#messagesContainer{
    height: 590px;
}

#message {
    padding: 15px 5px 2px;
    width: 100%;
    max-height: 120px;
    height: 157px;
    min-height: 50px;
    resize: vertical;
    max-width: 300px;
}

#btnSendMessage{
    padding:10px;
    cursor:pointer;
    transition: 300ms ease-in-out;
    position: relative;
    z-index:0;
    width:70px;
    max-height:50px;
}

#btnSendMessage::after{
    content: "";
    position:absolute;
    bottom:0;
    left:0;
    height:0%;
    width:100%;
    z-index:-1;
    background:var(--background);
    transition: 200ms ease-in-out;
}

#btnSendMessage:hover::after{
    height:100%;
}

#btnSendMessage:hover{
    color:white;
}

#userActionsContainer{
    display: flex;
    position: relative;
    width: 100%;
    gap: 8px;
    justify-content:space-between;
    align-items: end;
}

.chatBoxContainer{
    display: flex;
    position: relative;
    width: 100%;
}

#txtCharactersRemaining{
    position: absolute;
    top: 0px;
    font-size: 9px;
    padding: 2px 0 0 2px;
    left: 1px;
    width: 97%;
    max-width: 300px;
    height: 15px;
    background-color: white;
}
/* Chat Sidebar */
/* 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;
}

/* Modal Leaderboard */
.leaderboard {
    max-width: 700px !important;
    height: 90%;
    margin: auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.4) var(--container-background);
    scrollbar-gutter: stable always;
    position: relative;
}

.gridjs-pages{
    padding:3px;
}

.gridjs-footer button {
    margin-right: 10px !important;
    cursor: pointer !important;
}

button:is(:disabled) {
    cursor: default !important;
}

.gridjs-footer button:not(:disabled):hover {
    color: white !important;
    background-color: var(--button-background) !important;
}

.leaderboard .modal-content input:focus,
.leaderboard .modal-content button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.gridjs-th-content {
    text-align: center;
}

.user-cell:not(th) {
    max-width: 200px;
    text-overflow: ellipsis;
    overflow: hidden;
    padding: 5px;
    border: 1px solid white;
}

#leaderboardGrid th {
    vertical-align: middle;
}

#leaderboardGrid .gridjs-wrapper,
#leaderboardGrid .gridjs-footer {
    border-radius: 2px;
}

.leaderboard .title {
    font-weight: bolder;
    font-size: 22px;
}

/* Modal Leaderboard */

@media (max-width: 842px) {
    .ad-side {
        display: none;
    }

    .ad-layout {
        justify-content: center;
    }

    #mainGame {
        flex: 1 1 100%;
    }
}

@media(max-width:609px) {
    #container {
        max-width: 90vw;
    }
}