html {
  -ms-touch-action: none;
  height: 100%;
}

/* iOS WebClip 全屏：覆盖底部安全区域 */
html, body {
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  /* iOS 15+ 使用 env() 让内容延伸到安全区域之下 */
  padding-bottom: 0;
  padding-bottom: constant(safe-area-inset-bottom); /* iOS 11.0-11.2 */
  padding-bottom: env(safe-area-inset-bottom); /* iOS 11.2+ */
}

@supports (height: 100dvh) {
  html, body {
    height: 100dvh;
  }
}

body, canvas, div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  /* display: none; <- Crashes Chrome on hover */
  -webkit-appearance: none;
  margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

body {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #888;
  background-color: #000;

  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;

  display: flex;
  flex-direction: column;

  /* fix bug: https://github.com/cocos-creator/2d-tasks/issues/791 */
  /* overflow cannot be applied in Cocos2dGameContainer,
  otherwise child elements will be hidden when Cocos2dGameContainer rotated 90 deg */
  overflow: hidden;
}

#Cocos2dGameContainer {
  position: fixed;
  margin: 0;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  height: 100dvh;

  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

#GameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background-color: rgba(0, 0, 0, 0);
}

@supports (height: 100dvh) {
  body,
  #Cocos2dGameContainer {
    height: 100dvh;
  }
}

a:link, a:visited {
  color: #666;
}

a:active, a:hover {
  color: #666;
}

p.header {
  font-size: small;
}

p.footer {
  font-size: x-small;
}

#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #171717 url(./splash.ed71e.png) no-repeat center center;
  background-size: cover;
}

.progress-bar {
    position: absolute;
    left: 27.5%;
    top: 80%;
    height: 3px;
    padding: 2px;
    width: 45%;
    border-radius: 7px;
    box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease-in-out;
    background-color: #3dc5de;
}

.stripes span {
    background-size: 30px 30px;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
                        transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
                        transparent 75%, transparent);

    animation: animate-stripes 1s linear infinite;
}

@keyframes animate-stripes {
    0% {background-position: 0 0;} 100% {background-position: 60px 0;}
}

/* 横屏启动门蒙层 —— 竖屏进入时遮盖 #splash，等用户横屏后由 JS 移除 */
#lwgame-landscape-gate {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}
#lwgame-landscape-gate .lw-gate-inner { text-align: center; }
#lwgame-landscape-gate .lw-gate-phone {
    width: 64px; height: 104px;
    margin: 0 auto 24px;
    position: relative;
    border: 3px solid #fff;
    border-radius: 10px;
    box-sizing: border-box;
    animation: lw-gate-rotate 1.8s ease-in-out infinite;
}
#lwgame-landscape-gate .lw-gate-phone-body {
    position: absolute;
    left: 50%; bottom: 6px;
    width: 18px; height: 3px;
    margin-left: -9px;
    background: #fff;
    border-radius: 2px;
}
#lwgame-landscape-gate .lw-gate-arrow {
    position: absolute;
    right: -28px; top: 50%;
    width: 20px; height: 20px;
    margin-top: -10px;
    border-top: 3px solid #fff;
    border-right: 3px solid #fff;
    transform: rotate(45deg);
    opacity: 0.9;
}
#lwgame-landscape-gate .lw-gate-text {
    font-size: 16px;
    letter-spacing: 2px;
    line-height: 1.5;
    opacity: 0.9;
}
@keyframes lw-gate-rotate {
    0%, 40%   { transform: rotate(0deg);   }
    60%, 100% { transform: rotate(-90deg); }
}
