body.bg-a { 
  background: url(../media/bg.gif);
}
body.bg-b { 
  background: #fff;
}
html {
  width: 100%;
  height: 100%;
  height: 100dvh;
}
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;

  background-color: rgb(224,255,233);
  background-image: -o-linear-gradient(bottom, rgb(255,229,237) 0%, rgb(224,255,233) 100%);
  background-image: -moz-linear-gradient(bottom, rgb(255,229,237) 0%, rgb(224,255,233) 100%);
  background-image: -webkit-linear-gradient(bottom, rgb(255,229,237) 0%, rgb(224,255,233) 100%);
  background-image: -ms-linear-gradient(bottom, rgb(255,229,237) 0%, rgb(224,255,233) 100%);
  background-image: linear-gradient(bottom, rgb(255,229,237) 0%, rgb(224,255,233) 100%);

  touch-action: none;
  -webkit-text-size-adjust: 100%;
}

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
}


#compat { 
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  font: bold italic 150px serif;
  text-shadow: 0 3px 0 rgba(0,0,0,0.15);
  padding: 20px 40px;
  color: #fff;
  z-index: 2;
  pointer-events: none;
}

@-webkit-keyframes shake {
    0% { left: 30px; }
    50% { left: 0; }
    100% { left: 30px; }
}

@-moz-keyframes shake {
    0% { left: 30px; }
    50% { left: 0; }
    100% { left: 30px; }
}

@keyframes shake {
    0% { left: 30px; }
    50% { left: 0; }
    100% { left: 30px; }
}

#shake { 
  word-break: break-word;
  bottom: 0;
  right: 0;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  font: bold italic 110px serif;
  text-shadow: 0 3px 0 rgba(0,0,0,0.15);
  padding: 20px 40px;
  color: #fff;
  z-index: 2;
  pointer-events: none;
  -webkit-animation-direction: normal;
  -webkit-animation-duration: 0.2s;
  -webkit-animation-iteration-count: infinite;
  -webkit-animation-name: shake;
  -webkit-animation-timing-function: ease;
  -moz-animation-direction: normal;
  -moz-animation-duration: 0.2s;
  -moz-animation-iteration-count: infinite;
  -moz-animation-name: shake;
  -moz-animation-timing-function: ease;
  animation-direction: normal;
  animation-duration: 0.2s;
  animation-iteration-count: infinite;
  animation-name: shake;
  animation-timing-function: ease;
}

#warning { 
  font: bold 11px/14px sans-serif;
  width: 200px;
  border: 5px solid black;
  text-align: center;
  padding: 6px;
  padding-bottom: 8px;
  background-color: #fff;
  position: fixed;
  left: max(10px, env(safe-area-inset-left, 0px));
  top: max(10px, env(safe-area-inset-top, 0px));
  bottom: auto;
  z-index: 100;
  pointer-events: none;
}

.hint-top {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 520px);
  text-align: center;
  font: 600 13px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif;
  color: rgba(0, 0, 0, 0.55);
  z-index: 100;
  pointer-events: none;
  padding: 0 8px;
  box-sizing: border-box;
}

.page-source {
  position: fixed;
  left: 50%;
  top: max(52px, env(safe-area-inset-top, 0px) + 44px);
  bottom: auto;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 12px;
  font: 600 13px/1.4 "PingFang SC", "Microsoft YaHei", sans-serif;
  color: rgba(0, 0, 0, 0.72);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  z-index: 100;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.page-source-link {
  color: #1a5fb4;
  text-decoration: underline;
  cursor: default;
}

@media (max-width: 640px) {
  #shake {
    font-size: clamp(28px, 9vw, 48px);
    padding: 12px 16px;
  }
  .hint-top {
    font-size: 12px;
    top: max(44px, env(safe-area-inset-top, 0px) + 36px);
    width: min(88%, 420px);
    line-height: 1.45;
  }
  #warning {
    width: auto;
    max-width: 112px;
    font-size: 8px;
    line-height: 1.25;
    border-width: 2px;
    padding: 2px 4px;
    left: max(6px, env(safe-area-inset-left, 0px));
    top: max(6px, env(safe-area-inset-top, 0px));
    bottom: auto;
    transform: scale(0.9);
    transform-origin: left top;
  }
  #warning .chinese {
    font-size: 8px;
  }
  .page-source {
    font-size: 9px;
    top: max(28px, env(safe-area-inset-top, 0px) + 20px);
    bottom: auto;
    padding: 2px 7px;
    border-radius: 4px;
    transform: translateX(-50%) scale(0.9);
    transform-origin: center top;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #shake {
    font-size: 80px;
  }
  .hint-top {
    font-size: 13px;
    width: min(88%, 560px);
    top: max(48px, env(safe-area-inset-top, 0px) + 40px);
  }
  #warning {
    width: auto;
    max-width: 168px;
    font-size: 9px;
    line-height: 1.3;
    border-width: 3px;
    padding: 4px 6px;
    top: max(10px, env(safe-area-inset-top, 0px));
    bottom: auto;
    transform: scale(0.9);
    transform-origin: left top;
  }
  #warning .chinese {
    font-size: 9px;
  }
  .page-source {
    font-size: 10px;
    padding: 3px 9px;
    top: max(40px, env(safe-area-inset-top, 0px) + 32px);
    bottom: auto;
    transform: translateX(-50%) scale(0.9);
    transform-origin: center top;
  }
}
.english { 
  display: inline-block;
  vertical-align: middle;
  margin-top: 2px;
}
.chinese {
  font-size: 13px;
  vertical-align: middle;
  display: inline-block;
  /*margin-left: 10px;*/
}
#enquiries { 
  position: absolute;
  top: 15px;
  right: 20px;
  z-index: 3;
}
#enquiries a {
  display: inline-block;
  padding: 5px 7px;
  text-decoration: none;
  border-radius: 2px;
  font: bold 12px sans-serif;
  color: black;
  text-transform: uppercase;
}
#enquiries a:hover {
  background-color: #fff;
}

#embed { 
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 4;
  display: none;
}
#embed textarea { 
  position: absolute;
  top: 50%;
  left: 50%;
  width: 270px;
  height: 100px;
  word-break: break-word;
  margin-left: -158px;
  margin-top: -50px;
  font: 13px Monaco, monospace;
  padding: 20px;
}

#splash { 
  /* background: #fff; */
  background-image: -webkit-linear-gradient(bottom, rgb(255,229,237) 0%, rgb(224,255,233) 100%);
  z-index: 9999;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: bold 12px sans-serif;
  flex-direction: column;
  padding:
    max(16px, env(safe-area-inset-top, 0px) + 8px)
    max(16px, env(safe-area-inset-right, 0px) + 8px)
    max(16px, env(safe-area-inset-bottom, 0px) + 8px)
    max(16px, env(safe-area-inset-left, 0px) + 8px);
  box-sizing: border-box;
}
#warning-icon {
  width: 20px;
  margin: 0 auto;
  margin-bottom: 12px;
  display: block;
}
#accept { 
  display: inline-block;
  padding: 12px 20px;
  background: #000;
  color: #fff;
  text-decoration: none;
  margin-top: 15px;
  cursor: pointer;
  outline-offset: -2px;
  outline: 4px solid transparent;
}
#accept:hover { 
  outline: 4px solid #000;
  background-color: transparent;
  color: #000;
}
