@import url('https://fonts.googleapis.com/css2?family=SUSE+Mono:ital,wght@0,100..800;1,100..800&display=swap');

html {
    width: 99%;
}


body {
    font-family: 'SUSE Mono';
    /* background: linear-gradient(to bottom,#464646,#464646,#464646,#464646,#464646,#464646,#464646,#000); */

    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100lvh;
    background-color: rgb(37, 37, 37);
    width: 100%;
    overflow-x: hidden;
}

hr {
    width: 40vw;
    font-size: large;
    border: none;
    height: 1px;
    background: rgb(83, 83, 83);
}

header {
    display: flex;
    justify-content: center;
    width: 100%;
}

.alert {
    width: 60vw;
    background: rgb(209, 53, 53);
    text-align: center;
    border-radius: 10px;
    font-weight: bold;
    font-size: large;
    position: absolute;
    z-index: 2;
    top: 20px;
}

.close-alert {
    background: none;
    border: none;
    font-size: x-large;
    cursor: pointer;
    height: min-content;
    float: right;
    position: relative;
    top: 2px;
    right: 2px;
    border-radius: 10px;
}

.close-alert:hover {
    background: rgba(0, 0, 0, .3);
}

#title-container {
    padding: 20px;
    border: 1px solid rgb(149, 149, 149);
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, .5);
    border-radius: 5px;
    margin: 20px;
}

p,
li,
.title,
.subtitle,
.sort-lbl,
/* .sort-btn, */ /* <-- REMOVED */
.favorite-game,
#favorited-games p {
    color: darkgray;
}

.favorite-game {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.title {
    font-size: 1.5rem;
}

a {
    font-family: 'SUSE Mono';
}

.count {
    font-size: small;
    color: rgb(149, 149, 149);
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: larger;
}

.links,
.othersite-link a,
.gametxtlnk {

    text-decoration: none;
    font-family: 'SUSE Mono';
}

.gametxt {
    text-decoration: none;
    color: rgb(150, 172, 150);
}

.recent {
    font-size: larger;
}
.favorites {
    font-size: larger;
    display: flex;
    justify-content: left;
    flex-direction: column;
    width: 70%;
}

.top5 {
    font-size: larger;
    display: flex;
    flex-direction: column;
    width: max-content;
    align-items: left;
}

.play-count {
    font-size: large;
    float: right;
    margin-left: 40px;
    background-color: rgba(37, 37, 37, 0.473);
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 4px;
}

#version {
    font-size: 0.8rem;
    color: rgb(95, 95, 95);
    margin-left: 10px;
}

/* Spinner styles */
.spinner {
    border: none;
    border-top: 4px solid rgb(139, 173, 139);
    /* Blue */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    /* center it */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.top5 div {
    color: rgb(150, 172, 150);
    text-decoration: none;
    margin: 5px;
}

.top5 a {
    color: rgb(150, 172, 150);
    text-decoration: none;
}

.action-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 10fr 1fr;
    column-gap: 20px;
}

#searchbar {
    display: flex;
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 0px;
    padding: 0px;
}

.search-input {
    width: max-content;
    border: none;
    font-size: xx-large;
    text-align: center;
    color: rgb(139, 173, 139);
    border-radius: 5px;
    border: 1px solid rgb(149, 149, 149);
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, .5);
    padding: 5px;
    font-family: 'SUSE Mono';
    margin: 10px;
    width: 100%;
    height: 40px;
}

.search-input:focus {
    outline: none;
    border: 2px solid rgb(103, 129, 97);
}

#search-results {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: max-content;
    width: max-content;
    background-color: rgba(0, 0, 0, 0.63);
    z-index: 3;
    border-radius: 20px;
    padding: 20px;
    font-size: 1.5rem;
}

#search-results p {
    border-radius: 5px;
    padding: 5px;
    margin: 5px;
}

#search-results p:hover {
    background-color: rgba(37, 37, 37, 0.473);
}

