* {
  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: 1.5em;
  max-height: 1.5em;
  position: absolute;
  left: 0.8em;
  top: 0;
  bottom: 0;
  margin: auto;
}

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

.player-image {
  background-color: #ddd;
  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 for
   information about the responsive styling of the chart. */

#chart-container {
  display: none;
  padding: 30px 0;
  position: relative;
  width: 100%;
  max-width: 1200px;
}

#the-chart {
  height: 120vw;
  max-height: 900px;
}

#chart-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 30px;
  padding-right: 30px;
}

#chart-controls a {
  text-decoration: underline;
  padding-left: 5px;
}

#chart-controls a:not(:first-child)::before {
  content: ' - ';
  text-decoration: none;
  display: inline-block;
  padding: 0 5px;
}

button {
  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;
  }
}
