body {
  margin: 0;
  background: #c0c0c0;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

input,
canvas,
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.page {
  width: 100%;
  height: 100vh;
  border-collapse: collapse;
  background: #c0c0c0;
}

.banner {
  background: #000080;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  padding: 6px 10px;
  height: 28px;
}

.banner b {
  font-size: 18px;
  letter-spacing: 1px;
}

.sub {
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  margin-left: 14px;
  color: #ffff99;
}

.side {
  width: 250px;
  vertical-align: top;
  padding: 8px;
  background: #d4d0c8;
  border-right: 2px solid #808080;
}

.stage {
  vertical-align: top;
  padding: 8px;
  background: #c0c0c0;
}

.frame {
  position: relative;
  width: 100%;
  height: calc(100vh - 78px);
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: #808080;
}

#gl {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.nogl {
  display: none;
  position: absolute;
  left: 20px;
  top: 20px;
  background: #fff;
  border: 2px solid #000;
  padding: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.box {
  width: 100%;
  margin-bottom: 10px;
  background: #d4d0c8;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.boxhead {
  background: #000080;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  padding: 2px 6px;
}

.boxbody {
  font-size: 14px;
  line-height: 1.35;
  padding: 6px;
}

.boxbody form {
  margin: 0;
}

.boxbody input {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  font-family: "MS Sans Serif", Arial, Helvetica, sans-serif;
  font-size: 13px;
  padding: 2px 0;
  background: #d4d0c8;
  color: #000;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  cursor: pointer;
}

.boxbody input.on {
  background: #000080;
  color: #fff;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

#modeNote {
  margin-top: 6px;
  font-size: 13px;
}

.stats {
  width: 100%;
  font-size: 14px;
}

.stats td:first-child {
  color: #000080;
}

.stats td:last-child {
  text-align: right;
}

.barwrap {
  margin-top: 6px;
  height: 14px;
  background: #fff;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

#durBar,
#mDurBar {
  height: 14px;
  width: 100%;
  background: #008000;
}

body.mode-glass #durBar,
body.mode-metal #durBar,
body.mode-glass #mDurBar,
body.mode-metal #mDurBar {
  width: 100%;
  background: #808080;
}

#pwFill {
  height: 14px;
  width: 0;
  background: #000080;
}

#flipReadout,
#mFlipReadout {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  min-height: 16px;
}

.footer {
  background: #000080;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  padding: 3px 8px;
  height: 20px;
}

.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  background: #ffffcc;
  color: #000;
  border: 2px solid #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  font-weight: bold;
  padding: 3px 6px;
  white-space: nowrap;
  pointer-events: none;
}

.tag.low {
  background: #ffcccc;
}

.pops {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.pop {
  position: fixed;
  font-family: Impact, Arial, Helvetica, sans-serif;
  font-size: 28px;
  color: #ffff00;
  background: #000;
  border: 2px solid #ffff00;
  padding: 2px 8px;
  white-space: nowrap;
}

.mobpanel,
.mobtop,
.mobopt {
  display: none;
}

.mobrow {
  display: flex;
  align-items: stretch;
}

.mobrow input {
  display: block;
  width: auto;
  flex: 1 1 0;
  margin: 0;
}

.mobrow input + input {
  margin-left: 6px;
}

@media (max-width: 640px) {
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .page,
  .page tbody,
  .page tr,
  .page td {
    display: block;
    width: 100%;
  }

  .page {
    height: 100vh;
    height: 100dvh;
    background: #808080;
  }

  .page td.banner,
  .page td.side,
  .page td.footer {
    display: none;
  }

  .page td.stage {
    height: 100vh;
    height: 100dvh;
    padding: 0;
    background: #808080;
  }

  .frame {
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    border: none;
  }

  body.mobopen .frame {
    height: 54vh;
    height: 54dvh;
  }

  .tag {
    font-size: 12px;
    padding: 2px 5px;
  }

  .mobtop {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 6;
  }

  .mobpower {
    height: 12px;
    background: transparent;
  }

  .mobpower.on {
    background: #000;
    outline: 1px solid #808080;
  }

  .mobpower i {
    display: block;
    height: 100%;
    width: 0;
    background: #000080;
  }

  .mobopt {
    display: block;
    position: fixed;
    left: 50%;
    bottom: 10px;
    margin-left: -70px;
    width: 140px;
    z-index: 30;
    font-family: "MS Sans Serif", Arial, Helvetica, sans-serif;
    font-size: 14px;
    padding: 7px 0;
    background: #d4d0c8;
    color: #000;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    cursor: pointer;
  }

  .mobpanel {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46vh;
    height: 46dvh;
    box-sizing: border-box;
    overflow-y: auto;
    background: #d4d0c8;
    border-top: 2px solid #fff;
    padding: 6px 6px 54px 6px;
    z-index: 20;
    -webkit-overflow-scrolling: touch;
  }

  body.mobopen .mobpanel {
    display: block;
  }
}
