@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
  /* Base Colors */
  --dark-bg: #171a21;         /* Almost black */
  --medium-bg: #1b2838;       /* Deep blue-gray */
  --dark-blue: #2a475e;       /* Steely blue */
  --accent-blue: #66c0f4;     /* Light blue accent */
  --light-text: #c7d5e0;      /* Light gray-blue */

  /* Shading & Variants */
  --dark-bg-lighter: #282d38;
  --dark-bg-light: #1e222a;
  --dark-bg-darker: #0f1116;

  --medium-bg-light: #243547;
  --medium-bg-darker: #131d28;

  --dark-blue-light: #3a5d76;
  --dark-blue-darker: #1f3748;

  --accent-blue-light: #85cff9;
  --accent-blue-dark: #4797c0;

  --light-text-muted: #aebdca;
  --light-text-strong: #e3ecf5;

  /* Transparent overlays */
  --overlay-dark: rgba(23, 26, 33, 0.85);
  --overlay-light: rgba(199, 213, 224, 0.15);

  /* Danger */
  --danger: #ff3e3e;
  --danger-text: #f17b7b;
  --danger-overlay-dark: #ff3e3ea2;
  --danger-overlay-light: #ff3e3e57;

  /* In-game */
  --in-game: #90ba3c;
}

::-webkit-scrollbar {
    width: 12px;
    background: var(--dark-bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-blue-darker);
    border-radius: 0.2rem;
    border: 1px solid var(--dark-bg-darker);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-blue);
}

::-webkit-scrollbar-corner {
    background: var(--dark-bg-darker);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* font-family: "Geist Mono", monospace; */
    font-family: "Inter", sans-serif;
}

@keyframes bg-loop {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

body {
    background-color: var(--dark-bg);
    height: 100vh;
    background-image: url("https://www.transparenttextures.com/patterns/inspiration-geometry.png");
    backdrop-filter: brightness(0.6);
    animation: bg-loop 120s linear infinite;
    max-width: 100%;
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    padding: 0.4rem 1rem;
    background-color: var(--dark-bg-light);
    border: 0;
    border-radius: 0.2rem;
    color: var(--accent-blue-light);
    cursor: pointer;
}

input {
    padding: 0.4rem 1rem;
    background-color: var(--dark-bg-light);
    border: 0;
    border-radius: 0.2rem;
    color: var(--light-text);
    outline: none;
}
input::placeholder {
    color: var(--light-text-muted);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--overlay-dark);
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--dark-bg-lighter);
    z-index: 10;
}

header h1 {
    color: var(--light-text);
    margin-left: 4rem;
    font-family: "Geist Mono", monospace;
    cursor: pointer;
}

header nav {
    margin-right: 4rem;
}

