/** 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%;
}
h2 {
  color: rgb(27, 142, 61);
  text-align: center;
}
#stream_text {
  font-size: clamp(16px, 3cqw, 20px);
  font-family: "MinecraftSlim";
  text-align: center;
  margin-bottom: 8px;
}

#parent_stream_div {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2%;
}
#stream_div {
  width: 96%;
  box-sizing: border-box;
  container-type: inline-size;
}
#stream_frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  box-sizing: border-box;
  overflow: hidden;
  background: url("/media/tvbars.svg") center/100% 100% no-repeat;
}
#stream_frame::after {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 4px solid rgb(27, 142, 61);
  pointer-events: none;
  z-index: 2;
}
#stream_frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
}

/** SERVER INFO */
.blocks {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  background-color: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 4px solid rgb(27, 142, 61);
  padding-left: 1%;
  padding-right: 1%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  container-type: inline-size;
}
#blocks_parent {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 3%;
}
.top_count,
.queue_waiting {
  font-family: "Regular";
  font-size: clamp(16px, 3cqw, 20px);
  color: rgb(150, 213, 167);
}
#queue_top,
#leaderboard_top {
  margin-top: 10px;
  margin-bottom: 10px;
}
#queue_box {
  display: flex;
  flex-direction: column;
}
#leaderboard_box {
  display: flex;
  flex-direction: column;
}
.lists {
  font-size: clamp(16px, 3cqw, 20px);
  font-family: "Regular";
  color: rgb(203, 255, 221);
  overflow-y: auto;
  scrollbar-width: none;
  min-height: calc(5 * (1.2em + 8px));
  max-height: calc(5 * (1.2em + 8px));
  overflow-wrap: break-word;
  padding-right: 0.5%;
  list-style: none;
  margin: 0;
  padding-left: 0;
}
.lists::-webkit-scrollbar {
  display: none;
}
#queue {
  flex: 1 1 0;
  min-height: calc(5 * (1.2em + 8px));
  max-height: none;
}
#leaderboard {
  flex: 0 0 auto;
  min-height: calc(5 * (1.2em + 8px));
  max-height: calc(5 * (1.2em + 8px));
}

.full_leaderboard_btn {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.5cqw auto 4cqw;
  background-color: transparent;
  color: rgb(150, 213, 167);
  font-family: "Regular";
  font-size: clamp(16px, 2.6cqw, 20px);
  text-decoration: underline;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}
.full_leaderboard_btn:hover {
  color: rgb(34, 177, 76);
}

/** CUSTOM DOM SCROLLBAR for the queue (built in JS, no native bar).
    A rectangle sits INSIDE the queue box along the right edge so that side
    appears bolder while the box border stays 4px like the other boxes. */
.cs-track {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  z-index: 5;
  background: rgb(27, 142, 61);
  pointer-events: none;
}
.cs-track.cs-hidden {
  display: none;
}
.cs-thumb {
  position: absolute;
  top: 0;
  width: 100%;
  right: 0;
  background: rgb(160, 255, 190);
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}
.cs-thumb:active {
  cursor: grabbing;
}

/** OVERLAY-STYLE QUEUE + LEADERBOARD ROWS */
.queue-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 4px 0;
  font-size: clamp(16px, 3cqw, 20px);
  white-space: nowrap;
  min-width: 0;
  color: rgb(203, 255, 221);
}
.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);
  }
}
.q-pos {
  color: rgb(203, 255, 221);
  min-width: 1.4em;
  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;
  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;
}
.data_top {
  font-size: clamp(16px, 2.7cqw, 22px);
  font-family: "MinecraftSlim";
  margin: 0;
  text-align: center;
}
/** SOCIAL MEDIA + SERVER BOX */
#links_box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: "Regular";
  color: rgb(203, 255, 221);
  padding: 2% 1%;
  box-sizing: border-box;
}
.link_section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.block_divider {
  width: 60%;
  height: 1px;
  background: rgba(196, 230, 206, 0.15);
  margin: 8px auto;
}
#links_box .link_row,
#ip_section .server_ip_row {
  width: fit-content;
}
#links_box > *:not(h2:first-child),
.link_section > h2:not(:first-child) {
  box-sizing: border-box;
}
.link_row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: clamp(16px, 2.8cqw, 20px);
}
.link_section .link_row:first-of-type {
  margin-top: 10px;
}
.link_box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Regular";
  font-size: 1em;
  color: rgb(203, 255, 221);
  text-decoration: none;
}
.link_box:hover {
  text-decoration: underline;
}
.link_logo {
  height: 1.2em;
  width: auto;
  flex-shrink: 0;
}
#server_access_top {
  margin: 0;
  width: fit-content;
}
.server_ip_row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 2px;
  font-size: clamp(11px, 1.6cqw, 14px);
  width: fit-content;
}
#version {
  font-family: "Regular";
  font-size: clamp(14px, 2.6cqw, 18px);
  margin: 4px 0 14px;
}
#serverIP {
  font-family: "MinecraftBold", "Regular", monospace;
  font-size: 1em;
  font-weight: bold;
}
#copy_img {
  height: 1.8em;
  width: auto;
}
#serverIP,
#copy_img {
  cursor: pointer;
  user-select: none;
}

