body {
    margin: 0;
    padding: 0;
    font-family: "Nunito", sans-serif;
    background-color: #f4f4f4;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    height: 100%;
}


/**********************/
/* Connection Overlay */
/**********************/

#connection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.737);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 300;
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
}

#connection-overlay p {
    font-size: 20px;
    color: #fff;
    margin: 0 0 0 0;
    text-align: center;
}

#connection-overlay svg {
    width: 100px;
    height: 100px;
    fill: #fff;
}


/*******************************/
/* Navbar Toggle Button Styles */
/*******************************/

#navtoggle {
    display: flex;
    position: fixed;
    top: 20px;
    left: 20px;
    flex-direction: column;
    justify-content: space-between;
    width: 37px;
    height: 37px;
    cursor: pointer;
    border-radius: 10px;
    z-index: 200;
    /*border: 2px solid rgba(0, 0, 0, 0.121);*/
    border: none;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.391);
    background: rgb(249, 252, 255);
    transition: transform 0.2s ease-in-out, background 0.2s ease-in-out;
}

.dot1 {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: rgb(0, 204, 255);
    transition: transform 0.5s ease-in-out;
    position: absolute;
    left: 20%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dot2 {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: rgb(0, 204, 255);
    transition: transform 0.5s ease-in-out;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.dot3 {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: rgb(0, 204, 255);
    transition: transform 0.5s ease-in-out;
    position: absolute;
    left: 82%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dot1,
.dot2,
.dot3 {
    transition:
        left 0.2s ease-in-out,
        top 0.2s ease-in-out,
        transform 0.5s ease-in-out;
}

/*#navtoggle:hover .dot1 {
    left: 25%;
}

#navtoggle:hover .dot3 {
    left: 78%;
}*/

#navtoggle:hover {
    transform: scale(1.03);
    background: rgb(244, 244, 244);
}

#navtoggle:active {
    transform: scale(0.98);
}

.navtoggled .dot1, .navtoggled .dot2, .navtoggled .dot3 {
    left: 50%;
}

.navtoggledx .dot2 {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(2.8);
}

.bar1,
.bar2 {
    position: absolute;
    width: 0;
    height: 0;
    background-color: white;
    border-radius: 5px;
    z-index: 3;

    left: 50%;
    top: 50%;

    transition: transform 0.5s ease-in-out;
    transition: width 0.5s ease-in-out, height 0.5s ease-in-out;
    transform: translate(-50%, -50%) rotate(45deg);
}

.bar2 {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.navtoggledx .bar1 {
    transform: translate(-50%, -50%) rotate(45deg);
    width: 4px;
    height: 12px;
}

.navtoggledx .bar2 {
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 4px;
    height: 12px;
}


/*****************/
/* Navbar Styles */
/*****************/

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: rgba(255, 255, 255, 1);
    z-index: 100;
    transition: transform 0.5s ease-in-out;
    box-shadow: 5px 2px 9px rgba(0, 0, 0, 0.201);
    transform: translateX(-105%);
}

#navbar.open {
    transform: translateX(0);
}

#navbar h1 {
    text-align: right;
    font-size: 24px;
    margin-bottom: 16px;
    margin-top: 25px;
    color: #333;
    padding-right: 18px;
}

#navbar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

#navbar ul li {
    margin: 0 auto;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease-in-out;
}

#navbar ul li:hover {
    background-color: rgba(0, 204, 255, 0.1);
}

#navbar ul li p {
    font-weight: bold;
    font-size: 25px;
    color: #333;
    text-align: center;
    transition: color 0.3s ease-in-out;
    margin: 2px 0;
}


/***************/
/* Page Styles */
/***************/

#pages {
    width: 100%;
    height: 100dvh;
}

/* Homepage */

#homepage {
    display: none; /* flex */
    flex-direction: column;
    align-items: left;
    justify-content: flex-start;
    height: 100%;
    background-color: rgba(0, 204, 255, 0.1);
}

#homepage-title {
    font-size: 50px;
    color: #333;
    margin: 7px 0 0 70px;
}

#homepage-topbar {
    display: flex;
    align-items: space-between;
    justify-content: flex-start;
    width: 100%;
}

#homepage-content {
    margin: 0 0 0 0;
    font-size: 20px;
    color: #333;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: flex-start;
}

#homepage-content h2 {
    margin: 0 0 0 30px;
}

#modes-handler {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

#modes-holder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    gap: 20px;
}

.mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 255, 255, 0.617);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.26);
    transition: box-shadow 0.2s, transform 0.2s, background-color 0.2s;
    text-align: center;
}

.mode:hover {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.35);
    transform: scale(0.99);
}

.mode:active {
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.374);
    transform: scale(0.98);
}

.mode h3 {
    font-size: 35px;
    color: #333;
    margin: 0 0 0 0;
}

.mode p {
    font-size: 20px;
    color: #333;
    margin: 10px 15px 0 15px;
}


/* Mode Details */

#modedetails-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.737);
    display: none; /* flex */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 300;
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
}

#modedetails-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#modedetails-content {
    background-color: rgb(255, 255, 255);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    cursor: default;
}

#modedetails-title {
    font-size: 30px;
    color: #333;
    margin: 0 0 10px 0;
}

