@import url("https://fonts.googleapis.com/css2?family=Limelight&display=swap");

:root {
  --bg: #121214;
  --accent: greenyellow;
}

* {
  box-sizing: border-box;
  background: transparent;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  border-radius: 0;
  color: inherit;
  line-height: 1.4;
}

/* nobody uses the other ones */
:not(h1, h2, h3) {
  font-size: inherit;
}

a:any-link, button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid white;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 50px;
  font-family: system-ui, Helvetica, sans-serif;
}

h1 {
  font-family: "Limelight", sans-serif;
  font-size: 2.5em;
}

@keyframes header-gap {
  from {
    gap: 100px;
    letter-spacing: 5px;
  }
  to {
    gap: 25px;
    letter-spacing: 0;
  }
}

#header {
  position: sticky;
  top: 50px;
  color: var(--accent);
  display: flex;
  align-items: center;
  animation: header-gap 1s cubic-bezier(0.08, 0, 0.78, 1.22) forwards;
}

@keyframes spoon-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#header > .spoon {
  animation: spoon-fade 1s linear forwards;

  height: 20px;

  &:last-child { rotate: 180deg; }
}

.spoon {
  aspect-ratio: 1200 / 291;
  mask-image: url("./images/spoon.png");
  mask-size: 100%;
  background: currentColor;
}

#leaderboard {
  margin-top: 25px;
  width: 75%;
  border-collapse: collapse;
  position: relative;
}

tr {
  border-bottom: 1px solid gray;
}

thead > tr {
  border-bottom: 1px solid var(--accent);
}

td, th {
  padding: 5px;
  text-align: center;
}

th {
  color: var(--accent);
  font-size: 1.25em;
}

.rank {
  height: 1.25em;
  aspect-ratio: 1;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  font-family: "Limelight", sans-serif;
  margin: 0 auto;
}

.rank.gold {
  background: gold;

  &::after {
    content: "1";
  }
}

.rank.silver {
  background: silver;

  &::after {
    content: "2";
  }
}

.rank.bronze {
  background: #cd7f32;

  &::after {
    content: "3";
  }
}

.status {
  height: 1.25em;
  width: 50%;
  border-radius: 5px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status.alive {
  border: 1px solid var(--accent);
}

.status.alive::after {
  content: "Alive";
}

.status.dead {
  border: 1px solid crimson;
}

.status.dead::after {
  content: "Dead";
}

#report {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 25px;
  padding: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.1s linear;
}

#report:hover {
  color: black;
}

#report:active {
  color: inherit;
}

#report::after {
  content: "";
  position: absolute;
  inset: 0;
  top: unset;
  height: 2px;
  background: var(--accent);
  z-index: -1;
  transition: all 0.2s ease;
}

#report:hover::after {
  height: 100%;
}

#report:active::after {
  height: 2px;
  bottom: calc(100% - 2px);
}

form {
  margin-top: 25px;
  width: 75%;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

form > label {
  display: flex;
  gap: 10px;
  flex-direction: column;
  align-items: center;
}

form > label > span {
  width: 100%;
}

form > label > input {
  width: 100%;
  border: 1px solid white;
  height: 40px;
  padding: 0 10px;
  font-family: inherit;
  transition: outline 0.1s ease;
}

form > label:has([required]) > span::after {
  content: "*";
  color: crimson;
  margin-left: 5px;
}

#submit {
  background: #36363b;
  height: 40px;
  width: 50%;
  margin-left: auto;
  max-width: 300px;
  cursor: pointer;
  transition: filter 0.2s linear, outline 0.1s ease;
  font-family: inherit;
}

#submit:hover {
  filter: brightness(1.25);
}

#submit:active {
  filter: brightness(0.95);
}

.autocomplete-menu {
  display: flex;
  flex-direction: column;
  align-items: start;
  width: 100%;
  position: absolute;
  transition: all 0.2s ease;
  position: absolute;
  background: #36363b;
  border: 1px solid white;
  border-top: none;
  padding: 10px;
  clip-path: inset(0 0 0 0);
}

.autocomplete-menu-item {
  height: 25px;
  width: 100%;
  text-align: left;
}

.autocomplete-menu.hidden {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
}