#footer {
  display: flex;
  justify-content: center;
  color: rgb(120, 150, 132);
  font-family: "MinecraftSlim";
  font-size: 10px;
  margin-top: 22px;
  padding-bottom: 16px;
  opacity: 0.7;
}

/** TAGLINE + HOW TO PLAY */
#tagline_section {
  width: 96%;
  margin: 4% auto 0;
  text-align: center;
}
#tagline {
  font-family: "Regular";
  font-weight: bold;
  color: rgb(34, 177, 76);
  font-size: clamp(20px, 3.5cqw, 34px);
  letter-spacing: 0.5px;
  margin: 0 0 10px;
}
#tagline_desc {
  font-family: "Regular";
  color: rgb(203, 255, 221);
  font-size: clamp(13px, 2.2cqw, 17px);
  max-width: 70ch;
  margin: 0 auto 3%;
}
#steps_block {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 3%;
}
.step {
  flex: 1 1 0;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.step_num {
  font-family: "MinecraftSlim";
  font-size: clamp(18px, 3cqw, 26px);
  color: rgb(34, 177, 76);
}
.step_text {
  font-family: "MinecraftSlim";
  font-size: clamp(15px, 2.4cqw, 20px);
  font-weight: bold;
  color: rgb(203, 255, 221);
}
.step_hint {
  font-family: "Regular";
  font-size: clamp(12px, 2cqw, 15px);
  color: rgb(150, 213, 167);
}

/** 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);
}
#main_page_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(8px);
  -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;
}

/** DESKTOP (min-width: 1024px) */
@media (min-width: 1024px) {
  #blocks_parent {
    flex-direction: row;
    width: 96%;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
  }
  #leaderboard {
    min-height: calc(10 * (1.2em + 8px));
    max-height: calc(10 * (1.2em + 8px));
  }
}

/** MOBILE (max-width: 1023px) */
@media (max-width: 1023px) {
  #outrun_title {
    width: clamp(220px, 65%, 420px);
    z-index: 1000;
    margin-top: 10px;
    margin-bottom: 15px;
  }
  #parent_stream_div {
    margin-bottom: 5%;
  }
  #stream_div {
    width: 95%;
  }
  #blocks_parent {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    gap: 12px;
    min-height: 0;
  }
  .blocks {
    width: 100%;
    flex: none;
    height: auto;
    min-height: 0;
  }
  #queue_box,
  #leaderboard_box {
    height: auto;
    min-height: 0;
  }
  #links_box {
    height: auto;
  }
  #leaderboard {
    min-height: 130px;
  }
  #queue,
  #leaderboard {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
  #leaderboard_box .full_leaderboard_btn {
    flex: 0 0 auto;
  }
  #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;
  }
  .server_ip_row {
    font-size: clamp(12px, 2.4cqw, 15px);
  }
  .q-time {
    margin-left: auto;
    padding-right: 3%;
  }
  .tagline_part {
    display: block;
  }
  #tagline_section {
    width: 95%;
  }
  #tagline_desc {
    font-size: clamp(15px, 2.6cqw, 18px);
  }
  .step_hint {
    font-size: clamp(13px, 2.2cqw, 16px);
  }
  #steps_block {
    flex-direction: column;
    gap: 16px;
  }
  .step {
    max-width: none;
  }
}

/** 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;
}