header nav ul {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

header nav ul li {
    font-size: 1.2rem;
}

header nav ul li a {
    color: var(--accent-blue-light);
    transition: all 0.2s ease-in-out;
    font-family: "Geist Mono", monospace;
}

header nav ul li a:hover {
    color: var(--accent-blue-dark);
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    gap: 1rem;
    height: max-content;
    margin-top: 10rem;
}

main h1 {
    color: var(--light-text);
    font-family: "Geist Mono", monospace;
}

main .search {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 2rem;
}

main .input-group {
    display: flex;
    align-content: center;
    justify-content: space-between;
    gap: 0.2rem;
}
main .input-group input {
    width: 460px;
    font-size: 1.2rem;
    padding: 0.8rem 1.4rem;
    border: 1px solid var(--dark-bg-lighter);
    background-color: var(--overlay-dark);
    transition: all 0.2s ease-in-out;
}
main .input-group input::placeholder {
    color: var(--light-text-muted);
}
main .input-group input:focus {
    background-color: var(--dark-bg-lighter);
}
main .input-group button {
    font-size: 1.2rem;
    padding: 0.8rem 2rem;
    border: 1px solid var(--dark-bg-lighter);
    background-color: var(--overlay-dark);
    transition: all 0.2s ease-in-out;
    font-weight: bold;
}
main .input-group button:hover {
    background-color: var(--dark-bg-lighter);
}

main .added {
    background-color: var(--dark-bg-darker);
    padding: 2rem;
    border-radius: 0.2rem;
    overflow-y: auto;
    max-height: 340px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: 0 0 1rem var(--dark-bg-darker);
    color: var(--light-text);
    min-width: 600px;
    box-shadow: inset 0 0 1rem var(--dark-bg);
    transition: all 0.2s ease-in-out;
}
main .added p:first-child {
    display: block;
    text-align: center;
    color: var(--light-text-muted);
}
main .added .user {
    background-color: var(--dark-bg);
    border: 1px solid var(--dark-bg-light);
    border-radius: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 620px;
    padding: 0.6rem 0.6rem;
    cursor: pointer;
    transition: 0.2s all ease-in-out;
    color: var(--light-text);
    height: auto;
}
main .added .user:hover {
    background-color: var(--dark-bg-light);
}
main .added .user img {
    border-radius: 0.2rem;
    cursor: pointer;
}
main .added .user .left {
    display: flex;
    align-items: start;
    gap: 0.8rem;
    width: 80%;
}
main .added .user .left img {
    width: 64px;
    height: 64px;
}
main .added .user .left span {
    font-size: 1.2rem;
}
main .added .user .left span b {
    color: var(--dark-blue-light);
    font-size: 0.9rem;
}
main .added .user .left p {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: max-content;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
main .added .user .left p b {
    color: var(--accent-blue);
}
main .added .user .left .about-user p .location {
    display: flex;
    align-items: center;
}
main .added .user .left .about-user .flag {
    width: auto;
    height: 16px;
    border-radius: 0.2rem;
}
main .added .user .left .about-user span {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}
main .added .user .right img {
    width: 32px;
    height: 32px;
    background-color: var(--danger);
}
main .filter button {
    color: var(--light-text);
    font-size: 1.4rem;
    padding: 0.8rem 2rem;
    border: 1px solid var(--overlay-light);
    background-color: var(--overlay-dark);
    transition: 0.2s all ease-in-out;
}
main .filter button:hover {
    background-color: var(--dark-bg-lighter);
}

.shared-games h1 {
    font-size: 3rem;
    color: var(--light-text);
}
.shared-games-parent  {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background-color: var(--overlay-dark);
    padding: 4rem;
    height: auto;
    overflow-y: auto;
    margin-top: 4.5rem;
    display: none;
    height: 86.5vh;
    color: var(--light-text);
}
.shared-games-parent .action-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.shared-games-parent .action-bar div:first-child {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.shared-games-parent .action-bar img {
    width: 32px;
    height: 32px;
    border-radius: 0.4rem;
    background-color: var(--dark-blue);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.shared-games-parent .action-bar img:hover {
    filter: brightness(0.8);
}
.shared-games {
    display: grid;
    grid-template-columns: auto auto auto auto;
    gap: 0.8rem;
}
.shared-games .game {
    display: flex;
    align-items: start;
    gap: 1rem;
    background-color: var(--dark-bg-light);
    color: var(--light-text);
    border-radius: 0.2rem;
    padding: 1rem 1rem;
    height: max-content;
    border: 1px solid var(--dark-bg-lighter);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    max-width: 480px;
}
.shared-games .game:hover {
    transform: scale(1.04);
}
.shared-games .game img {
    height: 120px;
    border-radius: 0.2rem;
}
.shared-games .game span {
    color: var(--light-text);
    font-size: 1.2rem;
}
.shared-games .game .details {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 1rem;
}
.shared-games .game .details a {
    background-color: var(--in-game);
    color: var(--dark-bg);
    border-radius: 0.4rem;
    padding: 0.4rem 1rem;
    font-family: "Geist Mono", monospace;
    transition: all 0.2s ease-in-out;
}
.shared-games .game .details a:hover {
    filter: brightness(0.8);
}

.sidebar {
    position: absolute;
    top: 14rem;
    left: 4rem;
}
.sidebar * {
    color: var(--light-text);
    font-size: 1.6rem;
}
.sidebar h2 {
    font-family: "Geist Mono", monospace;
    color: var(--in-game);
}
.sidebar ul {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sidebar ul li a {
    font-family: "Geist Mono", monospace;
    color: var(--accent-blue);
}
.sidebar ul li a:hover {
    text-decoration: underline;
}

.ad {
    position: absolute;
    top: 10rem;
    right: 4rem;
}
.ad img {
    cursor: pointer;
    border-radius: 0.4rem;
}

footer {
    padding: 1.2rem;
    background-color: var(--overlay-dark);
    text-align: center;
    color: var(--light-text);
    position: absolute;
    width: 100%;
    bottom: 0;
    border-top: 2px solid var(--dark-bg-lighter);
}

/* */

@keyframes error-slide-in {
    0% {
        transform: translateX(12rem);
    } 
    
    100% {
        transform: translateX(0rem);
    }
}

.muted {
    width: fit-content;
    color: var(--light-text-muted);
}

.error {
    position: absolute;
    bottom: 6rem;
    right: 2rem;
    border: 1px solid var(--danger-overlay-dark);
    background-color: var(--danger-overlay-light);
    padding: 0.6rem 1.4rem;
    border-radius: 0.2rem;
    color: var(--danger-text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    animation: 0.4s error-slide-in ease-in-out;
    display: none;
}
.error img {
    width: 28px;
    height: 28px;
}
.error h2 {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 0.4rem;
    font-size: 1.4rem;
    font-family: "Geist Mono", monospace;
}
.error:hover {
    background-color: var(--danger-overlay-dark);
}

.get {
    color: var(--light-text);
    font-size: 1.2rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--dark-bg-lighter);
    background-color: var(--overlay-dark);
    transition: all 0.2s ease-in-out;
}
.get a {
    color: var(--accent-blue);
    text-decoration: none;
}
.get code {
    background-color: var(--dark-bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-family: "Geist Mono", monospace;
    color: var(--light-text);
}

/* Error slide-in animation */
@keyframes error-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error slide-out animation */
@keyframes error-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.error.slide-in {
    animation: error-slide-in 0.4s forwards;
}

.error.slide-out {
    animation: error-slide-out 0.4s forwards;
}

.truncate-overflow {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Number of lines to show */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 406px;
    max-height: 154px;
    line-height: 1.2em; /* Adjust to your font size */
    font-size: 1.2rem;
    white-space: normal;
}
.truncate-overflow::before,
.truncate-overflow::after {
    content: none;
}