#modedetails-description {
    font-size: 20px;
    color: #333;
    margin: 0 0 10px 0;
}

#modedetails-difficulty {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px 0;
    gap: 15px;
}

#modedetails-difficulty span {
    font-size: 20px;
    color: #333;
    margin: 0 5px 0 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

#modedetails-difficulty svg {
    width: 30px;
    height: 30px;
    margin: 0 5px 0 0;
}

#modedetails-hearts svg {
    fill: rgb(255, 70, 110);
}

#modedetails-hearts p {
    color: rgb(255, 70, 110);
}

#modedetails-time svg {
    fill: rgb(65, 229, 87);
}

#modedetails-time p {
    color: rgb(58, 210, 79);
}

#modedetails-difficulty p {
    font-size: 20px;
    margin: 0 0 0 0;
}

#modedetails-start {
    background-color: rgb(103, 225, 255);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    font-weight: bold;
    font-family: "Nunito", sans-serif;
}

#modedetails-start:hover {
    background-color: rgb(0, 204, 255);
}

#modedetails-start:active {
    background-color: rgb(0, 204, 255);
    transform: scale(0.98);
}

#modedetails-close {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: none;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#modedetails-close svg {
    width: 40px;
    height: 40px;
    fill: #ff3f3f;
    margin: 0;
}

#modedetails-close:hover svg {
    fill: #ff3636;
}

#modedetails-close:active {
    transform: scale(0.95);
}

/********/
/* Game */
/********/

#game-container {
    display: flex; /* flex */
    position: fixed;
    top: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: rgb(249, 254, 255);
    z-index: 400;
    transform: translateY(-100%);
    transition: transform 0.5s ease-in-out;
}

#game-container.visible {
    transform: translateY(0);
}

#game {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

#game-topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
}

#game-title {
    font-size: 30px;
    color: #333;
    margin: 0 0 0 10px;
}

#game-exit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0 10px 0 0;
    background-color: rgba(0, 0, 0, 0.113);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: transform 0.2s ease-in-out;
}

#game-exit svg {
    width: 40px;
    height: 40px;
    fill: #ff3e3e;
    transition: fill 0.2s ease-in-out;
}

#game-exit:hover svg {
    fill: #ff2e2e;
}

#game-exit:active {
    transform: scale(0.95);
}

#game-getready {
    display: flex; /* flex */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.737);
    z-index: 401;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

#game-getready p {
    font-size: 30px;
    color: #fff;
    margin: 0 0 0 0;
    font-weight: bold;
    cursor: default;
    user-select: none;
}

#game-getready.visible {
    opacity: 1;
}

#game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

#game-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 10px;
}

.game-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-stat p {
    font-size: 20px;
    margin: 0;
}

.game-stat svg {
    width: 25px;
    height: 25px;
    margin: 0;
}

#game-hearts {
    margin: 0 20px 0 10px;
    color: rgb(255, 70, 110);
}

#game-hearts svg {
    fill: rgb(255, 70, 110);
}

#game-time {
    margin: 0 10px 0 20px;
    color: rgb(63, 223, 84);
}

#game-time svg {
    fill: rgb(65, 229, 87);
}

#game-score {
    margin: 0 20px 0 10px;
    color: rgb(255, 179, 0);
    font-weight: bold;
}

#game-displayholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#game-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: 100%;
    width: 100%;
}

#game-correction p {
    font-size: 40px;
    color: #333;
    margin: 0 0 0 0;
    font-weight: bold;
    cursor: default;
    user-select: none;
}

#game-correction {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    position: absolute;
    top: calc(50% - 100px);
    left: calc(50% - 100px);
    background-color: rgb(255, 98, 98);
    border-radius: 10px;
    z-index: 401;
    transition: opacity 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.26);
    opacity: 0;
}

#game-correction.visible {
    opacity: 1;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.35);
}


/* Game Over */

#gameover-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgb(255, 255, 255);
    z-index: 380;
    transform: translateY(-100%);
    transition: transform 0.5s ease-in-out;
}

#gameover-container.visible {
    transform: translateY(0);
}

#gameover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 10px;
}

#gameover-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #1c1c1c;
    margin: 0 0 0 0;
    cursor: default;
    user-select: none;
    gap: 10px;
}

#gameover-content h2 {
    margin: 0;
    cursor: default;
    user-select: none;
}

#gameover-message p {
    font-size: 30px;
    color: #000;
    margin: 0 0 0 0;
    font-weight: bold;
    cursor: default;
    user-select: none;
}

#gameover-score {
    font-size: 40px;
    color: #000;
    margin: 0 0 0 0;
    font-weight: bold;
    cursor: default;
    user-select: none;
}

#gameover-menu {
    background-color: rgb(103, 225, 255);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    font-weight: bold;
    font-family: "Nunito", sans-serif;
}

#gameover-menu:hover {
    background-color: rgb(0, 204, 255);
}

#gameover-menu:active {
    background-color: rgb(0, 204, 255);
    transform: scale(0.98);
}

#gameover-content svg {
    width: 100px;
    height: 100px;
    margin: 0 0 0 0;
    cursor: default;
    user-select: none;
    fill: gold;
}