@font-face {
  font-family: "JetBrains Mono";
  font-weight: normal;
  src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-weight: bold;
  src: url("/fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Fira Sans";
  font-weight: normal;
  src: url("/fonts/FiraSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Fira Sans";
  font-weight: bold;
  src: url("/fonts/FiraSans-Bold.woff2") format("woff2");
}

html.document {
  background: #222;

  pre,
  code,
  td.rank,
  td.time,
  td.progress,
  td.date {
    font-size: 95%;
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  }

  body {
    padding: 0;
    margin: 0;
  }

  main {
    box-sizing: border-box;
    display: block;
    color: #000;
    background: #fff;
    font: 16px "Fira Sans", sans-serif;
    padding: 24px 0;
    margin: 16px auto;
    margin-top: 0;
    width: 100%;
    max-width: 650px;
    min-width: 600px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: 0 0 2px black, 0 0 4px rgba(255, 255, 255, 0.5);

    @media (max-width: 660px) {
      margin: 0 auto;
      border-radius: 0;
      box-shadow: none;
    }
  }

  main > * {
    width: 588px;
    margin-left: auto;
    margin-right: auto;
  }

  main :first-child {
    margin-top: 0;
  }

  section.content {
    min-height: 90vh;
  }

  a {
    text-decoration-style: underline;
    text-decoration-color: #008;
  }

  a:hover {
    color: #00f;
    text-decoration-color: #00f;
  }

  a:not(:hover) {
    color: inherit;
  }

  ::selection {
    color: black;
    background: rgb(200, 225, 255);
  }

  pre {
    white-space: pre-wrap;
    text-align: left;
    overflow-x: auto;
  }

  .duration {
    white-space: pre-wrap;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px;
  }

  h4 {
    font-size: 14px;
  }

  h5 {
    font-size: 12px;
  }

  h6 {
    font-size: 10px;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    a {
      text-decoration: none;
    }
  }

  section {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      margin: 1em;
      text-align: center;
    }
  }

  .header,
  .footer {
    display: block;
    width: 100%;
    max-width: 650px;
    min-width: 600px;
    margin: 0 auto;
    font-family: "Fira Sans";
    color: white;
    a:hover {
      color: yellow;
    }
    h1 {
      padding: 2px;
      font-size: 14px;
      margin: 0 auto;
      margin-top: 16px;
      @media (max-width: 660px) {
        margin-top: 0;
      }
      text-align: left;
      font-weight: normal;

      .subtitle {
        font-size: 12px;
      }
    }

    img {
      vertical-align: bottom;
    }
  }
  .footer {
    font-size: 10px;
    margin-bottom: 32px;

    p {
      margin: 16px;
    }

    a {
      text-decoration: underline;
    }
  }

  .home {
    ul {
      li {
        margin-bottom: 0.3em;
      }
    }
  }

  .voyagerFrame {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    color: black;
    overflow: hidden;
  }

  .colored {
    padding: 0 2px;
    border-radius: 4px;
  }

  .gamePage {
    font-size: 12px;

    table {
      &,
      * {
        box-sizing: border-box;
      }

      text-align: left;
      border-collapse: collapse;
      margin: auto;

      border-bottom: 3px double #f8f8f8;
      margin-bottom: 32px;

      th {
        font: 10px sans-serif;
        color: grey;
        padding: 2px 10px;
        vertical-align: bottom;
      }

      tbody tr {
        height: 20px;
      }

      td {
        padding: 6px;
      }

      .level {
        text-align: center;
        font-size: 8px;
        width: 100px;
      }

      td.rank {
        font-size: 14px;
        padding: 2px;
        text-align: center;
        width: 35px;
      }

      .player {
        text-align: center;
        width: 140px;
      }

      td.links,
      th.links {
        text-align: left;
        padding-left: 0px;
      }
      td.links {
        width: 60px;
        vertical-align: middle;

        a {
          position: relative;
          display: inline-block;
          position: relative;
          bottom: 16px;
          width: 18px;
          height: 0;
          left: -2px;
          overflow: visible;

          svg {
            padding: 4px;
            position: absolute;
            font-size: 24px;
          }
        }
      }

      tbody {
        tr:nth-child(odd):not(.empty) {
          background: #f8f8f8;
        }

        tr.empty {
          text-align: center;
          font-size: 12px;
          color: #aaa;
          border-top: 3px double #f8f8f8;

          td {
            padding: 8px;
          }
        }
      }

      .time,
      .progress {
        width: 100px;
      }

      th.time,
      th.progress {
        text-align: center;
      }

      td.time,
      td.progress {
        text-align: right;
      }

      .date {
        text-align: right;
        width: 100px;
      }

      td.rank {
        color: grey;
      }

      tr[data-rank="1"] td.rank {
        color: black;
        font-weight: bold;
        background: rgb(255, 210, 110);
        border: 4px solid white;
      }

      tr[data-rank="2"] td.rank {
        font-weight: bold;
        color: black;
        background: rgb(210, 230, 255);
        border: 4px solid white;
      }

      tr[data-rank="3"] td.rank {
        font-weight: bold;
        color: black;
        background: rgb(255, 175, 125);
        border: 4px solid white;
      }
    }

    section {
      padding-top: 8px;
      padding-bottom: 8px;
    }

    section:target {
      border-left: 4px dotted #234;
      border-right: 4px dotted #234;
    }
  }
  .nodePage {
    pre {
      background: white !important;
      color: black !important;
      font-size: 16px !important;
    }
    .typeName {
      font-size: 200%;
      vertical-align: -2px;
    }
  }

  .schemaFrame {
    > * > * {
      display: block !important;
    }
  }

  span.obsolete {
    cursor: help;
    color: #ddd;
    font-size: 8px;
  }

  [id="nprogress"] {
    pointer-events: none;
  }

  // TODO: remove nprogress and just add a simple self-contained spinner
  [id="nprogress"] [class~="bar"] {
    display: none;
  }

  /* Fancy blur effect */
  [id="nprogress"] [class~="peg"] {
    display: block;
    position: absolute;
    right: 0px;
    width: 100px;
    height: 100%;
    box-shadow: 0 0 10px #d92, 0 0 5px #d92;
    opacity: 1;

    transform: rotate(3deg) translate(0px, -4px);
  }

  /* Remove these to get rid of the spinner */
  [id="nprogress"] [class~="spinner"] {
    display: block;
    position: fixed;
    z-index: 1031;
    top: 32px;
    right: 32px;
  }

  [id="nprogress"] [class~="spinner-icon"] {
    width: 18px;
    height: 18px;
    box-sizing: border-box;

    border: solid 2px transparent;
    border-top-color: #d92;
    border-left-color: #d92;
    border-radius: 50%;

    animation: nprogress-spinner 400ms linear infinite;
  }

  [class~="nprogress-custom-parent"] {
    overflow: hidden;
    position: relative;
  }

  [class~="nprogress-custom-parent"] [id="nprogress"] [class~="spinner"] {
    position: absolute;
  }

  @keyframes nprogress-spinner {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
}
