html,
body {
  position: relative;
  width: 100%;
  height: 100%;
  font-size: 16px;
  background-color: #222;
}

* {
  box-sizing: border-box;
  color: #ddd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  /* font-size: 1rem; */
  user-select: none;
}

body {
  margin: 0;
  padding: 1rem;
  border: 0.125rem solid #333;
}

/* titlebar */

.titlebar {
  user-select: none;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  height: 2rem;
}

.titlebar-front {
  background: #0000;
}

.header-icon {
  max-height: 100%;
  flex: 0 0 auto;
}

.header-icon img {
  max-height: 1.5rem;
  pointer-events: none;
}

.header {
  font-size: 1.5rem;
  font-weight: 500;
  flex: 0 0 auto;
}

.header-space {
  flex: 1 0 auto;
}

.header-timer {
  flex: 0 0 auto;
  font-family: monospace;
}

/* main */

.main {
  margin-top: 2rem;
  height: calc(100% - 2rem);
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
}

.preview-row {
  flex: 0 1;
}

.options {
  padding: 0.5rem 0.25rem;

  flex: 1 1;
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;

  overflow-y: auto;
}

.buttons-row {
  flex: 0 1;
}

.row,
.row-2 {
  margin: 0 0 0.5rem 0;
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-start;
  justify-content: stretch;
}

.row .label {
  flex: 1 1 0;
}

.row .label[title] {
  text-decoration: underline dotted;
}

.row .label[title]:hover {
  text-decoration: underline;
}

.row .input {
  flex: 2 2 0;
}

.comment {
  font-size: 0.75rem;
}

.serverlist {
  width: 100%;
  max-height: 5rem;
  overflow-x: auto;
  font-size: 0.75rem;
}

.iplist {
  font-family: monospace;
  white-space: pre;
}

input,
select {
  width: 100%;
  background-color: #444;
  color: #ddd;
  border: none;
  font-size: 1rem;
}

button {
  font-size: 1rem;
  margin: 0.25rem;
  padding: 0.5rem;
  border-radius: 0.25rem;
  border: none;
  background-color: #444;
}

button:hover {
  background: #555;
}

button:active {
  background: #777;
}

button.primary {
  background: rgb(35, 67, 211);
}

/* Preview */

.preview {
  width: 100%;
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;
  /* border: 0.125rem solid white; */
}

.air {
  height: 2rem;
  position: relative;

  border-radius: 0.5rem 0.5rem 0 0;
  overflow: clip;

  background: #000;
}

.air-btn, .air-led {
  height: 2rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;

  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

.air-led {
  flex-flow: row nowrap;
}

.air-led-left, .air-led-right {
  display: flex;
  flex-flow: column-reverse nowrap;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1;
}
.air-led-data {
  flex: 1 0;
}

.air-led-space {
  flex: 14;
}

.air-btn {
  background: #0008;
  flex-flow: column-reverse nowrap;
}

.air-data {
  flex: 1 0;
}
.air-data-1 {
  background: #0aa;
}

.ground {
  position: relative;
  height: 3rem;

  border-radius: 0 0 0.5rem 0.5rem;
  overflow: clip;
}

.ground-btn,
.ground-led {
  height: 3rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;
}

.ground-row {
  flex: 1;
  width: 100%;
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  justify-content: space-between;
}

.ground-btn > .ground-row > div {
  text-align: center;
  flex: 1 0 0;
}

.ground-led-0 {
  flex: 1 0 0;
}

.ground-led-1 {
  flex: 0.4rem 0 0;
}

.ground-led-2 {
  flex: 0.2rem 0 0;
}

.ground-btn {
  background-color: #0008;
}

.ground-data {
  padding: 0.1rem 0;
  font-size: 0.8rem;
}

.extra {
  height: 2rem;
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  justify-content: center;
}
.extra-data {
  width: 1rem;
  height: 1rem;
  border-radius: 1rem;
  margin: 0.5rem;
}
.extra-data-0 {
  background: #000;
}
.extra-data-1 {
  background: #aaa;
}
