#rotate-device {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  padding: 28px;
  background: #100e16;
  color: #f6f4ef;
  text-align: center;
  font: 16px/1.4 Arial, sans-serif;
}
#rotate-device h2, .device-dialog h2 { margin: 0 0 8px; font-size: 21px; }
#rotate-device p, .device-dialog p { margin: 0; }
#landscape-lock { justify-self: center; }
#device-actions {
  position: fixed;
  z-index: 3;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  gap: 6px;
}
#device-actions button {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #665176;
  border-radius: 6px;
  background: #21182c;
  color: #e8d7fb;
  font: 600 12px/1.3 Arial, sans-serif;
}
@media (orientation: landscape) {
  html.night-mobile #device-actions {
    /* Center between the workshop tabs and the settings button. */
    top: calc(env(safe-area-inset-top) + 2px);
    left: calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2 + min(12.75vw, 22.65dvh));
    right: auto;
    transform: translateX(-50%);
    gap: 4px;
  }
  html.night-mobile #device-actions button {
    width: clamp(32px, 5vw, 44px);
    height: clamp(34px, 9.5dvh, 44px);
    padding: 0;
    font-size: 0;
  }
  html.night-mobile #device-actions button::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    vertical-align: middle;
  }
  html.night-mobile #device-actions #install-app::before {
    width: 11px;
    height: 15px;
    border-bottom-width: 4px;
  }
}
.device-dialog {
  width: min(340px, calc(100% - 36px));
  padding: 20px;
  border: 1px solid #5e5170;
  border-radius: 10px;
  background: #15121c;
  color: #f6f4ef;
  font: 16px/1.4 Arial, sans-serif;
}
.device-dialog::backdrop { background: #0b0911c9; }
.device-dialog p + p { margin-top: 10px; }
#gpu-help {
  position: fixed;
  z-index: 3;
  inset: auto 16px 16px auto;
  margin: 0;
}
.device-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.device-dialog-actions a, .device-dialog-actions button { margin: 0; padding: 8px 12px; }
.device-dialog-actions a { background: #b694df; color: #130e1a; text-decoration: none; }
.device-dialog-actions button { background: #292332; color: #f6f4ef; }
html.night-mobile body > #game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html.night-mobile #game:focus { outline: none; }
