* {
  box-sizing: border-box;
}

body {
  padding: 30px;
  font-family: "Lato", sans-serif;
  color: #555;
  font-size: 16px;
}

h1 {
  font-size: 3em;
  margin-bottom: 0.5em;
}

h2 {
  font-size: 2em;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 0.8em;
}

ul {
  padding-left: 0.5em;
  font-size: 1em;
}
ul li {
  margin-bottom: 3px;
}

table {
  margin-bottom: 2em;
  width: 100%;
  max-width: 900px;
}

table th {
  background: #f7f7f7;
  color: #000;
  text-transform: uppercase;
  font-size: 0.8em;
}

table td,
table th {
  padding: 0.8em;
  border: 1px solid #eee;
}
table th.number {
  text-align: right;
}
table td {
  text-align: right;
}
table td.position {
  text-align: left;
}
table td.name {
  text-align: left;
}
table td.rating {
  font-weight: bold;
}
table td.delta {
  padding-right: 1.5em;
  width: 35px;
}
table td.delta.plus,
table td.delta.minus {
  background-image: url(../img/arrow_up.gif);
  background-repeat: no-repeat;
  background-position: 55px 17px;
}
table td.delta.minus {
  background-image: url(../img/arrow_down.gif);
}

form .player-score,
form .player-name,
form .game-name,
input[type="submit"] {
  max-width: 600px;
}

fieldset {
  margin-top: 1em;
}

legend {
  font-weight: bold;
}

label {
  font-size: 0.9em;
}

label:not(.checkbox-label) {
  display: block;
  margin-bottom: 0.3em;
  margin-top: 0.5em;
}

input[type="checkbox"] {
  margin-top: 0.6em;
  margin-right: 0.3em;
  margin-left: 0.4em;
  transform: scale(1.5);
}

input[type="submit"] {
  padding: 0.5em;
  background-color: #fff;
  margin: 2.5em 0.5em 0.5em 0;
  border: 1px solid #000;
  width: 100%;
}

.selectize-dropdown {
  font-size: 4em;
}

.selectize-control > .selectize-input input,
.selectize-input .item,
.selectize-dropdown .option {
  font-size: 1.5em;
}

.selectize-dropdown img,
td.avatar img {
  max-width: 1em;
  max-height: 1em;
  position: absolute;
  left: 0.2em;
  top: 0;
  bottom: 0;
  margin: auto;
}

.selectize-dropdown div.option,
td.avatar {
  padding-left: 1.4em;
  position: relative;
}

.player-image {
  border-radius: 30%;
  max-width: 300px;
}

h2 {
  margin-top: 30px;
}

.tables {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.tables > * {
  margin-right: 70px;
  flex: 0;
}

.tables table {
  width: 100%;
}

.nav {
  margin-bottom: 2em;
}

a {
  text-decoration: none;
  font-weight: bold;
  color: #555;
}
a:hover {
  text-decoration: underline;
}

.nav a::before {
  content: "-";
  /* Get rid of text-decoration on this pseudo element. */
  display: inline-block; /* So we can set a width */
  width: 0;
  margin-left: 0.5em; /* "Size" of the Pseudo-element */
  margin-right: 1em; /* "Size" of the Pseudo-element */
}

.nav a:first-child::before {
  content: "";
  display: none;
}

.footer {
  margin-top: 100px;
}

/* See https://www.chartjs.org/docs/latest/general/responsive.html#important-note */
#chart-container {
  display: none;
  padding: 30px 0;
  position: relative;
  height: 120vw;
  width: 100%;
  max-width: 1200px;
  max-height: 900px;
}

#toggle-chart {
  padding: 0.4em;
  font-size: 1em;
  margin: 10px 0;
  background-color: #fff;
  border-radius: 7px;
  border: 1px solid #555;
}

ul.achievements {
  list-style-type: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.achievement {
  display: flex;
  flex-direction: column;
  margin: 10px;
  align-items: center;
}

.achievement-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  width: 100px;
  height: 100px;
  border: 1px solid #333;
  border-radius: 50%;
  margin-bottom: 10px;
}

.mobile {
  display: none;
}

@media (max-width: 900px) {
  .mobile {
    display: initial;
  }

  .tables > *,
  table {
    margin-right: 0;
    min-width: 100%;
    max-width: 100%;
  }
  .tables {
    flex-basis: 100%;
  }

  body {
    font-size: 16px;
    padding: 12px;
  }
}
