@font-face {
  font-family: Arial;
  /* src:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/Arial-Regular.otf); */
  font-weight: normal;
}

@font-face {
  font-family: Arial;
  /* src:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/Arial-Bold.otf); */
  font-weight: bold;
}
* {
  box-sizing: border-box;
}
a:link {
  color: black;
  background-color: transparent;
  text-decoration: underline;
}

a:visited {
  color: black;
  background-color: transparent;
  text-decoration: underline;
}

a:hover {
  color: blue;
  background-color: transparent;
  text-decoration: underline;
}

a:active {
  color: yellow;
  background-color: transparent;
  text-decoration: underline;
}
body {
  font-family: Arial;
  margin: 0.5vw;
  background: black;
  color: #000;
  counter-reset: element;
}
.periodic-table {
  display: grid;
  grid-gap: 0.4vw;
  height: 100%;
  padding-left: 0;
  padding-top: 0;
}
.periodic-table > li {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%; 
  border-radius: 3px;
  /*background: rgb(91, 194, 234);*/
  background: rgb(45, 97, 167);
  font-weight: bold;
}
.periodic-table > li:before {
  counter-increment: element; 
  content: counter(element);
  position: absolute;
  bottom: 70%;
  font-size: 0.72vw;
  font-weight: normal;
}
.periodic-table > li a abbr { 
  display: block;
  color: black;
  font-size: 1.2vw;
  text-align: center;
  height: 80%;
  width: 80%;
}
.periodic-table > li abbr {
  display: block;
  font-size: 1.2vw;
  text-align: center;
  /*position: relative;
  bottom: 2px;*/
}
#helium {
  grid-column-start: 18;
}
#boron, #aluminium {
  grid-column-start: 13;
}
#cerium, #thorium {
  grid-column-start: 4;
}
.periodic-table > li:nth-child(n+58):nth-last-child(n+48) {
  grid-row-start: 8;
}
.periodic-table > li:nth-child(n+90):nth-last-child(n+16) {
  grid-row-start: 9;
}
.periodic-table:before {
  display: block;
  content: '';
  grid-row: 8 / 10;
  grid-column: 1 / 4;
}
.periodic-table .other-metal{
  background: hsl(210, 100%, 40%);
}
.periodic-table .other-metal-na{
  background: hsl(210, 100%, 20%);
}
.periodic-table .transition-metal {
  background: hsl(60, 100%, 40%);
}
.periodic-table .transition-metal-na {
  background: hsl(60, 100%, 20%);
}
.periodic-table .noble-gas {
  background: hsl(180, 60%, 40%);
}
.periodic-table .noble-gas-na {
  background: hsl(180, 60%, 20%);
}
.periodic-table .diatomic-nonmetal {
  background: hsl(120, 100%, 40%);  
}
.periodic-table .diatomic-nonmetal-na {
  background: hsl(120, 100%, 20%);  
}
.periodic-table .alkali {
  background: hsl(300, 100%, 40%);
}
.periodic-table .alkali-na {
  background: hsl(300, 100%, 20%);
}
.periodic-table .hydrogen {
  background: rgb(163, 199, 210);  
}
.periodic-table .hydrogen-na {
  background: rgb(81, 99, 105);  
}
.periodic-table .alkaline {
  background: hsl(336, 100%, 40%);
}
.periodic-table .alkaline-na {
  background: hsl(336, 100%, 20%);
}
.periodic-table .unknown {
  background: rgb(185, 186, 188);
}
.periodic-table .unknown-na {
  background: rgb(92, 93, 94);
}
.periodic-table .lanthanide {
  background: hsl(24, 100%, 40%);
}
.periodic-table .lanthanide-na {
  background: hsl(24, 100%, 20%);
}
.periodic-table .actinide {
  background: hsl(180, 100%, 40%);  
}
.periodic-table .actinide-na {
  background: hsl(180, 100%, 20%);  
}
.periodic-table .metalloid {
  background: hsl(75, 100%, 40%);  
}
.periodic-table .metalloid-na {
  background: hsl(75, 100%, 20%);  
}
.periodic-table .polyatomic-non-metal {
  background: hsl(120, 100%, 40%);  
}
.periodic-table .polyatomic-non-metal-na {
  background: hsl(120, 100%, 20%);  
}

/*@media all and (max-width: 1100px) {
  #helium, #boron, #aluminium, #cerium, #thorium {
  grid-column-start: auto;
  }
  .periodic-table {
  grid-template-columns: 1fr 1fr 1fr;
  }
  .periodic-table > li abbr {
    font-size: 0;
  }
  .periodic-table > li {
    padding: 1rem;
  }
  .periodic-table > li abbr:after {
    content: attr(title);
    font-size: 2rem;
  }
  .periodic-table > li:before {
    font-size: 1rem;
  }
  .periodic-table > li:nth-child(n+58):nth-last-child(n+48) {
  grid-row-start: auto !important;
}
  .periodic-table > li:nth-child(n+90):nth-last-child(n+16) {
    grid-row-start: auto !important;
  }
  .periodic-table:before {
    display: none !important;
  }
}
@media all and (max-width: 750px) {
  body {
    margin: 1vw;
  }
  .periodic-table {
    grid-template-columns: 1fr 1fr;
  }
  .periodic-table > li {
    height: auto;
    font-size: 3vw;
  }
}
@media all and (max-width: 550px) {
  .periodic-table {
    grid-template-columns: 1fr;
  }
}*/
