.dialog {

  margin: 10vh auto 40px auto;
  width: fit-content; /* TODO: this is Chrome only; fix for others */
  max-width: 500px;
  min-width: 250px;
  min-height: 80px;

  position: absolute;
  left: 30px;
  right: 30px;
  top: 5px;

  background-color: white;
  padding: 20px 40px 40px 40px;
  border-radius: 20px;
  color: #222;
  box-shadow: 0 0 50px #0004;

  transition: opacity 0.25s, top 0.25s;
}

.dialog.undisplayed {
  display: none;
  opacity: 0;
}

.dialog.transparent {
  display: inline-block;
  opacity: 0;
}

.dialog.open {
  display: inline-block;
  opacity: 1;
  top: 20px;
}

.dialog a {
  color: #0984b9;
}

.dialog h3 {
  color: #0984b9;
}

.dialog .close {
  position: absolute;
  line-height: 18px;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  font-size: 30px;
  outline: none;
  color: #222;
}

#blanket {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.dialog .tip {
  border: 1px solid #0984b9;
  padding: 6px 14px 8px 14px;
  font-size: 13px;
  margin-top: 15px;
}

.dialog .tip h4 {
  font-weight: bold;
  margin-top: 0px;
  margin-bottom: 6px;
}

.dialog code {
  font-family: "Futura", "Century Gothic", sans-serif;
  color: white;
  background: #222;
  padding: 1px 6px 4px 6px;
  border-radius: 3px;
  margin-right: 1px;
}

#errorDialog {
  min-width: 380px;
}

#chr115 {
  width: 90px;
  height: 22px;
  display: inline-block;
  position: relative;
  top: 6px;
}

#chr115-tooltip {
  opacity: 0;
  width: 152px;
  height: 118px;
  position: absolute;
  top: 25px;
  left: -112px;
  transition: opacity 0.5s;
  transition-delay: 1.5s;
}

#aboutDialog.open #chr115-tooltip {
  opacity: 1;
}

#aboutDialog footer {
  text-align: center;
  font-size: 13px;
  margin-top: 60px;
}

.clickableOption {
  position: relative;
  background: #222;
  padding: 16px;
  border-radius: 2px;
  cursor: default;
  box-sizing: content-box;
  margin: 4px 1px;
}

.clickableOption .tooltip {
  opacity: 0;
  position: absolute;
  transition: opacity 0.2s;
  transition-delay: 0.2s;
}

.clickableOption:hover .tooltip {
  opacity: 1;
}

.clickableOptions-row {
  text-align: center;
}

.radioButton::before {
  content: ".";
  color: transparent;
  width: 20px;
  height: 20px;
  background: white;
  text-align: center;
  margin-left: -10px;
  border: 1px solid #222;
  border-radius: 100%;
  box-shadow: 0 0 0 2px white;
  display: inline-block;
  margin-left: 5px;
  margin-right: 10px;
  margin-bottom: 6px;
}

.radioButton:not(.selected):hover::before {
  background-color: #0001;
}

.radioButton.selected::before {
  background-color: #0984b9;
  border-color: #0984b9;
}


.clickableOption-checkbox {
  width: 20px;
  height: 20px;
  background: white;
  text-align: center;
  position: absolute;
  margin-left: -10px;
  left: 50%;
  border: 1px solid #222;
  border-radius: 2px;
  box-shadow: 0 0 0 2px white;
  color: white;
}

.clickableOption:hover .clickableOption-checkbox {
  background-color: #eee;
}

.clickableOption.selected .clickableOption-checkbox {
  background-color: #0984b9;
  border-color: #0005;
}

.clickableOption.selected .clickableOption-checkbox::after {
  content: "✓";
  text-shadow: 1px 1px #0005;
}

.clickableOption-radioButton {
  width: 20px;
  height: 20px;
  background: white;
  text-align: center;
  position: absolute;
  margin-left: -10px;
  left: 50%;
  border: 1px solid #222;
  border-radius: 100%;
  box-shadow: 0 0 0 2px white;
}

.clickableOption.selected .clickableOption-radioButton {
  background-color: #0984b9;
  border: 1px solid transparent;
}

.clickableOption.selected .clickableOption-radioButton::after {
  background-color: white;
  border: 1px solid transparent;
  box-shadow: 0px 1px 2px #0005;
  content: " ";
  display: block;
  position: relative;
  top: 6px;
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 100%;
}

#scopeRail {
  right: 0;
  width: 274px;
  padding: 10px 12px 18px 12px;
}

#scopeRail-blanket {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#scopeRail-blanket.hidden {
  display: none;
}

.scopePanel.hidden {
  display: none;
}

#scopeRail select {
  font-family: Futura;
  color: white;
  background: #222;
  font-size: 13px;
  border: 10px solid #222;
  font-weight: bold;
  box-shadow: 0 0 0 1px white;
  outline: none;
  margin: auto;
  width: 200px;
  display: block;
  margin-bottom: 11px;
  /* Firefox */
  border-radius: 5px;
  text-align: center;
  -moz-appearance: none;
  text-transform: uppercase;
}

.scope-colorSample {
  position: relative;
  display: inline-block;
  top: 4px;
  width: 20px;
  height: 20px;
  border: 1px solid black;
  margin-left: 3px;
  margin-right: 3px;
}

.scope-colorSample.highlightCol0 { background-color: hsl(  0, 50%, 50%); }
.scope-colorSample.highlightCol1 { background-color: hsl( 45, 50%, 50%); }
.scope-colorSample.highlightCol2 { background-color: hsl( 90, 50%, 50%); }
.scope-colorSample.highlightCol3 { background-color: hsl(135, 50%, 50%); }
.scope-colorSample.highlightCol4 { background-color: hsl(180, 50%, 50%); }
.scope-colorSample.highlightCol5 { background-color: hsl(225, 50%, 50%); }
.scope-colorSample.highlightCol6 { background-color: hsl(270, 50%, 50%); }
.scope-colorSample.highlightCol7 { background-color: hsl(315, 50%, 50%); }

