body {
  font-family: "Times", "Georgia", serif;
  display: grid;
  height: 100vh;
  grid-gap: 0;
  grid-template-areas:
    "header crtrees"
    "main   crtrees"
    "nav    nav";
  grid-template-columns: 1fr 0;
  grid-template-rows: 0 auto max-content;
  color: rgba(0, 0, 0, 0.7);
}

@media only screen and (min-width: 500px) {
  body {
    grid-template-areas:
      "header crtrees"
      "main   crtrees"
      "nav    nav";
    grid-template-columns: 1fr auto;
    grid-template-rows: 0 auto max-content;
  }
}

@media only screen and (min-width: 700px) {
  body {
    grid-template-areas:
      "nav header crtrees"
      "nav main   crtrees";
    grid-template-columns: max-content 1fr auto;
    grid-template-rows: 0 auto;
  }
}

main { grid-area: main; }

nav,
#crtrees {
  background-color: #eee;
}

h1 {
  font-weight: normal;
  margin: 0;
  padding: 0;
}

header {
  grid-area: header;
  text-align: left;
  margin: 0;
  padding-left: 2vw;
  padding-top: 0;
}

@media only screen and (min-width: 700px) {
  h1 { font-size: 5vw; }
  header { font-size: 3vw; }
}

nav {
  grid-area: nav;
  display: grid;
  grid-gap: 0;
  grid-template-rows: 1;
  grid-template-columns: repeat(auto-fit, max-content);
  grid-template-areas: "help reload left right down up";
}

@media only screen and (min-width: 700px) {
  nav {
    padding-top: 1em;
    grid-template-rows: repeat(3, max-content);
    grid-template-columns: repeat(2, max-content);
    grid-template-areas:
      "help reload"
      "left right"
      "down up";
  }
}

#up { grid-area: up; }
#left { grid-area: left; }
#right { grid-area: right; }
#down { grid-area: down; }

nav > div {
  margin-left: auto;
  margin-right: auto;
  margin-top: auto;
  margin-bottom: auto;
  font-size: 40px;
  border-radius: 25px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  text-align: center;
  line-height: 45px;
  font-family: "Arial", sans-serif;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#reload {
  grid-area: reload;
  line-height: 50px;
}

#help {
  grid-area: help;
  font-weight: bold;
  font-family: "Georgia", serif;
}

nav > div > div {
  border-radius: 1em;
  bottom: 2rem;
  display: block;
  font-family: "Times", "Georgia", serif;
  font-size: x-large;
  font-weight: normal;
  left: 2rem;
  padding: 0.5em 1em 0.5em 1em;
  position: absolute;
  text-align: left;
  visibility: hidden;
}

nav > div:hover {
  background-color: #cecef6;
}

nav > div:hover > div {
  background-color: #cecef6;
  visibility: visible;
}

@media only screen and (hover: none) {
  nav > div:hover {
    background-color: inherit;
  }

  nav > div:hover > div {
    background-color: inherit;
    visibility: hidden;
  }
}

#crtrees {
  grid-area: crtrees;
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(1, 100px);
  grid-template-rows: repeat(auto-fit, 100px);
  overflow-x: hidden;
  overflow-y: scroll;
}

@media only screen and (min-width: 924px) {
  #crtrees {
    grid-template-columns: repeat(2, 100px);
  }
}

@media only screen and (min-width: 1024px) {
  #crtrees {
    grid-template-columns: repeat(3, 100px);
  }
}

#crtrees svg {
  box-sizing: border-box;
  overflow: hidden;
  width: 100px;
  height: 100px;
  border: 4px solid transparent;
  border-radius: 50px;
}

#crtrees svg.highlight {
  border: 4px solid black;
}

.rootNode {
  fill: black;
}

.treeNode {
  fill: #555;
}

.treeEdge {
  fill: none;
  stroke-width: 1.5px;
}

.center-screen {
  height: 99%;
  overflow: hidden;
  width: 100%;
}

circle {
  stroke: none;
}

circle.highlight {
  stroke: black;
  stroke-width: 2px;
}

circle.nonhighlight {
  filter: grayscale(100%);
}

line {
  stroke: #000;
  stroke-width: 2px;
}

line.nonhighlight {
  stroke-opacity: 0.25;
}
