body {
  /* leave it to hide the scrollbars */
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  image-rendering: pixelated;
}

.hidden {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.1s ease-in, visibility 0.1s ease-in;
}

.visible {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.15s ease-in;
}

#ui {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  color: white;
  cursor: pointer;
}

#ui-container {
  max-height: 100vh;
  width: auto;
  margin: 1rem;
  cursor: default;
  z-index: 110;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: auto;
  border-radius: 2rem;
  box-shadow: 0 1.2rem 1.5rem rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  background-color: rgba(0, 0, 0, 0.6);
}

@media screen and (max-height: 600px) {
  #ui-container {
    flex-direction: row;
    width: 80%;
    justify-content: start;
    align-items: flex-start;
  }

  #traits-list,
  #controls-list {
    overflow-y: auto;
    overflow-x: hidden;
    height: 60vh;
  }

  #traits {
    margin-right: 2rem;
  }
}

@media screen and (min-height: 601px) and (max-height: 800px) {
  #traits-list,
  #controls-list {
    overflow-y: auto;
    overflow-x: hidden;
    height: 35vh;
  }

  #traits {
    margin-right: 0rem;
  }

  #traits-list {
    margin-bottom: 0.3rem;
  }
}

#traits-list {
  margin-bottom: 0.8rem;
}

@supports not (backdrop-filter: blur(1rem)) {
  #ui #ui-container {
    background-color: rgba(0, 0, 0, 0.8);
  }
}

#ui.ui-dark-mode #ui-container {
  background-color: rgba(255, 255, 255, 0.6);
  color: black;
}

@supports not (backdrop-filter: blur(1rem)) {
  #ui.ui-dark-mode #ui-container {
    background-color: rgba(255, 255, 255, 0.85);
  }
}

#ui h2 {
  font-size: 3.5rem;
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 1368px) {
  #ui h2 {
    font-size: 1.8rem;
  }
}

#ui h3 {
  font-size: 1.5rem;
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 1368px) {
  #ui h3 {
    font-size: 1rem;
  }
}

#controls,
#traits {
  width: 100%;
}

#controls .radio-group {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: flex-start;
  margin: 16px 0;
  padding: 0;
}

@media screen and (max-width: 1368px) {
  #controls .radio-group {
    margin: 8px 0;
  }
}

.radio-group h3 {
  flex: 2;
  text-align: right;
}

.radio {
  flex: 3;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  margin: 0 0 0 1rem;
  font-size: 1.3rem;
  text-transform: capitalize;
}

@media screen and (max-width: 1368px) {
  .radio {
    font-size: 0.75rem;
  }
}

.radio.radio-bool {
  flex: 3;
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
}

.radio > * + * {
  margin-top: 0.7rem;
}

@media screen and (max-width: 1368px) {
  .radio > * + * {
    margin-top: 0rem;
  }
}

.radio.radio-bool > * + * {
  margin-top: 0rem;
  margin-left: 2rem;
}

.radio > div {
  padding: 0.3rem 0.8rem;
  border-radius: 0.5rem;
  display: flex;
  justify-content: start;
  align-items: center;
  transition: background-color 0.2s ease-in;
}

.radio > div.selected {
  background-color: rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease-in;
}

#ui.ui-dark-mode .radio > div.selected {
  background-color: rgba(255, 255, 255, 0.4);
}

.radio input,
.radio label {
  cursor: pointer;
}

.radio input {
  margin: 0 0.5rem 0 0;
}

dl {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: flex-end;
}

@media screen and (max-width: 1368px) {
  dl {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
  }
}

dt {
  display: block;
  flex: 2;
  margin: 0;
  padding: 0;
  text-align: right;
  font-weight: bold;
  font-size: 1.5rem;
  word-break: keep-all;
}

@media screen and (max-width: 1368px) {
  dt {
    font-size: 1rem;
  }
}

dd {
  flex: 3;
  margin: 0 0 0 1rem;
  padding: 0;
  text-align: left;
  font-size: 1.6rem;
}

@media screen and (max-width: 1368px) {
  dd {
    font-size: 0.9rem;
  }
}

.color-preview div {
  width: 3rem;
  height: 1.7rem;
  border-radius: 0.3rem;
  margin: 0 0 0 0.5rem;
  border: black 1px solid;
}

@media screen and (max-width: 1368px) {
  .color-preview div {
    width: 1.8rem;
    height: 0.9rem;
  }
}

#ui.ui-dark-mode .color-preview div {
  border: white 1px solid;
}

.color-preview {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
}

#traits input {
  margin: 0 0.5rem 0 0;
  padding: 0.5rem;
  font-size: 0.9rem;
  border: none;
  background-color: rgba(0, 0, 0, 0);
  color: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 0.4rem;
  width: 12rem;
}

@media screen and (max-width: 1368px) {
  #traits input {
    font-size: 0.6rem;
    width: auto;
    padding: 0.3rem;
  }
}

#ui.ui-dark-mode #traits input {
  background-color: rgba(255, 255, 255, 0.4);
  color: black;
}
