html {
  -ms-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 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #888;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);

  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: 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: #1a1a2e;
}

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: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  margin: 0;
  padding: 0;
}

#splash.fade-out {
  opacity: 0;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 400px;
  margin: auto;
  padding: 20px;
  box-sizing: border-box;
}

.loading-logo {
  width: 200px;
  height: 200px;
  background: url(./splash.png) no-repeat center;
  background-size: contain;
  margin-bottom: 40px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-text {
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: 2px;
  animation: fade-in-out 1.5s ease-in-out infinite;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease-out;
    background: linear-gradient(90deg, #00d4ff 0%, #0099ff 50%, #00d4ff 100%);
    background-size: 200% 100%;
    animation: gradient-shift 2s ease infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.stripes span {
    background-image:
      linear-gradient(90deg, #00d4ff 0%, #0099ff 50%, #00d4ff 100%),
      linear-gradient(135deg, rgba(255, 255, 255, .2) 25%, transparent 25%,
                        transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%,
                        transparent 75%, transparent);
    background-size: 200% 100%, 30px 30px;
    animation: gradient-shift 2s ease infinite, animate-stripes 1s linear infinite;
}

.loading-percent {
  color: #00d4ff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

@keyframes animate-stripes {
    0% {background-position: 0 0, 0 0;}
    100% {background-position: 0 0, 60px 0;}
}

@keyframes gradient-shift {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

@keyframes pulse {
    0%, 100% {
      transform: scale(1);
      opacity: 1;
    }
    50% {
      transform: scale(1.05);
      opacity: 0.8;
    }
}

@keyframes fade-in-out {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
}
