* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #081923;
  color: #e7f7fb;
  font: 14px system-ui;
}
header {
  height: 110px;
  padding: max(12px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) 12px
    max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(110deg, #102e3c, #0d212d);
  border-bottom: 1px solid #b1dbda28;
}
small {
  font-size: 10px;
  letter-spacing: 3px;
  color: #87d5ca;
}
h1 {
  font-size: 27px;
  line-height: 1.1;
  margin: 5px 0;
}
header span {
  color: #9dbfc5;
  font-size: 12px;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
button,
select {
  font: inherit;
  color: #d6f7f3;
  background: #173f4d;
  border: 1px solid #79c5bc55;
  border-radius: 8px;
  padding: 10px 13px;
  cursor: pointer;
}
button:hover {
  background: #286170;
}
#viewport {
  height: calc(100% - 110px);
  position: relative;
  overflow: hidden;
  touch-action: none;
}
iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#status {
  position: absolute;
  left: 16px;
  top: 18px;
  background: #081e2cbb;
  padding: 10px;
  border-radius: 8px;
  color: #b8e5de;
  font-size: 12px;
  white-space: pre-line;
  max-width: 70%;
}
#label {
  position: absolute;
  transform: translate(-50%, -120%);
  background: #0a283acc;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
}
#controls {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 20px;
  color: #bce3e5;
  font-size: 12px;
}
#hit {
  position: absolute;
  bottom: 55px;
  right: 20px;
  pointer-events: auto;
}
#preview {
  position: fixed;
  inset: 15% 28%;
  background: #17313d;
  border: 1px solid #5caba1;
  border-radius: 16px;
  padding: 12px;
  z-index: 5;
}
#preview[hidden] {
  display: none;
}
#preview-frame {
  height: 85%;
}
#close-preview {
  float: right;
}
#fatal {
  position: fixed;
  bottom: 5px;
  background: #a52538;
  color: white;
  z-index: 10;
  white-space: pre-wrap;
}
body.host #overlay {
  display: none;
}
body.runtime header {
  display: none;
}
body.runtime #viewport {
  height: 100%;
}
body.runtime #layaCanvas {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  touch-action: none;
}
body.runtime #preview {
  display: none;
}
@media (max-width: 650px) {
  header {
    height: 145px;
    padding: 12px 16px;
    gap: 6px;
  }
  h1 {
    font-size: 22px;
  }
  nav {
    max-width: 215px;
    gap: 5px;
  }
  button,
  select {
    font-size: 12px;
    padding: 8px;
  }
  #viewport {
    height: calc(100% - 145px);
  }
  #preview {
    inset: 16% 7%;
  }
  #controls {
    font-size: 10px;
    left: 12px;
  }
}
