html {
  touch-action: none;
}

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 {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border: 0;

  cursor: default;
  color: #000;
  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 */
}

#Cocos2dGameContainer {
  position: absolute;
  margin: 0;
  left: 0px;
  top: 0px;

  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}



p.footer {
  font-size: x-small;
}

/* 启动页铺满视口，强制移除模板背景图 */
#splash {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: #000 !important;
    background-image: none !important;
    z-index: 100;
    overflow: hidden;
}

.splash-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#splash-logo {
    width: 54vw;
    max-width: 360px;
    min-width: 343px;
}

.bg-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
}

.bg-image, .bg-image>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

.landscape {
    display: block;
}

.portrait {
    display: none;
}

@media (max-width: 640px) {
    .landscape {
        display: none;
    }
    
    .portrait {
        display: block;
    }
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 36.29%, rgba(0, 0, 0, 0.7) 96%);
    pointer-events: none;
}

.content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ipad mini ipad Pro 竖屏 .title .subtitle 高度溢出适配 */
@media (orientation: portrait) and (max-width: 1024px) {
  .content-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 550px;
  }
}

/* 折叠屏展开 698*751 .title .subtitle 宽度适配 */
@media (orientation: portrait) and (max-width: 768px) and (min-width: 640px) {
  .content-wrapper {
    max-width: 450px;
  }
}

.title, .subtitle-wrapper {
  position: absolute;
  left: 0;
  /* top: 48.5%; */ /* 调整标题Y轴位置对齐背景 */
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  object-fit: contain;
}

.subtitle {
  width: 100%;
  object-fit: contain;
}

.loading-container {
  position: absolute;
  top: 73%;
  left: 0;
  width: 100%;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 70px;
}

@media screen and (orientation: landscape) {
  .title, .subtitle-wrapper {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
  }

  .subtitle {
    height: 100%;
  }

  .loading-container {
    top: 69%;
  }
}

.progress-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-bar {
  width: 265px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-bar-bg {
  width: 100%;
  height: auto;
}

.progress-fill {
  width: 0%;
  height: 100%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  transition: width 0.3s ease-out;
  overflow: hidden;
}

.progress-fill-bg {
  width: 265px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: left;
}


.loading-light-container {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.loading-light {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translate(50%, -50%);
  width: 0%;
  height: 32px;
  transition: right 0.3s ease-out;
  z-index: 10;
}

.loading-pulse-container {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.loading-pulse {
  position: absolute;
  right: 100%;
  transform: translateX(0%);
  height: 100%;
  transition: right 0.3s ease-out;
  /* animation: light-pulse 2s infinite; */
}

.progress-text {
  margin-top: 8px;
  color: white;
  font-size: 14px;
}

.tips-container {
  margin-top: 18px;
  height: 40px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tips-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-align: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
  min-height: 1.2em;
}

.tips-text.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

.tips-text.slide-out {
    animation: slideOutAndFade 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(150%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutAndFade {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes light-pulse {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}

.play-btn {
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;

  /* 防止选中 */
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  position: relative;
}

.play-btn-bg {
    width: auto;
    height: 66px;
}

.play-btn-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 37.5px;
}

@media (min-width: 768px) and (min-height: 480px) {

  .play-btn-bg {
    height: 120px;
  }

  .play-btn-text {
    height: 70px;
  }

  .progress-bar {
    width: 488px;
  }

  .tips-text {
    font-size: 15px;
  }
  
  .progress-text {
    font-size: 18px;
    margin-top: 20px;
  }

  .loading-light {
    height: 60px;
  }

  .progress-fill-bg {
    width: 488px;
  }
}

@media (min-width: 1280px) {

  .play-btn-bg {
    height: 176px;
  }

  .play-btn-text {
    height: 100px;
  }

  .progress-bar {
    width: 708px;
  }

  .tips-text {
    font-size: 18px;
  }
  
  .progress-text {
    font-size: 20px;
    margin-top: 40px;
  }

  .loading-light {
    height: 88px;
  }

  .progress-fill-bg {
    width: 708px;
  }
}

.footer-content {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
}

.footer-logo {
  width: auto;
  height: 30px;
}

.copyright-info {
  color: rgba(193, 193, 193, 1);
  font-size: 8px;
  line-height: 1.2;
  text-align: right;
}

.copyright-subtitle {
  font-size: 10px;
  font-weight: 600;
}

.copyright-text {
  margin-top: 4px;
  font-size: 8px;
}

.copyright-text-center {
  color: rgba(193, 193, 193, 1);
  text-align: right;
  display: none;
  margin-top: 0;
}

@media (orientation: landscape) and (max-width: 1024px) {
  .tips-container {
    margin-top: 8px;
  }

  .tips-text {
    font-size: 12px;
  }

  .title, .subtitle-wrapper {
    top: -7%;
  }

  .footer-content {
    bottom: 10px!important;
  }
}

@media (orientation: portrait) and (min-width: 630px) {

  .copyright-text {
    font-size: 8px;
  }

  .copyright-subtitle {
    font-size: 10px;
  }
}

@media (orientation: portrait) and (min-width: 768px) {

  .copyright-text {
    font-size: 10px;
  }

  .copyright-subtitle {
    font-size: 12px;
  }

  .copyright-text-center {
    display: block;
  }

  .copyright-text-right {
    display: none;
  }
}

@media  (min-width: 630px) {

  .copyright-text-center {
    display: block;
  }

  .copyright-text-right {
    display: none;
  }
}

@media (min-width: 1024px) {

  .copyright-text-center {
    display: block;
  }

  .copyright-text-right {
    display: none;
  }

  .copyright-text {
    font-size: 14px;
  }

  .copyright-subtitle {
    font-size: 16px;
  }


  .footer-logo {
    height: 40px;
  }
}