* {
  margin: 0;
}
body {
  overflow-x: hidden;
  canvas#canvas {
    background: rgba(0, 0, 0, 0.1);
    position: absolute;
  }
  div.menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    min-height: 500px;
    outline: solid;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    > * {
      margin: 10px;
    }
    div.header {
      display: flex;
      font-size: 2em;
      justify-content: center;
    }
    div.toggle {
      position: absolute;
      top: 5px;
      left: 5px;
      width: 25px;
      height: 25px;
      background: black;
    }
    div.properties {
      margin: 10px;
      font-size: 1.1em;
    }
  }
  div.settings {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    min-height: 500px;
    outline: solid;
    background: rgba(255, 255, 255, 0.4);
    z-index: 1;
    > * {
      margin: 10px;
    }
    div.header,
    div.startreset {
      display: flex;
      font-size: 2em;
      justify-content: center;
      > button {
        margin: 10px;
        padding: 10px;
        font-size: 1.1rem;
      }
    }
    div.controlBox {
      display: flex;
      flex-direction: column;
      > * {
        margin: 5px;
      }
      div.gamerules > div {
        display: flex;
        > * {
          padding: 5px;
        }
      }
      div.gamerules h4 {
        text-align: center;
      }
    }
    div.evolutionparameters {
      h4 {
        text-align: center;
      }
      > div {
        display: flex;
        > * {
          margin: 5px;
        }
        input[type="number"] {
          width: 50px;
        }
      }
    }
  }
  div.creatureCanvasBox {
    canvas#creatureTimeDiagram {
      position: absolute;
      top: 100vh;
    }
    div.creatureTimeMenu {
      position: absolute;
      top: calc(100vh + 10px);
      right: 10px;
      width: 300px;
      min-height: 100px;
      outline: solid;
      background: rgba(255, 255, 255, 0.8);
      pointer-events: none;
      user-select: none;
      opacity: 0;
      transition: all 0.3s ease-in-out;
      transform: translateY(30px);
      h4 {
        text-align: center;
      }
      > div {
        display: flex;
        > * {
          margin: 5px;
        }
      }
      div.exportPlotData,
      div.exportSurvivorData {
        display: block;
        div {
          display: flex;
          justify-content: space-evenly;
          button {
            padding: 5px 15px 5px 15px;
            margin: 5px;
            font-size: 1em;
          }
        }
      }
    }
    input[type="checkbox"] {
      position: absolute;
      top: calc(100vh + 10px);
      right: 10px;
      transform: scale(2);
      transform-origin: 100% 0%;
      z-index: 2;
      opacity: 0;
      cursor: pointer;
      &:checked {
        ~ div.creatureTimeMenuIcon span.bar {
          &:first-child {
            transform: rotate(45deg);
          }
          &:nth-child(2) {
            opacity: 0;
          }
          &:last-child {
            transform: rotate(-45deg);
          }
        }
        ~ div.creatureTimeMenu {
          opacity: 1;
          pointer-events: all;
          user-select: all;
          z-index: 1;
          transform: translateY(0px);
        }
      }
    }
    div.creatureTimeMenuIcon {
      position: absolute;
      right: 10px;
      top: calc(100vh + 10px);
      width: 28px;
      height: 28px;
      pointer-events: none;
      > span.bar {
        position: absolute;
        display: block;
        width: 28px;
        height: 5px;
        background-color: black;
        top: calc((var(--i) - 1) * 10px + 3px);
        opacity: 1;
        transform: rotate(0deg);
        transition: all 0.3s ease-in-out;
        transform-origin: 0% 50%;
        z-index: 2;
      }
    }
  }
  div.notifications {
    position: fixed;
    display: flex;
    bottom: 0;
    right: 0;
    height: 500px;
    width: 370px;
    flex-direction: column-reverse;
    overflow-y: scroll;
    div.notification {
      display: block;
      flex-shrink: 0;
      width: 330px;
      height: 40px;
      margin: 10px;
      padding: 10px;
      outline: 2px solid;
      opacity: 0.8;
      background: rgba(255, 255, 255, 0.8);
      animation: notification_fade 5s linear;
      transition: all 0.3s ease-in-out;
      cursor: pointer;
      &:hover {
        animation-play-state: paused;
        opacity: 1 !important;
      }
      &.warn {
        background: rgba(255, 215, 38, 0.8);
      }
      &.error {
        background: rgba(255, 45, 45, 0.6);
      }
      &.log {
        background: rgba(30, 187, 30, 0.6);
      }
    }
  }
  div.textExport {
    z-index: 4;
    position: fixed;
    width: 700px;
    height: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    outline: solid;
    background: rgba(0, 0, 0, 0.2);
    display: none;
    visibility: hidden;
    pointer-events: none;
    &.active {
      display: block;
      visibility: visible;
      pointer-events: all;
    }
    div.header {
      text-align: center;
      font-size: 2em;
    }
    div.textBox {
      min-height: 700px;
      width: 700px;
      textarea {
        background: rgba(255, 255, 255, 0.4);
        outline: 1px solid;
        margin: 50px;
        width: 600px;
        min-height: 600px;
      }
      button {
        position: absolute;
        font-size: 1.2em;
        padding: 5px;
        top: 100px;
        right: 50px;
      }
    }
    div.closeTextBox {
      position: absolute;
      right: 0;
      top: 0;
      width: 40px;
      height: 40px;
      cursor: pointer;
      span {
        position: absolute;
        display: block;
        background-color: black;
        width: 40px;
        height: 8px;
        top: 16px;
        transform-origin: 0% 50;
        &:first-child {
          transform: rotate(45deg);
        }
        &:last-child {
          transform: rotate(-45deg);
        }
      }
    }
  }
}

@keyframes notification_fade {
  0%,
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}
