@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

:root {
  --met-color: #ff9600;
  --did-not-meet-color: #b7bcbf;
  --circle-color: #50c7f9;
}

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #f5f7fa;
}

h1 {
  font-size: 2em;
  margin: 0;
}

.card {
  position: absolute;
  margin: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0, 0.2);
  border: 1px solid rgba(0,0,0, 0.15);
  background-color: rgba(255,255,255, 0.8);
  padding: 1em;
}

aside {
  max-width: 280px;
  top: 0;
  left: 0;
}

aside h2 {
  margin-bottom: 0.25em;
}

aside p {
  margin: 0 0 0.5em;
}

aside #stats {
  /* list-style-type: none; */
  /* padding: 0; */
  margin: 0.5em 0;
  line-height: 1.4;
}

aside #stats li {
  cursor: help;
}

aside #stats .stat {
  font-weight: bold;
}

table {
  border-collapse: collapse;
  border: 1px solid rgba(0,0,0, 0.15);
  width: 100%;
}

table, th, td {
  padding: 0.2em 0.4em;
}

th {
  color: white;
  background-color: #003087;
}

tr:nth-child(even) {
  background-color: #e4f1fb;
}

td.rank {
  font-weight: bold;
}

table th {
  text-align: left;
}

#leaderboard {
  max-height: 300px;
  overflow-y: scroll;
  box-shadow: 0 -10px 5px -5px rgba(0,0,0, 0.2) inset
}

#legend {
  top: 0;
  right: 0;
  max-width: 420px;
  line-height: 1.4;
}

#legend .accent {
  font-weight: bold;
  filter: brightness(85%);
}

#legend .circle {
  color: var(--circle-color);
}

#legend .met {
  color: var(--met-color);
}

#legend .did-not-meet {
  color: var(--did-not-meet-color);
}

#loading {
  position: absolute;
  z-index: -1;
  width: 100vw;
  height: 100vw;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  text-align: center;
  padding-top: 45vw;
  transition: 0.5s opacity;
  transition-delay: 2s;
  font-size: 1.2em;
}

#loading.disappear {
  opacity: 0;
}

#loading .spinner {
  font-size: 1.2em;
  font-weight: bold;
  animation: rotate 0.5s linear infinite;
  display: inline-block;
  margin-right: 0.2em;
  color: var(--circle-color);
  filter: brightness(85%);
}

figure {
  margin: 0;
  opacity: 0;
  transition: opacity 5s;
  transition-delay: 2s;
}

figure.appear {
  opacity: 1;
}

figure.node-selected :not(.selected) > circle {
  fill-opacity: 0.1;
  stroke-opacity: 0.2;
}

figure.node-selected :not(.selected) > text {
  fill-opacity: 0.2;
}

circle {
  fill: var(--circle-color);
  fill-opacity: 0.4;
  stroke: white;
  stroke-width: 2;
  stroke-opacity: 0.8;
  transition: fill-opacity 0.25s, stroke-opacity 0.25s;
}

text {
  font-size: 0.8em;
  text-shadow: 1px 1px white, 0 0 4px white;
  cursor: default;
  transition: fill-opacity 0.25s;
}

line {
  stroke: var(--did-not-meet-color);
  stroke-width: 2;
  stroke-opacity: 0.2;
  transition: stroke-width 0.25s, stroke-opacity 0.25s;
}

line.met {
  stroke: var(--met-color);
}

line.selected {
  stroke-opacity: 0.8;
  stroke-width: 3;
}

.person:hover circle, .person.selected circle {
  fill-opacity: 0.8;
}