.scope-colorSample.highlightColF00 { background-color: #f00; }
.scope-colorSample.highlightCol0F0 { background-color: #0f0; }
.scope-colorSample.highlightCol00F { background-color: #00f; }

#scopeRail .checkbox {
  color: white;
  font-size: 13px;
  text-align: left;
  padding-left: 32px;
  margin-bottom: 3px;
}

#scopeRail .checkbox::before {
  content: "✓";
  width: 16px;
  height: 16px;
  border-radius: 0px;
  box-shadow: 0 0 0 1px white;
  color: transparent;
  border: 1px solid #222;
  display: inline-block;
  margin-left: -27px;
  margin-right: 9px;
  margin-bottom: 6px;
  text-align: center;
}

#scopeRail .checkbox.selected::before {
  color: white;
}

#scopeRail .checkbox:not(.selected):hover::before {
  background-color: #0001;
}

.scope-legend {
  margin-bottom: 20px;
}

#snapshotsRail {
  left: 0;
  width: 150px;
}

.snapshot {
  position: relative;
  width: 130px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  transition-property: height, opacity;
  transition-duration: 0.375s;
  height: 125px;
  opacity: 1;
}

.snapshot.collapsed {
  height: 0;
  opacity: 0;
}

.snapshot .innerFrame {
  position: absolute;
  bottom: 10px;
}

.snapshot canvas {
  margin: 14px 10px 2px 10px;
  width: 110px;
}

.snapshot canvas:active {
  transform: scale(0.95);
}

.snapshot a {
  color: white;
}

.snapshot .close {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNiAyNiI+PGNpcmNsZSBjeD0iMTMiIGN5PSIxMyIgcj0iMTMiIHN0eWxlPSJmaWxsOiMyMjIiLz48cG9seWdvbiBwb2ludHM9IjE3LjkgOS41MiAxNi40OCA4LjEgMTMgMTEuNTkgOS41MiA4LjEgOC4xIDkuNTIgMTEuNTkgMTMgOC4xIDE2LjQ4IDkuNTIgMTcuOSAxMyAxNC40MSAxNi40OCAxNy45IDE3LjkgMTYuNDggMTQuNDEgMTMgMTcuOSA5LjUyIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+");
  opacity: 0;
  transition: opacity 0.1s, transform 0.1s;
  transform: scale(0.5);
}

.snapshot:hover .close {
  opacity: 1;
  transform: scale(1);
}

.snapshot .close:active {
  transform: scale(0.95);
}

.tray {
  position: fixed;
  left: 0;
  right: 0;
  min-width: 480px;
  background-color: #222;
  margin: 0;
  color: white;  

  /* line-height: 0; otherwise the buttons develop 4px on gap below them */
  line-height: 0;
  transition: opacity 0.375s;
}

.tray.hidden {
  opacity: 0;
}

.tray-blanket {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.tray-blanket.hidden {
  display: none;
}

.tray-flex {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.tray button:active svg {
  transform: scale(0.95);
}

.iconButton {
  width: 70px;
  height: 70px;
  border-radius: 6px;
}

.iconButton:hover {
  background-color: #ffffff11;
}

.iconButton.hidden {
  display: none;
}

#upperTray {
  top: 0;
}

.tray > * {
  padding: 0 10px;
}

#lowerTray {
  bottom: 0;
}

#fps {
  position: relative;
  bottom: 29px;
  width: 62px;
  display: inline-block;
  text-align: right;
  padding-right: 24px;
}

#aboutButton {
  width: 110px;
  height: 70px;
}

@media (max-width: 600px) {
  .iconButton {
    width: 52.5px;
    height: 52.5px;
  }

  #aboutButton {
    width: 82.5px;
    height: 52.5px;
  }

  #fps {
    font-size: 13px;
    bottom: 22px;
  }
}

#undoResetButton:not(.hidden) {
  display: inline-block;
  position: relative;
  width: 70px;
  height: 70px;
}

#undoResetButton-label {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  color: white;
}

#cursors-intro {
  margin-bottom: 20px;
}

#shiftCursorsDiagram {
  display: inline-block;
  width: 302px;
  height: 43px;
  position: relative;
  top: 10px;
  margin: 0 8px;
}

#crsrs_key {
  width: 176px;
  height: 80px;
}

#crsrs_cp1 {
  width: 60px;
  height: 80px;
}

#crsrs_cp2 {
  width: 60px;
  height: 80px;
}

#mapping-intro {
  margin-bottom: 20px;
}

#shift8Diagram {
  display: inline-block;
  width: 188px;
  height: 43px;
  position: relative;
  top: 10px;
}

#map_natural {
  width: 50px;
  height: 50px;
}

#map_direct {
  width: 132px;
  height: 50px;
  box-sizing: content-box;
}

#natural-keymap-tooltip {
  width: 190px;
  height: 191px;
  top: 36px;
  left: -125px;
}

#direct-keymap-tooltip {
  width: 132px;
  height: 194px;
  left: 103px;
  top: 41px;
}

#diskDialog-dirEntries {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px 0;
}

#diskDialog-dirEntries button {
  display: block;
  padding: 12px;
  background-color: #0984b9;
  margin: 2px;
  line-height: 0;
  border-radius: 11px;
}

#diskDialog-dirEntries button:active:not(:disabled) {
  transform: scale(0.97);
}

#diskDialog-dirEntries button:disabled {
  background-color: #ddd;
}

#diskDialog-dirEntries button:hover:not(:disabled) {
  opacity: 0.7;
}

