/** BASE */
html {
  color-scheme: dark;
  background-color: #000;
  scrollbar-gutter: stable;
}
body {
  margin: 0 auto;
  background-color: transparent;
  font-family: "MinecraftSlim", "Regular", sans-serif;
  max-width: 1000px;
}

/** NATIVE SCROLLBARS ARE HIDDEN EVERYWHERE (custom DOM scrollbar used instead) */
* {
  scrollbar-width: none;
}
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/** TOP CONTENT */
#outrun_title {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2%;
  width: 40%;
  image-rendering: pixelated;
}
a:has(> #outrun_title) {
  display: flex;
  justify-content: center;
  width: 100%;
}
h1 {
  color: rgb(27, 142, 61);
  font-size: 20px;
  margin: 0px;
  text-align: center;
  font-family: "MinecraftBold";
}
#stats_parent_box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#leaderboard_title {
  color: rgb(34, 177, 76);
  font-family: "Regular";
  font-weight: bold;
  font-size: clamp(20px, 3.5cqw, 34px);
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0 0 2%;
}
#search_wrap {
  width: 96%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  margin: auto;
  margin-bottom: 2%;
  gap: 2%;
  box-sizing: border-box;
}
#search_box {
  width: 84%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  background-color: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 4px solid rgb(27, 142, 61);
  padding: 0 1.5%;
}
.search_field {
  width: 100%;
  height: 36px;
  color: rgb(203, 255, 221);
  font-size: 20px;
  font-family: "Regular";
  padding-left: 1%;
  border: none;
  background-color: transparent;
  box-sizing: border-box;
  outline: none;
}
.search_field::placeholder {
  color: rgb(150, 213, 167);
}
.search_field:focus {
  color: rgb(203, 255, 221);
}
.search_button {
  width: 12%;
  text-align: center;
  color: rgb(203, 255, 221);
  font-size: 20px;
  font-family: "Regular";
  padding: 0 1%;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 4px solid rgb(27, 142, 61);
  cursor: pointer;
}
.search_button:hover {
  border-color: rgb(203, 255, 221);
  color: rgb(203, 255, 221);
}
#stats_box {
  width: 96%;
  display: flex;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 4px solid rgb(27, 142, 61);
}

#stats_list {
  width: 100%;
  list-style: none;
  margin: 0;
  padding-left: 2%;
  padding-right: 2%;
  color: rgb(203, 255, 221);
  font-family: "Regular";
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

/** OVERLAY-STYLE ROWS */
.queue-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 0;
  font-size: clamp(16px, 3cqw, 20px);
  white-space: nowrap;
  min-width: 0;
  color: rgb(203, 255, 221);
  border-bottom: 1px solid rgba(196, 230, 206, 0.15);
}
.queue-item.fade-in {
  animation: queue-fade-in 0.7s ease-out;
}
@keyframes queue-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.queue-item:last-child {
  border-bottom: none;
}
.q-pos {
  color: rgb(203, 255, 221);
  min-width: 1.8em;
  text-align: right;
  flex-shrink: 0;
}
.q-name-wrap {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.q-name-marquee {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}
.q-name-marquee.scrolling {
  animation: marquee-pingpong linear infinite alternate;
}
@keyframes marquee-pingpong {
  from { transform: translateX(0); }
  to { transform: translateX(var(--marquee-distance, -100px)); }
}
.q-name {
  color: rgb(203, 255, 221);
}
.q-rank {
  font-size: 0.75em;
  flex-shrink: 0;
}
.q-rank.rank-owner {
  color: #00cc00;
}
.q-rank.rank-dev {
  color: #ff4444;
}
.q-rank.rank-web {
  color: #ff4444;
}
.q-rank.rank-pro {
  color: #0066ff;
}
.q-rank.rank-plus {
  color: #00ffff;
}
.q-time {
  color: rgb(150, 213, 167);
  flex-shrink: 0;
  text-align: right;
  margin-left: auto;
}
.queue-empty {
  color: rgb(150, 213, 167);
  padding: 4px 0;
}
.total_count {
  color: rgb(203, 255, 221);
  font-family: "Regular";
  font-size: 20px;
  margin: 0;
  padding: 0;
  text-align: center;
  display: block;
}
#leaderboard_total {
  width: 96%;
  margin: 0 auto 10px;
  box-sizing: border-box;
  text-align: center;
}

