h3 {font-size: 1.25rem; margin-block: 0.25rem 0.5rem}
h3:first-child {margin-top: 1rem;}

/* ---- button ---- */
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 7px;
  background: #ddd;
  color: #222;
  font-family: sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

.button:hover {
  background-color: #8CF;
  color: #222;
}

.button:active,
.button.is-checked {
  background-color: #19F;
  color: white;
}

.button.is-checked {
  color: white;
}

.button:active {
  box-shadow: inset 0 1px 10px hsla(0, 0%, 0%, 0.2);
}

/* ---- button-group ---- */

.button-group:after {
  content: '';
  display: block;
  clear: both;
}

.button-group {display: flex; flex-wrap: wrap;}
.button-group .button {
  border-radius: 0;
  margin-left: 0;
  margin-right: 1px;
}

.button-group .button:first-child { border-radius: 0.25em 0 0 0.25em; }
.button-group .button:last-child { border-radius: 0 0.25em 0.25em 0; }

/* ---- isotope ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 5px;
  margin-bottom: 4rem;
  font-family: sans-serif;
}

/* ---- .element-item ---- */

.element-item {
  position: relative;
  padding: 10px;
  background: #888;
  color: #262524;
  aspect-ratio: 1;
}

.element-item > * {
  margin: 0;
  padding: 0;
}

.element-item .name {
  position: absolute;
  left: 10px;
  bottom: 25px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: normal;
}

.element-item .symbol {
  position: absolute;
  left: 10px;
  top: 0px;
  font-size: 42px;
  font-weight: bold;
  color: white;
}

.element-item .number {
  position: absolute;
  right: 8px;
  top: 5px;
}

.element-item .weight {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 12px;
}

.element-item.alkali          { background: #F00; background: hsl(   0, 100%, 50%); }
.element-item.alkaline-earth  { background: #F80; background: hsl(  36, 100%, 50%); }
.element-item.lanthanoid      { background: #FF0; background: hsl(  72, 100%, 50%); }
.element-item.actinoid        { background: #0F0; background: hsl( 108, 100%, 50%); }
.element-item.transition      { background: #0F8; background: hsl( 144, 100%, 50%); }
.element-item.post-transition { background: #0FF; background: hsl( 180, 100%, 50%); }
.element-item.metalloid       { background: #08F; background: hsl( 216, 100%, 50%); }
.element-item.diatomic        { background: #00F; background: hsl( 252, 100%, 50%); }
.element-item.halogen         { background: #F0F; background: hsl( 288, 100%, 50%); }
.element-item.noble-gas       { background: #F08; background: hsl( 324, 100%, 50%); }