.opts {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.sort-lbl,
/* .sort-btn, */ /* <-- REMOVED */
.random-game,
.top-link {
    font-family: 'SUSE mono';
}

.sort-lbl {
    margin-bottom: 2px;
    margin-top: 1px;
    font-size: smaller;
}

/* --- REMOVED .sort-btn, .sort-btn:hover, .sort-btn:active STYLES --- */

.random-game {
    border: none;
    border-radius: 10px;
    font-size: large;
    color: rgb(223, 223, 223);
    background: linear-gradient(to bottom right, rgb(9, 120, 20), rgb(45, 87, 45), rgb(9, 137, 9));
    cursor: pointer;
    margin: 10px;
}

.random-game:hover {
    transform: translateY(-5px);
}

.vpn-img {
    height: 400px;
    border-radius: 10px;
    border: 2px solid black;
}

.code {
    background: rgb(78, 78, 78);
    padding: 2px;
    border: 1px solid black;
    border-radius: 5px;
}


.topbar {
    border: 1px solid rgb(149, 149, 149);
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, .5);
    width: 100%;
    height: fit-content;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
}

.topbar div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.top-link {
    background: none;
    border: 1px solid;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px;
    color: rgb(195, 195, 195);
    font-size: larger;
    font-family: 'SUSE Mono';
    margin-left: 5px;
    margin-right: 5px;
}

.game,
.s-cont {
    border: 1px solid rgb(149, 149, 149);
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, .5);
    border-radius: 5px;
}

.game {
    padding: 5px;
    margin-top: 10px;
}

.game:hover {
    transform: scale(1.05);
}


.fav-star {
    color: rgb(150, 172, 150);
    scale: 0.8;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
}

.s-cont {
    margin: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 220px;
}

#top5-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

#top5-reload {
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgb(149, 149, 149);
    cursor: pointer;
    transition: 0.6s ease-out;
}

#top5-reload:hover {
    transform: rotate(90deg);
}

#top5-reload:active {
    transform: scale(0.9), rotate(90deg);
    
}

#games-container {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 10px;
    row-gap: 10px;
}


#recently-played,
#favorited-games {
    text-align: center;
}

#recently-played p,
#favorited-games p {
    padding: 0;
    margin: 5px;
}
#recently-played {
    text-align: left;
}

#favorited-games {
    overflow: scroll;
    overflow-x: visible;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: none;
}

::-webkit-scrollbar-thumb {
    background: darkgray;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #397162, rgb(45, 87, 45), rgb(9, 137, 9));
}

.othersite-link {
    width: 80%;
    text-align: center;
}


footer {
    margin: 20px;
    text-align: center;
}

/* WebGL background styling: */
#abstract-bg {
    position: fixed;
    top: 0;
    left: 0;
    inset: 0;
    z-index: -1;
    width: 100%;
    pointer-events: none;
    display: block;
}

#bg-mode {
    background-color: rgba(0, 0, 0, .5);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(149, 149, 149);
    padding: 10px;
    border-radius: 10px;
    color: rgb(195, 195, 195);
    margin: 10px;
}

#bg-mode option {
    background-color: rgb(37, 37, 37);
    color: rgb(195, 195, 195);
    border: none;
}

#privacy-policy {
    color: rgb(136, 212, 117);
    text-decoration: none;
}

/* --- NEW STYLES FOR SORT CIRCLES --- */
.opts {
  flex-direction: row; /* Align label and options horizontally */
  gap: 20px;
}

.sort-options {
  display: flex;
  gap: 20px;
}

.sort-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: darkgray;
  font-family: 'SUSE mono';
  font-size: large;
}

/* Hide the actual radio button */
.sort-options input[type="radio"] {
  display: none;
}

.sort-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid darkgray;
  margin-right: 8px;
  display: inline-block;
  position: relative;
  transition: border-color 0.2s;
}

.sort-options label:hover .sort-circle {
  border-color: rgb(139, 173, 139);
}

.sort-options input[type="radio"]:checked + .sort-circle {
  border-color: rgb(139, 173, 139);
}

/* Add the inner dot for the selected circle */
.sort-options input[type="radio"]:checked + .sort-circle::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgb(139, 173, 139);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* --- LOADING/DISABLED STYLES FOR POPULARITY SORT --- */
#sort-popularity-label {
    position: relative;
    /* Establish positioning context for the overlay */
}

#sort-popularity-label.loading {
    opacity: 0.5;
    /* Gray out the label text and circle */
    cursor: default;
    pointer-events: none;
    /* Prevent interaction with the label's child elements */
}

#popularity-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(37, 37, 37, 0.7);
    /* Semi-transparent overlay */
    border-radius: 5px;
    z-index: 10;
}

/* Ensure the spinner is centered and appropriately sized */
#popularity-loading .spinner {
    display: block;
    width: 15px;
    height: 15px;
    border-width: 3px;
    margin: 0;
}