/** TOP 3 HIGHLIGHTS */
.place-1 .q-pos,
.place-1 .q-name {
  color: #e6a800;
}
.place-2 .q-pos,
.place-2 .q-name {
  color: #c0c0c0;
}
.place-3 .q-pos,
.place-3 .q-name {
  color: #cd7f32;
}

/** BACKGROUND */
#portal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  z-index: -1;
  background: #000;
}

/** MENU ELEMENTS */
.menu_bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: 0;
  background-color: transparent;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  pointer-events: none;
}
.menu_bar #menu_box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 64px;
  margin: 0;
  pointer-events: auto;
}

#menu_box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 64px;
  margin: 0;
}

#menu_box nav {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3%;
}
.menu_link {
  display: inline-block;
  color: rgb(27, 142, 61);
  text-align: center;
  text-decoration: none;
  font-size: 18px;
  font-family: "MinecraftSlim";
  padding: 6px 10px;
}
.menu_link:not(.shop_link):hover {
  color: rgb(34, 177, 76);
}
#leaderboard_link {
  font-weight: bold;
  color: rgb(34, 177, 76);
}
.shop_link {
  color: #e6a800;
}
.shop_link:hover {
  color: #ffd24a;
}
#hamburger_box .hamburger_link:not(.shop_link):hover {
  color: rgb(34, 177, 76);
  border-color: rgb(34, 177, 76);
}
#hamburger_box .hamburger_link.shop_link {
  color: #e6a800;
  border-color: #e6a800;
}
#hamburger_box .hamburger_link.shop_link:hover {
  color: #ffd24a;
  border-color: #ffd24a;
}

/** HAMBURGER */
#hamburger_btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 4px;
  z-index: 1000;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.35),
    rgba(0, 0, 0, 0.35) 45%,
    transparent 75%
  );
}
#hamburger_btn span {
  display: block;
  width: 30px;
  height: 3px;
  background-color: rgb(27, 142, 61);
  transition: all 0.3s ease;
  transform-origin: center center;
}
#hamburger_btn.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
#hamburger_btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
  visibility: hidden;
  transition: all 0.3s ease, visibility 0s linear 0.3s;
}
#hamburger_btn.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}
#hamburger_overlay {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 998;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
#hamburger_overlay.overlay_open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}
#hamburger_box {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  z-index: 999;
  transition: left 0.3s ease;
  margin: 0;
  display: flex;
  justify-content: center;
}
#hamburger_box.hamburger_open {
  left: 0;
}
#hamburger_box nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 80%;
  height: 100%;
}
#hamburger_box .hamburger_link {
  width: 80%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgb(27, 142, 61);
  font-family: "MinecraftSlim";
  border: 4px solid rgb(27, 142, 61);
  padding-left: 2px;
  padding-right: 2px;
}

/** MOBILE (max-width: 1023px) */
@media (max-width: 1023px) {
  #outrun_title {
    width: clamp(220px, 65%, 420px);
    z-index: 1000;
    margin-top: 10px;
    margin-bottom: 15px;
  }
  #search_wrap {
    width: 95%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #search_box {
    width: 100%;
    padding: 0 3%;
  }
  .search_field {
    width: 100%;
  }
  .search_button {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3%;
  }
  #stats_box {
    width: 95%;
  }
  #stats_list {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  #stats_list .queue-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  #menu_box,
  .menu_bar #menu_box {
    display: none;
  }
.menu_bar {
    position: static;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  #hamburger_btn {
    display: flex;
  }
  #hamburger_box {
    display: flex !important;
  }
  #hamburger_box .hamburger_link {
    width: 80% !important;
  }
}

/** FONTS */
@font-face {
  font-family: "MinecraftSlim";
  src: url("fonts/L00OL.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MinecraftBold";
  src: url("fonts/L00OL-1.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MinecraftBoldItalic";
  src: url("fonts/L00OL-2.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MinecraftSlimItalic";
  src: url("fonts/L00OL-3.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Regular";
  src: url("fonts/ShareTechMono-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
